/* Tema compartilhado (claro/escuro) */
  :root {
  color-scheme: light;
  --bg: #f4f4f2; --surface-1: #fcfcfb; --border: #e3e2de;
  --text-primary: #0b0b0b; --text-secondary: #52514e; --text-muted: #7a7974;
  --grid: #ecebe7; --accent: #2a78d6;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --neg: #c03c3b; --warn-bg: #fff4e0; --warn-fg: #7a4b00;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #111110; --surface-1: #1a1a19; --border: #2c2c2a;
    --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #8f8e86;
    --grid: #262624; --accent: #3987e5;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --neg: #e66767; --warn-bg: #3a2a0c; --warn-fg: #f2c879;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface-1: #1a1a19; --border: #2c2c2a;
  --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #8f8e86;
  --grid: #262624; --accent: #3987e5;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --neg: #e66767; --warn-bg: #3a2a0c; --warn-fg: #f2c879;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text-primary); }
select, input, button { font: inherit; font-size: 13px; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { cursor: pointer; }
button:hover { border-color: var(--text-muted); }
button.primario { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.perigo { color: var(--neg); }
button:disabled { opacity: .55; cursor: default; }
.err { background: var(--warn-bg); color: var(--warn-fg); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.ok-msg { background: color-mix(in srgb, var(--series-3) 15%, transparent); color: var(--text-primary); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
