/* ================================================================
   THÈME DARK PREMIUM — Prodemial
   Harmonise toutes les pages sur un noir profond cohérent
   Améliore le look général du mode sombre
   ================================================================ */

/* ── Correction des pages avec leur propre :root bleuté ── */

/* fiscal_params_admin */
html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(239,68,68,.14), transparent 55%),
    radial-gradient(900px 450px at 90% 10%, rgba(34,197,94,.07), transparent 55%),
    #0b0f14 !important;
  color: #e5e7eb !important;
}

/* Override toutes les variables :root bleutées des pages autonomes */
html[data-theme="dark"] {
  --bg:     #0b0f14 !important;
  --panel:  #111827 !important;
  --panel2: #1a2236 !important;
  --panel-2:#1a2236 !important;
  --line:   rgba(255,255,255,.08) !important;
  --text:   #e5e7eb !important;
  --muted:  #9ca3af !important;
  --border: rgba(255,255,255,.10) !important;
  --card:   #111827 !important;
}

/* ── fiscal_params_admin body ── */
html[data-theme="dark"] body {
  background-color: #0b0f14 !important;
}

/* ── simulateur_ifi.php ── */
html[data-theme="dark"] .pagebar {
  background: rgba(11,15,20,.92) !important;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
}

/* ── simulateur_jeanbrun ── */
html[data-theme="dark"] .jb-wrap,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .results,
html[data-theme="dark"] .card-jb {
  background: #111827 !important;
}

/* ── Cards globales — plus de relief ── */
html[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.06)) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.30) !important;
}
html[data-theme="dark"] .card .hd {
  background: rgba(255,255,255,.05) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}

/* ── Sections simulateurs (fond bleuté → noir) ── */
html[data-theme="dark"] .simu-fiscalite .section,
html[data-theme="dark"] .simu-deficit-foncier .section {
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.07) !important;
}

/* ── primo_suivi — fond et cards ── */
html[data-theme="dark"] .wrap > *:not(.topbar) {
  background: transparent;
}

/* ── Inputs — cohérents ── */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: rgba(255,255,255,0.11) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}

/* ── Panel (fiscal_params, planning) ── */
html[data-theme="dark"] .panel {
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}

/* ── th global — cohérent ── */
html[data-theme="dark"] th {
  background: rgba(255,255,255,.08) !important;
  color: #9ca3af !important;
}

/* ── planning cells ── */
html[data-theme="dark"] .planGridHead {
  background: rgba(0,0,0,.65) !important;
}

/* ── Topbar — amélioration ── */
html[data-theme="dark"] .topbar {
  background: rgba(11,15,20,.75) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  backdrop-filter: blur(8px) !important;
}

/* ── Tool cards ── */
html[data-theme="dark"] .tool {
  background: rgba(255,255,255,0.09) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] .tool:hover {
  background: rgba(255,255,255,.06) !important;
}

/* ── primo_suivi .acc / accordion ── */
html[data-theme="dark"] .acc {
  background: rgba(255,255,255,0.10) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] details.acc-item {
  border-top-color: rgba(255,255,255,.07) !important;
}

/* ── fiscal_params : badge, btn-secondary ── */
html[data-theme="dark"] .btn-secondary {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  color: #e5e7eb !important;
}
html[data-theme="dark"] .badge {
  background: #1e3a5f !important;
  color: #93c5fd !important;
}

/* ── denormandie panels ── */
html[data-theme="dark"] .simu-denormandie .panel,
html[data-theme="dark"] .panel {
  background: rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] .simu-denormandie input,
html[data-theme="dark"] .simu-denormandie select,
html[data-theme="dark"] .simu-denormandie textarea {
  background: rgba(255,255,255,0.11) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}

/* ── Scrollbar dark améliorée ── */
html[data-theme="dark"] ::-webkit-scrollbar { width: 8px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0b0f14; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15);
  border-radius: 4px;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.25);
}
