/* Enhanced Sidebar Styles - Fixed & Adaptive */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 50;
    transition: transform var(--transition-speed);
    overflow: hidden;
    /* Prevent sidebar resizing/scroll showing */
}

/* Scrollable menu area but with hidden scrollbar for "fixed" look */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.sidebar-menu::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.sidebar .brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .brand i {
    font-size: 1.75rem;
    color: #8b5cf6;
}

.sidebar-section-title {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 1rem;
    font-weight: 700 !important;
}

.sidebar .nav-item {
    padding: 1rem 1.25rem !important;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 0.625rem !important;
    white-space: nowrap;
    /* Prevent wrap */
}

.sidebar .nav-item i {
    font-size: 1.125rem;
    width: 24px;
    /* Fixed width for alignment */
    text-align: center;
    margin-right: 0.5rem;
}

.sidebar .nav-item.active {
    background: linear-gradient(135deg, #8b5cf6, #a855f7) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.sidebar .nav-item:hover {
    background-color: rgba(139, 92, 246, 0.1) !important;
    color: #a78bfa;
}

.sidebar-footer {
    margin-top: auto;
    background: var(--bg-sidebar);
    /* Ensure opacity */
    z-index: 10;
}

.sidebar .user-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar .user-name {
    font-size: 0.8125rem;
    color: white;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 140px;
}

/* Logout Button */
#logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

#logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* =============================================
   VERTICAL RESPONSIVENESS (Laptop Fixes)
   ============================================= */
@media (max-height: 800px) {
    .sidebar-menu {
        padding: 1rem 0.75rem;
    }

    .sidebar .nav-item {
        padding: 0.75rem 1rem !important;
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }

    .sidebar-section-title {
        margin-bottom: 0.5rem;
        margin-top: 1rem;
    }

    .sidebar-header {
        height: 70px;
    }

    .sidebar .brand {
        font-size: 1.25rem;
    }
}

@media (max-height: 700px) {
    .sidebar .nav-item {
        padding: 0.6rem 1rem !important;
    }

    .sidebar-section {
        margin-bottom: 1rem;
    }

    .sidebar .user-profile {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    #logout-btn {
        padding: 0.5rem;
    }
}