/* =============================================================
 * Financeiro › DRE gerencial, etapa 1 (12/11/2026). Desenhada por assets/js/financeiro-dre-ui.js em #financeiroDreApp.
 * Só tokens da pele 2026 (portal-2026.css): sem cor fixa, o escuro vem dos mesmos tokens (não precisa do gerar_dark_css.py).
 * Estado sempre escrito (selo, "sem dado", "falta dado"), nunca só cor. Sem modal: alíquotas e detalhe abrem embutidos.
 * Corte do celular por contêiner (720 px): a tabela mostra a linha, o mês escolhido nos chips e o acumulado.
 * ============================================================= */
#financeiroDreApp{ min-width:0; }
.dre{ container:dre / inline-size; display:flex; flex-direction:column; gap:12px; min-width:0; padding:2px 0 28px; font-family:var(--font-body); color:var(--ink); }
.dre *{ box-sizing:border-box; }
.dre svg{ flex:none; }
.dre h2, .dre h3, .dre p{ margin:0; }
.dre button{ font-family:inherit; }
.dre .dre-mut{ color:var(--ink-2); font-size:12.5px; line-height:18px; }
.dre-sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.dre-caixa{ background:var(--panel); border:1px solid var(--line); border-radius:var(--r-lg, 14px); box-shadow:var(--shadow-soft); min-width:0; }
.dre-vazio{ display:flex; flex-direction:column; gap:4px; align-items:center; padding:40px 16px; color:var(--ink-2); }
.dre-vazio b{ color:var(--ink); }

/* ---------- barra (filtros; sem cabeçalho de título) ---------- */
.dre-barra{ display:flex; align-items:center; gap:8px 14px; flex-wrap:wrap; background:var(--panel); border:1px solid var(--line); border-radius:var(--r-lg, 14px); padding:8px 12px; box-shadow:var(--shadow-soft); }
.dre-filtro{ display:flex; align-items:center; gap:8px; }
.dre-filtro-r{ font-size:12.5px; font-weight:700; color:var(--ink-2); }
.dre-seg{ display:inline-flex; gap:4px; padding:3px; border-radius:11px; background:var(--chip); }
.dre-seg-b{ all:unset; box-sizing:border-box; cursor:pointer; height:28px; padding:0 14px; border-radius:8px; font-size:13px; font-weight:700; color:var(--ink-2); display:inline-flex; align-items:center; font-variant-numeric:tabular-nums; }
.dre-seg-b:hover{ color:var(--ink); }
.dre-seg-b.is-ativo{ background:var(--panel); color:var(--ink); box-shadow:var(--shadow-soft); }
.dre-chip{ display:inline-flex; align-items:center; height:26px; padding:0 10px; border-radius:999px; background:var(--chip); color:var(--ink-2); font-size:12.5px; font-weight:700; white-space:nowrap; }
.dre-barra-fim{ margin-left:auto; display:flex; align-items:center; gap:8px 12px; flex-wrap:wrap; justify-content:flex-end; }
.dre-atual{ font-size:12px; color:var(--ink-2); display:inline-flex; align-items:center; gap:6px; }
.dre-atual::before{ content:""; width:6px; height:6px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.dre-btn{ all:unset; box-sizing:border-box; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; height:30px; padding:0 12px; border-radius:9px; border:1px solid var(--line-2); background:var(--panel); color:var(--ink); font-size:12.5px; font-weight:700; white-space:nowrap; }
.dre-btn:hover{ background:var(--hover); }
.dre-btn.is-primario{ background:var(--accent-deep); border-color:var(--accent-deep); color:var(--on-accent); }
.dre-btn[aria-expanded="true"]{ border-color:var(--accent); background:var(--accent-50); color:var(--accent-ink); }
.dre-seg-b:focus-visible, .dre-btn:focus-visible, .dre-cel:focus-visible, .dre-i:focus-visible, .dre-foco-b:focus-visible, .dre-det-fechar:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* ---------- alíquotas (embutido, nunca modal) ---------- */
.dre-aliq[hidden]{ display:none; }
.dre-aliq-c{ display:grid; grid-template-columns:minmax(0, 1fr) 130px 130px; gap:10px 16px; align-items:end; padding:12px 16px; }
.dre-aliq-t{ font-size:13px; line-height:19px; color:var(--ink-2); }
.dre-campo{ display:flex; flex-direction:column; gap:4px; font-size:12px; font-weight:700; color:var(--ink-2); }
.dre-campo input{ height:34px; padding:0 10px; border-radius:9px; border:1px solid var(--line-2); background:var(--input); color:var(--ink); font:600 14px var(--font-body); font-variant-numeric:tabular-nums; }
.dre-aliq-acoes{ grid-column:1 / -1; display:flex; align-items:center; gap:8px; justify-content:flex-end; }
.dre-aliq-msg{ margin-right:auto; font-size:12.5px; color:var(--ink-2); }

/* ---------- faixas de aviso ---------- */
.dre-avisos{ display:flex; flex-direction:column; gap:6px; }
.dre-faixa{ display:block; padding:0; border-radius:10px; border:1px solid var(--line); font-size:13px; line-height:19px; color:var(--ink); }
.dre-faixa summary{ list-style:none; cursor:pointer; display:flex; align-items:center; gap:8px; padding:7px 12px; min-height:34px; }
.dre-faixa summary::-webkit-details-marker{ display:none; }
.dre-faixa summary:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; border-radius:10px; }
.dre-faixa svg{ width:16px; height:16px; }
.dre-faixa b{ font-weight:800; flex:1 1 auto; min-width:0; }
.dre-faixa-mais{ flex:none; font-size:12px; font-weight:700; color:var(--accent-ink); }
.dre-faixa[open] .dre-faixa-mais{ display:none; }
.dre-faixa p{ padding:0 12px 9px 36px; }
.dre-faixa.is-atencao{ background:var(--amber-soft); border-color:var(--amber); }
.dre-faixa.is-atencao svg{ color:var(--amber); }
.dre-faixa.is-info{ background:var(--bg-2); }
.dre-faixa.is-info svg{ color:var(--accent-ink); }

/* ---------- selos ---------- */
.dre-selo{ text-transform:none; letter-spacing:0; display:inline-flex; align-items:center; width:max-content; font-size:11px; line-height:15px; font-weight:700; padding:1px 7px; border-radius:999px; border:1px solid var(--line-2); background:var(--chip); color:var(--ink-2); white-space:nowrap; }
.dre-selo.is-nota{ background:var(--accent-50); border-color:var(--accent-line); color:var(--accent-ink); }
.dre-selo.is-estimado{ background:var(--amber-soft); border-color:var(--amber); color:var(--ink); }
.dre-selo.is-semdado{ background:var(--chip); color:var(--ink-2); border-style:dashed; }
.dre-selo.is-parcial{ background:transparent; border-style:dashed; border-color:var(--ink-3); color:var(--ink); }
.dre-selo.is-bloqueado{ background:var(--red-soft); border-color:var(--red-line); color:var(--ink); }
.dre-selo.is-aberto{ background:var(--blue-soft, var(--chip)); color:var(--ink); }
.dre-selo.is-classificar{ background:var(--yellow-soft, var(--amber-soft)); color:var(--ink); }

/* ---------- cartões do acumulado ---------- */
.dre h2.dre-rotulo{ font-size:11.5px; line-height:16px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-2) !important; margin-top:2px; }
.dre-cards{ display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:12px; }
.dre-card{ display:flex; flex-direction:column; gap:6px; padding:12px 14px; }
.dre-card-cab{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.dre .dre-card h3{ font-size:13.5px; line-height:18px; font-weight:800; color:var(--ink) !important; }
.dre-card-valor{ font-size:24px; line-height:30px; font-weight:800; letter-spacing:-.015em; font-variant-numeric:tabular-nums; white-space:nowrap; }
.dre-card-semvalor{ font-size:18px; color:var(--ink-2); font-weight:700; }
.dre-card-linha{ display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; font-size:13px; line-height:18px; padding-top:6px; border-top:1px solid var(--line-soft); }
.dre-card-r{ font-size:12px; font-weight:800; color:var(--ink-2); text-transform:uppercase; letter-spacing:.04em; }
.dre-card-linha b{ font-weight:800; font-variant-numeric:tabular-nums; }
.dre-card-pe{ margin-top:auto; padding-top:2px; }
.dre-varchip{ display:inline-flex; align-items:center; font-size:12px; line-height:16px; font-weight:700; padding:3px 8px; border-radius:8px; border:1px solid var(--line); background:var(--bg-2); color:var(--ink-2); font-variant-numeric:tabular-nums; }
.dre-varchip.is-sobe{ color:var(--accent-ink); }
.dre-varchip.is-desce{ color:var(--red); }
.dre-varchip.is-sem{ font-weight:600; }

/* ---------- a tabela ---------- */
.dre-tabela-caixa{ overflow:hidden; }
.dre-focos{ display:none; gap:6px; padding:8px 10px; overflow-x:auto; scrollbar-width:none; border-bottom:1px solid var(--line); }
.dre-focos::-webkit-scrollbar{ display:none; }
.dre-foco-b{ all:unset; box-sizing:border-box; cursor:pointer; display:inline-flex; align-items:center; height:30px; padding:0 12px; border-radius:9px; border:1px solid var(--line); background:var(--panel); color:var(--ink-2); font-size:13px; font-weight:700; white-space:nowrap; }
.dre-foco-b.is-ativo{ background:var(--accent-deep); border-color:var(--accent-deep); color:var(--on-accent); }
.dre-rolavel{ overflow-x:auto; }
.dre-tab{ width:100%; border-collapse:separate; border-spacing:0; font-size:13px; line-height:18px; font-variant-numeric:tabular-nums; }
.dre-tab thead th{ position:relative; text-align:right; vertical-align:bottom; font-size:12px; font-weight:800; color:var(--ink-2); padding:8px 8px 7px; border-bottom:1px solid var(--line); white-space:nowrap; background:var(--panel); }
.dre-th-m{ display:block; }
.dre-tab thead th .dre-selo{ margin:3px 0 0 auto; font-size:10.5px; }
.dre-tab th.dre-rot-cab{ text-align:left; font-size:11.5px; letter-spacing:.04em; text-transform:uppercase; }
.dre-rot{ position:sticky; left:0; z-index:2; text-align:left; font-weight:600; background:var(--panel); min-width:214px; width:214px; padding:0 6px 0 12px; border-right:1px solid var(--line-soft); }
.dre-rot-in{ display:flex; align-items:center; gap:6px; min-height:34px; flex-wrap:wrap; padding:4px 0; }
.dre-rot-t{ flex:0 1 auto; min-width:0; }
.dre-i{ all:unset; box-sizing:border-box; display:inline-grid; place-items:center; width:24px; height:24px; margin-left:auto; border-radius:50%; color:var(--ink-3); cursor:help; flex:none; }
.dre-i svg{ width:15px; height:15px; }
.dre-i:hover, .dre-i:focus-visible{ color:var(--accent-ink); background:var(--accent-50); }
.dre-tab tbody td, .dre-tab tbody th{ border-bottom:1px solid var(--line-soft); }
.dre-col{ min-width:58px; padding:0; text-align:right; }
.dre-c-acum{ border-left:1px solid var(--line); min-width:92px; }
.dre-c-ant{ min-width:84px; }
.dre-c-var{ min-width:70px; }
.dre-tab thead .dre-c-acum, .dre-tab tbody .dre-c-acum{ background:var(--bg-2); }
.dre-tab thead .dre-c-acum{ white-space:normal; min-width:92px; }
.dre-col.is-aberto{ background:repeating-linear-gradient(135deg, transparent 0 6px, var(--hover) 6px 7px); }
.dre-cel{ all:unset; box-sizing:border-box; cursor:pointer; display:flex; flex-direction:column; align-items:flex-end; justify-content:center; gap:2px; width:100%; min-height:32px; padding:5px 6px; }
.dre-cel:hover{ background:var(--hover); }
.dre-v{ white-space:nowrap; }
.dre-sd{ font-size:11.5px; font-style:italic; color:var(--ink-3); white-space:nowrap; }
.dre-sd.is-bloqueado{ font-style:normal; font-weight:700; color:var(--ink-2); }
.dre-marca{ font-size:10.5px; line-height:14px; font-weight:700; padding:0 5px; border-radius:6px; white-space:nowrap; font-style:normal; }
.dre-marca.is-parcial{ border:1px dashed var(--ink-3); color:var(--ink-2); }
.dre-marca.is-aviso{ background:var(--amber-soft); color:var(--ink); border:1px solid var(--amber); }
.dre-var{ font-weight:700; white-space:nowrap; }
.dre-var.is-sobe{ color:var(--accent-ink); }
.dre-var.is-desce{ color:var(--red); }

/* a pele (.content th, com !important) tira o fundo e o peso de todo th: aqui eles voltam */
.dre .dre-tab th{ text-transform:none !important; letter-spacing:0 !important; }
.dre .dre-tab thead th{ background:var(--panel) !important; color:var(--ink-2) !important; font-size:12px !important; font-weight:800 !important; }
.dre .dre-tab thead th.dre-c-acum{ background:var(--bg-2) !important; }
.dre .dre-tab tbody th.dre-rot{ background:var(--panel) !important; color:var(--ink) !important; font-size:13px !important; font-weight:600 !important; border-bottom:1px solid var(--line-soft) !important; }
.dre .dre-tab tbody .dre-t-sub th.dre-rot, .dre .dre-tab tbody .dre-t-info th.dre-rot, .dre .dre-tab tbody .dre-t-pct th.dre-rot{ color:var(--ink-2) !important; font-size:12.5px !important; font-weight:500 !important; }
.dre .dre-tab tbody .dre-t-subtotal th.dre-rot{ background:var(--bg-2) !important; font-weight:800 !important; border-top:1px solid var(--line) !important; }
.dre .dre-tab tbody .dre-t-final th.dre-rot{ background:var(--accent-50) !important; font-weight:800 !important; font-size:14px !important; border-top:2px solid var(--accent-line) !important; }
.dre .dre-det-tab th{ background:var(--panel) !important; text-transform:none !important; }
.dre .dre-det > td, .dre tbody tr.dre-det:hover > td{ background:var(--bg-2) !important; }

/* tipos de linha */
.dre-t-sub .dre-rot{ padding-left:28px; font-weight:500; font-size:12.5px; color:var(--ink-2); }
.dre-t-sub .dre-cel{ font-size:12.5px; color:var(--ink-2); }
.dre-t-info .dre-rot{ padding-left:28px; font-weight:500; font-style:italic; font-size:12.5px; color:var(--ink-2); }
.dre-t-info .dre-cel{ font-size:12.5px; font-style:italic; color:var(--ink-2); }
.dre-t-pct .dre-rot{ padding-left:28px; font-weight:600; font-size:12.5px; color:var(--ink-2); }
.dre-t-pct .dre-cel{ font-size:12.5px; color:var(--ink-2); }
.dre-t-subtotal > *{ background:var(--bg-2); }
.dre-t-subtotal .dre-rot, .dre-t-subtotal .dre-cel{ font-weight:800; }
.dre-t-subtotal > *{ border-top:1px solid var(--line); }
.dre-t-final > *{ background:var(--accent-50); border-top:2px solid var(--accent-line); }
.dre-t-final .dre-rot, .dre-t-final .dre-cel{ font-weight:800; font-size:14px; }
.dre-l.is-aberta > *{ box-shadow:inset 0 -2px 0 var(--accent); }
.dre-junta{ text-align:left !important; padding:6px 12px; font-size:12.5px; line-height:18px; color:var(--ink-2); }
.dre-junta-t{ display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px; max-width:880px; }
.dre-junta.is-bloqueado{ color:var(--ink); font-weight:600; }

/* ---------- detalhe embutido ---------- */
.dre-det > td{ padding:0; border-bottom:1px solid var(--line); background:var(--bg-2); }
.dre-det-in{ position:sticky; left:0; display:flex; flex-direction:column; gap:8px; padding:12px 16px 14px; border-left:3px solid var(--accent); width:min(100cqw, 100%); max-width:100cqw; }
.dre-det-cab{ display:flex; align-items:center; gap:10px; }
.dre .dre-det-cab h3{ font-size:14px; line-height:20px; font-weight:800; color:var(--ink) !important; }
.dre-det-fechar{ all:unset; box-sizing:border-box; margin-left:auto; display:inline-grid; place-items:center; width:30px; height:30px; border-radius:50%; border:1px solid var(--line-2); background:var(--panel); color:var(--ink-2); cursor:pointer; }
.dre-det-fechar svg{ width:14px; height:14px; }
.dre-det-regra{ font-size:13.5px; line-height:20px; color:var(--ink); max-width:920px; }
.dre-det-lista{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.dre-det-rola{ max-height:380px; overflow:auto; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.dre-det-tab{ width:100%; border-collapse:collapse; font-size:12.5px; line-height:17px; font-variant-numeric:tabular-nums; }
.dre-det-tab th{ position:sticky; top:0; z-index:1; background:var(--panel); text-align:left; font-size:11.5px; font-weight:800; color:var(--ink-2); padding:7px 10px; border-bottom:1px solid var(--line); white-space:nowrap; }
.dre-det-tab td{ padding:6px 10px; border-bottom:1px solid var(--line-soft); }
.dre-det-tab .dre-n{ text-align:right; white-space:nowrap; }
.dre-det-tab .dre-d{ white-space:nowrap; color:var(--ink-2); }
.dre-det-tab tr.is-fora td{ color:var(--ink-3); }

.dre-rodape{ font-size:12.5px; line-height:20px; color:var(--ink-2); }
.dre-rodape .dre-selo{ vertical-align:1px; }

#dreTip{ position:fixed; z-index:10060; max-width:380px; padding:9px 12px; border-radius:10px; background:var(--ink); color:var(--panel); font:12.5px/1.5 var(--font-body); box-shadow:var(--shadow); pointer-events:none; opacity:0; transition:opacity .1s; }
#dreTip.is-aberto{ opacity:1; }

/* ---------- notebook e celular ---------- */
@container dre (max-width: 1180px){
  .dre-cards{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .dre-rot{ min-width:200px; width:200px; }
}
@container dre (max-width: 720px){
  .dre-cards{ grid-template-columns:minmax(0, 1fr); }
  .dre-card-valor{ font-size:22px; line-height:28px; }
  .dre-aliq-c{ grid-template-columns:1fr 1fr; }
  .dre-aliq-t{ grid-column:1 / -1; }
  .dre-barra-fim{ margin-left:0; justify-content:flex-start; }
  .dre-focos{ display:flex; }
  .dre-tab .dre-c-mes:not(.is-foco), .dre-tab .dre-c-ant:not(.is-foco), .dre-tab .dre-c-var{ display:none; }
  .dre-rot{ min-width:0; width:46%; }
  .dre-col{ min-width:0; }
  .dre-c-acum{ min-width:0; }
  .dre-t-sub .dre-rot, .dre-t-info .dre-rot, .dre-t-pct .dre-rot{ padding-left:20px; }
  .dre-junta-t{ max-width:none; }
}
