:root {
    --sidebar-width: 260px;
    --sidebar-bg: #f8fafc;
    --sidebar-border-color: #e2e8f0;
    --sidebar-item-color: #475569;
    --sidebar-item-hover-bg: #f1f5f9;
    --sidebar-item-active-bg: var(--primary-color, #0f4c81);
    --sidebar-item-active-color: #ffffff;
    --sidebar-header-bg: var(--primary-color, #0f4c81);
    --sidebar-header-color: #ffffff;
    --transition-speed: 0.2s;
}

/* Sidebar Container */
.left-sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border-color);
    padding: 1rem 0;
    /* height: calc(100vh - 56px); */ /* Handled by JS */
    overflow-y: auto;
    width: var(--sidebar-width) !important;
    position: fixed;
    /* top: 56px; */ /* Handled by JS */
    left: 0;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed) ease, top var(--transition-speed) ease;
    
    /* Reset Bootstrap Grid */
    flex: 0 0 auto !important;
    max-width: none !important;
}

/* Adjust main content to account for sidebar */
.right-content {
    margin-left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
    padding: 2rem !important;
    transition: margin-left var(--transition-speed) ease, width var(--transition-speed) ease;
    
    /* Reset Bootstrap Grid */
    flex: 0 0 auto !important;
    max-width: none !important;
}

/* Sidebar List Group */
.list-group {
    border-radius: 0;
    gap: 4px;
    padding: 0 12px;
}

.list-group-item {
    border: none;
    border-radius: 8px !important;
    color: var(--sidebar-item-color);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 16px;
    margin-bottom: 2px;
    transition: all var(--transition-speed);
    background-color: transparent;
}

/* Sidebar Header / Title */
.list-group-item.title {
    background-color: var(--sidebar-header-bg);
    color: var(--sidebar-header-color);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    margin-top: 8px;
    padding: 8px 16px;
    border-radius: 6px !important;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hover State */
.list-group-item:not(.title):hover {
    background-color: var(--sidebar-item-hover-bg);
    color: var(--primary-color, #0f4c81);
    transform: translateX(4px);
}

/* Active State */
.list-group-item.active {
    background-color: var(--sidebar-item-active-bg);
    color: var(--sidebar-item-active-color);
    box-shadow: 0 4px 6px -1px rgba(15, 76, 129, 0.3);
    border-color: transparent;
}

/* Submenu Styling */
.collapse .list-group-item {
    padding-left: 32px;
    font-size: 0.9rem;
    color: #64748b;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0 !important;
    margin-left: 12px;
}

.collapse .list-group-item:hover {
    border-left-color: var(--primary-color, #0f4c81);
    background-color: #f8fafc;
}

.collapse .list-group-item.active {
    background-color: #e0f2fe; /* Light blue */
    color: var(--primary-color, #0f4c81);
    border-left-color: var(--primary-color, #0f4c81);
    font-weight: 600;
    box-shadow: none;
}

/* Toggle Icon Animation */
.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

[aria-expanded="true"] .toggle-icon {
    transform: rotate(-180deg);
}

/* Scrollbar Styling */
.left-sidebar::-webkit-scrollbar {
    width: 6px;
}

.left-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.left-sidebar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .left-sidebar {
        transform: translateX(-100%);
        width: 280px !important;
    }
    
    .left-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 24px rgba(0,0,0,0.15);
    }
    
    .right-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 1.5rem !important;
    }
    
    /* Overlay when sidebar is open on mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 90;
        display: none;
        backdrop-filter: blur(2px);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}
