/* NutriSaaS — Theme (passe design 2026-10) : jetons de couleur, typographie,
   contrastes AA (clair ET sombre), mouvements et prefers-reduced-motion.
   Charge APRES les autres feuilles : il corrige les couleurs ecrites en dur
   (styles inline du HTML et du JS) sans toucher a la logique.
   Mise en page (en-tete, onglets, colonne patients, barre basse) : shell.css. */

/* ---------- Jetons ---------- */
:root {
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --hover: rgba(15, 23, 42, .055);
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --field-line: #8592a6;       /* bord de champ : 3,1:1 sur blanc */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #5b6b80;            /* 5:1 sur #f1f5f9, 5,4:1 sur blanc */
  --placeholder: #64748b;
  --brand: #15803d;            /* texte blanc dessus : 5:1 (l'ancien #16a34a faisait 3,3:1) */
  --brand-hover: #166534;
  --brand-ink: #15803d;
  --brand-soft: #f0fdf4;
  --brand-soft-line: #bbf7d0;
  --seg-bg: #e8edf2;
  --seg-on: #ffffff;
  --focus: #15803d;
  --danger-ink: #b91c1c;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --r-card: 12px;
  --r-ctl: 8px;
}
.dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #172234;
  --hover: rgba(148, 163, 184, .14);
  --line: #334155;
  --line-strong: #475569;
  --field-line: #64748b;       /* 3:1 sur la carte #1e293b */
  --ink: #f1f5f9;
  --ink-2: #cbd5e1;
  --muted: #a3b1c4;            /* 6,7:1 sur #1e293b */
  --placeholder: #8392a7;
  --brand-ink: #4ade80;
  --brand-soft: rgba(34, 197, 94, .13);
  --brand-soft-line: rgba(74, 222, 128, .38);
  --seg-bg: #0f172a;
  --seg-on: #2b3a52;
  --focus: #4ade80;
  --danger-ink: #fca5a5;
  color-scheme: dark;
}

/* ---------- Typographie ----------
   IBM Plex Sans : grotesque au dessin reconnaissable (a, g, t, r) mais sobre,
   tres lisible en petite taille, chiffres tabulaires et zero sans barre.
   Une seule famille : titres en 600/700, texte en 400/500. Chiffres
   tabulaires sur toutes les valeurs (poids, kcal, IMC, tableaux). */
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-ui); font-feature-settings: "kern"; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, .sh { letter-spacing: -.01em; }
.inp, table, #cv-meta, #cv-health-score, #dash-score-val, [id^="dash-kpi"], #kpi-grid,
#aetq-row, .kpi-v, .sb-item-meta, #mesure-table, #ration-table, #d-aetq, #d-mb, #d-dej,
#d-nap, #d-imc, #d-img, [id^="d-g-"], .num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Surfaces du navigateur ---------- */
::selection { background: #bbf7d0; color: #14532d; }
.dark ::selection { background: #166534; color: #f0fdf4; }
:where(button, a, [role="button"], summary, .tnav, .bnav-btn):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--brand); }

/* ---------- Champs ---------- */
.inp { border-color: var(--field-line); }
.inp::placeholder { color: var(--placeholder); opacity: 1; }
.inp:hover:not(:focus):not(:disabled) { border-color: var(--ink-2); }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 128, 61, .18); }
.dark .inp { background: #0f172a; border-color: var(--field-line); color: #e2e8f0; }
.dark .inp:hover:not(:focus):not(:disabled) { border-color: #94a3b8; }
.dark .inp:focus { border-color: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }
.inp:disabled { opacity: .7; cursor: not-allowed; }

/* ---------- Vert de marque accessible ----------
   Le vert #16a34a est ecrit en dur dans des dizaines de styles inline (HTML et JS).
   Texte blanc dessus = 3,3:1 (echec AA) ; texte vert sur blanc = 3,3:1 aussi.
   On le remplace partout par #15803d (5:1) sans toucher au JS.
   Formes couvertes : attribut ecrit a la main (#16a34a) et style pose par JS,
   que le navigateur reecrit en rgb(22, 163, 74). "color:" est cherche en debut
   d'attribut ou apres ";" pour ne pas attraper background-color / border-color. */
[style*="background:#16a34a"], [style*="background: #16a34a"],
[style*="background-color:#16a34a"], [style*="background: rgb(22, 163, 74)"],
[style*="background-color: rgb(22, 163, 74)"],
.bg-green-600 {
  background-color: var(--brand) !important;
}
button[style*="background:#16a34a"]:hover, button[style*="background: rgb(22, 163, 74)"]:hover,
.bg-green-600:hover, .hover\:bg-green-700:hover { background-color: var(--brand-hover) !important; }
.shadow-green-200 { --tw-shadow-color: rgba(21, 128, 61, .18) !important; }
[style^="color:#16a34a"], [style*=";color:#16a34a"], [style*="; color:#16a34a"],
[style^="color: rgb(22, 163, 74)"], [style*="; color: rgb(22, 163, 74)"],
.text-green-600 {
  color: var(--brand-ink) !important;
}
/* Orange #ea580c (3,6:1) et bleu #0284c7 (4,1:1) en texte : un cran plus fonce. */
[style^="color:#ea580c"], [style*=";color:#ea580c"], [style*="; color:#ea580c"],
[style^="color: rgb(234, 88, 12)"], [style*="; color: rgb(234, 88, 12)"] { color: #c2410c !important; }
[style^="color:#0284c7"], [style*=";color:#0284c7"], [style*="; color:#0284c7"] { color: #0369a1 !important; }
[style^="color:#d97706"], [style*=";color:#d97706"], [style*="; color:#d97706"],
[style^="color: rgb(217, 119, 6)"], [style*="; color: rgb(217, 119, 6)"] { color: #b45309 !important; }
[style^="color:#ef4444"], [style*=";color:#ef4444"], [style*="; color:#ef4444"],
[style^="color: rgb(239, 68, 68)"], [style*="; color: rgb(239, 68, 68)"], .text-red-500 { color: var(--danger-ink) !important; }
.dark [style^="color:#ea580c"], .dark [style*=";color:#ea580c"], .dark [style*="; color:#ea580c"],
.dark [style^="color: rgb(234, 88, 12)"], .dark [style*="; color: rgb(234, 88, 12)"] { color: #fdba74 !important; }
.dark [style^="color:#0284c7"], .dark [style*=";color:#0284c7"], .dark [style*="; color:#0284c7"] { color: #7dd3fc !important; }
.dark [style^="color:#d97706"], .dark [style*=";color:#d97706"], .dark [style*="; color:#d97706"],
.dark [style^="color: rgb(217, 119, 6)"], .dark [style*="; color: rgb(217, 119, 6)"] { color: #fcd34d !important; }

/* Gris #94a3b8 en texte sur fond clair = 2,6:1. En clair il passe a --muted ;
   en sombre il reste (6,9:1 sur #0f172a). */
html:not(.dark) [style^="color:#94a3b8"], html:not(.dark) [style*=";color:#94a3b8"],
html:not(.dark) [style*="; color:#94a3b8"], html:not(.dark) [style^="color: rgb(148, 163, 184)"],
html:not(.dark) [style*="; color: rgb(148, 163, 184)"],
html:not(.dark) .text-slate-400 { color: var(--muted) !important; }
html:not(.dark) [style*="color:#64748b"], html:not(.dark) [style*="color: #64748b"] { color: #556377 !important; }
.kpi-l { color: var(--muted) !important; }

/* ---------- Mode sombre : corrections ----------
   Les regles generiques de dark-mode.css ne voient pas les styles poses par JS
   (reecrits en rgb()). Celles-ci couvrent ce qui restait illisible. */
.dark body, .dark main, .dark #main-area { background: var(--bg) !important; }
.dark .txt2 { color: var(--muted) !important; }
.dark .lbl { color: #b4c0d0; }
.dark [style*="color: rgb(71, 85, 105)"], .dark [style*="color: rgb(100, 116, 139)"],
.dark [style*="color: rgb(55, 65, 81)"], .dark [style*="color: rgb(15, 23, 42)"],
.dark [style*="color: rgb(30, 41, 59)"] { color: var(--ink-2) !important; }
.dark [style*="color:#1e293b"], .dark [style*="color: #1e293b"],
.dark [style*="color:#166534"], .dark [style*="color:#14532d"] { color: var(--ink) !important; }
.dark [style*="background: rgb(248, 250, 252)"], .dark [style*="background-color: rgb(248, 250, 252)"],
.dark [style*="background: rgb(255, 255, 255)"], .dark [style*="background-color: rgb(255, 255, 255)"],
.dark [style*="background: rgb(241, 245, 249)"], .dark [style*="background-color: rgb(241, 245, 249)"] {
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
}
.dark [style*="border:1px solid #e2e8f0"], .dark [style*="border: 1px solid rgb(226, 232, 240)"],
.dark [style*="border-bottom:1px solid #e2e8f0"], .dark [style*="border-top:1px solid #f1f5f9"],
.dark [style*="border-bottom:1px solid #f1f5f9"] { border-color: var(--line) !important; }
.dark .text-slate-400, .dark #login-screen .text-slate-400 { color: #a3b1c4 !important; }
.dark .text-slate-500 { color: #a3b1c4 !important; }
.dark .text-slate-600 { color: #cbd5e1 !important; }
.dark .text-slate-700, .dark .text-slate-800, .dark .text-slate-900 { color: #e2e8f0 !important; }
.dark .bg-white { background-color: var(--surface) !important; }
.dark .bg-slate-100, .dark .bg-slate-50 { background-color: #0f172a !important; }
.dark .border-slate-100, .dark .border-slate-200 { border-color: var(--line) !important; }
.dark .btn-neutral { background: #263347; color: #e2e8f0; border-color: #475569; }
.dark .btn-neutral:hover { background: #2f3e55; }
.dark .acc-chevron { color: #cbd5e1; }
.dark .dtab { background: #0f172a; border-color: #475569; color: #cbd5e1; }
.dark .dtab:hover { border-color: #94a3b8; color: #f1f5f9; }
.dtab.on, .dark .dtab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.dark .tgl { background: #475569; }
.dark .tgl.on { background: var(--brand); }
.dark .bg-ok { background: rgba(34, 197, 94, .14); color: #86efac; }
.dark .bg-w { background: rgba(234, 179, 8, .14); color: #fde047; }
.dark .bg-o { background: rgba(249, 115, 22, .14); color: #fdba74; }
.dark .bg-r { background: rgba(239, 68, 68, .14); color: #fca5a5; }
.dark .dark-banner { background: #10291d !important; border-color: #1f5135 !important; }
.dark-banner { background: var(--brand-soft); border-color: var(--brand-soft-line); }

/* Tonalites du score sante (data-tone pose par clients.js) : couleurs AA en clair et en sombre. */
[data-tone="good"] { --tone-fg: #166534; --tone-bg: #f0fdf4; --tone-line: #bbf7d0; }
[data-tone="ok"]   { --tone-fg: #047857; --tone-bg: #ecfdf5; --tone-line: #a7f3d0; }
[data-tone="warn"] { --tone-fg: #92400e; --tone-bg: #fffbeb; --tone-line: #fde68a; }
[data-tone="bad"]  { --tone-fg: #b91c1c; --tone-bg: #fef2f2; --tone-line: #fecaca; }
[data-tone="na"]   { --tone-fg: #475569; --tone-bg: #f1f5f9; --tone-line: #cbd5e1; }
.dark [data-tone="good"] { --tone-fg: #86efac; --tone-bg: rgba(34, 197, 94, .13); --tone-line: rgba(134, 239, 172, .35); }
.dark [data-tone="ok"]   { --tone-fg: #6ee7b7; --tone-bg: rgba(16, 185, 129, .13); --tone-line: rgba(110, 231, 183, .35); }
.dark [data-tone="warn"] { --tone-fg: #fcd34d; --tone-bg: rgba(245, 158, 11, .13); --tone-line: rgba(252, 211, 77, .35); }
.dark [data-tone="bad"]  { --tone-fg: #fca5a5; --tone-bg: rgba(239, 68, 68, .13); --tone-line: rgba(252, 165, 165, .35); }
.dark [data-tone="na"]   { --tone-fg: #cbd5e1; --tone-bg: rgba(148, 163, 184, .12); --tone-line: #475569; }
#cv-health-score[data-tone], #dash-health-badge[data-tone] {
  color: var(--tone-fg) !important;
  background-color: var(--tone-bg) !important;
  border-color: var(--tone-line) !important;
}
#dash-score-status[data-tone], #dash-kpi-qstatus[data-tone],
#dash-score-piliers[data-tone] .hs-pts { color: var(--tone-fg) !important; }
#dash-score-piliers .hs-na { color: var(--muted) !important; }

/* Sauvegarde automatique (couleurs posees par api.js). */
#autosave-status[style*="rgb(22, 163, 74)"] { color: var(--brand-ink) !important; }
#autosave-status[style*="rgb(239, 68, 68)"] { color: var(--danger-ink) !important; }
#autosave-status[style*="rgb(234, 88, 12)"] { color: #c2410c !important; }
.dark #autosave-status[style*="rgb(234, 88, 12)"] { color: #fdba74 !important; }

/* ---------- Mouvement ----------
   Un seul geste par ecran : l'entree d'onglet (fondu + 6 px), avec un leger
   decalage des blocs. Modales, tiroir et toasts : courts (160-240 ms),
   courbe exponentielle de sortie. Tout est coupe si l'utilisateur demande
   moins d'animations (prefers-reduced-motion). */
@keyframes nsTabIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nsModalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes nsDrawerIn { from { opacity: .4; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes nsToastIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

.anim-in { animation: nsTabIn .18s ease both; }
.anim-in > .card, .anim-in > .dark-banner, .anim-in > .acc-card, .anim-in > div {
  animation: nsTabIn .2s ease both;
}
.anim-in > :nth-child(2) { animation-delay: .02s; }
.anim-in > :nth-child(3) { animation-delay: .04s; }
.anim-in > :nth-child(4) { animation-delay: .06s; }
.anim-in > :nth-child(n+5) { animation-delay: .08s; }
.overlay { animation: nsFade .16s ease; backdrop-filter: none; background: rgba(15, 23, 42, .55); }
.overlay > .mbox { animation: nsModalIn .2s ease; }
.toast { animation: nsToastIn .2s ease forwards; }
.card { transition: border-color .18s ease, box-shadow .18s ease; }
.card:hover { box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
button { transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .18s; transition-timing-function: ease; }
button:not(:disabled):active { transform: translateY(1px); }
.bubble-pulse { animation-iteration-count: 3; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .float-anim, .bubble-pulse { animation: none !important; }
  button:not(:disabled):active { transform: none; }
}

/* ---------- Teintes de texte restantes (audit de contraste 2026-10) ----------
   Couleurs ecrites en dur dans le HTML genere par JS (infographie, tableaux, score). */
html:not(.dark) [style^="color:#059669"],
html:not(.dark) [style*=";color:#059669"],
html:not(.dark) [style*="; color:#059669"],
html:not(.dark) [style*="; color: #059669"],
html:not(.dark) [style^="color: rgb(5, 150, 105)"],
html:not(.dark) [style*="; color: rgb(5, 150, 105)"] { color: #047857 !important; }
html:not(.dark) [style^="color:#9ca3af"],
html:not(.dark) [style*=";color:#9ca3af"],
html:not(.dark) [style*="; color:#9ca3af"],
html:not(.dark) [style*="; color: #9ca3af"],
html:not(.dark) [style^="color: rgb(156, 163, 175)"],
html:not(.dark) [style*="; color: rgb(156, 163, 175)"] { color: var(--muted) !important; }
html:not(.dark) [style^="color:#6b7280"],
html:not(.dark) [style*=";color:#6b7280"],
html:not(.dark) [style*="; color:#6b7280"],
html:not(.dark) [style*="; color: #6b7280"],
html:not(.dark) [style^="color: rgb(107, 114, 128)"],
html:not(.dark) [style*="; color: rgb(107, 114, 128)"] { color: #4b5563 !important; }
html:not(.dark) [style^="color:#3b82f6"],
html:not(.dark) [style*=";color:#3b82f6"],
html:not(.dark) [style*="; color:#3b82f6"],
html:not(.dark) [style*="; color: #3b82f6"],
html:not(.dark) [style^="color: rgb(59, 130, 246)"],
html:not(.dark) [style*="; color: rgb(59, 130, 246)"] { color: #1d4ed8 !important; }
html:not(.dark) [style^="color:#22c55e"],
html:not(.dark) [style*=";color:#22c55e"],
html:not(.dark) [style*="; color:#22c55e"],
html:not(.dark) [style*="; color: #22c55e"],
html:not(.dark) [style^="color: rgb(34, 197, 94)"],
html:not(.dark) [style*="; color: rgb(34, 197, 94)"] { color: #15803d !important; }
html:not(.dark) [style^="color:#10b981"],
html:not(.dark) [style*=";color:#10b981"],
html:not(.dark) [style*="; color:#10b981"],
html:not(.dark) [style*="; color: #10b981"],
html:not(.dark) [style^="color: rgb(16, 185, 129)"],
html:not(.dark) [style*="; color: rgb(16, 185, 129)"] { color: #047857 !important; }
html:not(.dark) [style^="color:#f59e0b"],
html:not(.dark) [style*=";color:#f59e0b"],
html:not(.dark) [style*="; color:#f59e0b"],
html:not(.dark) [style*="; color: #f59e0b"],
html:not(.dark) [style^="color: rgb(245, 158, 11)"],
html:not(.dark) [style*="; color: rgb(245, 158, 11)"] { color: #b45309 !important; }
.dark [style^="color:#15803d"],
.dark [style*=";color:#15803d"],
.dark [style*="; color:#15803d"],
.dark [style*="; color: #15803d"],
.dark [style^="color: rgb(21, 128, 61)"],
.dark [style*="; color: rgb(21, 128, 61)"] { color: #4ade80 !important; }
.dark [style^="color:#16a34a"],
.dark [style*=";color:#16a34a"],
.dark [style*="; color:#16a34a"],
.dark [style*="; color: #16a34a"],
.dark [style^="color: rgb(22, 163, 74)"],
.dark [style*="; color: rgb(22, 163, 74)"] { color: #4ade80 !important; }
.dark [style^="color:#166534"],
.dark [style*=";color:#166534"],
.dark [style*="; color:#166534"],
.dark [style*="; color: #166534"] { color: #86efac !important; }
.dark [style^="color:#c2410c"],
.dark [style*=";color:#c2410c"],
.dark [style*="; color:#c2410c"],
.dark [style*="; color: #c2410c"],
.dark [style^="color: rgb(194, 65, 12)"],
.dark [style*="; color: rgb(194, 65, 12)"] { color: #fdba74 !important; }
.dark [style^="color:#9a3412"],
.dark [style*=";color:#9a3412"],
.dark [style*="; color:#9a3412"],
.dark [style*="; color: #9a3412"] { color: #fdba74 !important; }
.dark [style^="color:#1d4ed8"],
.dark [style*=";color:#1d4ed8"],
.dark [style*="; color:#1d4ed8"],
.dark [style*="; color: #1d4ed8"],
.dark [style^="color: rgb(29, 78, 216)"],
.dark [style*="; color: rgb(29, 78, 216)"] { color: #93c5fd !important; }
.dark [style^="color:#2563eb"],
.dark [style*=";color:#2563eb"],
.dark [style*="; color:#2563eb"],
.dark [style*="; color: #2563eb"],
.dark [style^="color: rgb(37, 99, 235)"],
.dark [style*="; color: rgb(37, 99, 235)"] { color: #93c5fd !important; }
.dark [style^="color:#1e3a8a"],
.dark [style*=";color:#1e3a8a"],
.dark [style*="; color:#1e3a8a"],
.dark [style*="; color: #1e3a8a"] { color: #93c5fd !important; }
.dark [style^="color:#3b82f6"],
.dark [style*=";color:#3b82f6"],
.dark [style*="; color:#3b82f6"],
.dark [style*="; color: #3b82f6"] { color: #93c5fd !important; }
.dark [style^="color:#dc2626"],
.dark [style*=";color:#dc2626"],
.dark [style*="; color:#dc2626"],
.dark [style*="; color: #dc2626"],
.dark [style^="color: rgb(220, 38, 38)"],
.dark [style*="; color: rgb(220, 38, 38)"] { color: #fca5a5 !important; }
.dark [style^="color:#b91c1c"],
.dark [style*=";color:#b91c1c"],
.dark [style*="; color:#b91c1c"],
.dark [style*="; color: #b91c1c"] { color: #fca5a5 !important; }
.dark [style^="color:#059669"],
.dark [style*=";color:#059669"],
.dark [style*="; color:#059669"],
.dark [style*="; color: #059669"],
.dark [style^="color: rgb(5, 150, 105)"],
.dark [style*="; color: rgb(5, 150, 105)"] { color: #6ee7b7 !important; }
.dark [style^="color:#047857"],
.dark [style*=";color:#047857"],
.dark [style*="; color:#047857"],
.dark [style*="; color: #047857"] { color: #6ee7b7 !important; }
.dark [style^="color:#b45309"],
.dark [style*=";color:#b45309"],
.dark [style*="; color:#b45309"],
.dark [style*="; color: #b45309"] { color: #fcd34d !important; }
.dark [style^="color:#92400e"],
.dark [style*=";color:#92400e"],
.dark [style*="; color:#92400e"],
.dark [style*="; color: #92400e"] { color: #fcd34d !important; }
.dark [style^="color:#7c3aed"],
.dark [style*=";color:#7c3aed"],
.dark [style*="; color:#7c3aed"],
.dark [style*="; color: #7c3aed"] { color: #c4b5fd !important; }
.dark [style^="color:#9ca3af"],
.dark [style*=";color:#9ca3af"],
.dark [style*="; color:#9ca3af"],
.dark [style*="; color: #9ca3af"],
.dark [style^="color: rgb(156, 163, 175)"],
.dark [style*="; color: rgb(156, 163, 175)"] { color: #a3b1c4 !important; }
.dark [style^="color:#6b7280"],
.dark [style*=";color:#6b7280"],
.dark [style*="; color:#6b7280"],
.dark [style*="; color: #6b7280"],
.dark [style^="color: rgb(107, 114, 128)"],
.dark [style*="; color: rgb(107, 114, 128)"] { color: #a3b1c4 !important; }
html:not(.dark) .text-gray-500, html:not(.dark) .text-gray-400 { color: #4b5563 !important; }
html input::placeholder, html textarea::placeholder { color: var(--placeholder); opacity: 1; }
/* Critere non evalue du score : l'opacite .75 faisait tomber le texte sous 4,5:1. */
#dash-score-piliers > div[style*="opacity"] { opacity: 1 !important; }
/* Pistes de jauges claires (#e2e8f0) restees blanches en sombre. */
.dark [style*="background:#e2e8f0"], .dark [style*="background: rgb(226, 232, 240)"] { background-color: #334155 !important; }
.dark circle[stroke="#e2e8f0"], .dark circle[stroke="#f1f5f9"] { stroke: #334155; }
.dark #chart-filters .dtab.on { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
/* Lignes de tableau posees par JS (bordures claires restees blanches en sombre). */
.dark [style*="border-bottom: 1px solid rgb(241, 245, 249)"], .dark [style*="border-bottom: 1px solid rgb(226, 232, 240)"],
.dark [style*="border-bottom:1px solid #f1f5f9"], .dark [style*="border-bottom:1px solid #e2e8f0"],
.dark #mesure-table tr, .dark #mesure-table td { border-color: var(--line) !important; }

/* Etiquette "Evolution totale" (Suivi seance) : baisse en vert, hausse en rouge, AA clair et sombre. */
#delta-tag[data-trend="down"] { background: #dcfce7 !important; color: #166534 !important; }
#delta-tag[data-trend="up"] { background: #fee2e2 !important; color: #991b1b !important; }
.dark #delta-tag[data-trend="down"] { background: rgba(34, 197, 94, .16) !important; color: #86efac !important; }
.dark #delta-tag[data-trend="up"] { background: rgba(239, 68, 68, .16) !important; color: #fca5a5 !important; }
