/* Mode sombre — Vallon Comptabilité */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #3d4f66;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] .bg-mesh {
  background: radial-gradient(ellipse 70% 50% at 80% 10%, rgba(13, 148, 136, 0.08), transparent 55%);
}

html[data-theme="dark"] .shell-header,
html[data-theme="dark"] .side-nav,
html[data-theme="dark"] .glass,
html[data-theme="dark"] .vp-loading-box,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .notif-panel,
html[data-theme="dark"] .auth-form-panel,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .compta-mailbox,
html[data-theme="dark"] .compta-alert,
html[data-theme="dark"] .chantier-card,
html[data-theme="dark"] .kpi-card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .vp-page-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
}

html[data-theme="dark"] .auth-visual {
  background: linear-gradient(160deg, rgba(13, 148, 136, 0.12) 0%, var(--surface2) 100%);
  border-right-color: var(--border);
}

html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .btn-ghost {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea {
  background: #0f1419;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .side-nav button.active,
html[data-theme="dark"] .side-nav button:hover {
  background: rgba(13, 148, 136, 0.18);
}

html[data-theme="dark"] .compta-tab.active {
  background: rgba(13, 148, 136, 0.2);
}

html[data-theme="dark"] .compta-mail-config-toggle,
html[data-theme="dark"] .chantier-metric,
html[data-theme="dark"] .flow-bar-track,
html[data-theme="dark"] .waterfall-row .wf-bar-wrap {
  background: var(--surface2);
}

html[data-theme="dark"] .vp-loading-overlay {
  background: rgba(15, 20, 25, 0.78);
}

html[data-theme="dark"] .scan-preview-pdf,
html[data-theme="dark"] .scan-thumb-pdf {
  background: var(--surface2);
}

html[data-theme="dark"] .compta-alert.danger { border-left-color: #f87171; }
html[data-theme="dark"] .compta-alert.warning { border-left-color: #fb923c; }
html[data-theme="dark"] .compta-alert.info { border-left-color: #818cf8; }

html[data-theme="dark"] .badge-teal { background: rgba(13, 148, 136, 0.22); }
html[data-theme="dark"] .badge-lime { background: rgba(21, 128, 61, 0.22); }
html[data-theme="dark"] .badge-orange { background: rgba(194, 65, 12, 0.22); }

/* Bouton thème */
/* Bouton thème dans le header — plus de fixed qui recouvre la déconnexion */
.vallon-theme-toggle {
  flex-shrink: 0;
}
.vallon-theme-toggle--fixed {
  position: fixed;
  top: 0.75rem;
  right: auto;
  left: 0.75rem;
  z-index: 1200;
  box-shadow: var(--shadow);
}
.vallon-theme-toggle .vallon-theme-icon--sun { display: none; }
html[data-theme="dark"] .vallon-theme-toggle .vallon-theme-icon--moon { display: none; }
html[data-theme="dark"] .vallon-theme-toggle .vallon-theme-icon--sun { display: block; }