/* Mode sombre — surcharge des variables CSS définies dans app.css.
   Le JS (theme.js) résout « Auto » et pose data-theme="dark" ou "light" sur <html>. */
html[data-theme="dark"] {
  --bg:#0b1220; --card:#1e293b; --ink:#e7eef7; --muted:#94a3b8; --line:#334155;
  --teal:#0e7490; --teal-d:#155e75; --teal-l:#0e3a44;
  --shadow:0 1px 3px rgba(0,0,0,.45),0 1px 2px rgba(0,0,0,.4);
  --green:#22c55e; --red:#f87171; --amber:#fbbf24; --blue:#60a5fa;
  color-scheme: dark;
}

/* Surfaces qui codaient une couleur claire en dur dans app.css */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background:#0b1220; color:var(--ink); }
html[data-theme="dark"] th { background:#0b1220; }
html[data-theme="dark"] .mainnav a:hover { background:#0b1220; }
html[data-theme="dark"] .btn.secondary { background:#1e293b; color:#67e8f9; border-color:#67e8f9; }

/* Accents texte lisibles sur fond sombre (--teal-d reste foncé pour le survol des boutons) */
html[data-theme="dark"] .stat .v,
html[data-theme="dark"] .bassin .bnum { color:#38bdf8; }
html[data-theme="dark"] .mainnav a.active { color:#38bdf8; background:#0e3a44; }

/* Pastilles flash adaptées au fond sombre */
html[data-theme="dark"] .flash-success { background:#14532d; color:#bbf7d0; }
html[data-theme="dark"] .flash-error   { background:#7f1d1d; color:#fecaca; }
html[data-theme="dark"] .flash-info     { background:#1e3a8a; color:#bfdbfe; }
html[data-theme="dark"] .flash-warning  { background:#78350f; color:#fde68a; }

/* Bouton de thème dans la barre */
#themeBtn { cursor:pointer; background:none; border:none; }
