/* Sidebar Component Styles */

/* ============================================
   BASE SIDEBAR CONTAINER & LAYOUT
   ============================================ */
.sidebar-wrapper {
      position: fixed;
    width: 100%;
    height: 100%;
        top: 0;
    left: 0;
    
}

.sidebar-main {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 9998;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   SIDEBAR HEADER / BRANDING
   ============================================ */
.sidebar-header {
    flex-shrink: 0;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s ease;
}

.sidebar-brand:hover {
    color: #60a5fa;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}
.mobile-sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.sidebar-brand:hover .sidebar-logo {
    border-color: #60a5fa;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
}

.sidebar-app-name {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar-nav {
    flex: 1 1 auto;
    padding: 1rem 0;
    margin: 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    color: #e5e7eb;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link i {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    width: 24px;
    justify-content: center;
    flex-shrink: 0;
}

.nav-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link:hover {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border-left: 3px solid #60a5fa;
    padding-left: calc(1rem - 3px);
}

.nav-link:active {
    background: rgba(96, 165, 250, 0.2);
    color: #3b82f6;
}

/* ============================================
   SIDEBAR FOOTER / USER & LOGOUT
   ============================================ */
.sidebar-footer {
    flex-shrink: 0;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    font-size: 1.1rem;
}

.user-info {
    flex: 1 1 auto;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.5);
}

.sidebar-logout-btn i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.logout-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   SIDEBAR COLLAPSE BUTTON (Desktop)
   ============================================ */
.sidebar-collapse-btn {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #60a5fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.sidebar-collapse-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
    transform: translateX(-50%) scale(1.1);
}

/* Hide on small screens */
@media (max-width: 768px) {
    .sidebar-collapse-btn {
        display: none;
    }
}

/* ============================================
   SIDEBAR TOGGLE BUTTON (Mobile)
   ============================================ */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle:hover {
    background: rgba(96, 165, 250, 0.1);
    border-color: #60a5fa;
    color: #60a5fa;
}

.sidebar-toggle.active {
    background: rgba(96, 165, 250, 0.2);
    border-color: #60a5fa;
    color: #60a5fa;
}

.desktop-sidebar-toggle {
    display: none;
}

@media (min-width: 769px) {
    .desktop-sidebar-toggle {
        display: flex;
        position: fixed;
        left: 262px;
        top: 24px;
        width: 34px;
        height: 34px;
        border-radius: 9999px;
        border: 1px solid rgba(226, 232, 240, 0.85);
        background: #ffffff;
        color: #1f2937;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10000;
        transition: transform 0.3s ease, left 0.3s ease, background-color 0.3s ease;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    }

    .desktop-sidebar-toggle:hover {
        background: #f8fafc;
    }

    .desktop-sidebar-toggle .toggle-icon {
        display: inline-block;
        font-size: 1rem;
        line-height: 1;
        transition: transform 0.3s ease;
    }

    .sidebar-main.sidebar-hidden {
        transform: translateX(-100%);
    }

    .sidebar-main.sidebar-hidden + .desktop-sidebar-toggle .toggle-icon,
    .desktop-sidebar-toggle.collapsed .toggle-icon {
        transform: rotate(180deg);
    }

    .sidebar-main.sidebar-hidden + .desktop-sidebar-toggle,
    .desktop-sidebar-toggle.collapsed {
        left: 0;
    }
}

/* Show on mobile */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: none;
        align-items: center;
        justify-content: center;
    }
 .modal-close-btn {
        display: none !important;

    }
    .desktop-sidebar-toggle {
        display: none;
    }
    .desktop-sidebar-toggle{
        display: none !important;
    }
    
}

/* ============================================
   MOBILE RESPONSIVE (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .sidebar-main {
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar-main.active {
        transform: translateX(0);
    }

    body {
        padding-left: 0 !important;
    }
}

/* ============================================
   TABLET/DESKTOP VARIATIONS
   ============================================ */
@media (max-width: 1024px) {
    .sidebar-main {
        width: 240px;
    }
}

@media (min-width: 1025px) {
    .sidebar-main {
        width: 280px;
    }
}

/* ============================================
   SIDEBAR COLLAPSED STATE (Desktop)
   ============================================ */
.sidebar-main.collapsed {
    width: 80px;
}

.sidebar-main.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
}

.sidebar-main.collapsed .sidebar-brand {
    justify-content: center;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-main.collapsed .sidebar-app-name {
    font-size: 0.65rem;
    text-align: center;
    line-height: 1;
}

.sidebar-main.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar-main.collapsed .nav-label,
.sidebar-main.collapsed .logout-label {
    display: none;
}

.sidebar-main.collapsed .sidebar-footer {
    padding: 0.75rem 0.5rem;
}

.sidebar-main.collapsed .user-section {
    justify-content: center;
    margin: 0 auto;
}

.sidebar-main.collapsed .user-info {
    display: none;
}

/* Update body padding when sidebar is collapsed */
.sidebar-main.collapsed ~ body {
    padding-left: 80px;
}

/* Very small screens */
@media (max-width: 375px) {
    .sidebar-main {
        width: 200px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.sidebar-main::-webkit-scrollbar {
    width: 6px;
}

.sidebar-main::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar-main::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.sidebar-wrapper {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   PRINT STYLES - Hide sidebar when printing
   ============================================ */
@media print {
    .sidebar-wrapper {
        display: none;
    }

    body {
        padding-left: 0 !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.sidebar-toggle:focus,
.sidebar-logout-btn:focus,
.nav-link:focus,
.sidebar-brand:focus,
.sidebar-collapse-btn:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.sidebar-toggle:focus {
    outline-offset: -2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
.nav-link .notification-dot {
    display: inline-block;
    margin-left: 8px;
    width: 8px;
    height: 8px;
    background-color: red;
    border-radius: 50%;
    /* no absolute positioning */
}






/* The "Flying" Blue Background Logic */
.background-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.blob {
    position: absolute;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.6;
    animation: flying 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: min(500px, 80vw);
    height: min(500px, 80vw);
    top: -10%;
    left: -10%;
    animation-duration: 15s;
}

.blob-2 {
    width: min(400px, 70vw);
    height: min(400px, 70vw);
    bottom: -5%;
    right: -5%;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    animation-duration: 22s;
    animation-delay: -5s;
}

@keyframes flying {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(10vw, 20vh) scale(1.2) rotate(120deg); }
    66% { transform: translate(-5vw, 35vh) scale(0.8) rotate(240deg); }
    100% { transform: translate(15vw, -10vh) scale(1.1) rotate(360deg); }
}

/* The Looping Text Animation */
.stock-app-text {
    font-size: clamp(2.5rem, 8vw, 8rem);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: whitesmoke;
    letter-spacing: -0.03em;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
    
}

.text-gradient {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}



/* Mobile adjustments */
@media (max-width: 640px) {

    
    @keyframes appearHideMobile {
        0%, 15% {
            opacity: 0;
            transform: scale(0.95) translateY(15px);
            filter: blur(5px);
        }
        35%, 65% {
            opacity: 1;
            transform: scale(1) translateY(0);
            filter: blur(0px);
        }
        85%, 100% {
            opacity: 0;
            transform: scale(1.03) translateY(-15px);
            filter: blur(5px);
        }
    }
}



/* ============================================
   MOBILE BOTTOM NAVIGATION (≤768px)
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: space-around;
    align-items: center;
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 9999;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    body {
        padding-bottom: 70px;
    }
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 12px;
    position: relative;
}

.mobile-nav-btn i {
    font-size: 22px;
}

.mobile-nav-btn span {
    font-size: 11px;
    font-weight: 500;
}

.mobile-nav-btn.active {
    color: #ffffff;
    background: rgba(96, 165, 250, 0.1);
}

.mobile-nav-btn:active {
    transform: scale(0.95);
}

.mobile-notification-dot {
    position: absolute;
    top: 2px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 1px solid #1a1a1a;
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
}

.mobile-drawer.hidden {
    display: none;
}

.mobile-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.mobile-drawer-content {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    animation: slideUp 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
     padding-bottom: 73px !important;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-drawer-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.mobile-drawer-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #9ca3af;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-drawer-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

.mobile-drawer-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
     z-index: 2147483647 !important;
}

.mobile-drawer-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    padding: 14px 16px;
    border-radius: 12px; 
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    font-size: 16px;
   
}

.mobile-drawer-item i {
    width: 24px;
    font-size: 20px;
    color: #ffffff;
}

.mobile-drawer-item:active {
    background: rgba(96, 165, 250, 0.15);
    transform: scale(0.98);
}

#mobile-bottom-nav {
  z-index: 2147483647 !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
}

#mobile-drawer, 
.mobile-drawer-content {
  z-index: 2147483617 !important;
}
#mobile-drawer {
  z-index: 2147483647 !important;
}
/* ============================================
   PROFESSIONAL SIDEBAR STYLES
   ============================================ */

:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --sidebar-bg: #1a1a2e;
    --sidebar-bg-hover: #16213e;
    --sidebar-text: #e2e8f0;
    --sidebar-text-muted: #94a3b8;
    --sidebar-active: #4f46e5;
    --sidebar-active-bg: rgba(79, 70, 229, 0.15);
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition-speed: 0.3s;
}


/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
    z-index: 999;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Sidebar Container */
.sidebar-main {
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1000;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Sidebar Header / Brand */
.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--sidebar-text);
    transition: opacity 0.2s;
}

.sidebar-brand:hover {
    opacity: 0.9;
}

.brand-logo-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-app-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--sidebar-text);
    white-space: nowrap;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-active);
    border-radius: 10px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    width: 100%;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text);
}

.nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
}

.nav-link.active .nav-icon svg {
    stroke: var(--sidebar-active);
}

.nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    transition: stroke 0.2s;
}

.nav-label {
    white-space: nowrap;
    transition: opacity 0.2s;
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Plan Section */
.sidebar-plan-section {
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.plan-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.plan-link:hover {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(79, 70, 229, 0.3);
}

.plan-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plan-icon svg {
    width: 20px;
    height: 20px;
    stroke: #f59e0b;
}

#current-plan-badge {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Footer - User Section */
.sidebar-footer {
    padding: 16px 16px 20px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
    margin-bottom: 8px;
}

.user-section:hover {
    background: var(--sidebar-active-bg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.2);
    border: 2px solid var(--sidebar-border);
    overflow: hidden;
}

.user-avatar svg {
    width: 22px;
    height: 22px;
    stroke: var(--sidebar-text);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--sidebar-text-muted);
    font-weight: 400;
}

/* Logout Button */
.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--sidebar-text-muted);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.logout-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.logout-label {
    white-space: nowrap;
}

/* Toggle Buttons */
.sidebar-toggle,
.desktop-sidebar-toggle {
    position: fixed;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1001;
    box-shadow: var(--sidebar-shadow);
}

.sidebar-toggle:hover,
.desktop-sidebar-toggle:hover {
    background: var(--sidebar-active);
    color: white;
    transform: scale(1.05);
}

.sidebar-toggle {
    bottom: 20px;
    left: 20px;
    display: none;
}

.desktop-sidebar-toggle {
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
}

.desktop-sidebar-toggle:hover {
    transform: translateY(-50%) scale(1.05);
}

.toggle-icon {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

/* Collapsed State */
.sidebar-main.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-main.collapsed .sidebar-app-name,
.sidebar-main.collapsed .nav-label,
.sidebar-main.collapsed .logout-label,
.sidebar-main.collapsed .user-info,
.sidebar-main.collapsed .plan-link span:not(.plan-icon),
.sidebar-main.collapsed .notification-dot {
    display: none;
}

.sidebar-main.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

.sidebar-main.collapsed .user-section {
    justify-content: center;
}

.sidebar-main.collapsed .sidebar-logout-btn {
    justify-content: center;
}

.sidebar-main.collapsed .sidebar-brand {
    justify-content: center;
}

/* 1. Make the container ignore clicks so they pass through to the page content */
div#sidebar-container,
div#sidebar-overlay {
    pointer-events: none !important;
}

/* 2. RE-ENABLE clicks for the sidebar itself and the toggle buttons */
aside#sidebar-main,
button#desktop-sidebar-toggle {
    pointer-events: auto !important;
}