:root {
    color-scheme: only light;

    /* Primary Brand Colors */
    --primary-color: #6366f1;
    --primary-hover: #5855eb;
    --primary-light: #e0e7ff;
    --primary-dark: #4338ca;

    /* Secondary Colors */
    --secondary-color: #f8fafc;
    --secondary-hover: #f1f5f9;
    --secondary-dark: #e2e8f0;

    /* Accent Colors */
    --accent-color: #10b981;
    --accent-hover: #059669;
    --accent-light: #d1fae5;
    --accent-dark: #047857;

    /* Status Colors */
    --success-color: #10b981;
    --success-light: #dcfce7;
    --success-dark: #047857;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;
    --error-color: #ef4444;
    --error-light: #fee2e2;
    --error-dark: #dc2626;
    --info-color: #3b82f6;
    --info-light: #dbeafe;
    --info-dark: #1d4ed8;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #f8fafc;
    --text-white: #ffffff;

    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;
    --bg-muted: #f1f5f9;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, #f1f5f9 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;

    /* ===================================================
       ECHELLE TYPOGRAPHIQUE — Source unique de vérité
       Toutes les tailles de police du projet s'y réfèrent.
       =================================================== */

    /* ── Échelle typographique fixe (source unique de vérité) ─────────── */
    --fs-2xs:      0.625rem;   /* 10px – badges, compteurs compressés    */
    --fs-xs:       0.75rem;    /* 12px – légendes, petites étiquettes    */
    --fs-sm:       0.875rem;   /* 14px – texte secondaire, labels        */
    --fs-base:     1rem;       /* 16px – corps de texte                  */
    --fs-lg:       1.125rem;   /* 18px – texte légèrement agrandi        */
    --fs-xl:       1.25rem;    /* 20px – sous-titres                     */
    --fs-2xl:      1.5rem;     /* 24px – titres de cartes                */
    --fs-2xl-plus: 1.75rem;    /* 28px – titres intermédiaires           */
    --fs-3xl:      2rem;       /* 32px – titres de sections              */
    --fs-3xl-plus: 2.25rem;    /* 36px – titres larges                   */
    --fs-4xl:      2.5rem;     /* 40px – titres de pages                 */
    --fs-5xl:      3rem;       /* 48px – titres héros                    */
    --fs-6xl:      4rem;       /* 64px – icônes / affichage              */

    /* ── Titres responsifs via clamp() ──────────────────────────────────── */
    --fs-h1: clamp(1.875rem, 5vw, 3rem);
    --fs-h2: clamp(1.5rem, 4vw, 2.5rem);
    --fs-h3: clamp(1.25rem, 3vw, 2rem);
    --fs-h4: clamp(1.125rem, 2.5vw, 1.75rem);
    --fs-h5: clamp(1rem, 2vw, 1.5rem);
    --fs-h6: clamp(0.875rem, 1.5vw, 1.25rem);
}

/* Dark mode variables */
[data-theme="dark"] {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #1e293b;

    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-dark: #0f172a;
    --bg-muted: #334155;

    --border-color: #334155;
    --border-light: #475569;
    --border-dark: #1e293b;

    --secondary-color: #1e293b;
    --secondary-hover: #334155;
    --secondary-dark: #0f172a;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    /* 100% = respecte la préférence de taille du navigateur/utilisateur */
    font-size: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--secondary-color);
}

/* Body with sidebar layout */
body.sidebar-layout {
    overflow-x: hidden;
}

body.sidebar-layout.sidebar-open {
    overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
}

/* h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); } */

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Buttons */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--gradient-primary);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    border-color: var(--border-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Form Elements */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.1);
}

/* Alerts */
.alert {
    border-radius: var(--radius);
    border: none;
    padding: var(--spacing-md);
}

.alert-success {
    background: var(--success-light);
    color: var(--success-color);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-color);
}

.alert-danger {
    background: var(--error-light);
    color: var(--error-color);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-color);
}

/* Flash Messages */
.alert.position-fixed {
    max-width: 600px;
    animation: slideDown 0.5s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -100%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.alert .btn-close {
    background: none;
    border: none;
    opacity: 0.7;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* Logo Moderne et Épuré */
.logo-brand {
    transition: all var(--transition-fast);
    padding: 0.5rem 0;
    border-radius: var(--radius-lg);
}

.logo-brand:hover {
    transform: translateY(-1px);
}

.logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    overflow: hidden;
}

.logo-container:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: var(--shadow-lg);
}

.logo-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.logo-container:hover::before {
    opacity: 1;
}

.logo-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
}

.logo-fallback {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.logo-fallback:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: var(--shadow-lg);
}

.logo-icon {
    font-size: var(--fs-2xl);
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transition: all var(--transition-fast);
}

.logo-fallback:hover .logo-icon {
    transform: scale(1.1);
}

.brand-content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: var(--fs-2xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition-fast);
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
    transition: color var(--transition-fast);
}

.logo-brand:hover .brand-name {
    transform: translateX(2px);
}

.logo-brand:hover .brand-subtitle {
    color: var(--primary-color);
}

/* Avatar avec Initiales Moderne */
.user-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.user-avatar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.user-avatar:hover::before {
    opacity: 1;
}

.user-avatar .avatar-initials {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

.user-avatar .avatar-icon {
    font-size: 1rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

/* Avatar Plus Grand pour Dropdown */
.user-avatar-large {
    width: 40px;
    height: 40px;
    box-shadow: var(--shadow-md);
}

.user-avatar-large .avatar-initials {
    font-size: 0.875rem;
}

.user-avatar-large .avatar-icon {
    font-size: 1.125rem;
}

/* Responsive Logo */
@media (max-width: 768px) {
    .logo-container,
    .logo-fallback {
        width: 40px;
        height: 40px;
    }

    .logo-image {
        width: 28px;
        height: 28px;
    }

    .logo-icon {
        font-size: 1.25rem;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .brand-subtitle {
        font-size: var(--fs-xs);
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .user-avatar .avatar-initials {
        font-size: var(--fs-xs);
    }

    .user-avatar .avatar-icon {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .logo-container,
    .logo-fallback {
        width: 36px;
        height: 36px;
    }

    .logo-image {
        width: 24px;
        height: 24px;
    }

    .logo-icon {
        font-size: 1.125rem;
    }

    .brand-name {
        font-size: 1.125rem;
    }

    .brand-subtitle {
        display: none;
    }

    .user-avatar {
        width: 24px;
        height: 24px;
    }

    .user-avatar .avatar-initials {
        font-size: 0.625rem;
    }

    .user-avatar .avatar-icon {
        font-size: 0.75rem;
    }
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #94a3b8;
}

.footer h5, .footer h6 {
    color: white;
}

.footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: white;
}

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--error-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background: var(--primary-color) !important; }
.bg-secondary { background: var(--secondary-color) !important; }
.bg-accent { background: var(--accent-color) !important; }

.border-primary { border-color: var(--primary-color) !important; }
.border-secondary { border-color: var(--border-color) !important; }

/* Responsive utilities */
@media (max-width: 768px) {
    h1 { font-size: var(--fs-h1); }
    h2 { font-size: var(--fs-h2); }
    h3 { font-size: var(--fs-h3); }

    .btn {
        /* padding: 0.5rem 1rem; */
        font-size: 0.875rem;
    }
}

/* Navigation Enhancements */
.notification-indicator {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.notification-indicator:hover {
    transform: scale(1.1);
}

.notification-indicator .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: var(--fs-xs);
    padding: 0.25em 0.4em;
    min-width: 18px;
    height: 18px;
    line-height: 1;
}

.notification-wrapper {
    position: relative;
}

.notification-btn {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.notification-btn:hover {
    color: var(--primary-color);
}

.notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: var(--fs-xs);
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    z-index: 1050;
    max-height: 400px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.notification-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
    align-items: center;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast);
    cursor: pointer;
}

.notification-item:hover {
    background-color: var(--secondary-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: #f0f9ff;
    border-left: 3px solid var(--primary-color);
}

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.notification-message {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.notification-time {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.notification-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-color);
}

.mark-all-read-btn {
    font-size: 0.75rem;
    padding: 0;
    color: var(--primary-color);
}

.mark-all-read-btn:hover {
    color: var(--primary-hover);
}

/* ── Responsive notification-dropdown (≤ 767px) ─────────────────────────────
   On neutralise Popper.js (qui injecte transform:translate) via
   position:fixed + transform:none!important sur toute la plage mobile/tablette.
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .notification-dropdown {
        position: fixed !important;
        /* topbar 64px + 8px marge */
        top: 72px !important;
        right: 0.75rem !important;
        /* largeur adaptative : pleine largeur sur téléphone, max 400px en tablette */
        left: auto !important;
        width: min(calc(100vw - 1.5rem), 400px) !important;
        min-width: unset !important;
        max-width: 400px !important;
        max-height: calc(100dvh - 88px);
        max-height: calc(100svh - 88px);
        overflow: hidden;
        border-radius: 0.875rem;
        /* neutralise le transform injecté par Popper.js */
        transform: none !important;
        inset: unset !important;
        top: 72px !important;
        right: 0.75rem !important;
    }
    .notification-list-modern {
        max-height: calc(100dvh - 210px);
        max-height: calc(100svh - 210px);
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .dropdown-header-modern {
        padding: 0.875rem 1rem;
    }
    /* iOS safe-area (encoche / barre home) */
    .dropdown-footer-modern {
        padding: 0.375rem 0.5rem;
        padding-bottom: calc(0.375rem + env(safe-area-inset-bottom, 0px));
    }
    /* Bouton "marquer comme lu" : toujours visible sur tactile */
    .notification-item-dropdown .btn-mark-read {
        opacity: 1;
        padding: 0.375rem 0.625rem;
    }
    /* Zone de tap minimale */
    .notification-item-dropdown {
        min-height: 56px;
        padding: 0.875rem 1rem;
    }
}

/* Sur téléphone (≤ 575px) : la dropdown prend toute la largeur */
@media (max-width: 575px) {
    .notification-dropdown {
        left: 0.75rem !important;
        width: calc(100vw - 1.5rem) !important;
        max-width: 100% !important;
    }
}

.user-avatar .avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid var(--border-color);
}

.dropdown-menu .dropdown-item {
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
    background-color: var(--light-bg);
}

.dropdown-menu .dropdown-item i {
    width: 16px;
    text-align: center;
}

.dropdown-menu .badge {
    font-size: 0.75rem;
}

/* Theme Toggle */
#theme-toggle {
    border: none;
    background: transparent;
    color: var(--text-color);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    background-color: var(--light-bg);
    transform: rotate(15deg);
}

#theme-toggle i {
    transition: transform 0.3s ease;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --light-bg: #2d2d2d;
        --border-color: #404040;
        --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --light-bg: #2d2d2d;
    --border-color: #404040;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* =====================================================
   SIDEBAR STYLES - MOBILE FIRST
   ===================================================== */

/* Sidebar Base - Mobile First (Caché par défaut sur mobile) */
.sidebar-modern {
    position: fixed;
    top: 0;
    left: 0;
    /* Mobile: largeur 85% ou 280px max */
    width: min(85vw, 280px);
    height: 100vh;
    background: white;
    border-right: 1px solid var(--border-color);
    z-index: 1040;
    /* Mobile: caché par défaut */
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    /* Scroll fluide sur mobile */
    -webkit-overflow-scrolling: touch;
    /* Ombre pour donner de la profondeur */
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

/* Dark theme */
[data-theme="dark"] .sidebar-modern {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

/* Mobile: Sidebar ouverte */
.sidebar-modern.open {
    transform: translateX(0);
}

/* Tablette: largeur fixe */
@media (min-width: 640px) {
    .sidebar-modern {
        width: 280px;
    }
}

/* Desktop: toujours visible */
@media (min-width: 1024px) {
    .sidebar-modern {
        transform: translateX(0);
        box-shadow: none;
    }
    
    .sidebar-modern.collapsed {
        transform: translateX(-100%);
    }
}

/* Sidebar Header - Mobile First */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* padding: 0.75rem 1rem; */
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 1;
    min-height: auto;
    gap: 0.5rem;
}

/* Tablette/Desktop: plus de padding */
@media (min-width: 768px) {
    .sidebar-header {
        /* padding: 1rem 1.25rem; */
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Mobile: logo plus petit */
.sidebar-logo-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 180px;
    height: auto;
    transition: all 0.2s ease;
    flex-shrink: 1;
    line-height: 1.2;
}

/* Desktop: logo normal */
@media (min-width: 768px) {
    .sidebar-logo-container {
        max-width: 200px;
    }
}

.sidebar-logo-container:hover {
    opacity: 0.9;
}

.sidebar-logo-image {
    width: 100%;
    height: auto;
    max-height: 65px;
    object-fit: contain;
    display: block;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .sidebar-logo-image {
        max-height: 70px;
    }
}

.sidebar-brand:hover .sidebar-logo-image {
    opacity: 0.9;
}

.sidebar-logo-fallback {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .sidebar-logo-fallback {
        width: 40px;
        height: 40px;
    }
}

.sidebar-logo-fallback:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.sidebar-logo-icon {
    font-size: 1.125rem;
    color: white;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .sidebar-logo-icon {
        font-size: 1.25rem;
    }
}

/* Logo SVG personnalisé */
.sidebar-logo-svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .sidebar-logo-svg {
        width: 28px;
        height: 28px;
    }
}

.sidebar-logo-fallback:hover .sidebar-logo-svg {
    transform: scale(1.1);
}

/* Animation pour le logo */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.sidebar-brand:hover .sidebar-logo-svg,
.sidebar-brand:hover .sidebar-logo-icon {
    animation: logoFloat 0.6s ease-in-out;
}

.sidebar-brand-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

/* Mobile: texte plus petit */
.sidebar-brand-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop: texte normal */
@media (min-width: 768px) {
    .sidebar-brand-name {
        font-size: 1.25rem;
    }
}

.sidebar-brand-subtitle {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sidebar-brand-subtitle i {
    font-size: 0.625rem;
    opacity: 0.8;
}

@media (min-width: 768px) {
    .sidebar-brand-subtitle {
        font-size: 0.75rem;
    }
    
    .sidebar-brand-subtitle i {
        font-size: var(--fs-xs);
    }
}

/* Toggle button - Zone tactile optimale */
.sidebar-toggle {
    /* Mobile: zone tactile 44px minimum */
    max-width: 62px;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    /* Zone tactile visible */
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
}

/* Desktop: taille normale */
@media (min-width: 1024px) {
    .sidebar-toggle {
        display: none;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
}

.sidebar-toggle:hover {
    background: var(--secondary-hover);
    color: var(--primary-color);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Sidebar Navigation - Mobile First */
.sidebar-nav {
    /* Mobile: plus d'espace vertical */
    padding: 0.75rem 0 1.5rem;
}

@media (min-width: 768px) {
    .sidebar-nav {
        padding: 1rem 0;
    }
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .sidebar-section {
        margin-bottom: 2rem;
    }
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

/* Section titles - Mobile optimized */
.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* Mobile: padding réduit */
    padding: 0 1rem;
    margin-bottom: 0.625rem;
}

@media (min-width: 768px) {
    .sidebar-section-title {
        font-size: 0.75rem;
        padding: 0 1.5rem;
        margin-bottom: 0.75rem;
    }
}

.sidebar-section-title i {
    font-size: 0.625rem;
    opacity: 0.7;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin-bottom: 0.125rem;
}

/* Navigation links - Mobile First avec zones tactiles */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    /* Mobile: padding généreux pour tactile */
    padding: 0.875rem 1rem;
    /* Mobile: zone tactile minimum 44px */
    min-height: 44px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    /* Touch feedback */
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
}

/* Desktop: padding normal */
@media (min-width: 768px) {
    .sidebar-nav-link {
        padding: 0.75rem 1.5rem;
        gap: 0.75rem;
    }
}

.sidebar-nav-link:hover {
    background: var(--secondary-hover);
    color: var(--text-primary);
}

/* Desktop: effet slide au hover */
@media (min-width: 1024px) {
    .sidebar-nav-link:hover {
        padding-left: 2rem;
    }
}

/* Mobile: effet tactile */
.sidebar-nav-link:active {
    background: var(--primary-light);
    transform: scale(0.98);
}

/* Lien actif - Indicateur visuel clair */
.sidebar-nav-link.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
    /* Mobile: bordure droite visible */
    border-right: 4px solid var(--primary-color);
}

/* Desktop: bordure plus subtile */
@media (min-width: 1024px) {
    .sidebar-nav-link.active {
        border-right: 3px solid var(--primary-color);
    }
}

.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 0 2px 2px 0;
}

.sidebar-nav-link i {
    /* Mobile: icône plus grande */
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 1.125rem;
    opacity: 0.7;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Desktop: icône normale */
@media (min-width: 768px) {
    .sidebar-nav-link i {
        width: 18px;
        min-width: 18px;
        font-size: 1rem;
    }
}

.sidebar-nav-link:hover i,
.sidebar-nav-link.active i {
    opacity: 1;
    transform: scale(1.1);
}

.sidebar-nav-link span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav-link.highlight {
    color: var(--accent-color);
}

.sidebar-nav-link.highlight:hover,
.sidebar-nav-link.highlight.active {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.sidebar-nav-link.back-to-site {
    color: var(--info-color);
}

.sidebar-nav-link.back-to-site:hover,
.sidebar-nav-link.back-to-site.active {
    background: var(--info-light);
    color: var(--info-dark);
}

.sidebar-nav-link.admin-link {
    color: var(--info-color);
}

.sidebar-nav-link.admin-link:hover,
.sidebar-nav-link.admin-link.active {
    background: var(--info-light);
    color: var(--info-dark);
}

.sidebar-nav-link.logout-link {
    color: var(--error-color);
}

.sidebar-nav-link.logout-link:hover {
    background: var(--error-light);
    color: var(--error-dark);
}

/* Badges responsive */
.sidebar-badge {
    padding: 0.125rem 0.5rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: white;
    background: var(--error-color);
    border-radius: var(--radius-full);
    margin-left: auto;
    /* Zone visible sur mobile */
    min-width: 20px;
    text-align: center;
}

@media (min-width: 768px) {
    .sidebar-badge {
        font-size: 0.75rem;
    }
}

/* User Info Section - Mobile First */
.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    /* Mobile: padding réduit */
    padding: 0.75rem 1rem;
    margin: 0 0.75rem 1rem;
    background: var(--secondary-color);
    border-radius: 0.75rem;
    /* Empêche débordement */
    min-width: 0;
}

/* Desktop: padding normal */
@media (min-width: 768px) {
    .sidebar-user-info {
        padding: 1rem 1.5rem;
        margin: 0 1rem 1rem;
        gap: 0.75rem;
    }
}

[data-theme="dark"] .sidebar-user-info {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-avatar {
    /* Mobile: avatar adapté */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    font-weight: 600;
    flex-shrink: 0;
}

/* Desktop: avatar plus grand */
@media (min-width: 768px) {
    .sidebar-user-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-user-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .sidebar-user-name {
        font-size: 0.875rem;
    }
}

.sidebar-user-role {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

@media (min-width: 768px) {
    .sidebar-user-role {
        font-size: 0.75rem;
    }
}

/* === NOUVELLE CARTE UTILISATEUR === */
.sidebar-user-card {
    margin: 0 0.75rem 1.5rem;
    padding: 0;
}

@media (min-width: 768px) {
    .sidebar-user-card {
        margin: 0 1rem 1.5rem;
    }
}

.sidebar-user-card-inner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

[data-theme="dark"] .sidebar-user-card-inner {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.sidebar-user-card-inner:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.sidebar-user-avatar-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.avatar-initials-large {
    line-height: 1;
}

.avatar-icon-large {
    font-size: var(--fs-2xl);
}

.user-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .user-status-indicator {
    border-color: #1e293b;
}

.sidebar-user-card-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-card-role {
    margin-bottom: 0.5rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    border-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.role-badge i {
    font-size: 0.75rem;
}

.role-badge.role-client {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.role-badge.role-gp {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.role-badge.role-admin {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sidebar-user-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-stat-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.user-stat-item i {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* === INDICATEUR DE NAVIGATION === */
.nav-link-indicator {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 3px 0 0 3px;
    transition: height 0.3s ease;
}

.sidebar-nav-link.active .nav-link-indicator {
    height: 60%;
}

.sidebar-nav-link:hover .nav-link-indicator {
    height: 40%;
}

/* === BADGES COLORÉS === */
.sidebar-badge-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.sidebar-badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.sidebar-badge-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.sidebar-badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.sidebar-badge-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* === SECTION DÉCONNEXION === */
.sidebar-section-logout {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Sidebar Overlay - Mobile primarily */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Touch feedback */
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Desktop: overlay invisible */
@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none;
    }
}

/* Top Bar - Mobile First (toujours visible) */
/* ════════════════════════════════════════════════════════
   TOP BAR — MOBILE FIRST — DESIGN ÉPURÉ
   ════════════════════════════════════════════════════════ */

/* ── BARRE PRINCIPALE ─────────────────────────────────── */
/* ═══════════════════════════════════════════════════════
   TOP BAR — Design moderne & épuré
   ═══════════════════════════════════════════════════════ */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    z-index: 1030;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Un dropdown du top-bar (langue, notifications, menu utilisateur) est un
   descendant de .top-bar : sa pile d'empilement reste plafonnée au z-index
   du top-bar (1030), donc il passe toujours derrière la sidebar (1040) même
   avec un z-index élevé. On relève le top-bar au-dessus de la sidebar
   seulement pendant qu'un de ses dropdowns est ouvert. */
.top-bar:has(.dropdown.show) {
    z-index: 1045;
}

/* Ligne d'accent colorée en bas de la topbar */
.top-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, #8b5cf6 50%, var(--accent-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.top-bar.scrolled::after {
    opacity: 1;
}

@media (min-width: 1024px) {
    .top-bar { left: 0 !important; right: 0 !important; }
    body.has-sidebar .top-bar,
    body.has-sidebar.sidebar-collapsed .top-bar { left: 0 !important; }
}

[data-theme="dark"] .top-bar {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ── LAYOUT INTERNE — 3 zones ─────────────────────────── */
.top-bar-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.875rem;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .top-bar-content { padding: 0 1.25rem; }
}

@media (min-width: 1024px) {
    .top-bar-content { padding: 0 1.5rem; }
}

/* ── GAUCHE : bouton hamburger ───────────────────────── */
.top-bar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mobile-menu-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.mobile-menu-toggle:active { transform: scale(0.9); }

@media (min-width: 1024px) {
    .mobile-menu-toggle { display: none; }
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle:hover .hamburger-line { background: var(--primary-color); }

.mobile-menu-toggle.active .hamburger-line { background: var(--primary-color); }
.mobile-menu-toggle.active .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.active .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-toggle.active .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── CENTRE : logo mobile ────────────────────────────── */
.top-bar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    padding: 0 0.5rem;
    transition: opacity 0.2s ease;
}

.top-bar-brand:hover { opacity: 0.8; }

.top-bar-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
    display: block;
    max-width: 140px;
}

/* Sur desktop, la sidebar affiche déjà le logo */
@media (min-width: 1024px) {
    .top-bar-brand { display: none; }
}

/* ── DROITE (mobile) / CENTRE (desktop) : actions ─────────
   Sur mobile, le bouton hamburger occupe la gauche : les actions
   restent alignées à droite pour ne pas le recouvrir. À partir de
   1024px, le hamburger disparaît (sidebar) et les actions sont
   centrées horizontalement dans la topbar via position absolue. */
.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .top-bar-actions { gap: 0.375rem; }
}

@media (min-width: 1024px) {
    .top-bar-actions {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}

/* ── GROUPE ICÔNES (cloche + messages) ───────────────── */
.top-bar-icon-group {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.top-bar-icon-group:has(.top-bar-btn:hover) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

[data-theme="dark"] .top-bar-icon-group {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

@media (min-width: 640px) {
    .top-bar-icon-group { gap: 0.25rem; padding: 0.3rem; }
}

/* ── SÉPARATEUR VERTICAL ─────────────────────────────── */
.top-bar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    flex-shrink: 0;
    border-radius: 1px;
    display: none;
}

@media (min-width: 640px) {
    .top-bar-divider { display: block; }
}

[data-theme="dark"] .top-bar-divider {
    background: rgba(255, 255, 255, 0.08);
}

/* ── BOUTONS ICÔNES ──────────────────────────────────── */
.top-bar-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
    position: relative;
    font-size: 0.875rem;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
}

@media (min-width: 640px) {
    .top-bar-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
}

.top-bar-btn:hover {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.18);
    transform: translateY(-1px);
}

[data-theme="dark"] .top-bar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ── BOUTON SÉLECTEUR DE LANGUE (drapeau + code, pilule) ── */
.language-switcher-btn {
    width: auto;
    min-width: auto;
    padding: 0 0.625rem;
    gap: 0.375rem;
}

.language-switcher-code {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.language-switcher-btn[aria-expanded="true"] {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.18);
}

[data-theme="dark"] .language-switcher-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.top-bar-btn:active { transform: scale(0.92) translateY(0); }

/* ── TOGGLE THÈME ────────────────────────────────────── */
.top-bar-theme-toggle {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    border-radius: 50px;
    outline: none;
}

.top-bar-theme-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

/* Masqué sur très petits écrans pour éviter l'encombrement */
@media (max-width: 359px) {
    .top-bar-theme-toggle { display: none; }
}

.theme-toggle-track {
    position: relative;
    display: flex;
    align-items: center;
    width: 52px;
    height: 28px;
    background: var(--bg-muted);
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    padding: 0 3px;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
}

[data-theme="dark"] .theme-toggle-track {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.35);
}

.theme-icon-light,
.theme-icon-dark {
    position: absolute;
    font-size: 0.625rem;
    z-index: 1;
    transition: opacity 0.25s, color 0.25s;
    pointer-events: none;
}

.theme-icon-light { left: 7px; color: #f59e0b; opacity: 1; }
.theme-icon-dark  { right: 7px; color: #818cf8; opacity: 0.4; }

[data-theme="dark"] .theme-icon-light { opacity: 0.3; }
[data-theme="dark"] .theme-icon-dark  { opacity: 1; color: #818cf8; }

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(24px);
    background: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.55);
}

.top-bar-theme-toggle:hover .theme-toggle-track {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ── BADGES DE NOTIFICATION ──────────────────────────── */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 3.5px;
    font-size: 0.5625rem;
    font-weight: 700;
    color: white;
    background: var(--error-color);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
    border: 2px solid white;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .notification-badge { border-color: #0f172a; }

.notification-badge-pulse { animation: pulse-badge 2.2s ease-in-out infinite; }

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45); }
    50%       { transform: scale(1.14); box-shadow: 0 3px 10px rgba(239, 68, 68, 0.6); }
}

/* ── PILL COMPTEUR NOTIFICATION DROPDOWN ─────────────── */
.notification-count-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary-light);
    border-radius: 50px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    letter-spacing: 0.01em;
}

[data-theme="dark"] .notification-count-pill {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.notification-badge-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.4);
}

/* ── TITRE DE PAGE (desktop) ─────────────────────────── */
.top-bar-title {
    flex: 1;
    display: none;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .top-bar-title { display: block; }
}

.current-page-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── MENU UTILISATEUR ────────────────────────────────── */
.top-bar-user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.25rem;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    min-height: 42px;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
    outline: none;
}

@media (min-width: 640px) {
    .top-bar-user-menu { padding: 0.25rem 0.75rem 0.25rem 0.25rem; }
}

.top-bar-user-menu:hover {
    background: var(--bg-muted);
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.18);
    transform: translateY(-1px);
}

.top-bar-user-menu:active { transform: translateY(0) scale(0.98); }

.top-bar-user-menu[aria-expanded="true"] {
    background: var(--primary-light);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .top-bar-user-menu {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .top-bar-user-menu:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.5);
}

[data-theme="dark"] .top-bar-user-menu[aria-expanded="true"] {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.45);
}

/* Avatar */
.user-menu-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: box-shadow 0.2s ease;
}

.top-bar-user-menu:hover .user-menu-avatar {
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.45);
}

@media (min-width: 640px) {
    .user-menu-avatar { width: 34px; height: 34px; }
}

.user-avatar-initials { line-height: 1; }

.user-menu-avatar,
.user-dropdown-avatar {
    overflow: hidden;
}

.user-avatar-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Point de statut */
.user-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .user-status-dot { border-color: rgba(15, 23, 42, 0.9); }

.status-online   { background: var(--accent-color); }
.status-gp       { background: #8b5cf6; }
.status-employee { background: #f59e0b; }
.status-admin    { background: var(--error-color); }

/* Nom + chevron (masqué sur petits écrans) */
.user-menu-info {
    display: none;
    align-items: center;
    gap: 0.375rem;
}

@media (min-width: 640px) {
    .user-menu-info { display: flex; }
}

.user-menu-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-icon {
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.top-bar-user-menu:hover .user-menu-icon { color: var(--primary-color); }
.top-bar-user-menu[aria-expanded="true"] .user-menu-icon { transform: rotate(180deg); color: var(--primary-color); }

/* ── DROPDOWNS ───────────────────────────────────────── */
.notification-dropdown,
.user-dropdown {
    min-width: 300px;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 0;
    margin-top: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: dropdown-appear 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-origin: top right;
}

@media (min-width: 640px) {
    .notification-dropdown { min-width: 360px; }
    .user-dropdown { min-width: 280px; }
}

/* Mobile : dropdown pleine largeur (≤ 767px pour notification, ≤ 575px pour user) */
@media (max-width: 767px) {
    .notification-dropdown {
        min-width: unset !important;
        transform: none !important;
    }
}

@media (max-width: 575px) {
    .notification-dropdown,
    .user-dropdown {
        min-width: unset !important;
        width: calc(100vw - 1.5rem) !important;
        border-radius: 0.875rem;
        transform-origin: top center;
        transform: none !important;
    }
    .notification-dropdown {
        position: fixed !important;
        top: 72px !important;
        right: 0.75rem !important;
        left: 0.75rem !important;
        max-height: calc(100dvh - 88px);
        overflow: hidden;
    }
    .user-dropdown {
        position: fixed !important;
        top: 72px !important;
        right: 0.75rem !important;
        left: 0.75rem !important;
        max-height: calc(100dvh - 84px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@keyframes dropdown-appear {
    from { opacity: 0; transform: scale(0.94) translateY(-6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

[data-theme="dark"] .notification-dropdown,
[data-theme="dark"] .user-dropdown {
    background: #1a2236;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── HEADER NOTIFICATION ─────────────────────────────── */
.dropdown-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .dropdown-header-modern { border-color: rgba(255, 255, 255, 0.06); }

/* ── HEADER UTILISATEUR ──────────────────────────────── */
.dropdown-header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.07) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.dropdown-header-user::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 80px; height: 80px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

[data-theme="dark"] .dropdown-header-user {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Avatar large dans le dropdown */
.user-dropdown-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.user-avatar-initials-large { line-height: 1; }

.user-dropdown-info { flex: 1; min-width: 0; }

.user-dropdown-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}

.user-dropdown-email {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.375rem;
}

/* ── BADGES DE RÔLE ──────────────────────────────────── */
.role-badge-small {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.175rem 0.55rem;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-badge-small.role-client   { background: rgba(59,130,246,.12);  color: #3b82f6; border: 1px solid rgba(59,130,246,.25); }
.role-badge-small.role-gp       { background: rgba(139,92,246,.12);  color: #8b5cf6; border: 1px solid rgba(139,92,246,.25); }
.role-badge-small.role-employee { background: rgba(245,158,11,.12);  color: #d97706; border: 1px solid rgba(245,158,11,.25); }
.role-badge-small.role-admin    { background: rgba(239,68,68,.12);   color: #ef4444; border: 1px solid rgba(239,68,68,.25); }

/* ── BODY DROPDOWN ───────────────────────────────────── */
.user-dropdown-body { padding: 0.375rem 0; }

.user-dropdown .dropdown-divider {
    margin: 0.25rem 0;
    border-color: var(--border-color);
    opacity: 0.6;
}

[data-theme="dark"] .user-dropdown .dropdown-divider { border-color: rgba(255,255,255,.06); }

/* ── DRAPEAUX (sélecteur de langue) ─────────────────────
   SVG inline au lieu d'emoji : Windows ne rend pas les
   emoji drapeau et retombe sur le code ISO texte (FR/GB). */
.flag-icon-wrapper { display: inline-flex; align-items: center; }
.flag-icon {
    width: 1.15em;
    height: 1.15em;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
    flex-shrink: 0;
}

/* ── ITEMS ───────────────────────────────────────────── */
.dropdown-item-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin: 0.125rem 0.5rem;
    border-radius: 0.625rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    border: none;
    background: transparent;
    width: calc(100% - 1rem);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.dropdown-item-modern:hover { background: rgba(99,102,241,.08); color: var(--primary-color); transform: translateX(2px); }
[data-theme="dark"] .dropdown-item-modern:hover { background: rgba(99,102,241,.15); }

.dropdown-item-modern.text-danger { color: var(--error-color); }
.dropdown-item-modern.text-danger:hover { background: rgba(239,68,68,.08); color: #dc2626; transform: translateX(2px); }
[data-theme="dark"] .dropdown-item-modern.text-danger:hover { background: rgba(239,68,68,.15); }

.dropdown-item-modern i {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    border-radius: 0.5rem;
    background: var(--secondary-hover);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.dropdown-item-modern:hover i { background: rgba(99,102,241,.12); color: var(--primary-color); }
[data-theme="dark"] .dropdown-item-modern i { background: rgba(255,255,255,.05); }
[data-theme="dark"] .dropdown-item-modern:hover i { background: rgba(99,102,241,.2); }
.dropdown-item-modern.text-danger i { color: var(--error-color); background: rgba(239,68,68,.08); }
.dropdown-item-modern.text-danger:hover i { background: rgba(239,68,68,.15); color: #dc2626; }

/* ── LISTE NOTIFICATIONS ─────────────────────────────── */
.notification-list-modern {
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.notification-list-modern::-webkit-scrollbar { width: 4px; }
.notification-list-modern::-webkit-scrollbar-track { background: transparent; }
.notification-list-modern::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.notification-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.notification-loading-state i { font-size: 1.5rem; opacity: 0.5; }

/* ── FOOTER DROPDOWN ─────────────────────────────────── */
.dropdown-footer-modern {
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .dropdown-footer-modern { border-color: rgba(255,255,255,.06); }

.dropdown-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 0.625rem;
    transition: background 0.15s;
}

.dropdown-footer-link:hover { background: rgba(99,102,241,.08); color: var(--primary-dark); }
[data-theme="dark"] .dropdown-footer-link:hover { background: rgba(99,102,241,.15); }

/* ── BOUTONS AUTH (non connecté) ─────────────────────── */
.top-bar-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.22s ease;
    min-height: 40px;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* Icône seule sur très petits écrans */
.top-bar-auth-btn span { display: none; }

@media (min-width: 480px) {
    .top-bar-auth-btn span { display: inline; }
}

/* Connexion */
.btn-login {
    color: var(--text-secondary);
    background: transparent;
    border: 1.5px solid var(--border-color);
}

.btn-login:hover {
    color: var(--primary-color);
    background: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-login {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-login:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

/* Inscription */
.btn-register {
    color: white !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: 1.5px solid transparent;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.32);
}

.btn-register:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.48);
    background: linear-gradient(135deg, #5855eb 0%, #7c3aed 100%);
}

.btn-register:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ── COULEURS HOVER ICÔNES SPÉCIFIQUES ───────────────── */
.top-bar-notification-btn:hover,
.top-bar-notification-btn[aria-expanded="true"] {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.22);
    transform: translateY(-1px);
}

[data-theme="dark"] .top-bar-notification-btn:hover,
[data-theme="dark"] .top-bar-notification-btn[aria-expanded="true"] {
    background: rgba(245, 158, 11, 0.15);
}

.top-bar-messages-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.22);
    transform: translateY(-1px);
}

[data-theme="dark"] .top-bar-messages-btn:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* État actif (dropdown ouvert) */
.top-bar-notification-btn[aria-expanded="true"] {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.22);
    transform: translateY(0);
}

[data-theme="dark"] .top-bar-notification-btn[aria-expanded="true"] {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

/* Main Content Adjustment - Mobile First */
.main-content-with-sidebar {
    /* Mobile: pas de marge gauche, juste marge top */
    margin-left: 0;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
    transition: margin-left 0.3s ease;
}

/* Desktop: marge pour le sidebar */
@media (min-width: 1024px) {
    .main-content-with-sidebar {
        margin-left: 260px;
        transition: margin-left 0.28s cubic-bezier(.4,0,.2,1);
    }

    body.sidebar-collapsed .main-content-with-sidebar {
        margin-left: 72px;
    }
}

/* =====================================================
   NAVBAR MODERNE
   ===================================================== */

.navbar-modern {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-normal);
}

[data-theme="dark"] .navbar-modern {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Brand */
.navbar-brand-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo-img {
    height: 70px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    transition: transform var(--transition-fast);
    border-radius: var(--radius-sm);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.navbar-brand-modern:hover .brand-logo-img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.brand-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--fs-2xl);
    transition: transform var(--transition-fast);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.navbar-brand-modern:hover .brand-icon {
    transform: rotate(-5deg) scale(1.05);
}

.brand-text {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

/* Navigation Links */
.navbar-nav-modern {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link-modern {
    padding: 0.5rem 1rem;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link-modern:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.nav-link-modern.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.nav-link-modern.highlight {
    color: var(--accent-color);
}

.nav-link-modern.highlight:hover,
.nav-link-modern.highlight.active {
    color: var(--accent-dark);
    background: var(--accent-light);
}

/* Actions Container */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-action-item {
    position: relative;
}

.nav-action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: 1.125rem;
}

.nav-action-btn:hover {
    background: var(--secondary-hover);
    color: var(--primary-color);
}

/* Notification List in Dropdown */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item-dropdown {
    position: relative;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.notification-item-dropdown:hover {
    background-color: var(--bg-hover);
}

.notification-item-dropdown.unread {
    background-color: rgba(99, 102, 241, 0.05);
    border-left: 3px solid var(--primary-color);
}

.notification-item-dropdown .notification-header {
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.notification-item-dropdown .notification-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem !important;
    margin: 0;
    flex: 1;
}

.notification-item-dropdown .notification-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.notification-item-dropdown .notification-message {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item-dropdown .notification-type {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.notification-item-dropdown .notification-type.info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.notification-item-dropdown .notification-type.success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.notification-item-dropdown .notification-type.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.notification-item-dropdown .notification-type.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.notification-item-dropdown .btn-mark-read {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    opacity: 0;
}

.notification-item-dropdown:hover .btn-mark-read {
    opacity: 1;
}

.notification-item-dropdown .btn-mark-read:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-dark);
}

/* User Menu */
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

[data-theme="dark"] .user-menu-trigger {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.user-menu-trigger:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.user-avatar-modern {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chevron-icon {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
    transition: transform var(--transition-fast);
}

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

/* Dropdown Menu Modern - Mobile First */
.dropdown-menu-modern {
    /* Mobile: pleine largeur disponible avec marges */
    min-width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    background: white;
    margin-top: 0.5rem !important;
}

@media (min-width: 640px) {
    .dropdown-menu-modern {
        min-width: 280px;
        max-width: 320px;
    }
}

@media (min-width: 768px) {
    .dropdown-menu-modern {
        min-width: 300px;
        max-width: 350px;
    }
}

[data-theme="dark"] .dropdown-menu-modern {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

/* Dropdown de notifications dans top-bar - Mobile First */
.top-bar .dropdown-menu {
    /* Mobile: adapté à l'écran */
    min-width: calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

@media (min-width: 640px) {
    .top-bar .dropdown-menu {
        min-width: 320px;
        max-width: 380px;
    }
}

@media (min-width: 768px) {
    .top-bar .dropdown-menu {
        min-width: 360px;
        max-width: 400px;
    }
}

/* Popin de langue : design carte moderne et épuré, seulement 2 items
   (FR/EN) donc pas besoin de la largeur quasi pleine écran des dropdowns
   de notifications sur mobile. Sélecteur par ID pour surclasser
   .top-bar .dropdown-menu sans !important. */
#languageDropdown + .dropdown-menu {
    min-width: 190px;
    max-width: calc(100vw - 2rem);
    width: max-content;
    padding: 0.375rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: dropdown-appear 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
    transform-origin: top right;
}

[data-theme="dark"] #languageDropdown + .dropdown-menu {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

@media (min-width: 640px) {
    #languageDropdown + .dropdown-menu {
        min-width: 180px;
        max-width: 220px;
    }
}

/* Sélecteur `.dropdown-menu .language-dropdown-item` (2 classes) requis
   pour surclasser la règle globale d'accessibilité `a:not(.btn)` qui
   force soulignement + couleur sur tous les liens (accessibility.css). */
.dropdown-menu .language-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.625rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.language-dropdown-item + .language-dropdown-item { margin-top: 0.125rem; }

.language-dropdown-item:hover { background: rgba(99, 102, 241, .08); color: var(--primary-color); }
[data-theme="dark"] .language-dropdown-item:hover { background: rgba(99, 102, 241, .15); }

.language-dropdown-item.active { background: rgba(99, 102, 241, .1); color: var(--primary-color); font-weight: 600; }
[data-theme="dark"] .language-dropdown-item.active { background: rgba(99, 102, 241, .18); }

.language-dropdown-item .flag-icon { width: 1.2em; height: 1.2em; }

.language-dropdown-label { flex: 1; }

.language-dropdown-check { font-size: 0.75rem; color: var(--primary-color); }

.dropdown-header-modern h6 {
    margin: 0;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-primary);
}

.btn-text-modern {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--fs-sm);
    color: var(--primary-color);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-text-modern:hover {
    color: var(--primary-dark);
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    gap: 0.5rem;
}

.notification-empty i {
    font-size: var(--fs-2xl);
    opacity: 0.5;
}

.notification-footer-modern {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-color);
}

.btn-see-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.btn-see-all:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .navbar-container {
        gap: 1rem;
    }

    .nav-link-modern {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 991px) {
    .navbar-container {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 768px) {
    .brand-text {
        font-size: 1.25rem;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .btn-nav-modern {
        padding: 0.5rem 0.875rem;
        font-size: var(--fs-sm);
    }

    .notification-dropdown-modern {
        width: 300px;
        right: -1rem;
    }

    .user-menu-trigger {
        padding: 0.25rem;
        border: none;
        background: transparent;
    }

    .user-menu-trigger:hover {
        box-shadow: none;
    }
}

@media (max-width: 576px) {
    .navbar-container {
        padding: 0.625rem 0.75rem;
    }

    .brand-text {
        display: none;
    }

    .btn-nav-modern.btn-ghost {
        display: none;
    }

    .btn-nav-modern.btn-filled {
        padding: 0.5rem 0.75rem;
    }

    .btn-nav-modern.btn-filled span {
        display: none;
    }

    .notification-dropdown-modern {
        position: fixed;
        top: auto;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        width: auto;
        max-height: 60vh;
        border-radius: var(--radius-xl);
    }
}

/* Navigation Buttons */
.btn-nav-modern {
    padding: 0.5rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-ghost {
    color: var(--text-secondary);
    background: transparent;
}

.btn-ghost:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.btn-filled {
    color: white;
    background: var(--gradient-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-filled:hover {
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Theme Toggle Modern */
.theme-toggle-modern {
    position: relative;
    overflow: hidden;
}

.theme-toggle-modern .theme-icon-light,
.theme-toggle-modern .theme-icon-dark {
    position: absolute;
    transition: all var(--transition-normal);
}

.theme-toggle-modern .theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle-modern .theme-icon-light {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle-modern .theme-icon-dark {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle-modern .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Navigation */
.mobile-nav-modern {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

[data-theme="dark"] .mobile-nav-modern {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

.mobile-nav-modern.open {
    max-height: 500px;
}

.mobile-nav-content {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.mobile-nav-link.highlight {
    color: var(--accent-color);
}

.mobile-nav-link.highlight:hover,
.mobile-nav-link.highlight.active {
    color: var(--accent-dark);
    background: var(--accent-light);
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.mobile-badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: var(--error-color);
    border-radius: var(--radius-full);
}

/* Notification Dropdown Modern */
.notification-dropdown-modern {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 360px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-dropdown);
    overflow: hidden;
}

[data-theme="dark"] .notification-dropdown-modern {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

.notification-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-header-modern h6 {
    margin: 0;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-primary);
}

/* =====================================================
   ADMIN NAVBAR VARIANT
   ===================================================== */

.navbar-admin {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #334155 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-admin .brand-icon {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-admin .brand-text {
    background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-admin .admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    margin-left: 0.5rem;
}

.navbar-admin .nav-link-modern {
    color: rgba(255, 255, 255, 0.7);
}

.navbar-admin .nav-link-modern:hover,
.navbar-admin .nav-link-modern.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-admin .nav-link-modern.highlight {
    color: var(--accent-color);
}

.navbar-admin .nav-link-modern.highlight:hover,
.navbar-admin .nav-link-modern.highlight.active {
    color: var(--accent-light);
    background: rgba(16, 185, 129, 0.15);
}

.navbar-admin .nav-action-btn {
    color: rgba(255, 255, 255, 0.7);
}

.navbar-admin .nav-action-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-admin .user-menu-trigger {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.navbar-admin .user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.navbar-admin .user-name {
    color: white;
}

.navbar-admin .user-role {
    color: var(--accent-color);
}

.navbar-admin .chevron-icon {
    color: rgba(255, 255, 255, 0.5);
}

.navbar-admin .hamburger-line {
    background: white;
}

.navbar-admin .btn-ghost {
    color: rgba(255, 255, 255, 0.7);
}

.navbar-admin .btn-ghost:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Admin Quick Actions */
.admin-quick-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    margin-right: 0.5rem;
}

.admin-quick-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.admin-quick-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.admin-quick-link.active {
    color: white;
    background: var(--primary-color);
}

.admin-quick-link[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    font-size: var(--fs-xs);
    color: white;
    background: rgba(0, 0, 0, 0.8);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Back to Site Button */
.btn-back-to-site {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-back-to-site:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-back-to-site i {
    font-size: 0.75rem;
}

/* Mobile Admin Nav */
.navbar-admin .mobile-nav-modern {
    background: var(--bg-dark);
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-admin .mobile-nav-link {
    color: rgba(255, 255, 255, 0.7);
}

.navbar-admin .mobile-nav-link:hover,
.navbar-admin .mobile-nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-admin .mobile-nav-divider {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 991px) {
    .admin-quick-nav {
        display: none;
    }
}

/* Sidebar Navigation Dividers */
.sidebar-nav-divider {
    margin: 1rem 0 0.75rem 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-nav-divider-text {
    display: block;
    padding: 0 1rem 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

[data-theme="dark"] .sidebar-nav-divider {
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar-nav-divider-text {
    color: rgba(255, 255, 255, 0.5);
}

/* ── Accordéon statistiques (mobile uniquement) ── */
@media (max-width: 767px) {
    .stats-accordion-header {
        cursor: pointer;
        user-select: none;
    }
    .stats-accordion-chevron {
        transition: transform .3s ease;
        color: var(--text-muted, #6c757d);
        flex-shrink: 0;
    }
    .stats-accordion-header[aria-expanded="true"] .stats-accordion-chevron {
        transform: rotate(180deg);
    }
}

/* ── Accordéon abonnement actuel (toutes tailles d'écran) ── */
.subscription-accordion-header {
    cursor: pointer;
    user-select: none;
}
.subscription-accordion-chevron {
    transition: transform .3s ease;
    color: var(--text-muted, #6c757d);
    flex-shrink: 0;
}
.subscription-accordion-header[aria-expanded="true"] .subscription-accordion-chevron {
    transform: rotate(180deg);
}

/* ── Form error messages (global) ───────────────────────────────────────── */
.form-error-list {
    list-style: none;
    margin: 0.375rem 0 0;
    padding: 0;
}

.form-error-item {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    color: #dc2626;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    margin-top: 0.25rem;
    padding: 0.375rem 0.625rem;
    background-color: rgba(220, 38, 38, 0.07);
    border-left: 3px solid #dc2626;
    border-radius: 0 4px 4px 0;
    animation: slideDown 0.25s ease-out;
}

.form-error-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 0.75rem;
}
