/* =============================================================================
   MODO ESCURO: ligado por html[data-tema="escuro"] (escolha da pessoa, ou "Automático"
   seguindo o sistema). Redefine as cores-base e cobre os poucos lugares com branco fixo.
   ============================================================================= */
html[data-tema="escuro"] {
  color-scheme: dark;
  --bg: #131316; --card: #1a1a1f; --ink: #ededf2; --muted: #a09fad; --line: #2c2c34; --soft: #202026; --hover: #26262d;
  --brand: #7653f6; --brand-d: #8a6cf8; --brand-dd: #bfb0fc; --brand-l: #272042; --login: #7653f6; --violeta: #8f75f8;
  --accent: #f0b84a; --ok: #3fc495; --warn: #f0b84a; --bad: #ff7b72; --dark: #ecebf3;
  --x: #ff6b63; --x-soft: #2c1716;
}
html[data-tema="escuro"] body { background: var(--bg); color: var(--ink); }
html[data-tema="escuro"] .card, html[data-tema="escuro"] .modal, html[data-tema="escuro"] .emp-menu,
html[data-tema="escuro"] .bn-painel, html[data-tema="escuro"] .bn-top, html[data-tema="escuro"] .bn,
html[data-tema="escuro"] .tb, html[data-tema="escuro"] .rail, html[data-tema="escuro"] #ia-panel { background: var(--card); border-color: var(--line); }
html[data-tema="escuro"] .tb, html[data-tema="escuro"] .rail { background: var(--bg); }
html[data-tema="escuro"] input, html[data-tema="escuro"] select, html[data-tema="escuro"] textarea { background: #0f0f12; color: var(--ink); border-color: var(--line); }
html[data-tema="escuro"] input::placeholder, html[data-tema="escuro"] textarea::placeholder { color: #6f6a88; }
html[data-tema="escuro"] button, html[data-tema="escuro"] .btn { background: var(--soft); color: var(--ink); border-color: var(--line); }
html[data-tema="escuro"] button.pri, html[data-tema="escuro"] .btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
html[data-tema="escuro"] button.dng { color: var(--bad); }
html[data-tema="escuro"] .rail .ri, html[data-tema="escuro"] .bn a, html[data-tema="escuro"] .bn button, html[data-tema="escuro"] .visao button, html[data-tema="escuro"] .tabs button, html[data-tema="escuro"] .emp-menu button { background: none; }
html[data-tema="escuro"] .visao button.on { background: var(--card); color: var(--ink); }
html[data-tema="escuro"] .tabs button.on { background: var(--soft); }
html[data-tema="escuro"] th { background: var(--soft); color: var(--muted); }
html[data-tema="escuro"] td { border-color: var(--line); }
html[data-tema="escuro"] tr:hover td, html[data-tema="escuro"] tr.sint td, html[data-tema="escuro"] tr.sub td { background: #1c1926; }
html[data-tema="escuro"] .toast { background: #ecebf3; color: #121019; }
html[data-tema="escuro"] .toast.bad { background: var(--bad); color: #121019; }
html[data-tema="escuro"] .ov { background: rgba(0, 0, 0, .65); }
html[data-tema="escuro"] .alert.ok { background: #102a20; border-color: #1d4a37; color: #8fe0bd; }
html[data-tema="escuro"] .alert.bad { background: #2c1514; border-color: #5a2522; color: #ffb4ad; }
html[data-tema="escuro"] .alert.info { background: #131f30; border-color: #22375a; color: #a9c8f5; }
html[data-tema="escuro"] .alert.warn, html[data-tema="escuro"] .faixa-cli { background: #2b2210; border-color: #5a4316; color: #f5d38a; }
html[data-tema="escuro"] .pill { background: var(--soft); color: var(--muted); }
html[data-tema="escuro"] .pill.ok { background: #12352a; color: #6fe0b4; }
html[data-tema="escuro"] .pill.bad { background: #3a1716; color: #ff9d95; }
html[data-tema="escuro"] .pill.warn { background: #3a2c10; color: #f5c66a; }
html[data-tema="escuro"] .var.up, html[data-tema="escuro"] .var.neg { background: #3a1716; color: #ff9d95; }
html[data-tema="escuro"] .var.down, html[data-tema="escuro"] .var.pos { background: #12352a; color: #6fe0b4; }
html[data-tema="escuro"] .badge { background: #3a2c10; color: #f5c66a; border-color: #5a4316; }
html[data-tema="escuro"] code { background: var(--soft); color: var(--ink); }
html[data-tema="escuro"] a { color: var(--brand-dd); }
html[data-tema="escuro"] .ask, html[data-tema="escuro"] .ask-mic { background: var(--card); border-color: var(--line); color: var(--ink); }
html[data-tema="escuro"] .chip { background: var(--card); color: var(--ink); border-color: var(--line); }
html[data-tema="escuro"] .empty::before { filter: invert(.85); }
html[data-tema="escuro"] .lote-bar { background: #221d3d; }
html[data-tema="escuro"] .ag-b i { opacity: .9; }
html[data-tema="escuro"] .ask-go { background: var(--brand); color: #fff; border-color: var(--brand); }
html[data-tema="escuro"] img.logo-claro { display: none; }
.tema-bt { display: inline-flex; align-items: center; gap: 8px; }
html[data-tema="escuro"] .ag-b button { background: none; }
html[data-tema="escuro"] .ask input { background: transparent; }
