/* ===================================================================
   GabWatch — thème "centre de supervision" (dark threat-intel)
   =================================================================== */
:root {
  /* === Marque officielle GDJ (Brand Book fév. 2026) — primitives ===
     Bleu / jaune / vert du drapeau gabonais. Le rouge n'appartient PAS à la
     marque : il sert UNIQUEMENT de couleur fonctionnelle de danger (opérateur
     illégal, alerte), jamais comme couleur d'identité. */
  --gdj-blue: #003f8d;       /* bleu institutionnel profond */
  --gdj-blue-2: #0061cb;     /* bleu vif (wordmark, primaire) */
  --gdj-yellow: #ffd300;     /* or */
  --gdj-green: #107a34;      /* vert */
  --gdj-black: #0a0b0c;
  --primary: #2f86ff;        /* primaire interactif (bleu GDJ lisible sur sombre) */
  --primary-strong: #0061cb;
  --brand-text: #ffffff;

  --bg: #081225;
  --bg-grad: radial-gradient(1200px 700px at 80% -15%, #0f2148 0%, transparent 60%),
             radial-gradient(900px 600px at -10% 10%, #0a1c3a 0%, transparent 55%);
  --surface: #0e1830;
  --surface-2: #131f3b;
  --elevated: #182442;
  --line: #1f2c4c;
  --line-2: #2a3a5e;
  --ink: #eaf0fc;
  --sub: #9fb0d2;
  --faint: #9aa8c8;
  --brand: #ff5266;        /* DANGER fonctionnel (illégal / alerte) — hors marque */
  --brand-2: #ff708a;
  --cyan: #2f86ff;         /* primaire interactif = bleu GDJ */
  --azure: #5aa2ff;
  --ok: #2ec27a;           /* succès = vert GDJ éclairci */
  --warn: #ffce3a;         /* avertissement = or GDJ */
  --violet: #a78bfa;
  --crit: #ff5266;
  --glow: 0 1px 2px rgba(0,0,0,.28), 0 4px 14px rgba(0,0,0,.22);
  --r: 7px;
  --grid-line: rgba(40,56,92,.5);
  --chart-text: #93a6cc;
  --sidebar-top: #0a1430; --sidebar-bot: #081225; --sidebar-foot: #0a1430;
  --header-bg: #0b1428;
  --input-bg: #0b1428;
  --topbar-bg: rgba(8,18,37,.82);
}
/* ---- Mode CLAIR ---- */
:root[data-theme="light"] {
  --primary: #0061cb;        /* bleu vif GDJ — primaire interactif */
  --primary-strong: #003f8d;
  --bg: #eaf1fb;
  --bg-grad: radial-gradient(1100px 650px at 85% -15%, #d6e6fb 0%, transparent 60%),
             radial-gradient(800px 550px at -10% 5%, #e7f0e9 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f4f8fd;
  --elevated: #e9f1fb;
  --line: #dde6f2;
  --line-2: #c5d5e8;
  --ink: #0a0b0c;            /* noir GDJ — texte */
  --sub: #45556f;
  --faint: #5e6e86;
  --brand: #c41230;         /* DANGER fonctionnel (illégal) — hors marque */
  --brand-2: #e11d3a;
  --cyan: #0061cb;          /* primaire interactif = bleu GDJ */
  --azure: #003f8d;         /* liens = bleu institutionnel GDJ */
  --ok: #107a34;            /* succès = vert GDJ */
  --warn: #b07400;          /* avertissement (texte lisible dérivé de l'or) */
  --violet: #6d28d9;
  --crit: #c41230;
  --glow: 0 1px 2px rgba(10,28,61,.05), 0 8px 26px rgba(10,28,61,.08);
  --grid-line: rgba(197,213,232,.7);
  --chart-text: #45556f;
  --sidebar-top: #003f8d; --sidebar-bot: #00306e; --sidebar-foot: #003f8d;
  --header-bg: #f4f8fd;
  --input-bg: #ffffff;
  --topbar-bg: rgba(255,255,255,.85);
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 13.5px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;          /* chiffres alignés (data-oriented) */
  font-feature-settings: "tnum" 1, "cv05" 1;
  -webkit-font-smoothing: antialiased;
}
/* Chiffres : toujours tabulaires (lisibilité des tableaux/KPI). */
.stat .v, .kpi .v, .mono, table, .score, td, th { font-variant-numeric: tabular-nums; }
body::before {
  content: ""; position: fixed; inset: 0; background: var(--bg-grad);
  pointer-events: none; z-index: 0;
}
a { color: var(--azure); text-decoration: none; transition: color .15s; }
a:hover { color: var(--cyan); }
.mono, code, .ip { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
code { background: color-mix(in srgb, var(--cyan) 9%, transparent); color: var(--azure);
  padding: 1px 6px; border-radius: 6px; font-size: 12.5px;
  border: 1px solid color-mix(in srgb, var(--cyan) 16%, transparent); }

/* Layout */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: 256px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bot) 100%);
  border-right: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column;
  transition: width .2s ease;
}
/* Identité GDJ officielle (lockup blanc sur barre latérale sombre/bleue). */
.brand { display: flex; align-items: center; justify-content: center; padding: 18px 18px 12px; }
.brand-lockup { width: 100%; max-width: 186px; height: auto; display: block; }
.brand-icon { display: none; width: 40px; height: auto; }
.brand-product { padding: 0 20px 16px; border-bottom: 1px solid rgba(255,255,255,.09); }
.prod-name { display: block; font-weight: 700; letter-spacing: 3px; font-size: 11.5px; color: #fff; }
.prod-tag { display: block; font-size: 11px; color: rgba(255,255,255,.72); margin-top: 2px; }
/* Liseré drapeau (vert/jaune/bleu) au bord de la barre latérale. */
.sidebar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--gdj-green) 0 33%, var(--gdj-yellow) 33% 66%, var(--gdj-blue-2) 66% 100%); }

/* Barre latérale repliée (rail d'icônes) */
.sb-collapsed .sidebar { width: 72px; }
.sb-collapsed .brand { padding: 16px 0 10px; }
.sb-collapsed .brand-lockup, .sb-collapsed .brand-product, .sb-collapsed .who { display: none; }
.sb-collapsed .brand-icon { display: block; margin: 0 auto; }
/* libellés masqués VISUELLEMENT mais lisibles par lecteur d'écran */
.sb-collapsed .nav .label { position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.sb-collapsed .nav { padding: 14px 8px; }
.sb-collapsed .nav a { justify-content: center; padding: 11px 0; }
.sb-collapsed .nav .ic { width: auto; }
.brand .dot { color: var(--brand); }
.brand small { display: block; color: var(--faint); font-size: 10.5px; margin-top: 4px;
  text-transform: uppercase; letter-spacing: 1.4px; font-weight: 600; }
.nav { padding: 14px 12px; flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  color: #a8b6d6; border-radius: 6px; font-weight: 500; font-size: 14px;
  position: relative; transition: all .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(239,68,68,.22), rgba(239,68,68,.05));
  color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px; background: var(--brand); }
.nav .ic { width: 20px; display: inline-flex; align-items: center; justify-content: center; opacity: .8; }
.nav .ic svg { width: 18px; height: 18px; }
.nav a.active .ic { opacity: 1; }
.who { padding: 13px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px;
  background: var(--sidebar-foot); flex-shrink: 0; }
.who b { color: #fff; display: block; font-size: 13px; }
.who .role { display: inline-block; margin: 5px 0 7px; padding: 2px 8px; border-radius: 5px;
  font-size: 10px; letter-spacing: .5px; font-weight: 700; text-transform: uppercase;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); }
.who .role--admin { background: color-mix(in srgb, var(--brand) 30%, transparent); }
.who .role--supadmin { background: color-mix(in srgb, var(--gdj-green) 42%, transparent); color: #fff; }
/* Lien externe (domaine d'opérateur) : ouvre une nouvelle fenêtre, signalé par ↗ */
a.ext { color: var(--gdj-blue-2); text-decoration: none; }
a.ext:hover { text-decoration: underline; }
a.ext::after { content: "\2197"; font-size: .8em; margin-left: 3px; opacity: .55; vertical-align: 1px; }
a.chip.ext { color: var(--ink); }
a.chip.ext:hover { border-color: var(--gdj-blue-2); color: var(--gdj-blue-2); text-decoration: none; }
.who .role--superviseur { background: color-mix(in srgb, var(--gdj-blue-2) 45%, transparent); }
.who .role--direction { background: color-mix(in srgb, var(--gdj-yellow) 26%, transparent); color: #fff; }
.who a { display: block; color: rgba(255,255,255,.75); font-size: 12.5px; }
.who a:hover { color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--topbar-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 12px; }
.content { padding: 22px 24px 56px; max-width: 1720px; }
/* États courts (En ligne / DNS / Actif…) : jamais coupés en deux lignes */
td .dot-on, td .dot-live, td .dot-dead { white-space: nowrap; }
td.state, .state { white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  padding: 9px 16px; border-radius: 6px; font-size: 13.5px; font-weight: 600;
  font-family: inherit; transition: all .15s; white-space: nowrap; }
.btn:hover { background: var(--elevated); border-color: var(--line-2); color: var(--ink); }
.btn--primary { background: #0061cb; border-color: #0061cb; color: #fff; }
.btn--primary:hover { background: #0056b8; border-color: #0056b8; color: #fff; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 5px 11px; font-size: 12.5px; border-radius: 4px; }
.btn .bi { width: 15px; height: 15px; flex-shrink: 0; }
.btn[aria-busy="true"] { opacity: .85; pointer-events: none; }
.spin { display: inline-block; width: 13px; height: 13px; vertical-align: -1px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn--crit { background: rgba(251,59,83,.14); border-color: rgba(251,59,83,.4); color: #fda4af; }
.btn--crit:hover { background: rgba(251,59,83,.24); color: #fff; }
.topsearch input { width: 230px; padding: 7px 12px; font-size: 13px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line-2); }
@media (max-width: 720px){ .topsearch { display: none; } }
.theme-toggle, .icon-btn { width: 38px; height: 38px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  font-size: 17px; line-height: 1; display: grid; place-items: center; transition: all .15s; flex-shrink: 0; }
.theme-toggle:hover, .icon-btn:hover { background: var(--elevated); border-color: var(--cyan); color: var(--cyan); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle svg { width: 17px; height: 17px; }
.nav-collapse { display: inline-flex; }
@media (max-width: 980px){ .nav-collapse { display: none; } }

/* Cards & grid */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px,1fr)); gap: 14px; }
.card { background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px;
  box-shadow: var(--glow); position: relative; overflow: hidden; }
a.card { transition: border-color .15s ease, box-shadow .15s ease; }
a.card:hover { border-color: var(--line-2); box-shadow: var(--glow); }
.stat .k { color: var(--sub); font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; }
.stat .v { font-size: 32px; font-weight: 700; margin-top: 10px; letter-spacing: -.8px;
  line-height: 1; color: var(--ink); }
.sub-stat { font-size: 12px; color: var(--sub); font-weight: 500; margin-top: 8px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--glow); margin-top: 22px; overflow: hidden; }
.panel > h2 { font-size: 14px; margin: 0; padding: 16px 22px; font-weight: 700;
  letter-spacing: -.2px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel .body { padding: 18px 22px; }
.grid2 { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 20px; }
@media (max-width: 1120px){ .grid2{ grid-template-columns:1fr; } }

/* Accessibilité & utilitaires */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.crumb { color: var(--faint); font-weight: 500; }
.crumb a { color: var(--sub); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--sub); cursor: pointer; user-select: none; }
.check input { width: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brand);
  color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* Navigation mobile (hamburger + overlay) */
.hamburger { display: none; width: 38px; height: 38px; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  cursor: pointer; align-items: center; justify-content: center; }
.hamburger svg { width: 20px; height: 20px; }
.nav-backdrop { display: none; }
@media (max-width: 980px){
  .hamburger { display: inline-flex; }
  .sidebar { position: fixed; top: 0; left: -290px; z-index: 60; transition: left .25s ease;
    box-shadow: 0 0 50px rgba(0,0,0,.55); }
  body.nav-open .sidebar { left: 0; }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(2,6,18,.55); z-index: 50; }
  body.nav-open .nav-backdrop { display: block; }
  .topbar { padding: 14px 18px; }
  .content { padding: 18px; }
}
/* Tables : scroll horizontal sur petit écran */
@media (max-width: 860px){
  .panel { overflow-x: auto; }
  .panel table { min-width: 640px; }
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--sub); font-weight: 600; padding: 8px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--line); background: var(--header-bg); position: sticky; }
td { padding: 7px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(47,134,255,.035); }
.th-sort { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.th-sort:hover { color: var(--cyan); text-decoration: none; }
/* Tri client : en-têtes cliquables + flèche de sens */
th.th-click { cursor: pointer; user-select: none; }
th.th-click:hover { color: var(--cyan); }
th.th-click[data-sort]::after { content: "▾"; font-size: 9px; margin-left: 5px; opacity: .8; }
th.th-click[data-sort="asc"]::after { content: "▴"; }
/* Copie en un clic */
.copy-on { cursor: copy; border-radius: 4px; transition: background .12s; }
.copy-on:hover { background: color-mix(in srgb, var(--cyan) 12%, transparent); }
.copy-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--surface); padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; box-shadow: var(--glow); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 200; }
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.muted { color: var(--sub); } .faint { color: var(--faint); }
.crit-text { color: var(--crit); font-weight: 700; }

/* Badges de statut — sobres : pastille neutre + point coloré (façon Linear/GitHub).
   La couleur ne porte que le statut (un seul point), le texte reste neutre. */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .1px;
  white-space: nowrap; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--faint); flex-shrink: 0; }
.badge--licensed::before { background: #2f9e55; }
.badge--suspected::before { background: #b58a34; }
.badge--high_confidence::before { background: #c4702c; }
.badge--confirmed::before,
.badge--resurfaced::before, .badge--RESURFACED::before, .badge--NEW_PAYMENT::before { background: #c8434f; }
.badge--blocked::before, .badge--down::before,
.badge--UPDATED::before, .badge--STATUS::before { background: #7a8aa0; }
.badge--NEW_OPERATOR::before { background: #3b73c4; }
.badge--NEW_DOMAIN::before { background: #b58a34; }

.score { font-weight: 700; color: var(--ink); }
.score-bar { display: inline-block; width: 72px; height: 5px; background: var(--line-2);
  border-radius: 3px; overflow: hidden; vertical-align: middle; margin-left: 8px; }
.score-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--cyan); }

.chip { display: inline-block; background: var(--surface-2); border: 1px solid var(--line-2);
  color: var(--sub); padding: 2px 9px; border-radius: 4px; font-size: 12px; margin: 2px 3px 2px 0; }

/* Status dots */
.dot-live, .dot-dead, .dot-on { display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot-live { background: var(--ok); }
.dot-on { background: var(--cyan); }
.dot-dead { background: var(--faint); }
.ip { font-size: 12.5px; color: var(--sub); }
.kpi-row { display: flex; gap: 26px; flex-wrap: wrap; }
.kpi .k { color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.kpi .v { font-size: 24px; font-weight: 800; color: var(--ink); }
.src-tag { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 6px;
  font-weight: 600; margin-right: 3px; background: var(--surface-2); color: var(--sub);
  border: 1px solid var(--line-2); }
.src-tag.permutation { background: rgba(251,191,36,.1); color: #fcd34d; border-color: rgba(251,191,36,.2); }
.src-tag.ct_log { background: rgba(56,189,248,.1); color: #7dd3fc; border-color: rgba(56,189,248,.2); }
.src-tag.search { background: rgba(52,211,153,.1); color: #6ee7b7; border-color: rgba(52,211,153,.2); }

/* Globe 3D */
.globe-panel { background: radial-gradient(900px 500px at 50% 40%, rgba(47,134,255,.05), transparent 70%), var(--surface); }
.globe-legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 22px 0;
  font-size: 12.5px; color: var(--sub); }
.globe-legend i { display: inline-block; vertical-align: middle; margin-right: 5px; }
.globe-legend .lg-dot { width: 10px; height: 10px; border-radius: 50%; }
.globe-legend .lg-line { width: 16px; height: 0; border-top: 2px dashed #2f86ff; }
.globe-pill { background: rgba(7, 11, 20, .9); color: #eaf6ff; border: 1px solid #2f86ff;
  padding: 3px 9px; border-radius: 999px; font: 700 11.5px "Montserrat", system-ui, sans-serif;
  white-space: nowrap; cursor: pointer; pointer-events: auto; user-select: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.6); letter-spacing: .2px; transition: transform .12s; }
.globe-pill:hover { transform: scale(1.08); border-color: #7aa9ff; }
.globe-pill--gabon { border-color: #ff5266; color: #fff;
  background: linear-gradient(180deg, #e11d3a, #b91530); box-shadow: 0 0 14px rgba(251,59,83,.6); }
.globe-stage { position: relative; }
.globe-viz { width: 100%; height: 480px; position: relative; cursor: grab; }
.globe-viz:active { cursor: grabbing; }
.globe-viz canvas { display: block; }

/* --- Console de veille (SOC) : bandeau de pilotage + HUD superposés au globe --- */
.soc-bar { display: flex; flex-wrap: wrap; padding: 11px 22px; margin-top: 6px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: "JetBrains Mono", ui-monospace, monospace; }
.soc-stat { flex: 1; min-width: 110px; padding: 0 16px; border-left: 1px solid var(--line); }
.soc-stat:first-child { border-left: 0; padding-left: 0; }
.soc-k { display: block; font-size: 9.5px; letter-spacing: .7px; text-transform: uppercase; color: var(--faint); }
.soc-v { display: block; font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.25;
  font-variant-numeric: tabular-nums; }
.soc-v.crit { color: #ff5266; }
.soc-v.lvl-eleve { color: #ff5266; } .soc-v.lvl-modere { color: #f59e0b; } .soc-v.lvl-faible { color: #22d3ee; }
.soc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #22d3ee;
  margin-right: 7px; vertical-align: 0; animation: socpulse 1.6s infinite; }
@keyframes socpulse { 0% { box-shadow: 0 0 0 0 rgba(34,211,238,.55); } 70% { box-shadow: 0 0 0 8px rgba(34,211,238,0); } 100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); } }
.soc-hud { position: absolute; z-index: 6; background: rgba(7,11,20,.72);
  border: 1px solid rgba(47,134,255,.32); border-radius: 8px; padding: 9px 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace; pointer-events: none; }
.soc-hud--tl { top: 14px; left: 14px; }
.soc-hud--bl { bottom: 14px; left: 14px; min-width: 188px; }
.soc-hud h4 { margin: 0 0 7px; font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase;
  color: #7aa9ff; font-weight: 700; }
.soc-hud .tag { font-size: 10px; color: #9fb3d6; letter-spacing: .3px; margin-top: 2px; }
.soc-origin { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 10.5px; color: #cfe0ff; }
.soc-origin .lbl { flex: 0 0 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soc-origin .track { flex: 1; height: 5px; background: rgba(255,255,255,.09); border-radius: 3px; }
.soc-origin .track > span { display: block; height: 100%; border-radius: 3px; }
.soc-origin .n { width: 30px; text-align: right; color: #eaf6ff; font-weight: 600; }
@media (max-width: 720px) { .soc-hud--tl { display: none; } }

/* Animation d'entrée (sobre) */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cards > *, .panel { animation: fadeUp .32s ease-out both; }
.cards > *:nth-child(2){ animation-delay:.04s; } .cards > *:nth-child(3){ animation-delay:.08s; }
.cards > *:nth-child(4){ animation-delay:.12s; } .cards > *:nth-child(5){ animation-delay:.16s; }
.cards > *:nth-child(6){ animation-delay:.2s; }
@media (prefers-reduced-motion: reduce){ .cards>*,.panel{ animation:none; } }

/* Focus clavier visible (accessibilité) */
a:focus-visible, button:focus-visible, .btn:focus-visible, .theme-toggle:focus-visible,
input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px;
}
.nav a:focus-visible { outline-offset: -2px; }

/* Flash messages (feedback après action) */
.flash-stack { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 11px 16px; border-radius: 6px; font-size: 13.5px; font-weight: 500;
  border: 1px solid; display: flex; align-items: center; gap: 8px; animation: fadeUp .3s ease-out both; }
.flash::before { content: "✓"; font-weight: 800; }
.flash--ok { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.3); color: #6ee7b7; }
.flash--err { background: rgba(251,59,83,.12); border-color: rgba(251,59,83,.3); color: #fda4af; }
.flash--err::before { content: "!"; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.chart-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.chart-h { position: relative; height: 240px; }
@media (max-width: 1200px){ .chart-grid{ grid-template-columns:1fr 1fr; } }
@media (max-width: 860px){ .chart-grid, .chart-grid-2{ grid-template-columns:1fr; } }

/* Connexion — layout SaaS (panneau marque GDJ + formulaire) */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: center;
  gap: 30px; padding: 56px 60px; color: #fff; overflow: hidden;
  background: linear-gradient(155deg, #06122a 0%, #0a2a63 52%, #003f8d 100%); }
.auth-brand::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--gdj-green) 0 33%, var(--gdj-yellow) 33% 66%, var(--gdj-blue-2) 66% 100%); }
.auth-brand::after { content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,211,0,.12), transparent 65%); }
.auth-logo { width: 300px; max-width: 72%; height: auto; position: relative; z-index: 1; }
.auth-pitch { position: relative; z-index: 1; }
.auth-pitch h1 { font-size: 38px; margin: 0 0 14px; font-weight: 800; letter-spacing: 4px; }
.auth-pitch p { font-size: 15px; line-height: 1.7; color: rgba(255,255,255,.8); max-width: 46ch; margin: 0; }
.auth-foot { font-size: 12.5px; color: rgba(255,255,255,.5); position: relative; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--ink); }
.magic-req { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.magic-req summary { cursor: pointer; color: var(--azure); font-size: 13px; list-style: none; }
.magic-req summary::-webkit-details-marker { display: none; }
.magic-req summary:hover { color: var(--cyan); }
.login-card p.sub { color: var(--sub); margin: 0 0 22px; font-size: 13.5px; }
@media (max-width: 860px){
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 36px 30px; gap: 18px; }
  .auth-pitch h1 { font-size: 28px; }
  .auth-logo { width: 220px; }
}
label { display: block; font-size: 12px; font-weight: 600; margin: 16px 0 6px;
  color: var(--sub); text-transform: uppercase; letter-spacing: .5px; }
input, select { width: 100%; padding: 11px 13px; border: 1px solid var(--line-2);
  border-radius: 6px; font: inherit; background: var(--input-bg); color: var(--ink); }
input::placeholder { color: var(--sub); opacity: 1; }
input:focus, select:focus { outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 22%, transparent); }
.err { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 34%, transparent); padding: 11px 14px;
  border-radius: 6px; font-size: 13.5px; margin-top: 16px; }
.note { background: color-mix(in srgb, var(--cyan) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 22%, transparent);
  color: var(--azure); padding: 11px 14px; border-radius: 6px; font-size: 13px; margin-top: 18px; }

/* Toolbar / filters */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; }
.toolbar input, .toolbar select { width: auto; }

/* Logs / dossier */
pre.log { background: #070b14; color: #9fb0d0; padding: 18px; border-radius: 12px;
  border: 1px solid var(--line); font: 12.5px/1.7 "JetBrains Mono", Consolas, monospace;
  overflow-x: auto; white-space: pre-wrap; }
.dossier { background: var(--surface); padding: 10px 36px 32px; color: var(--ink); }
.dossier h1 { font-size: 25px; color: var(--ink); } .dossier h2 { font-size: 17px; margin-top: 26px; color: var(--ink); }
.dossier blockquote { border-left: 3px solid var(--brand); margin: 14px 0; padding: 8px 18px;
  background: rgba(239,68,68,.07); color: #fda4af; border-radius: 0 10px 10px 0; }
.dossier ul { padding-left: 22px; } .dossier li.sub { list-style: circle; margin-left: 18px; }
.dossier hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.dossier code { color: #cfe0ff; }

/* Evidence */
.evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 14px; }
.evidence figure { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface-2); }
.evidence img { width: 100%; display: block; border-bottom: 1px solid var(--line); }
.evidence figcaption { padding: 10px 12px; font-size: 12px; color: var(--sub); }

/* =====================================================================
   Mode CLAIR : textes saturés FONCÉS sur les fonds teintés (lisibilité).
   Le mode sombre garde ses pastels clairs (définis plus haut).
   ===================================================================== */
:root[data-theme="light"] code,
:root[data-theme="light"] .dossier code { color: #0e7490; }
:root[data-theme="light"] .src-tag.permutation { color: #b45309; }
:root[data-theme="light"] .src-tag.ct_log { color: #0369a1; }
:root[data-theme="light"] .src-tag.search { color: #15803d; }
:root[data-theme="light"] .flash--ok { color: #15803d; }
:root[data-theme="light"] .flash--err,
:root[data-theme="light"] .err { color: #b91c1c; }
:root[data-theme="light"] .note { color: #0e7490; }
:root[data-theme="light"] .crit-text { color: #dc2626; }
:root[data-theme="light"] .dossier blockquote { color: #991b1b; }
