/* ===========================================================================
   Administration du serveur de licence : les jetons du design system AvoCare
   ---------------------------------------------------------------------------
   Portes depuis static/ds-tokens.css (le poste) et la maquette de la console
   (mockups/serveur-monitoring.html), sous les MEMES noms : une couleur, une
   taille de police ou un rayon ne s'ecrit qu'ici. admin.css ne lit que des
   var(--ds-*) (tests/test_admin_revamp_gabarits.py le verifie).

   Aucun CDN (document 41, D41.2) : les polices sont servies par le serveur,
   depuis /actifs-admin/polices/, comme le poste les embarque.

   Clair par defaut ; l'ombre en option (:root[data-theme="sombre"]), posee
   par le bouton de la barre du haut et gardee dans un cookie sans secret.
   =========================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/actifs-admin/polices/inter-latin-400-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/actifs-admin/polices/inter-latin-500-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/actifs-admin/polices/inter-latin-600-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/actifs-admin/polices/inter-latin-700-normal.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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* L'arabe des donnees (noms de cabinet, collaborateurs) : IBM Plex Sans
   Arabic, la police arabe du poste, sur sa seule plage unicode. */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/actifs-admin/polices/plex-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE9F; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/actifs-admin/polices/plex-arabic-600-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE9F; }

:root {
  /* ── Marque : le bleu nuit et l'or d'AvoCare ─────────────────────────── */
  --ds-navy:        #0c1222;
  --ds-navy-600:    #162032;
  --ds-navy-500:    #1e2d47;
  --ds-navy-400:    #2a3f5f;
  --ds-navy-300:    #3d5a94;
  --ds-gold:        #c9a227;
  --ds-gold-light:  #e8cc6e;
  --ds-gold-dark:   #a68619;
  --ds-gold-dim:    rgba(201, 162, 39, 0.12);
  --ds-gold-text:   #7d6410;
  --ds-cream:       #fbf6e6;
  --ds-cream-border:#e6d291;

  /* La barre laterale reste bleu nuit dans les deux themes. */
  --ds-side-bg:     #0c1222;
  --ds-side-text:   #c0c9db;
  --ds-side-muted:  #8391ad;
  --ds-side-hover:  rgba(255, 255, 255, 0.06);
  --ds-side-line:   rgba(255, 255, 255, 0.08);
  --ds-side-actif:  rgba(201, 162, 39, 0.35);

  /* ── Fonds et surfaces (variante A du poste) ─────────────────────────── */
  --ds-bg:          #eae8e2;
  --ds-surface:     #f7f6f3;
  --ds-card:        #ffffff;
  --ds-surface-2:   #f4f3ef;
  --ds-surface-3:   #eae8e2;
  --ds-section-h-bg:#efeee9;

  /* ── Bordures ─────────────────────────────────────────────────────────── */
  --ds-border:        #e7e5df;
  --ds-border-light:  #f0eee9;
  --ds-border-strong: #cfccc3;
  --ds-scroll-thumb:  #85827b;

  /* ── Texte : trois niveaux ────────────────────────────────────────────── */
  --ds-text:         #1a1f2e;
  --ds-text-2:       #5a6478;
  --ds-text-3:       #5f687a;
  --ds-text-inverse: #ffffff;

  /* ── Accent : le bleu nuit porte l'action, l'or la marque ─────────────── */
  --ds-accent:        #1e3a6e;
  --ds-accent-hover:  #162d57;
  --ds-accent-dim:    rgba(30, 58, 110, 0.08);
  --ds-primary:       #162032;
  --ds-primary-hover: #1e2d47;
  --ds-primary-fg:    #ffffff;
  --ds-btn-icon:      #e8cc6e;
  --ds-link:          #1e3a6e;

  /* ── Couleurs semantiques : reservees au sens ─────────────────────────── */
  --ds-success:        #0d7c5f;
  --ds-success-bg:     #ecfdf5;
  --ds-success-border: #a7f3d0;
  --ds-warn:           #92400e;
  --ds-warn-bg:        #fffbeb;
  --ds-warn-border:    #fde68a;
  --ds-danger:         #c53030;
  --ds-danger-hover:   #9b2c2c;
  --ds-danger-bg:      #fef2f2;
  --ds-danger-border:  #fecaca;
  --ds-info:           #1e3a6e;
  --ds-info-bg:        #eff6ff;
  --ds-info-border:    #bfdbfe;
  --ds-category:       #6d28d9;
  --ds-category-bg:    #f5f0ff;
  --ds-neutral:        #5a6478;
  --ds-neutral-bg:     #f4f3ef;
  --ds-success-dot:    #10a37f;
  --ds-warn-dot:       #d98a0b;
  --ds-danger-dot:     #e04848;
  --ds-info-dot:       #3b6fd1;
  --ds-neutral-dot:    #9aa1af;

  /* Tuiles d'icone des cartes de chiffres. */
  --ds-tile-gold-bg:   #fbf1cf;  --ds-tile-gold-fg:   #7d6410;
  --ds-tile-blue-bg:   #e8effc;  --ds-tile-blue-fg:   #2c58a8;
  --ds-tile-green-bg:  #e6f6ef;  --ds-tile-green-fg:  #0d7c5f;
  --ds-tile-rose-bg:   #fdecef;  --ds-tile-rose-fg:   #b83256;
  --ds-tile-violet-bg: #f1ecfd;  --ds-tile-violet-fg: #6d28d9;

  /* ── Graphiques : marine et or, aucune couleur propre ─────────────────── */
  --ds-chart-1:     #1e2d47;
  --ds-chart-2:     #c9a227;
  --ds-chart-3:     #3d5a94;
  --ds-chart-4:     #e8cc6e;
  --ds-chart-grid:  #f0eee9;
  --ds-chart-texte: #5f687a;
  --ds-chart-danger:#c53030;

  /* ── Focus ────────────────────────────────────────────────────────────── */
  --ds-focus:        #1e3a6e;
  --ds-focus-ring:   0 0 0 3px rgba(30, 58, 110, 0.28);
  --ds-overlay:      rgba(12, 18, 34, 0.45);

  /* ── Espacements : echelle de 4 px ────────────────────────────────────── */
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-7: 32px;
  --ds-space-8: 40px;

  /* ── Typographie : sept niveaux ───────────────────────────────────────── */
  --ds-font:      "Inter", "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ds-font-mono: "Cascadia Mono", "JetBrains Mono", Consolas, ui-monospace, monospace;
  --ds-text-xs:     0.6875rem;  /* 11 px : micro-entete de tableau, mention */
  --ds-text-sm:     0.75rem;    /* 12 px : precision, legende */
  --ds-text-base:   0.875rem;   /* 14 px : corps, champs, cellules */
  --ds-text-md:     1rem;       /* 16 px : titre de carte */
  --ds-text-lg:     1.125rem;   /* 18 px : titre de section */
  --ds-text-xl:     1.875rem;   /* 30 px : titre de page */
  --ds-text-kpi:    1.75rem;    /* 28 px : grand chiffre */
  --ds-text-kpi-sm: 1.25rem;    /* 20 px : chiffre compact */
  --ds-text-code:   1.75rem;    /* le code a dicter (code de support, cle remise) */
  --ds-tracking-caps: 0.09em;
  --ds-weight-normal: 400;
  --ds-weight-medium: 500;
  --ds-weight-semi:   600;
  --ds-weight-bold:   700;
  --ds-leading-tight:  1.25;
  --ds-leading-normal: 1.5;

  /* ── Dimensions de controle ───────────────────────────────────────────── */
  --ds-control-h:         40px;
  --ds-control-h-compact: 32px;
  --ds-icon-btn:          34px;
  --ds-row-pad-y:         11px;
  --ds-card-pad:          20px;

  /* ── Rayons, ombres ───────────────────────────────────────────────────── */
  --ds-radius-sm:   6px;
  --ds-radius:      10px;
  --ds-radius-lg:   14px;
  --ds-radius-pill: 999px;
  --ds-shadow-sm: 0 1px 2px rgba(12, 18, 34, 0.04);
  --ds-shadow:    0 2px 8px rgba(12, 18, 34, 0.06);
  --ds-shadow-lg: 0 8px 24px rgba(12, 18, 34, 0.10);

  /* ── Structure ────────────────────────────────────────────────────────── */
  --ds-sidebar-w:  248px;
  --ds-topbar-h:   64px;
  --ds-page-pad-x: 28px;
  --ds-page-pad-y: 24px;
  --ds-form-max-w: 820px;
  --ds-content-max-w: 1440px;
  --ds-carte-w:    460px;

  /* ── Mouvement ────────────────────────────────────────────────────────── */
  --ds-duration-fast: 120ms;
  --ds-duration:      160ms;
  --ds-ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --ds-transition:    var(--ds-duration) var(--ds-ease);

  color-scheme: light;
}

/* ===========================================================================
   L'OMBRE : theme sombre, sur demande seulement
   =========================================================================== */
:root[data-theme="sombre"] {
  --ds-bg:          #0a0f1c;
  --ds-surface:     #111a2c;
  --ds-card:        #141c2e;
  --ds-surface-2:   #18223a;
  --ds-surface-3:   #1c2740;
  --ds-section-h-bg:#18223a;
  --ds-border:        #26324c;
  --ds-border-light:  #1c2740;
  --ds-border-strong: #34425f;
  --ds-scroll-thumb:  #4b5a78;
  --ds-text:    #e9edf5;
  --ds-text-2:  #a9b4c8;
  --ds-text-3:  #8f9bb1;
  --ds-accent:        #8fb3ff;
  --ds-accent-hover:  #b3cbff;
  --ds-accent-dim:    rgba(143, 179, 255, 0.12);
  --ds-primary:       #c9a227;
  --ds-primary-hover: #e8cc6e;
  --ds-primary-fg:    #0c1222;
  --ds-btn-icon:      #0c1222;
  --ds-link:          #8fb3ff;
  --ds-gold-text:     #e8cc6e;
  --ds-cream:         rgba(201, 162, 39, 0.10);
  --ds-cream-border:  rgba(201, 162, 39, 0.40);
  --ds-success:        #3fd0a3;
  --ds-success-bg:     rgba(13, 124, 95, 0.18);
  --ds-success-border: rgba(63, 208, 163, 0.35);
  --ds-warn:           #f2c14e;
  --ds-warn-bg:        rgba(146, 64, 14, 0.22);
  --ds-warn-border:    rgba(242, 193, 78, 0.35);
  --ds-danger:         #f28b82;
  --ds-danger-hover:   #f6aca5;
  --ds-danger-bg:      rgba(197, 48, 48, 0.18);
  --ds-danger-border:  rgba(242, 139, 130, 0.35);
  --ds-info:           #8fb3ff;
  --ds-info-bg:        rgba(30, 58, 110, 0.30);
  --ds-info-border:    rgba(143, 179, 255, 0.30);
  --ds-category:       #b69cff;
  --ds-category-bg:    rgba(109, 40, 217, 0.20);
  --ds-neutral:        #a9b4c8;
  --ds-neutral-bg:     #1c2740;
  --ds-tile-gold-bg:   rgba(201, 162, 39, 0.16);  --ds-tile-gold-fg:   #e8cc6e;
  --ds-tile-blue-bg:   rgba(59, 111, 209, 0.20);  --ds-tile-blue-fg:   #8fb3ff;
  --ds-tile-green-bg:  rgba(13, 124, 95, 0.22);   --ds-tile-green-fg:  #3fd0a3;
  --ds-tile-rose-bg:   rgba(184, 50, 86, 0.22);   --ds-tile-rose-fg:   #f59ab3;
  --ds-tile-violet-bg: rgba(109, 40, 217, 0.22);  --ds-tile-violet-fg: #b69cff;
  --ds-chart-1:     #8fb3ff;
  --ds-chart-3:     #5d7fc4;
  --ds-chart-grid:  #1c2740;
  --ds-chart-texte: #8f9bb1;
  --ds-chart-danger:#f28b82;
  --ds-focus:       #e8cc6e;
  --ds-focus-ring:  0 0 0 3px rgba(232, 204, 110, 0.35);
  --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --ds-shadow:    0 2px 10px rgba(0, 0, 0, 0.35);
  --ds-shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.50);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root { --ds-duration-fast: 1ms; --ds-duration: 1ms; }
}
