/* Anonari Apps — Design tokens
   ---------------------------------------------------------------------------
   Seule source des valeurs visuelles des Apps (app.anonari.fr). Aucune autre
   feuille ne doit contenir de couleur, rayon, ombre ou taille de police en dur :
   elles consomment ces variables.

   Indépendant de la console Anonari (anonari.fr, thème sombre) : modifier l'une
   ne touche pas l'autre. Référence : maquettes « Anonari Apps Redesign »,
   « Home V2 » et « Fiche Tiers 360 » — fond clair chaud, cartes blanches,
   Hanken Grotesk à chiffres tabulaires, JetBrains Mono pour les identifiants.

   Points de rupture (les variables CSS ne sont pas utilisables dans @media,
   ils sont donc documentés ici et repris tels quels dans layout.css) :
     mobile  < 640px    une colonne, KPI en 2 colonnes, barre de navigation haute
     tablet  < 900px    sidebar remplacée par la barre haute, grilles en 2 colonnes
     laptop  < 1280px   réduction progressive des colonnes
     desktop ≥ 1280px   sidebar persistante, grille riche (3 cartes d'App)        */

@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  /* ── Neutres ─────────────────────────────────────────────────────────── */
  --ax-bg:            oklch(0.975 0.004 85);   /* fond de page, chaud */
  --ax-bg-sidebar:    oklch(0.985 0.003 85);
  --ax-bg-sunken:     oklch(0.965 0.004 85);   /* contrôles, bandeaux internes */
  --ax-bg-hover:      oklch(0.95 0.004 85);
  --ax-surface:       #fff;                    /* cartes */
  --ax-fill:          oklch(0.94 0.004 260);   /* pastilles neutres, squelettes */
  --ax-fill-soft:     oklch(0.96 0.004 260);
  --ax-line:          oklch(0.92 0.005 260);   /* bordures de carte */
  --ax-line-soft:     oklch(0.95 0.004 260);   /* séparateurs internes */
  --ax-line-strong:   oklch(0.88 0.006 260);   /* bordures de contrôle */
  --ax-track:         oklch(0.80 0.01 260);    /* barre « brute », piste */
  --ax-ink:           oklch(0.23 0.01 260);    /* texte principal */
  --ax-ink-2:         oklch(0.40 0.012 260);   /* texte secondaire appuyé */
  --ax-muted:         oklch(0.48 0.012 260);   /* texte secondaire */
  --ax-faint:         oklch(0.60 0.01 260);    /* flèches, séparateurs typographiques */
  --ax-disabled:      oklch(0.60 0.01 260);

  /* ── Marque / action ─────────────────────────────────────────────────── */
  --ax-action:        oklch(0.36 0.07 165);    /* bouton primaire : seul usage du vert */
  --ax-action-hover:  oklch(0.31 0.07 165);
  --ax-link:          oklch(0.42 0.08 165);
  --ax-link-hover:    oklch(0.32 0.08 165);
  --ax-action-soft:   oklch(0.93 0.03 165);
  --ax-focus:         oklch(0.42 0.08 165);

  /* ── Statuts : même luminance, teinte variable. Toujours doublés d'un
        libellé ou d'une flèche (jamais la couleur seule). ──────────────── */
  --ax-positive:      oklch(0.58 0.13 155);
  --ax-positive-ink:  oklch(0.40 0.10 155);
  --ax-positive-bg:   oklch(0.95 0.03 155);
  --ax-warning:       oklch(0.68 0.13 70);
  --ax-warning-ink:   oklch(0.45 0.10 70);
  --ax-warning-bg:    oklch(0.95 0.035 70);
  --ax-negative:      oklch(0.58 0.13 25);
  --ax-negative-ink:  oklch(0.45 0.13 25);
  --ax-negative-strong: oklch(0.42 0.14 25);
  --ax-negative-bg:   oklch(0.95 0.03 25);
  --ax-negative-surface: oklch(0.985 0.008 25);
  --ax-negative-line: oklch(0.88 0.04 25);
  --ax-info:          oklch(0.58 0.13 265);
  --ax-info-ink:      oklch(0.42 0.12 265);
  --ax-info-bg:       oklch(0.95 0.03 265);
  --ax-neutral:       oklch(0.70 0.01 260);
  --ax-neutral-ink:   oklch(0.40 0.012 260);
  --ax-neutral-bg:    oklch(0.94 0.004 260);

  /* ── Domaines de contexte métier (tags à coins 6 px) ─────────────────── */
  --ax-dom-finance:        oklch(0.58 0.13 265);
  --ax-dom-finance-ink:    oklch(0.42 0.12 265);
  --ax-dom-finance-bg:     oklch(0.96 0.02 265);
  --ax-dom-commercial:     oklch(0.58 0.13 305);
  --ax-dom-commercial-ink: oklch(0.43 0.12 305);
  --ax-dom-commercial-bg:  oklch(0.96 0.02 305);
  --ax-dom-operational:    oklch(0.58 0.11 195);
  --ax-dom-operational-ink: oklch(0.40 0.08 195);
  --ax-dom-operational-bg: oklch(0.96 0.02 195);
  --ax-dom-relation:       oklch(0.62 0.13 45);
  --ax-dom-relation-ink:   oklch(0.45 0.12 45);
  --ax-dom-relation-bg:    oklch(0.96 0.02 45);
  --ax-dom-signal:         oklch(0.60 0.14 350);
  --ax-dom-signal-ink:     oklch(0.45 0.13 350);
  --ax-dom-signal-bg:      oklch(0.96 0.02 350);
  --ax-anomaly-halo:       oklch(0.88 0.08 70);

  /* ── Teintes dérivées (états d'alerte, bandeaux, verbes) ─────────────── */
  --ax-verb-negative: oklch(0.48 0.15 25);
  --ax-verb-warning: oklch(0.50 0.12 45);
  --ax-verb-positive: oklch(0.45 0.11 155);
  --ax-residual-bg: oklch(0.97 0.015 25);
  --ax-residual-line: oklch(0.92 0.02 25);
  --ax-alert-row: oklch(0.99 0.006 25);
  --ax-alert-row-hover: oklch(0.98 0.01 25);
  --ax-info-line: oklch(0.85 0.05 265);
  --ax-info-surface: oklch(0.985 0.008 265);
  /* Voile derrière un panneau modal (éditeur de dashboard). */
  --ax-scrim: oklch(0.2 0.01 260 / 0.28);
  --ax-late-legend: oklch(0.58 0.13 25 / 0.12);
  --ax-late-band: oklch(0.58 0.13 25 / 0.07);
  --ax-story-bg: oklch(0.97 0.012 265);
  --ax-error-panel: oklch(0.975 0.012 25);
  --ax-error-line: oklch(0.92 0.03 25);
  --ax-shadow-control-color: oklch(0.2 0.01 260 / 0.1);
  --ax-note-bg: oklch(0.985 0.006 265);
  --ax-note-line: oklch(0.92 0.025 265);

  /* ── Catégories d'application (badge, fond d'aperçu, série principale) ─ */
  --ax-cat-collections:    155;   /* Encaissements */
  --ax-cat-risk:           25;    /* Risque */
  --ax-cat-forecast:       265;   /* Prévision */
  --ax-cat-anomalies:      70;    /* Anomalies */
  --ax-cat-reminders:      305;   /* Relance / actions */
  --ax-cat-thirdparty:     210;   /* Tiers */
  --ax-cat-default:        260;

  /* ── Séries de graphiques (ordre stable) ─────────────────────────────── */
  --ax-series-0: oklch(0.52 0.13 155);
  --ax-series-1: oklch(0.58 0.13 265);
  --ax-series-2: oklch(0.68 0.13 70);
  --ax-series-3: oklch(0.58 0.13 305);
  --ax-series-4: oklch(0.58 0.11 195);
  --ax-grid-line: oklch(0.94 0.004 260);
  --ax-axis-line: oklch(0.85 0.006 260);

  /* ── Typographie ─────────────────────────────────────────────────────── */
  --ax-font:      'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ax-font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ax-fs-h1:      clamp(30px, 3.2vw, 42px);  /* H1 · 42/650 */
  --ax-fs-h1-page: clamp(26px, 2.6vw, 34px);  /* H1 de page détail · 34/650 */
  --ax-fs-kpi:     28px;                      /* KPI · 28-30/650 */
  --ax-fs-h2:      19px;                      /* H2 · 19/600 */
  --ax-fs-card:    18px;                      /* titre de carte · 18/600 */
  --ax-fs-lead:    16px;
  --ax-fs-body:    15px;                      /* corps · 15/400 */
  --ax-fs-ui:      14px;
  --ax-fs-label:   13px;                      /* label · 13/500 */
  --ax-fs-small:   12.5px;
  --ax-fs-xs:      12px;
  --ax-fs-xxs:     11px;
  --ax-fw-regular: 400;
  --ax-fw-medium:  500;
  --ax-fw-semi:    600;
  --ax-fw-strong:  650;
  --ax-fw-bold:    700;
  --ax-tracking-tight: -0.02em;
  --ax-tracking-caps:  0.04em;

  /* ── Espacements · base 4 ────────────────────────────────────────────── */
  --ax-s1: 4px;  --ax-s2: 8px;  --ax-s3: 12px; --ax-s4: 16px;
  --ax-s5: 20px; --ax-s6: 24px; --ax-s8: 32px; --ax-s11: 44px; --ax-s12: 48px;

  /* ── Rayons ──────────────────────────────────────────────────────────── */
  --ax-r-xs:   5px;    /* mini-tags d'aperçu */
  --ax-r-sm:   6px;    /* contrôle, tag de contexte */
  --ax-r-md:   10px;   /* bouton, aperçu */
  --ax-r-lg:   14px;   /* KPI, carte compacte */
  --ax-r-xl:   16px;   /* carte */
  --ax-r-2xl:  20px;   /* bloc éditorial (« ce qui change la lecture ») */
  --ax-r-pill: 999px;

  /* ── Ombres (très légères) ───────────────────────────────────────────── */
  --ax-shadow-xs:    0 1px 2px oklch(0.2 0.01 260 / 0.04);
  --ax-shadow-sm:    0 1px 2px oklch(0.2 0.01 260 / 0.06), 0 0 0 1px var(--ax-line);
  --ax-shadow-hover: 0 14px 32px -14px oklch(0.25 0.03 260 / 0.25);
  --ax-shadow-lift:  0 1px 2px oklch(0.2 0.01 260 / 0.04), 0 20px 40px -32px oklch(0.25 0.03 260 / 0.25);

  /* ── Mise en page ────────────────────────────────────────────────────── */
  --ax-sidebar-w:  248px;
  --ax-main-max:   1280px;
  --ax-control-h:  40px;
  --ax-touch:      44px;   /* cible tactile minimale */
  --ax-ease:       .18s ease;
}
