/*
 * ═══════════ ELYSIUM — THÈME « SITE » DU PANEL ADMIN (Astro 2026-10-28) ═══════════
 * Même habillage que les pages membres refaites : orange Elysium, verre fumé, Inter, arrondis, pilules.
 * Dérivé du thème HUD (public/css/elys-hud-admin.css, conservé) : mêmes sélecteurs (pages maison incluses).
 * Chargé par AdminPanelProvider (HEAD_END) : Setting admin.theme = site (défaut) | hud ; admin.hud_theme = 0 → aucun.
 */
html.dark {
    --hud-cy: #f97316;
    --hud-cy2: #fb923c;
    --hud-line: rgba(148, 163, 184, .13);
    --hud-glass: linear-gradient(180deg, rgba(20, 30, 52, .62), rgba(10, 16, 30, .66));
    --hud-glass-solid: linear-gradient(180deg, rgb(17, 26, 46), rgb(10, 16, 30));
    --hud-mono: Inter, system-ui, sans-serif;
}

/* ── Fond : halo cyan + quadrillage discret ── */
html.dark .fi-body {
    background:
        radial-gradient(1100px 420px at 8% -10%, rgba(249, 115, 22, .10), transparent 60%),
        radial-gradient(900px 360px at 100% -5%, rgba(99, 102, 241, .08), transparent 60%),
        #020617;
}

/* ── Barre du haut ── */
html.dark .fi-topbar {
    background: rgba(5, 10, 22, .72);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(251, 146, 60, .16);
    box-shadow: 0 10px 30px -22px rgba(249, 115, 22, .55);
}

/* ── Menu latéral ── */
html.dark .fi-sidebar {
    background: linear-gradient(180deg, rgba(9, 15, 29, .92), rgba(5, 10, 22, .95));
    border-inline-end: 1px solid rgba(251, 146, 60, .12);
}
html.dark .fi-sidebar-group-label {
    text-transform: uppercase; letter-spacing: .09em; font-size: 10.5px; font-weight: 700;
    color: #94a3b8;
}
html.dark .fi-sidebar-item-btn { border-radius: 10px; transition: background-color .15s, box-shadow .2s; }
html.dark .fi-sidebar-item-btn:hover { background-color: rgba(249, 115, 22, .07); }
html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: linear-gradient(90deg, rgba(249, 115, 22, .16), rgba(249, 115, 22, .03));
    box-shadow: inset 2px 0 0 var(--hud-cy), 0 0 22px -10px rgba(249, 115, 22, .8);
}
html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label { color: #fff7ed; }
html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn svg { color: var(--hud-cy); filter: drop-shadow(0 0 6px rgba(249, 115, 22, .6)); }

/* ── Titres de page ── */
html.dark .fi-header-heading {
    letter-spacing: .01em; color: #ffffff;
    letter-spacing: -.02em;
}

/* ── Cadres « verre » : sections, tableaux, widgets, stats ── */
html.dark .fi-section:not(.fi-section-not-contained),
html.dark .fi-ta-ctn,
html.dark .fi-wi-stats-overview-stat {
    background: var(--hud-glass);
    border-radius: 20px;
    --tw-ring-color: var(--hud-line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 16px 40px -30px rgba(249, 115, 22, .45), 0 0 0 1px var(--hud-line);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
html.dark .fi-section-header-heading { letter-spacing: .02em; color: #fff7ed; }
html.dark .fi-wi-stats-overview-stat { transition: transform .15s, box-shadow .2s; }
html.dark .fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 18px 44px -26px rgba(249, 115, 22, .6), 0 0 0 1px rgba(249, 115, 22, .3);
}
html.dark .fi-wi-stats-overview-stat-value {
    font-family: var(--hud-mono); letter-spacing: -.01em; color: #fff7ed;
    
}

/* ── Tableaux ── */
html.dark .fi-ta-header-cell {
    font-family: var(--hud-mono); text-transform: uppercase; letter-spacing: .06em; font-size: 11px;
    color: #94a3b8;
}
html.dark .fi-ta-row { transition: background-color .12s; }
html.dark .fi-ta-row:hover { background-color: rgba(249, 115, 22, .045); }

/* ── Onglets : pastille cyan comme DDL Morts ── */
html.dark .fi-tabs {
    background: rgba(2, 6, 23, .55); border-radius: 999px; padding: 4px;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, .16);
}
html.dark .fi-tabs-item { border-radius: 999px; font-family: var(--hud-mono); letter-spacing: .03em; }
html.dark .fi-tabs-item.fi-active {
    background: linear-gradient(180deg, var(--hud-cy), var(--hud-cy2));
    box-shadow: 0 0 20px -6px rgba(249, 115, 22, .8);
}
html.dark .fi-tabs-item.fi-active, html.dark .fi-tabs-item.fi-active * { color: #ffffff !important; }

/* ── Boutons : orange Elysium conservé, avec halo ── */
html.dark .fi-btn { border-radius: 999px; transition: transform .12s, box-shadow .2s, background-color .15s; }
html.dark .fi-btn.fi-color-primary:not(.fi-outlined) { box-shadow: 0 0 22px -8px rgba(249, 115, 22, .75); }
html.dark .fi-btn:hover { transform: translateY(-1px); }

/* ── Champs de formulaire ── */
html.dark .fi-input-wrp {
    background-color: rgba(2, 6, 23, .55);
    border-radius: 12px;
    transition: box-shadow .15s;
}
html.dark .fi-input-wrp:focus-within { box-shadow: 0 0 0 1px rgba(249, 115, 22, .55), 0 0 18px -6px rgba(249, 115, 22, .6) !important; }

/* ── Fenêtres, menus déroulants ── */
html.dark .fi-modal-window,
html.dark .fi-dropdown-panel {
    background: var(--hud-glass-solid);
    box-shadow: 0 0 0 1px rgba(251, 146, 60, .18), 0 24px 60px -24px rgba(0, 0, 0, .8), 0 0 40px -24px rgba(249, 115, 22, .5);
}

/* ── Pagination ── */
html.dark .fi-pagination { font-family: var(--hud-mono); }

/* Le contenu passe au-dessus du quadrillage */
html.dark .fi-layout, html.dark .fi-main-ctn, html.dark .fi-simple-layout { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
    html.dark .fi-wi-stats-overview-stat, html.dark .fi-btn, html.dark .fi-sidebar-item-btn { transition: none; }
    html.dark .fi-wi-stats-overview-stat:hover, html.dark .fi-btn:hover { transform: none; }
}

/* ═══════════ PAGES SUR MESURE (Astro 2026-10-08, « fais tout ») ═══════════
 * Les ~50 pages maison (Robots, Système, Validation…) écrivent leurs panneaux en style
 * inline avec la même palette slate (fond rgb(15 23 42)/#0f172a/#0b1220, bordure
 * rgb(51 65 85)/#334155/#1e293b). On les « habille » ici par sélecteurs d'attribut, sans
 * toucher aux 50 vues. !important obligatoire pour passer devant le style inline.
 * Les liserés colorés à gauche (border-left d'accent) sont PRÉSERVÉS. */
html.dark .fi-main :is(
    [style*="background:rgb(15 23 42)"], [style*="background: rgb(15 23 42)"],
    [style*="background:rgb(15,23,42)"], [style*="background:#0f172a"], [style*="background: #0f172a"],
    [style*="background:#0b1220"], [style*="background: #0b1220"]
),
html.dark .fi-main :is(.s-panel, .s-card, .w-panel) {
    background: linear-gradient(180deg, rgba(20, 30, 52, .62), rgba(10, 16, 30, .66)) !important;
    border-top-color: rgba(148, 163, 184, .13) !important;
    border-right-color: rgba(148, 163, 184, .13) !important;
    border-bottom-color: rgba(148, 163, 184, .13) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 14px 34px -28px rgba(249, 115, 22, .45);
}
html.dark .fi-main :is([style*="background:rgb(15 23 42)"], [style*="background:#0f172a"], [style*="background:#0b1220"], .s-panel, .s-card, .w-panel):not([style*="border-left"]) {
    border-left-color: rgba(148, 163, 184, .13) !important;
}
/* Zones creuses (code, détails, puits) */
html.dark .fi-main :is([style*="background:rgb(2 6 23)"], [style*="background: rgb(2 6 23)"], [style*="background:#020617"]) {
    background: rgba(2, 6, 23, .62) !important;
}
/* Bordures slate → filets du thème (sauf liseré gauche d'accent) */
html.dark .fi-main :is([style*="solid rgb(51 65 85)"], [style*="solid #334155"], [style*="solid #1e293b"]) {
    border-top-color: rgba(148, 163, 184, .14) !important;
    border-right-color: rgba(148, 163, 184, .14) !important;
    border-bottom-color: rgba(148, 163, 184, .14) !important;
}
html.dark .fi-main :is([style*="solid rgb(51 65 85)"], [style*="solid #334155"], [style*="solid #1e293b"]):not([style*="border-left"]) {
    border-left-color: rgba(148, 163, 184, .14) !important;
}
/* Tableaux maison (hors tables Filament) */
html.dark .fi-main table:not(.fi-ta-table) th {
    font-family: var(--hud-mono); text-transform: uppercase; letter-spacing: .05em; font-size: 11px; color: #94a3b8;
}
html.dark .fi-main table:not(.fi-ta-table) tbody tr { transition: background-color .12s; }
html.dark .fi-main table:not(.fi-ta-table) tbody tr:hover { background-color: rgba(249, 115, 22, .045); }
/* Gros chiffres des tableaux de bord maison */
html.dark .fi-main :is(.s-num, .s-v, .w-v, .num) { font-family: var(--hud-mono); font-variant-numeric: tabular-nums; }

/* ═══════════ PAGES ROBOTS (Astro 2026-10-09 : « les robots c'est toujours l'ancien design ») ═══════════
 * Les pages Robots (22 vues) construisent leurs cartes avec un fond BLANC translucide
 * ($cardBg = rgba(255,255,255,.04) + bordure rgba(255,255,255,.09)), le bandeau « en marche »
 * en vert ($okBg) et leurs petits contrôles en rgba(255,255,255,.06). */
/* Cartes (bandeau, compteurs, listes de releases, panneaux) */
html.dark .fi-main [style*="background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.09)"] {
    background: linear-gradient(180deg, rgba(20, 30, 52, .62), rgba(10, 16, 30, .66)) !important;
    border-color: rgba(148, 163, 184, .13) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 14px 34px -28px rgba(249, 115, 22, .45);
}
/* Bandeau « robot en marche » : verre teinté vert + halo émeraude */
html.dark .fi-main [style*="background:rgba(34,197,94,.10);border:1px solid rgba(34,197,94,.35)"] {
    background: linear-gradient(180deg, rgba(16, 185, 129, .13), rgba(10, 16, 30, .62)) !important;
    border-color: rgba(52, 211, 153, .32) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 16px 40px -26px rgba(52, 211, 153, .6);
}
/* Compteurs cliquables : relief au survol */
html.dark .fi-main button[style*="background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.09)"] { transition: transform .15s, box-shadow .2s; }
html.dark .fi-main button[style*="background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.09)"]:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 18px 40px -24px rgba(249, 115, 22, .6), 0 0 0 1px rgba(249, 115, 22, .3);
}
/* Petits contrôles (tri, filtres, sources, pagination) → pastilles HUD */
html.dark .fi-main [style*="background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14)"] {
    background: rgba(2, 6, 23, .55) !important;
    border-color: rgba(148, 163, 184, .2) !important;
    transition: border-color .15s, box-shadow .15s, color .15s;
}
html.dark .fi-main :is(button, a, select, label)[style*="background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.14)"]:hover {
    border-color: rgba(249, 115, 22, .5) !important;
    box-shadow: 0 0 14px -5px rgba(249, 115, 22, .6);
}
/* Surfaces secondaires #1e293b (lignes, encarts) → verre sombre */
html.dark .fi-main [style*="background:#1e293b"] {
    background: rgba(30, 41, 59, .55) !important;
}

/* ═══════════ PANNEAUX DÉFINIS PAR CLASSES (Astro 2026-10-09 : « absolument tout ») ═══════════
 * Liens proposés (.ls-*), Catégories & langues (.tmc-*), nettoyages (.cs-*), listes
 * « À réparer » de DDL/NZB Morts (.elys-dead-card, .elys-series-group). Liseré gauche conservé. */
html.dark .fi-main :is(.ls-card, .ls-empty, .tmc-panel, .cs-panel, .cs-card, .elys-dead-card, .elys-series-group) {
    background: linear-gradient(180deg, rgba(20, 30, 52, .62), rgba(10, 16, 30, .66)) !important;
    border-top-color: rgba(148, 163, 184, .13) !important;
    border-right-color: rgba(148, 163, 184, .13) !important;
    border-bottom-color: rgba(148, 163, 184, .13) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 14px 34px -28px rgba(249, 115, 22, .45);
    border-radius: 20px;
}
html.dark .fi-main :is(.ls-card, .ls-empty, .tmc-panel, .cs-panel, .cs-card) { border-left-color: rgba(148, 163, 184, .13) !important; }
/* Champs maison (.s-in, .w-in, .tmc-in, .cs-input, .ls-search, .uw-field select) */
html.dark .fi-main :is(.s-in, .w-in, .tmc-in, .cs-input, .ls-search, .uw-field select, .uw-ta) {
    background: rgba(2, 6, 23, .55) !important;
    border-color: rgba(148, 163, 184, .2) !important;
    border-radius: 10px;
}
html.dark .fi-main :is(.s-in, .w-in, .tmc-in, .cs-input, .ls-search, .uw-field select, .uw-ta):focus {
    border-color: rgba(249, 115, 22, .55) !important; box-shadow: 0 0 16px -6px rgba(249, 115, 22, .6); outline: none;
}
/* Onglets et puces maison → style HUD */
html.dark .fi-main :is(.ls-tab, .w-chip, .ls-chip, .s-preset, .cs-preset) { font-family: var(--hud-mono); letter-spacing: .02em; }
/* Zones de code */
html.dark .fi-main :is(.ai-code, .rv-code) { background: rgba(2, 6, 23, .62) !important; border: 1px solid rgba(148, 163, 184, .12); }

/* ═══════════ COMPOSANTS HUD COMMUNS (nouvelles pages, Astro 2026-10-09) ═══════════
 * Utilisés par : Santé serveur, Comptes 1Fichier, Doublons, Classement uploaders,
 * Historique staff. Toujours actifs (pas seulement en sombre) car ces pages n'ont pas
 * d'autre style. */
.hud-wrap { display: flex; flex-direction: column; gap: 18px; }
.hud-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.hud-kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 20px;
    background: linear-gradient(180deg, rgba(20, 30, 52, .62), rgba(10, 16, 30, .66)); border: 1px solid rgba(148, 163, 184, .13);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 14px 34px -28px rgba(249, 115, 22, .45); }
.hud-kpi-l { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; font-family: var(--hud-mono); }
.hud-kpi-n { font-family: var(--hud-mono); font-size: 26px; font-weight: 800; line-height: 1.1; color: #fff7ed;  font-variant-numeric: tabular-nums; }
.hud-kpi-s { font-size: 11.5px; color: #94a3b8; }
.hud-kpi--ok { border-left: 3px solid #34d399; } .hud-kpi--ok .hud-kpi-n { color: #6ee7b7; }
.hud-kpi--warn { border-left: 3px solid #f59e0b; } .hud-kpi--warn .hud-kpi-n { color: #fcd34d; }
.hud-kpi--ko { border-left: 3px solid #f87171; } .hud-kpi--ko .hud-kpi-n { color: #fca5a5; }
.hud-card { padding: 16px 18px; border-radius: 20px; background: linear-gradient(180deg, rgba(20, 30, 52, .62), rgba(10, 16, 30, .66));
    border: 1px solid rgba(148, 163, 184, .13); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 16px 40px -30px rgba(249, 115, 22, .45); }
.hud-card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hud-card-t { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff7ed;  }
.hud-card-sub { font-size: 11.5px; color: #64748b; font-family: var(--hud-mono); }
.hud-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hud-table th { text-align: left; padding: 8px 10px; font-family: var(--hud-mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: #94a3b8; border-bottom: 1px solid rgba(148, 163, 184, .14); white-space: nowrap; }
.hud-table td { padding: 9px 10px; border-bottom: 1px solid rgba(148, 163, 184, .08); color: #cbd5e1; vertical-align: middle; }
.hud-table tbody tr:hover { background: rgba(249, 115, 22, .045); }
.hud-num { font-family: var(--hud-mono); font-variant-numeric: tabular-nums; }
.hud-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
    background: rgba(148, 163, 184, .14); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, .2); }
.hud-badge--ok { background: rgba(16, 185, 129, .15); color: #6ee7b7; border-color: rgba(16, 185, 129, .35); }
.hud-badge--warn { background: rgba(245, 158, 11, .15); color: #fcd34d; border-color: rgba(245, 158, 11, .4); }
.hud-badge--ko { background: rgba(239, 68, 68, .15); color: #fca5a5; border-color: rgba(239, 68, 68, .4); }
.hud-badge--cy { background: rgba(249, 115, 22, .14); color: #fdba74; border-color: rgba(249, 115, 22, .4); }
.hud-dot { width: 9px; height: 9px; border-radius: 999px; flex: none; display: inline-block; }
.hud-dot--ok { background: #34d399; box-shadow: 0 0 9px #34d399; } .hud-dot--warn { background: #f59e0b; box-shadow: 0 0 9px #f59e0b; } .hud-dot--ko { background: #f87171; box-shadow: 0 0 9px #f87171; }
.hud-bar { height: 8px; border-radius: 999px; background: rgba(2, 6, 23, .85); box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .12); overflow: hidden; }
.hud-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #fb923c, #f97316); box-shadow: 0 0 12px rgba(249, 115, 22, .6); }
.hud-bar--warn > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow: 0 0 12px rgba(245, 158, 11, .6); }
.hud-bar--ko > span { background: linear-gradient(90deg, #ef4444, #f87171); box-shadow: 0 0 12px rgba(239, 68, 68, .6); }
.hud-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none;
    background: rgba(2, 6, 23, .55); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, .22); transition: border-color .15s, box-shadow .15s, color .15s; }
.hud-btn:hover { border-color: rgba(249, 115, 22, .55); color: #fff7ed; box-shadow: 0 0 14px -5px rgba(249, 115, 22, .6); }
.hud-btn--cy { background: linear-gradient(180deg, #f97316, #fb923c); color: #ffffff; border-color: transparent; box-shadow: 0 0 18px -6px rgba(249, 115, 22, .8); }
.hud-btn--cy:hover { color: #ffffff; }
.hud-btn--ko:hover { border-color: rgba(239, 68, 68, .6); color: #fca5a5; box-shadow: 0 0 14px -5px rgba(239, 68, 68, .6); }
.hud-btn svg { width: 14px; height: 14px; }
.hud-empty { text-align: center; padding: 28px 16px; border: 1px dashed rgba(251, 146, 60, .28); border-radius: 20px; color: #94a3b8; font-size: 13px; }
.hud-mono { font-family: var(--hud-mono); }
.hud-muted { color: #64748b; font-size: 11.5px; }
.hud-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hud-filters select, .hud-filters input { background: rgba(2, 6, 23, .55); border: 1px solid rgba(148, 163, 184, .22); border-radius: 9px; color: #e2e8f0; padding: 6px 10px; font-size: 12.5px; }
.hud-filters select:focus, .hud-filters input:focus { border-color: rgba(249, 115, 22, .55); outline: none; box-shadow: 0 0 14px -6px rgba(249, 115, 22, .6); }
.hud-scroll { overflow-x: auto; }


/* ═══════════ PAGE DE CONNEXION / MOT DE PASSE OUBLIÉ (layout « simple » de Filament) ═══════════ */
html.dark .fi-simple-layout {
    background:
        radial-gradient(900px 520px at 15% 0%, rgba(249, 115, 22, .22), transparent 60%),
        radial-gradient(800px 520px at 100% 100%, rgba(99, 102, 241, .16), transparent 60%),
        #020617;
}
html.dark .fi-simple-main {
    background: linear-gradient(180deg, rgba(20, 30, 52, .78), rgba(10, 16, 30, .86)) !important;
    border-radius: 28px !important;
    --tw-ring-color: rgba(148, 163, 184, .14);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, .14), 0 40px 100px -40px rgba(0, 0, 0, .9), 0 30px 80px -50px rgba(249, 115, 22, .55) !important;
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
html.dark .fi-simple-header .fi-logo { height: 2.4rem !important; margin-bottom: 4px; }
html.dark .fi-simple-header-heading { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }
html.dark .fi-simple-header-subheading { color: #94a3b8; }
html.dark .fi-simple-main .fi-btn.fi-color-primary:not(.fi-outlined) {
    width: 100%; height: 46px; font-size: 15px; font-weight: 700;
    background-image: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 14px 30px -12px rgba(249, 115, 22, .95);
}
html.dark .fi-simple-main .fi-input-wrp { border-radius: 14px; min-height: 46px; }
html.dark .fi-simple-main .fi-fo-field-label-content { font-weight: 600; color: #cbd5e1; }
html.dark .fi-simple-main a.fi-link { color: #fdba74; }

/* ═══════════ Divers ═══════════ */
html.dark .fi-badge { border-radius: 999px; }
html.dark .fi-sidebar-nav { scrollbar-width: thin; }
html.dark .fi-global-search-field .fi-input-wrp { border-radius: 999px; }
html.dark .fi-wi-chart, html.dark .fi-wi-widget > .fi-section { border-radius: 20px; }
html.dark .fi-ta-ctn { overflow: hidden; }
html.dark .fi-ta-header-cell { letter-spacing: .06em; font-weight: 700; }
html.dark .fi-dropdown-panel, html.dark .fi-modal-window { border-radius: 20px; }

/* Identifiants, hashes, code : on garde une police à chasse fixe */
.hud-mono, html.dark .fi-main code, html.dark .fi-main pre, html.dark .fi-main :is(.ai-code, .rv-code) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ═══════════════════ V2 « STUDIO » (Astro 2026-10-28 : « modernise bien, je vois pas la différence ») ═══════════════════
 * Menu flottant, élément actif en pilule orange pleine, titres imposants, cartes de stats lumineuses,
 * tableaux en carte, actions de ligne discrètes, barre du haut en verre. Habillage seul. */
html.dark { --el-or: #f97316; --el-or2: #ea580c; --el-card: rgba(15, 23, 42, .78); --el-line: rgba(148, 163, 184, .12); --el-soft: rgba(148, 163, 184, .08); }
html.dark .fi-body { font-family: Inter, system-ui, sans-serif; }

/* ── Barre du haut : verre, liseré dégradé ── */
html.dark .fi-topbar { background: rgba(2, 6, 23, .6) !important; border-bottom: 0 !important; box-shadow: none !important;
    -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
html.dark .fi-topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, .55) 20%, rgba(99, 102, 241, .35) 80%, transparent); }
html.dark .fi-global-search-field .fi-input-wrp { background: rgba(15, 23, 42, .8) !important; min-width: 300px; }
html.dark .fi-user-menu-trigger .fi-avatar { box-shadow: 0 0 0 2px #020617, 0 0 0 4px rgba(249, 115, 22, .7); }

/* ── Menu latéral : panneau flottant ── */
html.dark .fi-sidebar { background: transparent !important; border: 0 !important; }
@media (min-width: 1024px) {
    html.dark .fi-sidebar.fi-main-sidebar { padding: 14px 0 14px 14px; }
    html.dark .fi-sidebar .fi-sidebar-nav { border-radius: 24px; background: linear-gradient(180deg, rgba(15, 23, 42, .82), rgba(9, 14, 28, .88));
        box-shadow: 0 0 0 1px var(--el-line), 0 30px 70px -40px rgba(0, 0, 0, .9); padding: 14px 10px; }
}
html.dark .fi-sidebar-group-label { color: #64748b !important; font-size: 10.5px !important; letter-spacing: .1em; display: flex; align-items: center; gap: 8px; }
html.dark .fi-sidebar-group-label::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #f97316, transparent); }
html.dark .fi-sidebar-item-btn { border-radius: 12px !important; padding-top: 8px; padding-bottom: 8px; }
html.dark .fi-sidebar-item-btn:hover { background: rgba(148, 163, 184, .08) !important; }
html.dark .fi-sidebar-item-btn .fi-sidebar-item-icon { color: #64748b; transition: color .15s; }
html.dark .fi-sidebar-item-btn:hover .fi-sidebar-item-icon { color: #fdba74; }
html.dark .fi-sidebar-item-label { color: #cbd5e1; font-weight: 500; }
html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: linear-gradient(135deg, #f97316, #ea580c) !important;
    box-shadow: 0 12px 26px -12px rgba(249, 115, 22, .95), inset 0 1px 0 rgba(255, 255, 255, .18) !important; }
html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-label { color: #fff !important; font-weight: 700; }
html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn svg, html.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon { color: #fff !important; filter: none !important; }
html.dark .fi-sidebar-item-badge-ctn .fi-badge { border-radius: 999px; font-weight: 800; }
html.dark .fi-sidebar-item.fi-active .fi-badge { background: rgba(255, 255, 255, .22) !important; color: #fff !important; --tw-ring-color: transparent; }

/* ── En-tête de page ── */
html.dark .fi-header { position: relative; padding-bottom: 18px; }
html.dark .fi-header-heading { font-size: 2rem !important; font-weight: 800 !important; letter-spacing: -.03em !important; color: #fff !important; text-shadow: none !important; }
html.dark .fi-header::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #f97316, #fb923c); }
html.dark .fi-breadcrumbs-item-label { font-size: 12.5px; color: #64748b; }
html.dark .fi-breadcrumbs-item:last-child .fi-breadcrumbs-item-label { color: #fdba74; }
html.dark .fi-header-actions-ctn .fi-btn { height: 40px; padding-inline: 18px; }

/* ── Boutons ── */
html.dark .fi-btn.fi-color-primary:not(.fi-outlined) { background-image: linear-gradient(135deg, #f97316, #ea580c) !important; border: 0; color: #fff !important;
    box-shadow: 0 12px 26px -12px rgba(249, 115, 22, .95), inset 0 1px 0 rgba(255, 255, 255, .18) !important; }
/* Actions de ligne de tableau : discrètes (avant : gros boutons orange pleins sur chaque ligne) */
html.dark .fi-ta-row .fi-btn.fi-color-primary:not(.fi-outlined), html.dark .fi-ta-actions .fi-btn.fi-color-primary:not(.fi-outlined) {
    background: rgba(249, 115, 22, .12) !important; background-image: none !important; color: #fdba74 !important; box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .32) !important; }
html.dark .fi-ta-row .fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon, html.dark .fi-ta-actions .fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon { color: #fdba74 !important; }
html.dark .fi-ta-row .fi-btn.fi-color-primary:not(.fi-outlined):hover { background: rgba(249, 115, 22, .22) !important; }

/* ── Cartes (sections, widgets) ── */
html.dark .fi-section:not(.fi-section-not-contained), html.dark .fi-ta-ctn, html.dark .fi-wi-widget > .fi-section {
    background: var(--el-card) !important; border-radius: 22px !important; box-shadow: 0 0 0 1px var(--el-line), 0 30px 70px -44px rgba(0, 0, 0, .95) !important; }
html.dark .fi-section-header { padding-bottom: 6px; }
html.dark .fi-section-header-heading { font-weight: 700; font-size: 15px; color: #fff !important; }

/* ── Statistiques : cartes lumineuses ── */
html.dark .fi-wi-stats-overview-stat { position: relative; overflow: hidden; border-radius: 22px !important;
    background: radial-gradient(120% 90% at 100% 0%, rgba(249, 115, 22, .14), transparent 55%), var(--el-card) !important;
    box-shadow: 0 0 0 1px var(--el-line), 0 30px 70px -44px rgba(0, 0, 0, .95) !important; }
html.dark .fi-wi-stats-overview-stat::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, #f97316, transparent); opacity: .8; }
html.dark .fi-wi-stats-overview-stat:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(249, 115, 22, .35), 0 30px 60px -34px rgba(249, 115, 22, .55) !important; }
html.dark .fi-wi-stats-overview-stat-label { font-size: 12px !important; font-weight: 700 !important; letter-spacing: .07em; text-transform: uppercase; color: #94a3b8 !important; }
html.dark .fi-wi-stats-overview-stat-value { font-size: 2.1rem !important; font-weight: 800 !important; letter-spacing: -.03em !important; color: #fff !important;
    font-variant-numeric: tabular-nums; text-shadow: none !important; }
html.dark .fi-wi-stats-overview-stat-description { display: inline-flex !important; width: fit-content; padding: 3px 10px; border-radius: 999px; background: rgba(148, 163, 184, .08); font-size: 12px !important; font-weight: 600; }

/* ── Tableaux ── */
html.dark .fi-ta-header-toolbar { background: rgba(2, 6, 23, .35); border-bottom: 1px solid var(--el-line) !important; padding-block: 12px; }
html.dark .fi-ta-search-field .fi-input-wrp { border-radius: 999px !important; }
html.dark .fi-ta-table > thead > tr { background: rgba(2, 6, 23, .45) !important; }
html.dark .fi-ta-header-cell { font-size: 10.5px !important; font-weight: 800 !important; letter-spacing: .08em !important; color: #64748b !important; }
html.dark .fi-ta-row { border-color: rgba(148, 163, 184, .07) !important; }
html.dark .fi-ta-row:hover { background: linear-gradient(90deg, rgba(249, 115, 22, .07), rgba(249, 115, 22, .02)) !important; }
html.dark .fi-ta-cell { padding-block: 4px; }
html.dark .fi-ta-text-item .fi-font-bold, html.dark .fi-ta-cell-name .fi-ta-text-item { color: #fff; }
html.dark .fi-pagination-item-btn { border-radius: 10px; }
html.dark .fi-pagination-item.fi-active .fi-pagination-item-btn { background: rgba(249, 115, 22, .18); color: #fdba74; }

/* ── Badges : pastilles douces ── */
html.dark .fi-badge { border-radius: 999px !important; padding-inline: 9px; font-weight: 700; }

/* ── Formulaires ── */
html.dark .fi-input-wrp { background: rgba(2, 6, 23, .6) !important; border-radius: 14px !important; }
html.dark .fi-input-wrp:focus-within { box-shadow: 0 0 0 1px rgba(249, 115, 22, .7), 0 0 0 4px rgba(249, 115, 22, .14) !important; }
html.dark .fi-fo-field-label-content { color: #cbd5e1 !important; font-weight: 600; }
html.dark .fi-toggle.fi-toggle-on { background: linear-gradient(135deg, #f97316, #ea580c) !important; }
html.dark .fi-checkbox-input:checked { background-color: #f97316 !important; }

/* ── Menus déroulants, fenêtres, notifications ── */
html.dark .fi-dropdown-panel { border-radius: 18px !important; background: rgba(12, 18, 34, .98) !important; box-shadow: 0 0 0 1px var(--el-line), 0 30px 60px -20px rgba(0, 0, 0, .9) !important; }
html.dark .fi-dropdown-list-item { border-radius: 10px; }
html.dark .fi-dropdown-list-item:hover { background: rgba(249, 115, 22, .1) !important; }
html.dark .fi-modal-window { border-radius: 26px !important; background: linear-gradient(180deg, rgba(20, 30, 52, .98), rgba(10, 16, 30, .98)) !important;
    box-shadow: 0 0 0 1px var(--el-line), 0 40px 100px -30px rgba(0, 0, 0, .95), 0 30px 80px -50px rgba(249, 115, 22, .5) !important; }
html.dark .fi-no-notification { border-radius: 18px !important; }

/* ═══════════ V3 (Astro 2026-10-28 : « modernise toutes les pages ») ═══════════
 * Boutons « info » (bleus) → verre neutre, icône orange : moins de couleurs concurrentes. */
html.dark .fi-btn.fi-color-info:not(.fi-outlined) { background: rgba(148, 163, 184, .12) !important; background-image: none !important; color: #e2e8f0 !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .22) !important; }
html.dark .fi-btn.fi-color-info:not(.fi-outlined):hover { background: rgba(148, 163, 184, .2) !important; }
html.dark .fi-btn.fi-color-info:not(.fi-outlined) .fi-icon { color: #fdba74 !important; }
html.dark .fi-btn.fi-color-gray:not(.fi-outlined) { background: rgba(148, 163, 184, .1) !important; box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .2) !important; }
/* Liens d'action de tableau (Edit / Delete / Resync) : pastilles au survol */
html.dark .fi-ac-link-action { border-radius: 8px; padding: 2px 6px; transition: background .12s; }
html.dark .fi-ac-link-action:hover { background: rgba(148, 163, 184, .1); }
/* Encadrés d'aide en tête des pages maison */
html.dark .fi-main .fi-section-header-description, html.dark .fi-main .fi-section-description { color: #94a3b8 !important; }

/* ═══════════ V4 — PANEL SUR MOBILE (Astro 2026-10-28) ═══════════
 * Modération confortable au téléphone : en-têtes compacts, actions pleine largeur, onglets et tableaux
 * qui défilent horizontalement, menu latéral en tiroir lisible, zones tactiles ≥ 40 px. */
@media (max-width: 1023px) {
    /* Tiroir de menu (off-canvas) */
    html.dark .fi-sidebar.fi-sidebar-open, html.dark .fi-sidebar { background: rgba(9, 14, 28, .98) !important; }
    html.dark .fi-sidebar .fi-sidebar-nav { padding: 12px 10px 90px; }
    html.dark .fi-sidebar-item-btn { min-height: 44px; }
    html.dark .fi-sidebar-close-overlay { background: rgba(2, 6, 23, .7) !important; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
    html.dark .fi-topbar-open-sidebar-btn, html.dark .fi-topbar-close-sidebar-btn { width: 42px; height: 42px; border-radius: 12px; background: rgba(148, 163, 184, .1); }
    html.dark .fi-global-search-field .fi-input-wrp { min-width: 0 !important; }
}
@media (max-width: 640px) {
    html.dark .fi-main { padding-inline: 12px !important; }
    html.dark .fi-header { padding-bottom: 14px; gap: 12px; }
    html.dark .fi-header-heading { font-size: 1.5rem !important; }
    html.dark .fi-header::after { width: 40px; height: 3px; }
    html.dark .fi-breadcrumbs { display: none; }
    /* Boutons d'en-tête : pleine largeur, faciles à toucher */
    html.dark .fi-header-actions-ctn { width: 100%; }
    html.dark .fi-header-actions-ctn .fi-ac, html.dark .fi-header-actions-ctn .fi-btn { flex: 1 1 auto; justify-content: center; }
    html.dark .fi-btn { min-height: 40px; }
    /* Onglets (Filament et groupes .elh-tabs) : une ligne qui défile */
    html.dark .fi-tabs, .elh-tabs { flex-wrap: nowrap !important; overflow-x: auto; max-width: 100% !important; scrollbar-width: none; }
    html.dark .fi-tabs::-webkit-scrollbar, .elh-tabs::-webkit-scrollbar { display: none; }
    html.dark .fi-tabs-item, .elh-tab { flex: none; }
    /* Cartes et sections plus compactes */
    html.dark .fi-section:not(.fi-section-not-contained), html.dark .fi-ta-ctn, html.dark .fi-wi-stats-overview-stat { border-radius: 18px !important; }
    html.dark .fi-section-content-ctn, html.dark .fi-section-content { padding: 14px !important; }
    html.dark .fi-wi-stats-overview-stat-value { font-size: 1.6rem !important; }
    /* Tableaux : défilement horizontal propre, barre d'outils empilée */
    html.dark .fi-ta-content-ctn, html.dark .fi-ta-content { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    html.dark .fi-ta-header-toolbar { flex-wrap: wrap; gap: 8px; }
    html.dark .fi-ta-search-field { width: 100%; }
    html.dark .fi-ta-cell, html.dark .fi-ta-header-cell { white-space: nowrap; }
    /* Fenêtres : quasi plein écran */
    html.dark .fi-modal-window { border-radius: 22px !important; margin: 8px; max-height: calc(100dvh - 16px); }
    /* Pages maison : tableaux et grilles en ligne */
    html.dark .fi-main table:not(.fi-ta-table) { display: block; overflow-x: auto; }
    html.dark .fi-main .hud-kpis { grid-template-columns: 1fr 1fr; }
    html.dark .fi-pagination { flex-wrap: wrap; gap: 8px; justify-content: center; }
}
