/* Mode sombre — Vallon Partenaires */

html[data-theme="dark"] {
  color-scheme: dark;
  --vp-bg: #0f172a;
  --vp-surface: #1e293b;
  --vp-surface-2: #273449;
  --vp-border: #334155;
  --vp-border-strong: #475569;
  --vp-text: #f1f5f9;
  --vp-muted: #94a3b8;
  --vp-sidebar: #0b1220;
  --vp-sidebar-hover: #1e293b;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #273449;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --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(--vp-bg) !important;
  color: var(--vp-text) !important;
}

html[data-theme="dark"] .vp-sidebar {
  border-right-color: #020617;
}

html[data-theme="dark"] .vp-hub-status.live {
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(134, 239, 172, 0.35);
}

html[data-theme="dark"] .vp-hub-status.prep {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(253, 230, 138, 0.35);
}

html[data-theme="dark"] .vp-table tbody tr:hover td {
  background: rgba(51, 65, 85, 0.45);
}

html[data-theme="dark"] .vp-pill--wait { background: rgba(146, 64, 14, 0.25); color: #fcd34d; }
html[data-theme="dark"] .vp-pill--urgent { background: rgba(153, 27, 27, 0.3); color: #fca5a5; }
html[data-theme="dark"] .vp-pill--neutral { background: rgba(71, 85, 105, 0.35); color: #cbd5e1; }

html[data-theme="dark"] .vp-alert-row--urgent { background: rgba(127, 29, 29, 0.15); }
html[data-theme="dark"] .vp-alert-tag { background: #334155; color: #cbd5e1; }
html[data-theme="dark"] .vp-alert-row--urgent .vp-alert-tag { background: rgba(153, 27, 27, 0.35); color: #fecaca; }

html[data-theme="dark"] .vp-landing-form,
html[data-theme="dark"] .auth-form-panel,
html[data-theme="dark"] .vp-auth-card {
  background: var(--vp-surface) !important;
  border-color: var(--vp-border) !important;
  color: var(--vp-text);
}

/* Tous les champs (pas seulement .form-group) — contraste fort, jamais blanc/texte clair */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .vp-input,
html[data-theme="dark"] .vp-select,
html[data-theme="dark"] .vp-textarea,
html[data-theme="dark"] .bc-poste-form input,
html[data-theme="dark"] .bc-poste-form select,
html[data-theme="dark"] .bc-poste-form textarea,
html[data-theme="dark"] .bc-gen-pu-input,
html[data-theme="dark"] .bc-lot-select {
  background: #1e293b !important;
  background-color: #1e293b !important;
  border-color: #64748b !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] input[type="password"] {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  background: #1e293b !important;
}

html[data-theme="dark"] .vp-loading-overlay {
  background: rgba(15, 23, 42, 0.82);
}

html[data-theme="dark"] .vp-loading-box,
html[data-theme="dark"] .vp-toast,
html[data-theme="dark"] .vp-notif-panel {
  background: var(--vp-surface);
  border-color: var(--vp-border);
  color: var(--vp-text);
}

html[data-theme="dark"] .vp-notif-item:hover {
  background: var(--vp-surface-2);
  border-color: var(--vp-border-strong);
}

/* Bouton thème — dans la barre d’actions (ne plus fixer en haut à droite = plus de superposition déconnexion) */
.vallon-theme-toggle {
  flex-shrink: 0;
}
.vallon-theme-toggle--fixed {
  /* legacy : si encore présent hors header, basculer à gauche pour ne pas masquer logout */
  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; }
/* Écran login : bascule thème bas-gauche (jamais sur la déconnexion) */
.vallon-theme-toggle--login {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: auto;
  top: auto;
  z-index: 1200;
  box-shadow: var(--shadow);
  background: var(--vp-surface, #fff);
  border: 1px solid var(--vp-border, #e0dbd3);
}