/* ============================================================
   AI PLANNER — Design System v1 — tokens.css
   Source unique : couleurs, espacements, rayons, typo.
   Mode clair + sombre. Variables de marque overridables (branding).
   Regle : aucun hex en dur dans templates/JS — tout via var(--...).
   ============================================================ */

:root {
  /* --- MARQUE (override via settings.json > branding) --- */
  --brand-primary:        #0C447C;
  --brand-primary-strong: #042C53;
  --brand-secondary:      #185FA5;
  --brand-accent:         #6BC5D2;
  --brand-accent-soft:    #E1F2F5;
  --brand-mark:           #FFB546;
  --brand-surface:        #FAF8F1;

  /* --- SURFACES --- */
  --surface-page:   #F2EDE0;
  --surface-card:   #FFFFFF;
  --surface-raised: var(--brand-surface);
  --surface-sunken: #F8F5EC;

  /* --- TEXTE --- */
  --text-primary:   #262624;
  --text-secondary: #5F5E5A;
  --text-tertiary:  #888780;
  --text-on-brand:  #FFFFFF;
  --text-on-accent: #063E47;

  /* --- BORDURES --- */
  --border-soft:   #E5E2D9;
  --border-strong: #C8C5BC;

  /* --- STATUTS --- */
  --status-info:         #185FA5;
  --status-info-bg:      #E6F1FB;
  --status-info-text:    #0C447C;
  --status-success:      #3B6D11;
  --status-success-bg:   #EAF3DE;
  --status-success-text: #27500A;
  --status-warning:      #BA7517;
  --status-warning-bg:   #FAEEDA;
  --status-warning-text: #854F0B;
  --status-danger:       #A32D2D;
  --status-danger-bg:    #FCEBEB;
  --status-danger-text:  #791F1F;

  /* --- RAYONS --- */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-pill: 999px;

  /* --- ESPACEMENTS --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* --- TYPO ---
     LOT I point 2 : cet ancien systeme ("AI Planner v1") coexistait avec
     l'echelle 3a de kairos-theme.css (--ai-fs-*) - deux echelles actives en
     meme temps sur les memes ecrans, c'est la cause premiere de
     l'incoherence typographique constatee. Plutot que de traquer chaque
     template qui utilise encore var(--fs-*), on aliase ces variables SUR les
     6 tailles 3a : un seul jeu de valeurs reelles dans toute l'app, meme si
     les deux jeux de noms continuent d'exister pendant la migration
     progressive des templates. Ne plus ecrire de nouveau CSS avec --fs-* :
     utiliser directement --ai-fs-* (voir kairos-theme.css). */
  --font-sans: var(--ai-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --font-mono: var(--ai-mono, ui-monospace, "SF Mono", Menlo, monospace);
  --fs-xs:   var(--ai-fs-meta, 11.5px);   /* texte d'aide */
  --fs-sm:   var(--ai-fs-table, 12.5px);  /* libelle / dense */
  --fs-base: var(--ai-fs-body, 13.5px);   /* corps */
  --fs-md:   var(--ai-fs-h3, 14px);       /* titre de carte */
  --fs-lg:   var(--ai-fs-icon-md, 16px);  /* LOT K point 5 : dernier alias non tokenise ferme - inutilise dans les templates (verifie), icones/segments */
  --fs-xl:   var(--ai-fs-h2, 19px);       /* titre de section */
  --fs-2xl:  var(--ai-fs-h1, 27px);       /* titre de page */

  /* --- DIVERS --- */
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .05);
  --control-h:   37px;   /* hauteur unique boutons / champs / datepicker */
  --transition:  140ms ease;
}

[data-theme="dark"] {
  --brand-primary:        #2E6FB0;
  --brand-primary-strong: #1B4E86;
  --brand-secondary:      #4A8BCB;
  --brand-accent:         #4FA6B3;
  --brand-accent-soft:    #16323A;
  --brand-surface:        #242422;

  --surface-page:   #1A1A18;
  --surface-card:   #242422;
  --surface-raised: #2C2C2A;
  --surface-sunken: #1F1F1D;

  --text-primary:   #EDEBE4;
  --text-secondary: #A8A69E;
  --text-tertiary:  #7C7A73;
  --text-on-brand:  #FFFFFF;
  --text-on-accent: #DCF1F5;

  --border-soft:   #3A3A37;
  --border-strong: #4A4A46;

  --status-info-bg:      #12365C;
  --status-info-text:    #BFD8F0;
  --status-success-bg:   #1E3210;
  --status-success-text: #BFE08E;
  --status-warning-bg:   #3A2A0A;
  --status-warning-text: #E6C079;
  --status-danger-bg:    #3A1414;
  --status-danger-text:  #F0A8A8;

  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .4);
}
