.sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;

    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 48px;
    overflow: visible !important;
}

/* ============================================
   SIDEBAR HEADER
   ============================================ */
.sidebar-header {
    padding: 12px 16px;
    background: #f3f2f1;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-title {
    display: none;
}

.toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #605e5c;
    font-size: 16px;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: #edebe9;
    border-radius: 2px;
}

/* ============================================
   SIDEBAR NAVIGATION - PROPER SCROLLING
   ============================================ */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible !important; /* CRITICAL - Must be visible for tooltips */
    min-height: 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #f3f2f1;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #c8c6c4;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #a19f9d;
}

/* ============================================
   MENU SECTIONS
   ============================================ */
.menu-section {
    border-bottom: 1px solid #edebe9;
}

.menu-section:last-child {
    border-bottom: none;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #faf9f8;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s;
    min-height: 36px;
    position: relative;
    overflow: visible; /* Allow tooltip overflow */
}

.section-header:hover {
    background: #f3f2f1;
}

.section-header.active {
    background: #edebe9;
}

.section-icon {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    color: #605e5c;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-title {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: #323130;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .section-title {
    display: none;
}

.section-arrow {
    width: 16px;
    height: 16px;
    color: #605e5c;
    font-size: 12px;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.sidebar.collapsed .section-arrow {
    display: none;
}

.section-header.expanded .section-arrow {
    transform: rotate(180deg);
}

/* ============================================
   MENU ITEMS
   ============================================ */
.menu-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #ffffff;
}

.menu-items.show {
    max-height: 1000px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 44px;
    text-decoration: none;
    color: #323130;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
    overflow: visible; /* Allow tooltip overflow */
}

.menu-item-standalone {
    padding-left: 16px;
}

.sidebar.collapsed .menu-item {
    padding-left: 16px;
}

.menu-item:hover {
    background: #f3f2f1;
}

.menu-item.active {
    background: #edebe9;
    font-weight: 600;
    color: #0078d4;
    padding-left: 41px;
    border-left: 3px solid #0078d4;
}

.sidebar.collapsed .menu-item.active {
    padding-left: 16px;
    /*border-left: none;*/
}

.menu-item-icon {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    color: #605e5c;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-item.active .menu-item-icon {
    color: #0078d4;
}

.menu-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .menu-item-text {
    display: none;
}

.menu-item-arrow {
    width: 16px;
    height: 16px;
    color: #605e5c;
    font-size: 10px;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.sidebar.collapsed .menu-item-arrow {
    display: none;
}

.menu-item.has-submenu.expanded .menu-item-arrow {
    transform: rotate(180deg);
}

/* ============================================
   SUBMENU
   ============================================ */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #faf9f8;
}

.submenu.show {
    max-height: 500px;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 6px 16px 6px 60px;
    text-decoration: none;
    color: #323130;
    font-size: 13px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
    position: relative;
    overflow: visible; /* Allow tooltip overflow */
}

.sidebar.collapsed .submenu-item {
    padding-left: 16px;
}

.submenu-item:hover {
    background: #edebe9;
}

.submenu-item.active {
    background: #e1dfdd;
    font-weight: 600;
    color: #0078d4;
    padding-left: 57px;
    border-left: 3px solid #0078d4;
}

.sidebar.collapsed .submenu-item.active {
    padding-left: 16px;
    /*border-left: none;*/
}

.submenu-item-icon {
    width: 12px;
    height: 12px;
    margin-right: 8px;
    color: #605e5c;
    font-size: 10px;
    flex-shrink: 0;
}

.submenu-item.active .submenu-item-icon {
    color: #0078d4;
}

.submenu-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .submenu-item-text {
    display: none;
}

/* ============================================
   BADGES
   ============================================ */
.menu-badge {
    background: #0078d4;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
}

.sidebar.collapsed .menu-badge {
    display: none;
}

/* ============================================
   TOOLTIPS - REMOVED (Using JavaScript instead)
   ============================================ */
/* CSS pseudo-element tooltips removed to prevent overflow-x scrollbar */
/* See separate JavaScript file for proper fixed-position tooltips */

/* Hide non-expanded items when collapsed */
.sidebar.collapsed .menu-items:not(.show),
.sidebar.collapsed .submenu:not(.show) {
    display: none;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    background: #faf9f8;
    padding: 24px;
    overflow-y: auto;
}

.content-header {
    margin-bottom: 24px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #323130;
    margin-bottom: 8px;
}

.content-header p {
    color: #605e5c;
    font-size: 14px;
}

/* ============================================
   MOBILE MENU BUTTON
   ============================================ */
.mobile-menu-btn {
    display: none;
    position: fixed;
    left: 16px;
    top: 70px;
    background: #0078d4;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #106ebe;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* ============================================
   RESPONSIVE (MOBILE)
   ============================================ */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .toggle-btn {
        display: none;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 250px;
    }

    .main-content {
        margin-left: 0;
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        top: 55px;
        height: calc(100vh - 55px);
    }
}

@media (max-width: 360px) {
    .sidebar {
        top: 50px;
        height: calc(100vh - 50px);
    }
}

/* ============================================
   RESPONSIVE (DESKTOP)
   ============================================ */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
}
