/*!
 * Lamarck UI v1.0 — Design tokens (refonte 2026).
 * Source de vérité unique : ce fichier remplace le bloc :root de lamarck.css.
 *
 * Direction : Schibsted Grotesk + bleu Lamarck #1f54cf + neutres réchauffés.
 * Les NOMS de variables restent compatibles avec l'existant (--accent, --bg,
 * --text, --muted, --border, --green/-light…) pour un drop-in sans casse.
 * Nouveaux tokens additifs : --text-2, --accent-50, palette BU (--bu-*).
 *
 *   <link rel="stylesheet" href="/lamarck-static/ds-tokens.css">
 */

/* ── Fonts ───────────────────────────────────────────────────────────
   Self-host woff2 (subset latin) servis par lamarck-shared sous
   /lamarck-static/fonts/. Aucun appel réseau tiers (perf + offline + RGPD).
   Schibsted Grotesk : UI + display (400-800). Spline Sans Mono : chiffres,
   codes (400-600). font-display:swap pour éviter le FOIT. */
@font-face { font-family:"Schibsted Grotesk"; font-style:normal; font-weight:400; font-display:swap; src:url("/lamarck-static/fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Schibsted Grotesk"; font-style:normal; font-weight:500; font-display:swap; src:url("/lamarck-static/fonts/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Schibsted Grotesk"; font-style:normal; font-weight:600; font-display:swap; src:url("/lamarck-static/fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Schibsted Grotesk"; font-style:normal; font-weight:700; font-display:swap; src:url("/lamarck-static/fonts/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family:"Schibsted Grotesk"; font-style:normal; font-weight:800; font-display:swap; src:url("/lamarck-static/fonts/schibsted-grotesk-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family:"Spline Sans Mono"; font-style:normal; font-weight:400; font-display:swap; src:url("/lamarck-static/fonts/spline-sans-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Spline Sans Mono"; font-style:normal; font-weight:500; font-display:swap; src:url("/lamarck-static/fonts/spline-sans-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Spline Sans Mono"; font-style:normal; font-weight:600; font-display:swap; src:url("/lamarck-static/fonts/spline-sans-mono-latin-600-normal.woff2") format("woff2"); }

/* ── LIGHT (défaut) ─────────────────────────────────────────────────── */
:root,
:root[data-theme="light"] {
  /* Surfaces & fond */
  --bg:          #f4f6fa;   /* fond applicatif, bleu-blanc tiède */
  --surface:     #ffffff;   /* cartes, top bar */
  --surface-2:   #eef1f7;   /* champs, hover discret, têtes de tableau */
  --surface-3:   #f7f9fc;   /* zébrures, fonds très légers */

  /* Lignes */
  --border:      #e6e9f0;   /* séparateurs, bordures cartes */
  --border-2:    #d7dce6;   /* bordures de champs, contrastées */

  /* Texte */
  --text:        #101826;   /* ink — titres */
  --text-2:      #3a4658;   /* corps de texte secondaire */
  --muted:       #6b7689;   /* labels, méta, placeholders */

  /* Marque */
  --accent:      #1f54cf;   /* bleu Lamarck raffiné */
  --accent-dark: #1742a8;   /* hover / pressed */
  --accent-light:#eef3ff;   /* fonds, états actifs (= --accent-50) */
  --accent-50:   #eef3ff;
  --accent-ring: rgba(31,84,207,.16); /* halo focus */

  /* Sémantique */
  --green:       #15924f;  --green-light:  #e7f5ee;
  --red:         #d23b3b;  --red-light:    #fcebeb;
  --amber:       #b7791f;  --amber-light:  #fff5e3;
  --info:        #1f54cf;  --info-light:   #eef3ff;

  /* Palette Business Units / agences (badges, dots, sparklines) */
  --bu-fi:  #3556c4;  --bu-fi-bg:  #e6ebfb;
  --bu-sol: #1f9d57;  --bu-sol-bg: #e3f6ec;
  --bu-ish: #e08a1e;  --bu-ish-bg: #fcf0dd;
  --bu-han: #d6457f;  --bu-han-bg: #fce6ef;
  --bu-key: #2f7bd6;  --bu-key-bg: #e4eefb;
  --bu-stf: #7a8699;  --bu-stf-bg: #eef0f4;
  --bu-ins: #caa12a;  --bu-ins-bg: #f9f1d6;

  /* Typo */
  --font:      "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rayons */
  --r-xs: 6px;
  --r:    10px;   /* champs, boutons */
  --r-md: 12px;   /* boutons larges, chips */
  --rl:   14px;   /* cartes */
  --r-xl: 18px;   /* modales, grandes surfaces */

  /* Ombres — douces, jamais lourdes */
  --sh-sm: 0 1px 2px rgba(16,24,38,.05), 0 1px 3px rgba(16,24,38,.04);
  --sh:    0 4px 14px rgba(16,24,38,.07), 0 2px 6px rgba(16,24,38,.04);
  --sh-lg: 0 12px 34px rgba(16,24,38,.12), 0 4px 12px rgba(16,24,38,.06);

  /* Échelle d'espacement (4px base) — à utiliser partout */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;

  color-scheme: light;
}

/* ── DARK ────────────────────────────────────────────────────────────
   Bleu marque éclairci pour rester lisible sur fond sombre, neutres
   bleutés (pas de gris pur), sémantique remontée en luminosité. */
:root[data-theme="dark"] {
  --bg:          #0c1018;
  --surface:     #141a26;
  --surface-2:   #1c2433;
  --surface-3:   #11192580;

  --border:      rgba(255,255,255,.09);
  --border-2:    rgba(255,255,255,.16);

  --text:        #e8edf6;
  --text-2:      #aeb8c9;
  --muted:       #828ea3;

  --accent:      #6f9bff;
  --accent-dark: #5b86f0;
  --accent-light:#1a2747;
  --accent-50:   #1a2747;
  --accent-ring: rgba(111,155,255,.22);

  --green:  #3fcf7f;  --green-light:  #11271c;
  --red:    #f0635c;  --red-light:    #2a1717;
  --amber:  #e3a93a;  --amber-light:  #2a2212;
  --info:   #6f9bff;  --info-light:   #1a2747;

  --bu-fi:  #7d96ec;  --bu-fi-bg:  #1c2747;
  --bu-sol: #56c98c;  --bu-sol-bg: #12301f;
  --bu-ish: #e7ab5b;  --bu-ish-bg: #322512;
  --bu-han: #ec7aa6;  --bu-han-bg: #341526;
  --bu-key: #6aa6ec;  --bu-key-bg: #16294a;
  --bu-stf: #9aa6ba;  --bu-stf-bg: #232a36;
  --bu-ins: #d8be62;  --bu-ins-bg: #2c2613;

  --sh-sm: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
  --sh:    0 4px 16px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.35);
  --sh-lg: 0 14px 40px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);

  color-scheme: dark;
}

/* ── Reset minimal ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-ring); }

/* Chiffres tabulaires partout où ça aligne (tableaux, KPIs) */
.tnum, .table td.num, .kpi-value, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
