/* ============================================================
   BELVEDIA PILOT — main.css
   Charte graphique globale : teal #11A1B0 | navy #1A3D68 | lime #CBD423
   Mode clair / sombre — Responsive
   ============================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   1. VARIABLES CSS — MODE CLAIR
   ============================================================ */
:root {
    /* Charte Belvedia */
    --teal:              #11A1B0;
    --teal-dark:         #0C7A87;
    --teal-darker:       #085F6A;
    --teal-light:        #D8F3F6;
    --teal-xlight:       #EEF9FB;

    --navy:              #1A3D68;
    --navy-dark:         #102440;
    --navy-darker:       #091729;
    --navy-light:        #D6E4F0;
    --navy-xlight:       #EBF2F9;

    --lime:              #CBD423;
    --lime-dark:         #9EA01B;
    --lime-darker:       #747515;
    --lime-light:        #EDF5B0;
    --lime-xlight:       #F6FAD8;

    /* Surfaces — mode clair */
    --bg:                #F0F4F8;
    --bg-alt:            #E8EDF3;
    --surface:           #FFFFFF;
    --surface-2:         #F8FAFC;
    --surface-3:         #F0F4F8;

    /* Typographie */
    --text:              #111827;
    --text-secondary:    #374151;
    --text-muted:        #6B7280;
    --text-faint:        #9CA3AF;

    /* Bordures & ombres */
    --border:            #E2E8F0;
    --border-strong:     #CBD5E1;
    --shadow-sm:         0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --shadow:            0 4px 16px rgba(26,61,104,.08), 0 1px 4px rgba(0,0,0,.04);
    --shadow-lg:         0 10px 40px rgba(26,61,104,.12), 0 4px 12px rgba(0,0,0,.06);
    --shadow-teal:       0 4px 20px rgba(17,161,176,.25);

    /* UI */
    --radius-sm:         6px;
    --radius:            10px;
    --radius-lg:         16px;
    --radius-xl:         24px;
    --radius-full:       9999px;

    /* Sidebar */
    --sidebar-w:         260px;
    --sidebar-bg:        var(--navy);
    --sidebar-text:      rgba(255,255,255,.75);
    --sidebar-text-active: #FFFFFF;
    --sidebar-accent:    var(--teal);
    --sidebar-hover:     rgba(255,255,255,.07);
    --sidebar-active:    rgba(17,161,176,.20);

    /* Header */
    --header-h:          64px;
    --header-bg:         var(--surface);
    --header-border:     var(--border);

    /* Transitions */
    --transition:        .2s cubic-bezier(.4,0,.2,1);
    --transition-slow:   .35s cubic-bezier(.4,0,.2,1);

    /* Typographie */
    --font:              'Plus Jakarta Sans', system-ui, sans-serif;
    --font-mono:         'JetBrains Mono', 'Courier New', monospace;
}

/* ============================================================
   2. VARIABLES CSS — MODE SOMBRE
   ============================================================ */
[data-theme="dark"] {
    --bg:                #0D1825;
    --bg-alt:            #111E2E;
    --surface:           #162032;
    --surface-2:         #1C2A3F;
    --surface-3:         #213049;

    --text:              #EDF2F7;
    --text-secondary:    #CBD5E0;
    --text-muted:        #8FA5C0;
    --text-faint:        #506480;

    --border:            #243347;
    --border-strong:     #2E4060;
    --shadow-sm:         0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow:            0 4px 16px rgba(0,0,0,.25), 0 1px 4px rgba(0,0,0,.15);
    --shadow-lg:         0 10px 40px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.25);

    --sidebar-hover:     rgba(255,255,255,.05);
    --sidebar-active:    rgba(17,161,176,.25);

    --header-bg:         var(--surface);
    --header-border:     var(--border);

    --teal-light:        rgba(17,161,176,.18);
    --teal-xlight:       rgba(17,161,176,.08);
    --navy-light:        rgba(26,61,104,.35);
    --navy-xlight:       rgba(26,61,104,.15);
    --lime-light:        rgba(203,212,35,.18);
    --lime-xlight:       rgba(203,212,35,.08);
}

/* ============================================================
   3. RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition-slow), color var(--transition-slow);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--teal-dark); }

img { max-width: 100%; height: auto; }

ul, ol { list-style: none; }

/* ============================================================
   4. LAYOUT PRINCIPAL
   ============================================================ */
.bp-layout {
    display: flex;
    min-height: 100vh;
}

.bp-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left var(--transition-slow);
}

.bp-content {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
}

/* ============================================================
   5. SIDEBAR
   ============================================================ */
.bp-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    transition: width var(--transition-slow);
}

/* Bande décorative 3 couleurs en haut */
.bp-sidebar::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--navy-dark) 0%, var(--teal) 50%, var(--lime) 100%);
    flex-shrink: 0;
}

/* ---- Logo dans sidebar ---- */
.sidebar-logo {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

.sidebar-logo img {
    height: 36px;
    width: auto;
    /* Filtre pour forcer le logo en blanc/clair sur fond navy */
    opacity: .92;
}

.sidebar-logo .logo-fallback {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.sidebar-logo .logo-fallback span {
    color: var(--teal);
}

/* ---- Module badge ---- */
.sidebar-module {
    padding: .75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

.sidebar-module-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255,255,255,.35);
    margin-bottom: .4rem;
}

.sidebar-module-name {
    font-size: .85rem;
    font-weight: 600;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.sidebar-module-name .dot {
    width: 6px;
    height: 6px;
    background: var(--lime);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(.7); }
}

/* ---- Navigation ---- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-section-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.28);
    padding: 1rem 1.5rem .4rem;
}

.nav-section-title {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.28);
    padding: 1rem 1.5rem .4rem;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.5rem;
    color: var(--sidebar-text);
    font-size: .875rem;
    font-weight: 500;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    position: relative;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--teal);
    border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .7;
    transition: opacity var(--transition);
}


.nav-badge { margin-left: auto; font-size: .65rem; font-weight: 700; padding: .15rem .45rem; border-radius: var(--radius-full); min-width: 18px; text-align: center; color: #fff; }
.nav-badge-warning { background: #F59E0B; }
.nav-badge-orange  { background: #F97316; }
.nav-badge-danger  { background: #EF4444; }

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--teal);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.nav-item .nav-badge.badge-lime {
    background: var(--lime);
    color: var(--navy-dark);
}

/* ---- Pied de sidebar (user) ---- */
.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border-radius: var(--radius);
    transition: background var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.sidebar-user-card:hover { background: var(--sidebar-hover); }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--navy-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.15);
}

.user-info { min-width: 0; flex: 1; }

.user-name {
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: .7rem;
    color: rgba(255,255,255,.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   6. HEADER
   ============================================================ */
.bp-header {
    height: var(--header-h);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background var(--transition-slow), border-color var(--transition-slow);
}

.header-title {
    flex: 1;
}

.header-page-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.header-breadcrumb {
    font-size: .75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.header-breadcrumb a { color: var(--text-muted); }
.header-breadcrumb a:hover { color: var(--teal); }
.header-breadcrumb .sep { opacity: .5; }

.header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* Toggle thème dans le header */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
    text-decoration: none;
}

.theme-toggle-btn:hover {
    border-color: var(--teal);
    color: var(--teal);
    background: var(--teal-xlight);
}

/* Cloche alertes */
.alerts-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-size: 1rem;
}

.alerts-btn:hover { border-color: var(--teal); color: var(--teal); }

.alerts-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #EF4444;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

/* ============================================================
   7. COMPOSANTS — CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}

.card-subtitle {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .15rem;
}

.card-body { padding: 1.5rem; }
.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

/* ---- KPI cards ---- */
.kpi-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card.kpi-teal::after  { background: var(--teal); }
.kpi-card.kpi-navy::after  { background: var(--navy); }
.kpi-card.kpi-lime::after  { background: var(--lime); }
.kpi-card.kpi-red::after   { background: #EF4444; }

.kpi-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    letter-spacing: -.03em;
}

.kpi-sub {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .4rem;
}

.kpi-icon {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.kpi-card.kpi-teal .kpi-icon { background: var(--teal-xlight); color: var(--teal); }
.kpi-card.kpi-navy .kpi-icon { background: var(--navy-xlight); color: var(--navy); }
.kpi-card.kpi-lime .kpi-icon { background: var(--lime-xlight); color: var(--lime-dark); }
.kpi-card.kpi-red  .kpi-icon { background: #FEF2F2; color: #EF4444; }

/* ============================================================
   8. GRILLES
   ============================================================ */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ============================================================
   9. TABLEAUX
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    background: var(--surface);
}

thead {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

thead th {
    padding: .85rem 1.25rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

tbody td {
    padding: .9rem 1.25rem;
    color: var(--text);
    vertical-align: middle;
}

/* Plaque immatriculation */
.license-plate {
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 600;
    background: var(--navy-xlight);
    color: var(--navy);
    padding: .2rem .5rem;
    border-radius: 4px;
    border: 1px solid var(--navy-light);
    letter-spacing: .05em;
    white-space: nowrap;
}

[data-theme="dark"] .license-plate {
    background: rgba(26,61,104,.35);
    border-color: rgba(26,61,104,.5);
    color: var(--teal-light);
}

/* ============================================================
   10. BADGES & STATUTS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .65rem;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge-success   { background: #DCFCE7; color: #15803D; }
.badge-primary   { background: var(--teal-light); color: var(--teal-dark); }
.badge-secondary { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border); }
.badge-warning   { background: #FEF9C3; color: #A16207; }
.badge-danger    { background: #FEE2E2; color: #DC2626; }
.badge-info      { background: var(--navy-xlight); color: var(--navy); }
.badge-lime      { background: var(--lime-light); color: var(--lime-darker); }

[data-theme="dark"] .badge-success   { background: rgba(21,128,61,.2);  color: #4ADE80; }
[data-theme="dark"] .badge-primary   { background: var(--teal-xlight);  color: #5DD8E6; }
[data-theme="dark"] .badge-secondary { background: var(--surface-3);    color: var(--text-muted); }
[data-theme="dark"] .badge-warning   { background: rgba(161,98,7,.2);   color: #FCD34D; }
[data-theme="dark"] .badge-danger    { background: rgba(220,38,38,.2);  color: #FCA5A5; }
[data-theme="dark"] .badge-info      { background: var(--navy-xlight);  color: #93C5FD; }
[data-theme="dark"] .badge-lime      { background: var(--lime-xlight);  color: var(--lime); }

/* ============================================================
   11. BOUTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem 1.25rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-sm { padding: .45rem .9rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; }
.btn-icon { padding: .6rem; width: 38px; height: 38px; }

.btn-primary {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
    box-shadow: 0 2px 8px rgba(17,161,176,.25);
}
.btn-primary:hover {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
    box-shadow: var(--shadow-teal);
    transform: translateY(-1px);
    color: #fff;
}

.btn-navy {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.btn-navy:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-lime {
    background: var(--lime);
    color: var(--navy-darker);
    border-color: var(--lime);
}
.btn-lime:hover {
    background: var(--lime-dark);
    border-color: var(--lime-dark);
    color: var(--navy-darker);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--teal);
    border-color: var(--teal);
}
.btn-outline:hover {
    background: var(--teal-xlight);
    color: var(--teal-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-danger {
    background: #EF4444;
    color: #fff;
    border-color: #EF4444;
}
.btn-danger:hover { background: #DC2626; border-color: #DC2626; color: #fff; }

/* ============================================================
   12. FORMULAIRES
   ============================================================ */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.form-label .required { color: #EF4444; margin-left: .2rem; }

.form-control {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: .9rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(17,161,176,.15);
}

.form-control::placeholder { color: var(--text-faint); }

.form-control:disabled {
    background: var(--surface-3);
    color: var(--text-muted);
    cursor: not-allowed;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .3rem;
}

.form-error {
    font-size: .75rem;
    color: #DC2626;
    margin-top: .3rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.form-control.is-invalid { border-color: #EF4444; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.15); }

.form-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ============================================================
   13. ALERTES & NOTIFICATIONS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: .875rem;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.4; }

.alert-success { background: #DCFCE7; border-color: #BBF7D0; color: #15803D; }
.alert-error   { background: #FEE2E2; border-color: #FECACA; color: #DC2626; }
.alert-warning { background: #FEF9C3; border-color: #FEF08A; color: #A16207; }
.alert-info    { background: var(--teal-xlight); border-color: var(--teal-light); color: var(--teal-darker); }

[data-theme="dark"] .alert-success { background: rgba(21,128,61,.15);  border-color: rgba(74,222,128,.2);  color: #4ADE80; }
[data-theme="dark"] .alert-error   { background: rgba(220,38,38,.15);  border-color: rgba(252,165,165,.2); color: #FCA5A5; }
[data-theme="dark"] .alert-warning { background: rgba(161,98,7,.15);   border-color: rgba(253,224,71,.2);  color: #FCD34D; }
[data-theme="dark"] .alert-info    { background: var(--teal-xlight);   border-color: rgba(17,161,176,.25); color: #5DD8E6; }

/* ============================================================
   14. PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 .6rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}

.page-link:hover    { border-color: var(--teal); color: var(--teal); background: var(--teal-xlight); }
.page-link.active   { background: var(--teal); border-color: var(--teal); color: #fff; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   15. RECHERCHE GLOBALE
   ============================================================ */
.search-global {
    position: relative;
    width: 280px;
}

.search-global input {
    width: 100%;
    padding: .55rem .9rem .55rem 2.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font);
    font-size: .85rem;
    outline: none;
    transition: all var(--transition);
}

.search-global input:focus {
    border-color: var(--teal);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(17,161,176,.12);
    width: 320px;
}

.search-global .search-icon {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .9rem;
    pointer-events: none;
}

/* ============================================================
   16. FILTRES TEMPORELS (période prédéfinie)
   ============================================================ */
.period-filters {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.period-btn {
    padding: .35rem .75rem;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.period-btn:hover  { border-color: var(--teal); color: var(--teal); }
.period-btn.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

/* ============================================================
   17. UTILITAIRES
   ============================================================ */
.text-teal   { color: var(--teal); }
.text-navy   { color: var(--navy); }
.text-lime   { color: var(--lime-dark); }
.text-muted  { color: var(--text-muted); }
.text-danger { color: #DC2626; }
.text-right  { text-align: right; }
.text-center { text-align: center; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.font-mono { font-family: var(--font-mono); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none; }
.d-block  { display: block; }
.align-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }
.flex-1 { flex: 1; }

.w-100 { width: 100%; }

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* Barre 3 couleurs décorative */
.belvedia-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--navy) 0%, var(--teal) 50%, var(--lime) 100%);
    border-radius: var(--radius-full);
}

/* ============================================================
   18. PAGE VIDE / ÉTAT ZÉRO
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: .4;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .5rem;
}

.empty-state p { font-size: .875rem; }

/* ============================================================
   19. SCROLLBAR GLOBALE
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   20. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    :root { --sidebar-w: 220px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    .bp-sidebar {
        width: 260px;
        transform: translateX(-260px);
        transition: transform var(--transition-slow);
    }

    .bp-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .bp-main { margin-left: 0; }
    .bp-content { padding: 1rem; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .search-global { width: 100%; }
    .search-global input { width: 100%; }
    .search-global input:focus { width: 100%; }

    .bp-header { padding: 0 1rem; }
}

@media (max-width: 480px) {
    .kpi-value { font-size: 1.6rem; }
    .card-body { padding: 1rem; }
    .card-header { padding: 1rem; }
}

/* ============================================================
   21. ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}

.animate-fade    { animation: fadeIn .3s ease both; }
.animate-slide   { animation: slideInLeft .3s ease both; }
.animate-scale   { animation: scaleIn .25s ease both; }

/* Délais en cascade pour les grilles */
.animate-fade:nth-child(1) { animation-delay: .05s; }
.animate-fade:nth-child(2) { animation-delay: .10s; }
.animate-fade:nth-child(3) { animation-delay: .15s; }
.animate-fade:nth-child(4) { animation-delay: .20s; }

/* ════════════════════════════════════════════════
   ENVIRONNEMENT DE TEST — Surchage visuelle rouge
   ════════════════════════════════════════════════ */
body.env-test {
    --teal: #DC2626;
    --navy: #991B1B;
}
 
body.env-test .main-header {
    background: linear-gradient(90deg, #FEF2F2 0%, #FEE2E2 100%);
    border-bottom-color: #FCA5A5;
}
 
body.env-test .main-header::after {
    content: "🧪 ENVIRONNEMENT DE TEST";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #DC2626;
    color: #fff;
    padding: .3rem 1rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    box-shadow: 0 2px 8px rgba(220, 38, 38, .3);
    pointer-events: none;
    z-index: 1000;
}
 
body.env-test .sidebar,
body.env-test aside.sidebar {
    background: linear-gradient(180deg, #7F1D1D 0%, #991B1B 100%) !important;
}
 
body.env-test .sidebar-link.active,
body.env-test .nav-item.active {
    background: rgba(255, 255, 255, .15) !important;
    border-left-color: #FCA5A5 !important;
}