/* themes.css — Theme switcher (Sprint 24). Remapeia os tokens --az-* no dark, cobrindo todas as telas. */

/* DARK — explícito ou auto+prefers dark */
:root[data-theme='dark'],
:root[data-theme='auto'] {
  /* placeholder; auto sobrescrito abaixo por media query */
}
:root[data-theme='dark'] {
  --az-bg-primary: #0f172a;
  --az-bg-secondary: #1e293b;
  --az-bg-tertiary: #243044;
  --az-text-primary: #f1f5f9;
  --az-text-secondary: #cbd5e1;
  --az-text-tertiary: #94a3b8;
  --az-border-primary: #334155;
  --az-border-secondary: #334155;
  --az-border-tertiary: #1f2a3a;
  --az-primary-50: #1e3a5f;
  --az-primary-100: #1e40af;
  color-scheme: dark;
}
:root[data-theme='dark'] body { background: var(--az-bg-primary); color: var(--az-text-primary); }
/* superfícies brancas hardcoded comuns viram surface no dark */
:root[data-theme='dark'] .panel,
:root[data-theme='dark'] .conf-nav,
:root[data-theme='dark'] .kpi,
:root[data-theme='dark'] .drawer,
:root[data-theme='dark'] .adm-input,
:root[data-theme='dark'] .utils-nav { background: var(--az-bg-secondary) !important; color: var(--az-text-primary); }

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --az-bg-primary: #0f172a; --az-bg-secondary: #1e293b; --az-bg-tertiary: #243044;
    --az-text-primary: #f1f5f9; --az-text-secondary: #cbd5e1; --az-text-tertiary: #94a3b8;
    --az-border-primary: #334155; --az-border-secondary: #334155; --az-border-tertiary: #1f2a3a;
    --az-primary-50: #1e3a5f; color-scheme: dark;
  }
  :root[data-theme='auto'] body { background: var(--az-bg-primary); color: var(--az-text-primary); }
}

/* switcher no header */
.theme-switcher { display: inline-flex; gap: 2px; background: var(--az-bg-tertiary); border-radius: 8px; padding: 2px; }
.theme-switcher button { border: none; background: none; padding: 5px 8px; border-radius: 6px; cursor: pointer; color: var(--az-text-secondary); font-size: 15px; }
.theme-switcher button.active { background: var(--az-primary); color: #fff; }
