/* ARK MASTER — tema preto. Cores de dados = paleta categórica validada (passos para superfície escura). */
:root {
  color-scheme: dark;
  --page: #070707;
  --surface-1: #101010;
  --surface-2: #161616;
  --surface-3: #1e1e1e;
  --hairline: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.12);
  --text-primary: #f4f4f2;
  --text-secondary: #bdbcb4;
  --text-muted: #898781;
  --grid: #232322;
  --axis: #383835;
  --accent: #c9a45c;
  --accent-strong: #dcbb78;
  --accent-soft: rgba(201, 164, 92, 0.12);

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --series-other: #5f5e59;

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;

  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text-primary); font-family: var(--font); font-size: 14px; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); }
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ marca */
.wordmark { display: flex; flex-direction: column; line-height: 1; user-select: none; }
.wordmark strong { font-weight: 300; letter-spacing: 0.42em; font-size: 15px; color: var(--text-primary); }
.wordmark strong b { font-weight: 700; }
.wordmark span { margin-top: 5px; font-size: 9.5px; letter-spacing: 0.38em; color: var(--accent); text-transform: uppercase; }
.wordmark.large strong { font-size: clamp(30px, 4.2vw, 52px); letter-spacing: 0.32em; }
.wordmark.large span { font-size: 12px; margin-top: 14px; letter-spacing: 0.5em; }

/* ------------------------------------------------------------------ login */
.login-page { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(201, 164, 92, 0.10), transparent 60%),
    radial-gradient(700px 600px at 90% 100%, rgba(57, 135, 229, 0.06), transparent 60%),
    #050505;
  border-right: 1px solid var(--hairline);
}
.login-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.login-hero > * { position: relative; }
.login-hero .rule { width: 64px; height: 1px; background: var(--accent); margin: 34px 0 22px; }
.login-hero p.tagline { max-width: 460px; color: var(--text-secondary); font-size: 17px; line-height: 1.6; font-weight: 300; }
.login-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; color: var(--text-secondary); }
.login-hero li { display: flex; gap: 12px; align-items: center; font-size: 13.5px; }
.login-hero li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.login-hero footer { color: var(--text-muted); font-size: 12px; letter-spacing: 0.04em; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-card > p { margin: 0 0 30px; color: var(--text-muted); }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 12px; color: var(--text-secondary); letter-spacing: 0.02em; }
.input, .select {
  height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-1);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0b0906; font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-block { width: 100%; height: 46px; margin-top: 8px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: default; }
.form-error { min-height: 20px; color: var(--serious); font-size: 13px; margin: 4px 0 0; }
.login-card .fine { margin-top: 28px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.login-card .lead { margin: 0 0 26px; color: var(--text-muted); line-height: 1.55; }
.login-card .form-success {
  margin: 0 0 22px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; color: var(--text-secondary);
  background: rgba(12, 163, 12, 0.08); border: 1px solid rgba(12, 163, 12, 0.32);
}
.link-btn {
  display: block; margin: 14px auto 0; padding: 4px 2px; border: 0; background: none; cursor: pointer; font-size: 13px;
  color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(220, 187, 120, 0.4);
}
.link-btn:hover { color: var(--text-primary); }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.link-btn.left { margin: 4px 0 10px; text-align: left; }
.hint { font-size: 12px; color: var(--text-muted); margin: -4px 0 6px; line-height: 1.5; }
.hint-inline { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-muted); }
.code-input { font-size: 20px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.steps { margin: 0 0 22px; padding-left: 20px; display: grid; gap: 12px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
.qr { width: 184px; margin: 12px 0 10px; border-radius: 10px; overflow: hidden; background: #ffffff; }
.qr svg { display: block; width: 100%; height: auto; }
.secret-key {
  display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-primary);
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; letter-spacing: 0.06em; word-break: break-all; user-select: all;
}
.recovery-codes { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.recovery-codes li {
  padding: 9px 6px; border-radius: 8px; background: var(--surface-3); text-align: center; user-select: all;
  font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: 0.06em;
}
.check { display: flex; gap: 10px; align-items: center; margin: 18px 0 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

@media (max-width: 880px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 36px 28px; min-height: auto; }
  .login-hero ul, .login-hero footer { display: none; }
}

/* ------------------------------------------------------------------ layout do app */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; height: 64px; padding: 0 28px;
  background: rgba(7, 7, 7, 0.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--hairline);
}
.topbar > .wordmark { flex: none; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.nav button {
  height: 64px; padding: 0 14px; border: 0; background: none; color: var(--text-muted); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; font-size: 13.5px;
}
.nav button:hover { color: var(--text-primary); }
.nav button[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--accent); }
.userbox { display: flex; align-items: center; gap: 12px; flex: none; }
.userbox .who { text-align: right; line-height: 1.25; }
.userbox .who strong { display: block; font-size: 13px; font-weight: 600; }
.userbox .who span { font-size: 11px; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; }

main { padding: 22px 28px 60px; max-width: 1480px; margin: 0 auto; }

/* seções "disponível em breve": página desfocada atrás de um aviso; a barra de abas (z-index 20) fica acima e clicável */
.wip-overlay {
  position: fixed; inset: 64px 0 0 0; z-index: 15; display: grid; place-items: center; padding: 24px;
  background: rgba(7, 7, 7, 0.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.nav button .lock {
  width: 13px; height: 13px; margin-right: 6px; vertical-align: -2px; fill: none; stroke: var(--accent);
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.wip-overlay[hidden] { display: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .wip-overlay { background: rgba(7, 7, 7, 0.9); }
}
.wip-banner {
  padding: 22px 44px; border-radius: 16px; background: rgba(16, 16, 16, 0.72);
  border: 1px solid rgba(201, 164, 92, 0.38); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 22px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-primary); text-align: center;
}
.wip-banner::before {
  content: ""; display: block; width: 36px; height: 2px; margin: 0 auto 14px; border-radius: 2px; background: var(--accent);
}
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 8px; }
.filters .field { margin: 0; }
.filters .field label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.filters .select, .filters .input { height: 36px; font-size: 13px; padding: 0 10px; min-width: 130px; }
.filters .input[type="month"] { min-width: 150px; }
.freshness { font-size: 12px; color: var(--text-muted); margin: 10px 0 20px; }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 6px 0 16px; }
.page-title h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.card { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 20px 20px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head p { margin: 3px 0 0; font-size: 12px; color: var(--text-muted); }
.loading { opacity: 0.45; transition: opacity .2s; }

/* ------------------------------------------------------------------ números */
.hero-row { display: grid; grid-template-columns: minmax(280px, 1.1fr) 3fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .hero-row { grid-template-columns: 1fr; } }
.hero { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(160deg, #131210, var(--surface-1) 60%); }
.hero .label { font-size: 12px; color: var(--text-secondary); }
.hero .value { font-size: clamp(38px, 4vw, 54px); font-weight: 600; letter-spacing: -0.03em; margin: 8px 0 6px; line-height: 1.05; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile .label { font-size: 12px; color: var(--text-secondary); }
.tile .value { font-size: 23px; font-weight: 600; margin: 8px 0 4px; letter-spacing: -0.02em; }
.tile .sub { font-size: 12px; color: var(--text-muted); }
.delta { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--series-8); }
.delta.flat { color: var(--text-muted); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.5;
  background: rgba(250, 178, 25, 0.06); border: 1px solid rgba(250, 178, 25, 0.22); color: var(--text-secondary); margin-bottom: 16px; }
.notice::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--warning); color: #111; font-weight: 700; font-size: 12px; display: grid; place-items: center; }

/* ------------------------------------------------------------------ gráficos */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .data-label { fill: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .crosshair { stroke: var(--text-muted); stroke-width: 1; }
.chart .mark { transition: opacity .12s, filter .12s; }
.chart .mark:hover, .chart .mark:focus { filter: brightness(1.25); outline: none; }
.chart .dim { opacity: 0.35; }
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 160px; max-width: 320px; padding: 10px 12px; border-radius: 10px;
  background: #0c0c0c; border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); font-size: 12px;
}
.tooltip .t-title { color: var(--text-muted); margin-bottom: 6px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tooltip .t-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tooltip .t-val { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.tooltip .t-name { color: var(--text-secondary); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 2px 0 10px; font-size: 12px; color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend i.line { height: 2px; width: 14px; border-radius: 1px; }
.legend i.dashed { height: 0; width: 14px; border-top: 2px dashed; background: none !important; }
.view-toggle { font-size: 12px; }

/* ------------------------------------------------------------------ tabelas */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.wrap { white-space: normal; min-width: 220px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border); color: var(--text-secondary); }
.badge.gold { border-color: rgba(201, 164, 92, 0.45); color: var(--accent-strong); }
.badge.off { border-color: rgba(230, 103, 103, 0.4); color: var(--series-8); }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-cell i { height: 6px; border-radius: 3px; background: var(--series-1); display: block; }

/* ------------------------------------------------------------------ assistente */
.chat { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 230px); min-height: 480px; }
.chat-log { overflow-y: auto; padding: 4px 4px 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 820px; line-height: 1.6; font-size: 14px; }
.msg.user { align-self: flex-end; background: var(--surface-3); border: 1px solid var(--hairline); padding: 10px 14px; border-radius: 14px 14px 4px 14px; }
.msg.assistant { align-self: flex-start; padding: 2px 2px; }
.msg.assistant .who { font-size: 11px; letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase; margin-bottom: 4px; }
.msg.assistant p { margin: 0 0 10px; }
.msg.assistant ul, .msg.assistant ol { margin: 0 0 10px; padding-left: 20px; }
.msg.assistant table { border-collapse: collapse; margin: 6px 0 12px; font-size: 12.5px; }
.msg.assistant th, .msg.assistant td { border-bottom: 1px solid var(--hairline); padding: 6px 10px; text-align: left; }
.msg .tools { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.msg.error { color: var(--serious); }
.typing { color: var(--text-muted); font-size: 13px; }
.chat-input { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.chat-input textarea { flex: 1; resize: none; min-height: 48px; max-height: 160px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-1); outline: none; }
.chat-input textarea:focus { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip { border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 7px 12px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--text-primary); }

/* ------------------------------------------------------------------ modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 440px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.modal h3 { margin: 0 0 6px; font-size: 18px; }
.modal p { color: var(--text-muted); margin: 0 0 20px; line-height: 1.5; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 16px; padding: 12px 14px; background: var(--surface-3); border-radius: 10px; letter-spacing: 0.04em; user-select: all; }
.form-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
@media (max-width: 1100px) { .form-row { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ DRE */
.small { font-size: 12px; }
.dre-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.subtabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface-1); }
.subtabs button { border: 0; background: transparent; color: var(--text-muted); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.subtabs button:hover { color: var(--text-primary); }
.subtabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--accent); }
.dre-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dre-controls .field { margin: 0; }
.dre-controls .field label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.dre-controls .select { height: 36px; font-size: 13px; padding: 0 10px; min-width: 150px; }
.multi { position: relative; }
.multi summary { list-style: none; height: 36px; min-width: 180px; padding: 0 34px 0 12px; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); cursor: pointer; font-size: 13px; position: relative; user-select: none; }
.multi summary::-webkit-details-marker { display: none; }
.multi summary::after { content: "▾"; position: absolute; right: 12px; color: var(--text-muted); }
.multi[open] summary { border-color: var(--accent); }
.multi .panel { position: absolute; z-index: 30; top: 42px; right: 0; min-width: 220px; max-height: 340px; overflow-y: auto; padding: 6px; background: #0c0c0c; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.multi label.opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary); text-transform: none; letter-spacing: 0; }
.multi label.opt:hover { background: var(--surface-2); }
.multi input { accent-color: var(--accent); width: 16px; height: 16px; }

.dre-struct { max-width: 780px; margin: 0 auto; padding: 26px 28px 18px; }
.dre-struct-title { text-align: center; font-weight: 700; letter-spacing: 0.06em; font-size: 15px; margin-bottom: 4px; }
.dre-struct .period { text-align: center; color: var(--text-muted); font-size: 12px; margin-bottom: 24px; }
.dre-block { display: grid; gap: 4px; margin-bottom: 22px; }
.dre-row, .dre-sub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 230px) 58px; align-items: center; gap: 12px; }
.dre-label { text-align: right; font-size: 12.5px; letter-spacing: 0.02em; color: var(--text-secondary); }
.dre-value { text-align: center; font-size: 16px; font-weight: 600; padding: 7px 12px; border-radius: 6px; border: 1px solid transparent; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.dre-av { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dre-row.receita .dre-value { background: rgba(12, 163, 12, 0.14); border-color: rgba(12, 163, 12, 0.30); }
.dre-row.despesa .dre-value { background: rgba(250, 178, 25, 0.12); border-color: rgba(250, 178, 25, 0.28); }
.dre-row.investimento .dre-value { background: rgba(57, 135, 229, 0.18); border-color: rgba(57, 135, 229, 0.36); }
.dre-row.subtotal .dre-label, .dre-row.final .dre-label { color: var(--text-primary); font-weight: 700; }
.dre-row.subtotal .dre-value { background: rgba(12, 163, 12, 0.30); border-color: rgba(12, 163, 12, 0.55); }
.dre-row.final .dre-value { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.22); font-size: 17px; }
.dre-row.negativo .dre-value { background: rgba(208, 59, 59, 0.26); border-color: rgba(208, 59, 59, 0.5); }
.dre-row.expandable { cursor: pointer; }
.dre-row.expandable .dre-label::before { content: "▸ "; color: var(--text-muted); }
.dre-row.expandable.open .dre-label::before { content: "▾ "; }
.dre-row.expandable:hover .dre-value, .dre-row.expandable:focus-visible .dre-value { filter: brightness(1.2); }
.dre-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.dre-subs { display: grid; gap: 3px; margin: 2px 0 8px; }
.dre-sub { font-size: 12px; color: var(--text-muted); }
.dre-sub span:first-child { text-align: right; }
.dre-sub span:nth-child(2) { text-align: center; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
@media (max-width: 640px) {
  .dre-row, .dre-sub { grid-template-columns: minmax(0, 1fr) 148px; }
  .dre-av, .dre-sub span:nth-child(3) { display: none; }
  .dre-struct { padding: 18px 12px; }
  .dre-value { font-size: 14px; }
}

table.data tr.clickable { cursor: pointer; }
table.data tr.selected td { background: var(--surface-2); }
table.data tr.pareto td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.data tr.subtotal td { font-weight: 600; border-top: 1px solid var(--border); }
table.data tr.subconta td { color: var(--text-secondary); font-size: 12px; }
table.data tr.subconta td:first-child { padding-left: 28px; }
.insights { margin: 0; padding-left: 18px; }
.insights li { margin: 0 0 8px; line-height: 1.55; color: var(--text-secondary); }
.drill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.drill-grid h4 { margin: 0 0 4px; font-size: 14px; }
@media (max-width: 1100px) { .drill-grid { grid-template-columns: 1fr; } }
table.data.heat td.cell { text-align: right; font-variant-numeric: tabular-nums; }
.chart .data-label.strong { fill: var(--text-primary); font-weight: 600; }
