/* ===================================================================
   BaobabProcure — "Clarity" Design System v3
   Scandinavian-functionalist. Quiet surfaces, strong typography,
   layered depth via subtle shadows, refined dark mode.
   Typography: Outfit (UI) × JetBrains Mono (data)
   =================================================================== */

/* Polices auto-hébergées : voir css/fonts.css (l'@import Google Fonts a été retiré — aucun CDN). */

/* ===== DESIGN TOKENS (Light) ===== */
:root {
    /* ── Typography ── */
    --font-body:    'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'Fira Code', monospace;

    /* ── Type scale (fluid) ── */
    --text-xs:   0.75rem;     /* 12 */
    --text-sm:   0.8125rem;   /* 13 */
    --text-base: 0.9375rem;   /* 15 — body */
    --text-md:   1rem;        /* 16 */
    --text-lg:   1.125rem;    /* 18 */
    --text-xl:   1.375rem;    /* 22 */
    --text-2xl:  1.625rem;    /* 26 */
    --text-3xl:  2rem;        /* 32 */
    --text-4xl:  2.5rem;      /* 40 */

    /* ── Surfaces (warmer neutrals) ── */
    --bg-page:        #f5f6f9;
    --bg-surface:     #ffffff;
    --bg-elevated:    #fafbfd;
    --bg-hover:       #f0f2f6;
    --bg-active:      #e6e9ef;
    --bg-input:       #ffffff;
    --bg-overlay:     rgba(13, 17, 28, 0.50);
    --bg-glass:       rgba(255, 255, 255, 0.78);

    /* ── Sidebar — deep cool with subtle gradient ── */
    --sidebar-bg:        #0d1018;
    --sidebar-bg-2:      #11151f;
    --sidebar-text:      #a4a9bd;
    --sidebar-text-dim:  #5d6178;
    --sidebar-hover:     rgba(255, 255, 255, 0.04);
    --sidebar-active:    rgba(96, 165, 250, 0.12);
    --sidebar-active-2:  rgba(37, 99, 235, 0.18);
    --sidebar-border:    rgba(255, 255, 255, 0.06);

    /* ── Primary — refined royal blue ── */
    --primary:           #2563eb;
    --primary-hover:     #1d4ed8;
    --primary-active:    #1e40af;
    --primary-light:     #60a5fa;
    --primary-soft:      #dbeafe;
    --primary-muted:     rgba(37, 99, 235, 0.08);
    --primary-gradient:  linear-gradient(135deg, #2563eb 0%, #3b82f6 60%, #60a5fa 100%);
    --primary-glow:      0 6px 20px -4px rgba(37, 99, 235, 0.35);

    /* ── Semantic ── */
    --success:        #059669;
    --success-light:  #10b981;
    --success-soft:   #d1fae5;
    --success-muted:  rgba(5, 150, 105, 0.09);
    --danger:         #dc2626;
    --danger-light:   #f87171;
    --danger-soft:    #fee2e2;
    --danger-muted:   rgba(220, 38, 38, 0.08);
    --warning:        #d97706;
    --warning-light:  #f59e0b;
    --warning-soft:   #fef3c7;
    --warning-muted:  rgba(217, 119, 6, 0.09);
    --info:           #0284c7;
    --info-light:     #38bdf8;
    --info-soft:      #e0f2fe;
    --info-muted:     rgba(2, 132, 199, 0.09);
    --purple:         #7c3aed;
    --purple-muted:   rgba(124, 58, 237, 0.09);

    /* ── Text ── */
    --text-primary:   #0f1320;
    --text-secondary: #454a5c;
    --text-muted:     #6b7080;
    --text-faint:     #9398a8;
    --text-inverse:   #ffffff;

    /* ── Borders ── */
    --border:         rgba(15, 19, 32, 0.07);
    --border-strong:  rgba(15, 19, 32, 0.12);
    --border-light:   rgba(15, 19, 32, 0.04);
    --border-focus:   rgba(37, 99, 235, 0.30);

    /* ── Shadows — layered, refined ── */
    --shadow-xs:  0 1px 2px rgba(15, 19, 32, 0.04);
    --shadow-sm:  0 1px 2px rgba(15, 19, 32, 0.04), 0 1px 3px rgba(15, 19, 32, 0.03);
    --shadow-md:  0 2px 4px rgba(15, 19, 32, 0.04), 0 6px 16px rgba(15, 19, 32, 0.06);
    --shadow-lg:  0 4px 12px rgba(15, 19, 32, 0.06), 0 16px 48px rgba(15, 19, 32, 0.10);
    --shadow-xl:  0 8px 24px rgba(15, 19, 32, 0.10), 0 24px 64px rgba(15, 19, 32, 0.14);
    --shadow-focus: 0 0 0 3px var(--primary-muted), 0 0 0 1px var(--primary);

    /* ── Spacing (4pt base) ── */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-7:  1.75rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* ── Radii ── */
    --radius-xs:   4px;
    --radius-sm:   6px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   16px;
    --radius-2xl:  20px;
    --radius-full: 9999px;

    /* ── Layout ── */
    --sidebar-width: 256px;
    --topbar-height: 64px;
    --container-max: 1440px;

    /* ── Motion ── */
    --ease:        cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out:    cubic-bezier(0.33, 1, 0.68, 1);
    --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
    --duration:    180ms;
    --duration-slow: 280ms;

    /* ── Legacy aliases (preserved for back-compat) ── */
    --surface:                   var(--bg-page);
    --surface-dim:               var(--bg-active);
    --surface-bright:            var(--bg-surface);
    --surface-container-lowest:  var(--bg-surface);
    --surface-container-low:     var(--bg-elevated);
    --surface-container:         var(--bg-hover);
    --surface-container-high:    var(--bg-active);
    --surface-container-highest: #d9dce3;
    --surface-variant:           var(--bg-elevated);
    --surface-tint:              var(--primary);
    --on-surface:                var(--text-primary);
    --on-surface-variant:        var(--text-secondary);
    --on-background:             var(--text-primary);
    --background:                var(--bg-page);
    --outline:                   var(--text-muted);
    --outline-variant:           var(--border);
    --ghost-border:              var(--border);
    --input-border:              var(--border);
    --inverse-surface:           var(--sidebar-bg);
    --inverse-on-surface:        #ffffff;
    --brand-primary:             var(--primary);
    --primary-container:         var(--primary-hover);
    --primary-fixed:             var(--primary-muted);
    --primary-fixed-dim:         var(--primary-light);
    --on-primary:                var(--text-inverse);
    --on-primary-container:      var(--text-inverse);
    --secondary:                 #4b5563;
    --secondary-container:       var(--bg-hover);
    --on-secondary:              #ffffff;
    --on-secondary-container:    #374151;
    --tertiary:                  var(--success);
    --tertiary-container:        var(--success);
    --tertiary-fixed:            var(--success-muted);
    --tertiary-fixed-dim:        var(--success-light);
    --on-tertiary:               #ffffff;
    --on-tertiary-container:     #ffffff;
    --error:                     var(--danger);
    --error-container:           var(--danger-muted);
    --on-error:                  #ffffff;
    --on-error-container:        var(--danger);
    --bg-card:                   var(--bg-surface);
    --bg-elevated-var:           var(--bg-active);
    --border-color:              var(--border);
    --success-var:               var(--success);
    --danger-var:                var(--danger);
    --warning-var:               var(--warning);
    --border-subtle:             var(--border);
    --card-bg:                   var(--bg-card);
}

/* ===== DARK ===== */
[data-theme="dark"] {
    --bg-page:        #0a0d14;
    --bg-surface:     #131722;
    --bg-elevated:    #171b27;
    --bg-hover:       #1d2230;
    --bg-active:      #242938;
    --bg-input:       #171b27;
    --bg-overlay:     rgba(0, 0, 0, 0.65);
    --bg-glass:       rgba(19, 23, 34, 0.78);

    --sidebar-bg:        #07090f;
    --sidebar-bg-2:      #0c0f17;
    --sidebar-text:      #a4a9bd;
    --sidebar-text-dim:  #5d6178;
    --sidebar-hover:     rgba(255, 255, 255, 0.05);
    --sidebar-active:    rgba(96, 165, 250, 0.16);
    --sidebar-active-2:  rgba(96, 165, 250, 0.22);
    --sidebar-border:    rgba(255, 255, 255, 0.05);

    --text-primary:   #e7e9f1;
    --text-secondary: #a3a8bd;
    --text-muted:     #6b7088;
    --text-faint:     #494e63;
    --text-inverse:   #0a0d14;

    --border:         rgba(255, 255, 255, 0.07);
    --border-strong:  rgba(255, 255, 255, 0.14);
    --border-light:   rgba(255, 255, 255, 0.04);
    --border-focus:   rgba(96, 165, 250, 0.35);

    --primary:           #60a5fa;
    --primary-hover:     #3b82f6;
    --primary-active:    #2563eb;
    --primary-light:     #93c5fd;
    --primary-soft:      rgba(96, 165, 250, 0.12);
    --primary-muted:     rgba(96, 165, 250, 0.12);
    --primary-gradient:  linear-gradient(135deg, #3b82f6 0%, #60a5fa 60%, #93c5fd 100%);
    --primary-glow:      0 6px 20px -4px rgba(96, 165, 250, 0.40);

    --success:        #34d399;
    --success-light:  #6ee7b7;
    --success-soft:   rgba(52, 211, 153, 0.14);
    --success-muted:  rgba(52, 211, 153, 0.10);
    --danger:         #f87171;
    --danger-light:   #fca5a5;
    --danger-soft:    rgba(248, 113, 113, 0.14);
    --danger-muted:   rgba(248, 113, 113, 0.10);
    --warning:        #fbbf24;
    --warning-light:  #fcd34d;
    --warning-soft:   rgba(251, 191, 36, 0.14);
    --warning-muted:  rgba(251, 191, 36, 0.10);
    --info:           #38bdf8;
    --info-light:     #7dd3fc;
    --info-soft:      rgba(56, 189, 248, 0.14);
    --info-muted:     rgba(56, 189, 248, 0.10);
    --purple:         #a78bfa;
    --purple-muted:   rgba(167, 139, 250, 0.12);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.30), 0 6px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.40), 0 24px 64px rgba(0, 0, 0, 0.55);
    --shadow-focus: 0 0 0 3px rgba(96, 165, 250, 0.18), 0 0 0 1px var(--primary);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv11', 'ss01', 'ss03';
}

body, #app {
    height: 100%;
    font-family: var(--font-body);
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: var(--text-base);
    line-height: 1.65;
    font-weight: 400;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(15, 19, 32, 0.12);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(15, 19, 32, 0.22); background-clip: content-box; border: 2px solid transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.10); background-clip: content-box; border: 2px solid transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); background-clip: content-box; border: 2px solid transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(15, 19, 32, 0.12) transparent; }
[data-theme="dark"] * { scrollbar-color: rgba(255, 255, 255, 0.10) transparent; }

::selection { background: var(--primary-muted); color: var(--primary); }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; color: var(--text-primary); }
h2 { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.022em; line-height: 1.2;  color: var(--text-primary); }
h3 { font-size: var(--text-xl);  font-weight: 650; letter-spacing: -0.015em; line-height: 1.3;  color: var(--text-primary); }
h4 { font-size: var(--text-lg);  font-weight: 600; letter-spacing: -0.01em;  line-height: 1.35; color: var(--text-primary); }
h5 { font-size: var(--text-md);  font-weight: 600; line-height: 1.4; color: var(--text-primary); }
h6 { font-size: var(--text-sm);  font-weight: 600; line-height: 1.4; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

p, .subtitle, .text-body { color: var(--text-secondary); line-height: 1.7; font-size: var(--text-base); }

a { color: var(--primary); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--primary-hover); }

strong, b { font-weight: 600; color: var(--text-primary); }

.amount, .reference, .ref, .mono, code, pre, kbd {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

code, kbd {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    font-size: 0.875em;
    color: var(--text-secondary);
}

hr { border: none; height: 1px; background: var(--border); margin: var(--space-6) 0; }

/* Focus visibility for keyboard users */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* ===== LAYOUT ===== */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 50;
    border-right: 1px solid var(--sidebar-border);
    overflow: hidden;
}

.sidebar-logo {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
    transition: background var(--duration) var(--ease);
}
.sidebar-logo:hover { background: var(--sidebar-hover); }
.sidebar-logo .logo-icon {
    width: 38px; height: 38px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 19px; font-weight: 700;
    color: white; flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    letter-spacing: -0.02em;
}
.sidebar-logo .logo-text {
    font-family: var(--font-body);
    font-size: 19px; font-weight: 700;
    color: white;
    letter-spacing: -0.015em;
    line-height: 1.1;
}
.sidebar-logo .logo-sub {
    font-family: var(--font-body);
    font-size: 10px; font-weight: 700;
    color: var(--sidebar-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 3px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }

.nav-section { margin-bottom: 14px; }
.nav-section-title {
    font-size: 10px; font-weight: 700;
    color: var(--sidebar-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    padding: 14px 14px 8px;
}

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 13px;
    margin: 1px 0;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500; font-size: 14px;
    letter-spacing: 0;
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
    cursor: pointer;
    position: relative;
}
.nav-link:hover { color: #ffffff; background: var(--sidebar-hover); }
.nav-link.active {
    color: #ffffff;
    background: var(--sidebar-active);
    font-weight: 600;
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 8px; bottom: 8px;
    width: 3px;
    background: var(--primary-light);
    border-radius: 0 3px 3px 0;
}
.nav-link i, .nav-link .nav-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.75;
}
.nav-link.active i, .nav-link.active .nav-icon { opacity: 1; color: var(--primary-light); }

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 10px; font-weight: 700;
    line-height: 1.6;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}
.nav-badge.danger  { background: var(--danger);  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35); }
.nav-badge.warning { background: var(--warning); box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35); }
.nav-badge.info    { background: var(--info);    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35); }

/* ── Main Area ── */
.main-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Top Bar ── */
.top-bar {
    height: var(--topbar-height);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky; top: 0; z-index: 40;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.top-bar-left { display: flex; align-items: center; min-width: 0; }
.top-bar-left .breadcrumb {
    display: flex; align-items: center;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.3;
}
.top-bar-left .breadcrumb span {
    color: var(--text-faint);
    margin: 0 8px;
    font-weight: 400;
}
.top-bar-left .breadcrumb strong {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.012em;
}
.top-bar-right { display: flex; align-items: center; gap: 10px; }

.top-bar-search {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 14px;
    display: flex; align-items: center; gap: 10px;
    min-width: 260px;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.top-bar-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-muted);
}
.top-bar-search input {
    background: transparent; border: none; outline: none;
    color: var(--text-primary); font-family: var(--font-body);
    font-weight: 500; font-size: 14px; width: 100%;
}
.top-bar-search input::placeholder { color: var(--text-faint); font-weight: 400; }

.icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-size: 16px;
}
.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* ── User Menu ── */
.user-menu {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer;
    padding: 4px 6px 4px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all var(--duration) var(--ease);
}
.user-menu:hover { background: var(--bg-hover); border-color: var(--border); }
.user-info-block .user-name {
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.user-info-block .user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
    line-height: 1.3;
    margin-top: 1px;
}
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 13px; font-weight: 700; color: white;
    flex-shrink: 0;
    letter-spacing: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.user-dropdown {
    position: absolute; right: 20px; top: 70px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    backdrop-filter: blur(20px);
    animation: dropdownIn 180ms var(--ease-spring);
}
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.user-dropdown-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px; font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.user-dropdown-item i { width: 16px; font-size: 14px; opacity: 0.7; }
.user-dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-dropdown-item:hover i { opacity: 1; }
.user-dropdown-item.danger:hover { background: var(--danger-muted); color: var(--danger); }

/* ── Tenant switcher (entite active) ── */
.tenant-switcher { position: relative; }
.tenant-switcher-btn {
    height: 38px;
    max-width: 240px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 9px;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-sm); font-weight: 600;
    transition: all var(--duration) var(--ease);
}
.tenant-switcher-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.tenant-switcher-btn:disabled { opacity: 0.6; cursor: progress; }
/* Rappel visuel : on agit sur une entite autre que son rattachement. */
.tenant-switcher-btn.switched {
    background: var(--warning-muted);
    border-color: var(--warning);
    color: var(--warning);
}
.tenant-switcher-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-switcher-caret { font-size: 10px; opacity: 0.55; }

.tenant-dropdown {
    right: 0; left: auto; top: calc(100% + 8px);
    min-width: 260px;
    max-height: min(60vh, 420px);
    overflow-y: auto;
}
.tenant-dropdown-title {
    padding: 6px 14px 8px;
    font-size: var(--text-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted);
}
.tenant-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Indentation hierarchique. !important necessaire : theme-hive.css impose
   `padding: 8px 11px !important` a tout .user-dropdown-item, ce qui bat meme un style inline.
   La hierarchie Holding > Filiale > Agence > Site plafonne a 4 niveaux. */
.tenant-dropdown .user-dropdown-item.tenant-lvl-1 { padding-left: 27px !important; }
.tenant-dropdown .user-dropdown-item.tenant-lvl-2 { padding-left: 43px !important; }
.tenant-dropdown .user-dropdown-item.tenant-lvl-3 { padding-left: 59px !important; }
.tenant-item-check { margin-left: auto; color: var(--primary); }
.user-dropdown-item.selected { background: var(--primary-muted); color: var(--primary); }
.user-dropdown-item.selected i { opacity: 1; }

/* ── Content ── */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
}

/* ===== CARDS ===== */
.card, .glass-panel {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card.interactive { cursor: pointer; }
.card.interactive:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: 18px;
}
.card-title {
    font-size: 17px;
    font-weight: 650;
    color: var(--text-primary);
    letter-spacing: -0.012em;
    line-height: 1.3;
}
.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 400;
    line-height: 1.4;
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-strong);
}
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stat-icon.primary  { background: var(--primary-muted);  color: var(--primary); }
.stat-icon.success  { background: var(--success-muted);  color: var(--success); }
.stat-icon.warning  { background: var(--warning-muted);  color: var(--warning); }
.stat-icon.danger   { background: var(--danger-muted);   color: var(--danger); }
.stat-icon.info     { background: var(--info-muted);     color: var(--info); }

.stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}
.stat-trend {
    font-size: 11px; font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    line-height: 1.4;
    display: inline-flex; align-items: center; gap: 4px;
}
.stat-trend.up      { background: var(--success-muted); color: var(--success); }
.stat-trend.down    { background: var(--danger-muted);  color: var(--danger); }
.stat-trend.neutral { background: var(--bg-hover);      color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: 600; font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: -0.005em;
    user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.10), 0 2px 8px rgba(37, 99, 235, 0.22);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15), 0 6px 16px rgba(37, 99, 235, 0.32);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

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

.btn-success {
    background: var(--success); color: white;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.10), 0 2px 8px rgba(5, 150, 105, 0.22);
}
.btn-success:hover { background: #047857; transform: translateY(-1px); }

.btn-danger {
    background: var(--danger); color: white;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.10), 0 2px 8px rgba(220, 38, 38, 0.22);
}
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; gap: 10px; }
.btn-xl { padding: 16px 32px; font-size: 16px; border-radius: 14px; gap: 12px; }

.btn-outline-primary {
    background: transparent;
    border-color: var(--border-focus);
    color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary-muted); border-color: var(--primary); }

.btn-outline-danger { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-muted); border-color: var(--danger); }

.btn-group { display: inline-flex; gap: 6px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 7px;
    letter-spacing: -0.005em;
}
.form-label .required, .required { color: var(--danger); margin-left: 2px; font-weight: 700; }
.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}
.form-error {
    display: block;
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
    font-weight: 500;
    line-height: 1.5;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    padding: 10px 14px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 14px; font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
    line-height: 1.5;
}
.form-control::placeholder { color: var(--text-faint); font-weight: 400; }
.form-control:hover { border-color: var(--text-muted); }
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-muted);
    background: var(--bg-surface);
}
.form-control:disabled, .form-control[readonly] {
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
}
.form-control--compact { padding: 7px 10px; font-size: 13px; border-radius: 8px; }

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7080' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
textarea.form-control { resize: vertical; min-height: 88px; line-height: 1.6; }
[data-theme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a3a8bd' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
[data-theme="dark"] select.form-control option { background: var(--bg-elevated); color: var(--text-primary); }

/* ===== TABLES ===== */
.table-responsive { overflow-x: auto; border-radius: var(--radius-lg); }
.table, .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.table th, .data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--bg-elevated);
}
.table th:first-child, .data-table th:first-child { border-top-left-radius: var(--radius-lg); }
.table th:last-child,  .data-table th:last-child  { border-top-right-radius: var(--radius-lg); }
.table td, .data-table td {
    padding: 14px 16px;
    font-size: 14px; font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td, .data-table tr:last-child td { border-bottom: none; }
.table tbody tr, .data-table tbody tr { transition: background var(--duration) var(--ease); }
.table tbody tr:hover td, .data-table tbody tr:hover td { background: var(--bg-hover); }
.table th:last-child, .table td:last-child,
.data-table th:last-child, .data-table td:last-child { text-align: right; }
.data-table td:last-child .btn-group { justify-content: flex-end; }

.table th.sortable, .data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.table th.sortable:hover, .data-table th.sortable:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
    letter-spacing: 0.005em;
    border: 1px solid transparent;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge.no-dot::before { display: none; }

.badge-success, .badge-approved, .badge-matched, .badge-complete, .badge-paid
    { background: var(--success-muted); color: var(--success); border-color: rgba(5, 150, 105, 0.15); }
.badge-danger, .badge-rejected, .badge-blacklisted, .badge-cancelled, .badge-disputed
    { background: var(--danger-muted); color: var(--danger); border-color: rgba(220, 38, 38, 0.15); }
.badge-warning, .badge-pendingapproval, .badge-pending
    { background: var(--warning-muted); color: var(--warning); border-color: rgba(217, 119, 6, 0.15); }
.badge-info, .badge-sent, .badge-acknowledged, .badge-received
    { background: var(--info-muted); color: var(--info); border-color: rgba(2, 132, 199, 0.15); }
.badge-draft { background: var(--bg-hover); color: var(--text-muted); border-color: var(--border); }
.badge-priority-low    { background: var(--bg-hover);      color: var(--text-muted); }
.badge-priority-normal { background: var(--info-muted);    color: var(--info); }
.badge-priority-high   { background: var(--warning-muted); color: var(--warning); }
.badge-priority-urgent { background: var(--danger-muted);  color: var(--danger); }
.badge-neutral { background: var(--bg-hover); color: var(--text-muted); border-color: var(--border); }
.badge-primary { background: var(--primary-muted); color: var(--primary); border-color: rgba(37, 99, 235, 0.18); }
.badge.bg-warning { color: #212529 !important; }
.badge.bg-warning::before { display: none; }

/* ===== PROGRESS BARS ===== */
.progress-bar {
    height: 6px;
    background: var(--bg-active);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s var(--ease);
    background: var(--primary);
}
.progress-fill.blue   { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.progress-fill.green  { background: linear-gradient(90deg, var(--success), var(--success-light)); }
.progress-fill.yellow { background: linear-gradient(90deg, var(--warning), var(--warning-light)); }
.progress-fill.red    { background: linear-gradient(90deg, var(--danger), var(--danger-light)); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: overlayIn 200ms var(--ease);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-container {
    background: var(--bg-surface);
    border-radius: var(--radius-2xl);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    width: 560px;
    animation: modalIn 240ms var(--ease-spring);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-sm { width: 420px; }
.modal-lg { width: 760px; }
.modal-xl { width: 960px; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 22px;
    gap: var(--space-4);
}
.modal-header h3 {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 700;
    letter-spacing: -0.018em;
}
.modal-close {
    width: 34px; height: 34px; border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; flex-shrink: 0;
    transition: all var(--duration) var(--ease);
}
.modal-close:hover { background: var(--danger-muted); color: var(--danger); border-color: rgba(220, 38, 38, 0.20); }
.modal-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px; justify-content: flex-end;
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon {
    font-size: 44px;
    margin-bottom: 14px;
    opacity: 0.30;
    color: var(--text-secondary);
}
.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.empty-state p { font-size: 14px; margin-top: 4px; max-width: 380px; margin-left: auto; margin-right: auto; }

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    display: flex; gap: 12px; align-items: flex-start;
    line-height: 1.5;
}
.alert i { font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.alert-info {
    background: var(--primary-muted);
    border-color: rgba(37, 99, 235, 0.18);
    color: var(--primary);
}
.alert-success { background: var(--success-muted); border-color: rgba(5, 150, 105, 0.18); color: var(--success); }
.alert-warning { background: var(--warning-muted); border-color: rgba(217, 119, 6, 0.18); color: var(--warning); }
.alert-danger  { background: var(--danger-muted);  border-color: rgba(220, 38, 38, 0.18); color: var(--danger); }

/* ===== FILTER CHIPS ===== */
.page-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.toolbar-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 13px; font-weight: 600;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    line-height: 1.4;
}
.filter-chip:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 28px;
    gap: var(--space-4);
}
.page-header h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--text-primary);
}
.page-header .subtitle {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 680px;
}
.header-content { flex: 1; min-width: 0; }
.header-actions {
    display: flex; gap: 10px; align-items: center;
    flex-shrink: 0;
}

/* ===== GRIDS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* ===== PAGINATION ===== */
.pagination {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 0 4px;
    margin-top: 18px;
    border-top: 1px solid var(--border);
    gap: var(--space-4);
    flex-wrap: wrap;
}
.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btns button {
    min-width: 36px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.pagination-btns button:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.pagination-btns button:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination-btns button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== FOOTER ===== */
.app-footer {
    text-align: center;
    padding: 14px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
    letter-spacing: 0.01em;
}
.app-footer strong { color: var(--primary); font-weight: 700; }

/* ===== LOADING ===== */
.loading, .loading-state { display: flex; justify-content: center; align-items: center; padding: 48px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 32px; height: 32px;
    border: 2.5px solid var(--bg-active);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ===== NOTIFICATION BELL ===== */
.notif-bell {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
    position: relative;
    transition: all var(--duration) var(--ease);
}
.notif-bell:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.notif-bell .badge {
    position: absolute; top: 3px; right: 3px;
    background: var(--danger); color: white;
    font-size: 9px; font-weight: 800;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg-elevated);
    line-height: 1;
}
.notif-bell .badge::before { display: none; }

.notif-panel {
    position: absolute; top: 60px; right: 18px;
    width: 400px; max-height: 480px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 18px;
    z-index: 200;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    animation: dropdownIn 200ms var(--ease-spring);
}
.notif-panel .panel-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.notif-panel .panel-header h4 {
    font-size: 16px;
    font-weight: 650;
    color: var(--text-primary);
}
.notif-panel .btn-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 12px;
    transition: all var(--duration) var(--ease);
}
.notif-panel .btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-item {
    display: flex; gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background var(--duration) var(--ease);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread {
    background: var(--primary-muted);
    border: 1px solid rgba(37, 99, 235, 0.12);
}
.notif-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    background: var(--bg-hover);
    color: var(--text-muted);
}
.notif-icon.success         { background: var(--success-muted); color: var(--success); }
.notif-icon.warning         { background: var(--warning-muted); color: var(--warning); }
.notif-icon.info            { background: var(--info-muted);    color: var(--info); }
.notif-icon.approvalneeded  { background: var(--primary-muted); color: var(--primary); }
.notif-icon.system          { background: var(--danger-muted);  color: var(--danger); }
.notif-content { flex: 1; min-width: 0; }
.notif-content strong {
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    display: block;
    line-height: 1.3;
}
.notif-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.45;
}
.notif-content small {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: var(--bg-page);
    padding: var(--space-4);
}
.login-card {
    background: var(--bg-surface);
    border-radius: var(--radius-2xl);
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 440px;
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-big {
    width: 56px; height: 56px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 26px; font-weight: 700;
    color: white;
    margin-bottom: 18px;
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    letter-spacing: -0.02em;
}
.login-logo h2 {
    font-size: 26px; font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.022em;
}
.login-logo p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}
.login-error {
    background: var(--danger-muted);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 18px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    display: flex; align-items: center; gap: 10px;
}
.login-btn {
    width: 100%;
    justify-content: center;
    margin-top: 18px;
    padding: 12px 20px;
    font-size: 15px;
}
.login-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color var(--duration) var(--ease);
}
.login-card a:hover { color: var(--primary-hover); }
.login-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0;
    color: var(--text-faint);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 14px 18px;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 12px;
    min-width: 320px;
    backdrop-filter: blur(20px);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }

/* ===== UTILITIES ===== */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-info      { color: var(--info) !important; }
.text-mono      { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-4) 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); width: 0; }
    .sidebar.open { transform: translateX(0); width: var(--sidebar-width); }
    .main-area { margin-left: 0; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .content-area { padding: 20px; }
}
@media (max-width: 768px) {
    :root { --topbar-height: 56px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .top-bar { padding: 0 16px; }
    .content-area { padding: 16px; }
    .top-bar-search { display: none; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 14px; }
    .page-header h2 { font-size: 22px; }
    h1 { font-size: 1.625rem; }
    h2 { font-size: 1.375rem; }
    .modal-container { padding: 22px; }
    .user-info-block { display: none; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
