.viz-root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-import: #2a78d6;   /* slot 1 azul: importado */
  --series-export: #eb6834;   /* slot 2 naranja: exportado */
  --critical: #d03b3b;
  --good-text: #006300;
}
@media (prefers-color-scheme: dark) {
  .viz-root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface-1: #1a1a19;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series-import: #3987e5;
    --series-export: #d95926;
    --good-text: #0ca30c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #f9f9f7; }
@media (prefers-color-scheme: dark) { body { background: #0d0d0d; } }
.viz-root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--page);
  max-width: 1100px; margin: 0 auto; padding: 16px;
  min-height: 100vh;
}
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
h3 { font-size: 0.95rem; margin: 20px 0 6px; }
.muted { color: var(--text-secondary); }
.small { font-size: 0.8rem; font-weight: normal; }
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; margin: 12px 0;
}
.narrow { max-width: 380px; margin: 10vh auto; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.badge { background: #fab219; color: #0b0b0b; border-radius: 6px; padding: 2px 8px; font-size: 0.75rem; font-weight: 600; }
form label { display: block; margin: 10px 0; font-size: 0.9rem; color: var(--text-secondary); }
input { display: block; width: 100%; margin-top: 4px; padding: 8px; font: inherit;
  border: 1px solid var(--axis); border-radius: 6px; background: var(--surface-1); color: var(--text-primary); }
button { font: inherit; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--series-import);
  background: var(--series-import); color: #fff; cursor: pointer; }
button.ghost { background: transparent; color: var(--text-primary); border-color: var(--axis); }
.error { color: var(--critical); min-height: 1.2em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.tile.wide { grid-column: span 2; }
@media (max-width: 520px) { .tile.wide { grid-column: span 1; } }
.label { font-size: 0.8rem; color: var(--text-secondary); }
.hero { font-size: 2rem; font-weight: 650; margin-top: 4px; }
.value { font-size: 1.4rem; font-weight: 600; margin-top: 4px; }
.note { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.banner { border-left: 4px solid #fab219; padding: 8px 12px; margin: 8px 0; background: rgba(250, 178, 25, 0.10); font-size: 0.9rem; }
.breakdown { margin-top: 14px; border-collapse: collapse; min-width: 320px; font-variant-numeric: tabular-nums; }
.breakdown td { padding: 3px 12px 3px 0; }
.breakdown td.num { text-align: right; }
.breakdown tr.total td { border-top: 1px solid var(--axis); font-weight: 650; }
.compare { margin-top: 12px; font-size: 0.9rem; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-secondary); margin: 4px 0; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.legend .sw.hatch { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.55) 0 2px, transparent 2px 5px); }
.chart-box { position: relative; height: 280px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 8px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 4px 6px; border-bottom: 1px solid var(--grid); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--text-secondary); }
.settings form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.settings label { margin: 0; }
footer { margin: 16px 0; }
/* admin */
.proposal { border-top: 1px solid var(--grid); padding-top: 12px; margin-top: 12px; }
.proposal h3 { margin-top: 0; }
td.changed { color: var(--critical); font-weight: 650; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
tr.unread td { font-weight: 600; }
.small-btn { font-size: 0.75rem; padding: 2px 8px; margin-left: 8px; }
.admin-link { font-size: 0.85rem; }
a { color: var(--series-import); }
table.data.text th, table.data.text td { text-align: left; }
.banner.error-banner { border-left-color: var(--critical); background: rgba(208, 59, 59, 0.10); }
