/* JASS Budget V2 — surcharge de thème. Charger APRÈS style.css.
   On conserve les couleurs métier : orange = dépense, vert = recette. */
.visually-hidden { position: absolute!important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.nav-theme-select {
  width: auto; min-width: 7.5rem; height: 2.2rem; margin: 0;
  padding: .25rem 1.65rem .25rem .55rem; font-size: .85rem;
  border-radius: .55rem; cursor: pointer;
  background-color: var(--pico-card-background-color);
  color: var(--pico-color);
}
@media (max-width: 960px) { .nav-theme-select { width: 100%; margin: .35rem 0; } }

/* PicoCSS fournit déjà ses variables nocturnes, nous adaptons celles propres
   à l'application et les quelques fonds / séparateurs codés en dur. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --pico-background-color: #111827;
  --pico-card-background-color: #1f2937;
  --pico-color: #e5e7eb;
  --pico-muted-color: #aeb9ca;
  --pico-muted-border-color: #374151;
  --pico-border-color: #475569;
  --pico-form-element-background-color: #182333;
  --pico-form-element-border-color: #46566b;
  --pico-form-element-color: #f1f5f9;
  --pico-form-element-placeholder-color: #94a3b8;
  --pico-dropdown-background-color: #1f2937;
  --pico-primary: #93c5fd;
  --pico-primary-background: #2563eb;
  --pico-primary-border: #2563eb;
  --pico-primary-hover: #bfdbfe;
  --pico-primary-hover-background: #1d4ed8;
  --pico-primary-hover-border: #1d4ed8;
  --pico-primary-inverse: #fff;
  --couleur-orange: #fb923c;
  --couleur-orange-hover: #fdba74;
  --couleur-orange-clair: #422617;
  --couleur-orange-badge-texte: #fdba74;
  --couleur-bleu: #93c5fd;
  --couleur-bleu-hover: #bfdbfe;
  --couleur-bleu-clair: #1c3558;
  --couleur-gris: #303b4b;
  --couleur-gris-texte: #b8c3d3;
  --couleur-texte-fonce: #f1f5f9;
  --couleur-vert: #4ade80;
  --couleur-vert-clair: #143d30;
}
[data-theme="dark"] body,
[data-theme="dark"] .topbar { background: var(--pico-background-color); }
[data-theme="dark"] .topbar,
[data-theme="dark"] .nav-links,
[data-theme="dark"] .note-carte-pied,
[data-theme="dark"] .params-tabs-bar,
[data-theme="dark"] .table-notes td,
[data-theme="dark"] .table-notes th { border-color: #374151; }
[data-theme="dark"] .topbar { border-bottom-color: #374151; }
[data-theme="dark"] .positif { color: #4ade80; }
[data-theme="dark"] .negatif { color: #fb923c; }
[data-theme="dark"] .note-carte,
[data-theme="dark"] .stats-card,
[data-theme="dark"] .table-scroll-x,
[data-theme="dark"] .param-list-scroll { border-color: #374151; }
[data-theme="dark"] .note-carte-rappel-depasse { background: #492328; color: #fca5a5; }
[data-theme="dark"] .note-carte-ajout { border-color: #64748b; }
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f1f5f9 !important;
  -webkit-box-shadow: 0 0 0 30px #182333 inset !important;
  caret-color: #f1f5f9;
}

/* Lot 1b : en-têtes de tableaux lisibles en mode sombre. */
:root[data-theme="dark"] table thead th,
:root[data-theme="dark"] .param-list-scroll thead th,
:root[data-theme="dark"] .stats-table-categories th {
  background: #1e293b;
  color: #dbeafe;
  border-bottom-color: #60a5fa;
}
:root[data-theme="dark"] .table-operations tbody tr.row-ajout,
:root[data-theme="dark"] .table-echeancier tbody tr.row-ajout {
  background: #172235;
}
:root[data-theme="dark"] .dashboard-solde-item + .dashboard-solde-item {
  border-left-color: #475569;
}
:root[data-theme="dark"] .dashboard-solde-label,
:root[data-theme="dark"] .operations-soldes { color: #cbd5e1; }
