/* FO_DARK_OVERRIDE_V4 — Dark-only. Overrides header.css LIGHT_V1.
   Uses html.fo-pos-shell selectors to match LIGHT_V1 specificity.
   Load AFTER header.css on every page. */

/* === Base === */
html, body,
html.fo-pos-shell, body.fo-pos-shell,
:root.fo-pos-shell {
  color-scheme: dark !important;
  --fo-bg: #0f172a !important;
  --fo-surface: #1e293b !important;
  --fo-surface2: #0e1420 !important;
  --fo-border: rgba(148,163,184,0.18) !important;
  --fo-text: #e5e7eb !important;
  --fo-muted: #94a3b8 !important;
  --fo-accent: #2563eb !important;
  background: #0f172a !important;
  color: #e5e7eb !important;
}

/* === Cards — override LIGHT_V1 .card === */
.card, .card2, .fo-card, .panel, .box, .fo-col,
html.fo-pos-shell .card,
body.fo-pos-shell .card,
html.fo-pos-shell .panel,
body.fo-pos-shell .panel {
  background: #1e293b !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
  color: #e5e7eb !important;
}
.card2 {
  background: rgba(15,23,42,0.5) !important;
  border: 1px solid rgba(148,163,184,0.15) !important;
}

/* === List — override LIGHT_V1 .list === */
html.fo-pos-shell .list,
body.fo-pos-shell .list,
.list {
  background: #0e1420 !important;
  border-color: rgba(148,163,184,0.18) !important;
}

/* === Inputs — override LIGHT_V1 html.fo-pos-shell input #ffffff === */
input, select, textarea, .inp, .fo-input, .fo-select,
html.fo-pos-shell input,
html.fo-pos-shell select,
html.fo-pos-shell textarea,
body.fo-pos-shell input,
body.fo-pos-shell select,
body.fo-pos-shell textarea,
html.fo-pos-shell .inp,
body.fo-pos-shell .inp {
  background: #0e1420 !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,0.22) !important;
}
input::placeholder, textarea::placeholder { color: #64748b !important; }
select option {
  background: #1e293b !important;
  color: #e5e7eb !important;
}

/* === Buttons — override LIGHT_V1 html.fo-pos-shell .btn === */
.btn, .fo-btn,
html.fo-pos-shell .btn,
body.fo-pos-shell .btn {
  background: #1e293b !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,0.22) !important;
}
.btn:hover, .fo-btn:hover { background: #334155 !important; }
.btn.primary, .fo-btn.primary,
html.fo-pos-shell .btn.primary,
body.fo-pos-shell .btn.primary {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
}
.btn.danger, .fo-btn.danger {
  background: rgba(239,68,68,0.12) !important;
  border-color: rgba(239,68,68,0.3) !important;
  color: #fca5a5 !important;
}

/* === Items — override LIGHT_V1 html.fo-pos-shell .item === */
.item,
html.fo-pos-shell .item,
body.fo-pos-shell .item {
  background: #1e293b !important;
  border-color: rgba(148,163,184,0.18) !important;
  color: #e5e7eb !important;
}
html.fo-pos-shell .item.active,
body.fo-pos-shell .item.active {
  outline: 2px solid rgba(59,130,246,0.35) !important;
}

/* === Muted — override LIGHT_V1 html.fo-pos-shell .muted === */
.muted, .small, .fo-muted, .fo-mini,
html.fo-pos-shell .muted,
html.fo-pos-shell .small,
body.fo-pos-shell .muted,
body.fo-pos-shell .small {
  color: #94a3b8 !important;
  opacity: 1 !important;
}

/* === Typography === */
h1, h2, h3 { color: #f1f5f9 !important; }
.fo-title { font-size: 22px; font-weight: 800; color: #f1f5f9 !important; }
.fo-subtitle { font-size: 15px; font-weight: 700; color: #e2e8f0 !important; }

/* === Badges === */
.badge, .fo-pill {
  background: rgba(15,23,42,0.6) !important;
  border-color: rgba(148,163,184,0.25) !important;
  color: #e2e8f0 !important;
}
.badge.ok { background: rgba(34,197,94,0.15) !important; color: #86efac !important; }
.badge.warn { background: rgba(245,158,11,0.15) !important; color: #fcd34d !important; }
.badge.crit { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; }
#findingsBadge { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; }
#reportBadge { background: rgba(59,130,246,0.15) !important; color: #93c5fd !important; }

/* === Notice === */
.notice {
  background: rgba(37,99,235,0.08) !important;
  border-color: rgba(37,99,235,0.2) !important;
  color: #cbd5e1 !important;
}

/* === Links === */
a, .fo-link,
body.fo-pos-shell a { color: #60a5fa !important; }
a:hover, .fo-link:hover { color: #93c5fd !important; }

/* === Divider === */
.hr, hr {
  border-color: rgba(148,163,184,0.15) !important;
  background: rgba(148,163,184,0.15) !important;
}

/* === Header bar (header.js) === */
.foHdrV1 {
  background: rgba(15,23,42,0.95) !important;
  border-bottom-color: rgba(148,163,184,0.18) !important;
  backdrop-filter: blur(6px);
}
.foHdrBrandV1, .foHdrLinkV1, .foHdrBtnV1 {
  background: #1e293b !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,0.15) !important;
}
.foHdrBtnV1.isOn {
  border-color: rgba(59,130,246,0.6) !important;
  background: #334155 !important;
}
.foHdrLangLabelV1 { color: #94a3b8 !important; }

/* === i18n_core toggle === */
#foLangToggleCoreV1 button,
#foLangToggleCoreV2 button {
  background: #1e293b !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,0.22) !important;
}
#foLangToggleCoreV1 span, #foLangToggleCoreV1 div,
#foLangToggleCoreV2 span, #foLangToggleCoreV2 div {
  color: #e5e7eb !important;
}

/* === Pill === */
.pill {
  background: rgba(30,41,59,0.8) !important;
  border-color: rgba(148,163,184,0.25) !important;
  color: #e2e8f0 !important;
}

/* === Auditor layout === */
.fo-col.fo-left, .fo-col.fo-right {
  background: #1e293b !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* === Wrap container === */
.wrap > .card {
  background: #1e293b !important;
  border: 1px solid rgba(148,163,184,0.18) !important;
}

/* === Hide theme toggle (dark-only) === */
#themeBtn, #btnLight, #btnDark,
.foHdrThemeWrapV1,
[data-theme-toggle],
.foSB-btn[data-grp="theme"],
.foSB-label[data-en="Theme"],
span[style*="Theme"] {
  display: none !important;
}
