/* 1arc — Design tokens. Sobre, dense, un seul accent. Clair + sombre. Accent client surchargeable (contraste AA garanti via ui.js applyAccent).
   Base d'espacement 4px · Inter (chargée par la page) · chiffres tabulaires pour les données. */
:root {
  /* Marque */
  --navy: #0f2338;
  --accent: #ef8500;          /* accent par défaut (logo 1arc) — surchargé par le client */
  --accent-ink: #b35e00;      /* accent lisible sur fond clair (texte/liens) */
  --accent-contrast: #0f2338; /* texte sur aplat d'accent orange par défaut (navy = 6.4:1 ; applyAccent recalcule par client) */

  /* Surfaces (clair) */
  --bg: #ffffff;
  --bg-sunken: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f1f5f9;
  --overlay: rgba(15, 35, 56, .42);

  /* Texte */
  --ink: #0f2338;
  --ink-2: #41566b;
  --ink-3: #5f7082;    /* texte tertiaire — ≥4.5:1 sur --bg (AA) */
  --on-accent: var(--accent-contrast);

  /* Lignes */
  --line: #e4e9f0;
  --line-2: #eef2f7;
  --focus: var(--accent);

  /* Sémantique risque (identique partout : tables, badges, graphes, PDF) */
  --ok: #0f8a5f;      --ok-bg: #e7f5ee;   --ok-ink: #0c6b4a;
  --warn: #9a5b00;    --warn-bg: #fdf1dd;  --warn-ink: #7a4800;
  --bad: #c4372c;     --bad-bg: #fbe9e7;   --bad-ink: #9d2b22;
  --info: #2a5bd7;    --info-bg: #eaf0fe;  --info-ink: #1f46ab;
  --neutral: #64748b; --neutral-bg: #eef2f6;

  /* Rayons (4–8px, bords fins plutôt qu'ombres) */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-pill: 999px;

  /* Ombres (discrètes, fonctionnelles) */
  --shadow-1: 0 1px 2px rgba(15, 35, 56, .06), 0 1px 3px rgba(15, 35, 56, .04);
  --shadow-2: 0 6px 16px -6px rgba(15, 35, 56, .18);
  --shadow-pop: 0 14px 40px -12px rgba(15, 35, 56, .28);

  /* Typo — une seule famille, 4–5 tailles */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --num: "Inter", ui-monospace, monospace; /* via font-variant-numeric: tabular-nums */
  --t-xs: 11.5px; --t-sm: 13px; --t-md: 14px; --t-lg: 16px; --t-xl: 20px; --t-2xl: 26px; --t-3xl: 34px;
  --lh: 1.5; --lh-tight: 1.25;

  /* Espacement (base 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* Divers */
  --tap: 24px;                /* cible minimale */
  --dur: 150ms;
  --ease: cubic-bezier(.2, .6, .2, 1);
  --header-h: 56px;
  --side-w: 232px;
}

/* ---- Sombre ---- */
:root[data-theme="dark"] {
  --bg: #0c1623;
  --bg-sunken: #0a1420;
  --surface: #11202f;
  --surface-2: #152636;
  --surface-hover: #1b2e40;
  --overlay: rgba(0, 0, 0, .58);

  --ink: #eaf1f8;
  --ink-2: #aebccb;
  --ink-3: #8294a6;
  --accent-ink: #ffb25a;      /* accent lisible sur fond sombre */

  --line: #24364a;
  --line-2: #1c2d3f;

  --ok: #37b483;  --ok-bg: #112a22;  --ok-ink: #5ccfa0;
  --warn: #d79a3a; --warn-bg: #2c2112; --warn-ink: #e8b45f;
  --bad: #e5675b; --bad-bg: #2d1514; --bad-ink: #f2897e;
  --info: #6c9cff; --info-bg: #141f33; --info-ink: #9bbcff;
  --neutral: #8294a6; --neutral-bg: #1a2a3a;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 20px -8px rgba(0, 0, 0, .55);
  --shadow-pop: 0 16px 44px -12px rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1623; --bg-sunken: #0a1420; --surface: #11202f; --surface-2: #152636; --surface-hover: #1b2e40; --overlay: rgba(0,0,0,.58);
    --ink: #eaf1f8; --ink-2: #aebccb; --ink-3: #8294a6; --accent-ink: #ffb25a;
    --line: #24364a; --line-2: #1c2d3f;
    --ok: #37b483; --ok-bg: #112a22; --ok-ink: #5ccfa0; --warn: #d79a3a; --warn-bg: #2c2112; --warn-ink: #e8b45f;
    --bad: #e5675b; --bad-bg: #2d1514; --bad-ink: #f2897e; --info: #6c9cff; --info-bg: #141f33; --info-ink: #9bbcff; --neutral: #8294a6; --neutral-bg: #1a2a3a;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 20px -8px rgba(0,0,0,.55); --shadow-pop: 0 16px 44px -12px rgba(0,0,0,.6);
  }
}
@media (prefers-reduced-motion: reduce) { :root { --dur: 0ms; } }
