/* =========================================================
   Financeiro — estilos (sem dependências externas)
   ========================================================= */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --borda: #e4e7ec;
  --borda-forte: #cfd4dc;
  --texto: #14161c;
  --suave: #667085;
  --acento: #2f5bea;
  --acento-2: #2249c9;
  --acento-fundo: #eef2fe;
  --pessoal: #0e9f8e;
  --empresa: #5b4be0;
  --cartao: #e8772e;
  --nc: #98a2b3;
  --ok: #138a52;
  --ok-fundo: #e7f6ee;
  --atencao: #b26b00;
  --atencao-fundo: #fff4e0;
  --perigo: #cc3b3b;
  --perigo-fundo: #fdecec;
  --raio: 14px;
  --raio-p: 9px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --fonte: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015;
    --surface: #161920;
    --surface-2: #1b1f27;
    --borda: #262b35;
    --borda-forte: #353b47;
    --texto: #e9ebef;
    --suave: #98a1b0;
    --acento: #6d8cff;
    --acento-2: #8aa3ff;
    --acento-fundo: #1c2440;
    --pessoal: #2cc4b1;
    --empresa: #8d80ff;
    --cartao: #ff9a52;
    --nc: #6b7383;
    --ok: #3cc683;
    --ok-fundo: #12291d;
    --atencao: #f0b44c;
    --atencao-fundo: #2e2410;
    --perigo: #ff6b6b;
    --perigo-fundo: #331818;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--texto);
  font: 15px/1.5 var(--fonte); font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acento); text-decoration: none; }
a:hover { color: var(--acento-2); }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1rem; font-weight: 650; }
small { font-size: .8rem; }
code { background: var(--surface-2); border: 1px solid var(--borda); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { width: 18px; height: 18px; flex: none; }
.num { text-align: right; white-space: nowrap; }
.suave { color: var(--suave); }
.pre { white-space: pre-wrap; margin: .5rem 0 0; }
.js .sem-js { display: none; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--surface) 247px, var(--borda) 247px, var(--borda) 248px, transparent 248px); }
.lateral {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px;
}
.marca { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--texto); padding: 2px 6px 0; }
.marca img { display: block; width: 100%; max-width: 208px; height: auto; }
.marca-app { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); }
.marca-mobile { display: none; }
.marca-ic {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--acento); color: #fff; font-weight: 800;
}
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--raio-p);
  color: var(--suave); font-weight: 550;
}
.menu a:hover { background: var(--surface-2); color: var(--texto); }
.menu a.ativo { background: var(--acento-fundo); color: var(--acento); }
.sair { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 0; border-top: 1px solid var(--borda); }
.usuario { font-size: .85rem; color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conteudo { padding: 28px 32px 48px; max-width: 1280px; width: 100%; min-width: 0; }
.barra-inferior { display: none; }

/* ---------- Topo ---------- */
.topo { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.sub { margin: 4px 0 0; color: var(--suave); font-size: .9rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.voltar { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; margin-bottom: 6px; color: var(--suave); }
.topo-acoes { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border: 1px solid var(--borda-forte); border-radius: var(--raio-p); background: var(--surface); color: var(--texto);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); color: var(--texto); }
.btn-primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn-primario:hover { background: var(--acento-2); border-color: var(--acento-2); color: #fff; }
.btn-perigo { color: var(--perigo); }
.btn-perigo:hover { background: var(--perigo-fundo); color: var(--perigo); border-color: var(--perigo); }
.btn-sm { height: 34px; padding: 0 12px; font-size: .9rem; }
.btn-bloco { width: 100%; }
.btn-novo { width: 100%; }
.btn-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--suave); font: inherit; font-size: .85rem; cursor: pointer; padding: 4px; }
.btn-link:hover { color: var(--perigo); }
.btn-ic {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--suave); cursor: pointer;
}
.btn-ic:hover { background: var(--surface-2); border-color: var(--borda); color: var(--texto); }
.btn-ic.ok:hover { color: var(--ok); background: var(--ok-fundo); border-color: transparent; }
.btn-ic.perigo:hover { color: var(--perigo); background: var(--perigo-fundo); border-color: transparent; }
.link { font-size: .88rem; font-weight: 550; }
.acoes { display: flex; justify-content: flex-end; gap: 2px; }
.acoes form { margin: 0; }

/* ---------- Avisos ---------- */
.aviso { padding: 12px 16px; border-radius: var(--raio-p); margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.aviso-ok { background: var(--ok-fundo); color: var(--ok); }
.aviso-erro { background: var(--perigo-fundo); color: var(--perigo); }
.aviso-aviso { background: var(--atencao-fundo); color: var(--atencao); }
.faixa-alerta {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 18px; border-radius: var(--raio-p);
  background: var(--perigo-fundo); color: var(--perigo);
}
.faixa-alerta:hover { color: var(--perigo); filter: brightness(.98); }

/* ---------- Seletor de mês ---------- */
.seletor-mes { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--borda); border-radius: 12px; padding: 4px; box-shadow: var(--sombra); flex-wrap: wrap; }
.seletor-rotulo { display: none; }
.seletor-mes select { width: auto; min-height: 0; border: 0; background: transparent; font: inherit; font-weight: 650; color: var(--texto); padding: 6px 4px; cursor: pointer; }
.seletor-mes select:focus-visible { outline: 2px solid var(--acento); border-radius: 6px; }
.alternar { display: inline-flex; background: var(--surface-2); border: 1px solid var(--borda); border-radius: 9px; padding: 2px; margin-left: 6px; }
.alternar a { padding: 5px 12px; border-radius: 7px; color: var(--suave); font-size: .85rem; font-weight: 600; }
.alternar a.ativo { background: var(--surface); color: var(--texto); box-shadow: var(--sombra); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; background: var(--surface);
  border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); color: var(--texto); overflow: hidden;
}
a.kpi:hover { border-color: var(--borda-forte); color: var(--texto); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cor-kpi, transparent); }
.kpi-pessoal { --cor-kpi: var(--pessoal); }
.kpi-empresa { --cor-kpi: var(--empresa); }
.kpi-cartao { --cor-kpi: var(--cor-cartao, var(--cartao)); }
.kpi-total { background: var(--texto); color: var(--surface); border-color: var(--texto); }
.kpi-total .kpi-rot, .kpi-total .kpi-det { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.kpi-rot { font-size: .82rem; color: var(--suave); font-weight: 550; }
.kpi-valor { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.kpi-valor.menor { font-size: 1.2rem; }
.kpi-det { font-size: .8rem; color: var(--suave); display: flex; flex-direction: column; gap: 6px; }
.mini-barra { display: block; height: 5px; border-radius: 9px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--borda); }
.kpi-total .mini-barra { background: rgba(255,255,255,.15); border-color: transparent; }
.mini-barra i { display: block; height: 100%; background: var(--ok); border-radius: 9px; }
.mini-barra.alerta i { background: var(--cartao); }

/* ---------- Painéis ---------- */
.painel { background: var(--surface); border: 1px solid var(--borda); border-radius: var(--raio); padding: 20px; box-shadow: var(--sombra); margin-bottom: 18px; min-width: 0; }
.painel.sem-padding { padding: 0; overflow: hidden; }
.painel-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.painel-topo.com-padding { padding: 18px 20px 0; }
.painel-form { max-width: 820px; }
.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grade > .painel { margin-bottom: 18px; }
.vazio { color: var(--suave); margin: 4px 0; }
.vazio-grande { text-align: center; padding: 40px 20px; color: var(--suave); }
.vazio-grande p { margin: 0 0 14px; }
.nota { color: var(--suave); font-size: .82rem; margin: 10px 0 0; }
.dica { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--borda-forte); color: var(--suave); font-size: .75rem; font-weight: 700; cursor: help; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--suave); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.pt { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.seg-pessoal { background: var(--pessoal); }
.seg-empresa { background: var(--empresa); }
.seg-cartao { background: var(--cartao); }
.seg-nc { background: var(--nc); }

/* Pessoal x Empresa */
.barra-dividida { display: flex; height: 16px; border-radius: 9px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.barra-dividida i { display: block; height: 100%; }
.legenda-lista { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.legenda-lista li { display: grid; grid-template-columns: auto 1fr auto 56px; align-items: center; gap: 10px; }
.legenda-lista b { font-weight: 650; }
.legenda-lista em { font-style: normal; color: var(--suave); text-align: right; font-size: .85rem; }

/* Barras horizontais (categorias) */
.barras-h { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.barras-h li { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; align-items: center; gap: 12px; font-size: .9rem; }
.bh-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-trilho { height: 10px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.bh-trilho i { display: block; height: 100%; border-radius: 9px; }
.bh-valor { font-weight: 600; white-space: nowrap; }

/* Colunas mês a mês */
.colunas { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 230px; align-items: end; }
.coluna { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; gap: 6px; color: var(--suave); border-radius: 8px; padding: 4px 2px 0; }
.coluna:hover { background: var(--surface-2); color: var(--texto); }
.coluna.atual { background: var(--acento-fundo); color: var(--acento); }
.col-pilha { display: flex; flex-direction: column; min-height: 2px; border-radius: 6px 6px 3px 3px; overflow: hidden; margin: 0 14%; background: var(--borda); }
.col-pilha i { display: block; min-height: 2px; }
.col-rot { text-align: center; font-size: .78rem; font-weight: 600; }
.col-valor { text-align: center; font-size: .7rem; min-height: 1em; }

/* Listas */
.lista-faturas, .lista-simples { list-style: none; margin: 0; padding: 0; }
.lista-faturas li + li, .lista-simples li + li { border-top: 1px solid var(--borda); }
.lista-faturas a, .lista-simples a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--texto); }
.lista-faturas a:hover, .lista-simples a:hover { background: var(--surface-2); }
.lf-nome, .lista-simples span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lf-nome small, .lista-simples small, .lf-valor small { color: var(--suave); }
.lf-valor { text-align: right; font-weight: 650; display: flex; flex-direction: column; }
.lista-simples .ic { color: var(--cartao); }
.cartao-pt { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; flex: none; }
.cartao-pt.grande { width: 30px; height: 20px; border-radius: 5px; margin: 0; }

/* ---------- Tags e selos ---------- */
.tag, .selo { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 650; white-space: nowrap; }
.tag-pessoal { color: var(--pessoal); background: color-mix(in srgb, var(--pessoal) 12%, transparent); }
.tag-empresa { color: var(--empresa); background: color-mix(in srgb, var(--empresa) 12%, transparent); }
.tag-cartao { color: var(--cartao); background: color-mix(in srgb, var(--cartao) 13%, transparent); }
.selo-pago { color: var(--ok); background: var(--ok-fundo); }
.selo-pendente { color: var(--atencao); background: var(--atencao-fundo); }
.selo-atrasado { color: var(--perigo); background: var(--perigo-fundo); }
.parcela { font-weight: 650; font-variant-numeric: tabular-nums; }
.parcela.ultima { color: var(--cartao); }
.parcela.ultima::after { content: " • última"; font-weight: 500; font-size: .75rem; }

/* ---------- Tabelas ---------- */
.tabela-rolagem { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th { text-align: left; font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); padding: 12px 14px; border-bottom: 1px solid var(--borda); background: var(--surface-2); white-space: nowrap; }
.tabela th.num { text-align: right; }
.tabela td { padding: 11px 14px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela tbody tr:hover td { background: var(--surface-2); }
.tabela tfoot td { font-weight: 600; color: var(--suave); background: var(--surface-2); border-bottom: 0; }
.tabela.compacta td, .tabela.compacta th { padding: 8px 10px; }
.cel-desc a { color: var(--texto); font-weight: 600; }
.cel-desc a:hover { color: var(--acento); }
.cel-desc small { display: block; color: var(--suave); }
.linha-paga td:not(.acoes-col) { opacity: .62; }
.linha-foco td { background: var(--acento-fundo) !important; }
.linha-edicao td { background: var(--surface-2); }
.acoes-col { width: 1%; white-space: nowrap; }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--texto); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--texto); background: var(--surface); border: 1px solid var(--borda-forte); border-radius: var(--raio-p);
  padding: 9px 12px; min-height: 40px; width: 100%; font-weight: 450;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--acento); }
input[type=color] { padding: 3px; height: 40px; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-fundo); }
textarea { resize: vertical; }
.opcional { color: var(--suave); font-weight: 450; }
.linha { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.linha.tres { grid-template-columns: 2fr 1fr 1fr; }
.segmentado { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.segmentado legend { font-size: .85rem; font-weight: 600; margin-bottom: 6px; padding: 0; }
.seg { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 1px solid var(--borda-forte); border-radius: var(--raio-p); font-weight: 600; font-size: .9rem; background: var(--surface); }
.seg input:checked + span { border-color: var(--acento); background: var(--acento-fundo); color: var(--acento); }
.opt-pessoal input:checked + span { border-color: var(--pessoal); color: var(--pessoal); background: color-mix(in srgb, var(--pessoal) 10%, var(--surface)); }
.opt-empresa input:checked + span { border-color: var(--empresa); color: var(--empresa); background: color-mix(in srgb, var(--empresa) 10%, var(--surface)); }
.opt-cartao input:checked + span { border-color: var(--cartao); color: var(--cartao); background: color-mix(in srgb, var(--cartao) 10%, var(--surface)); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--acento-fundo); }
.segmentado.pequeno .seg span { height: 40px; padding: 0 12px; }
.atalhos { display: flex; flex-wrap: wrap; gap: 6px; }
.atalhos button { height: 34px; min-width: 42px; padding: 0 8px; border: 1px solid var(--borda); border-radius: 8px; background: var(--surface-2); font: inherit; font-size: .85rem; font-weight: 600; color: var(--suave); cursor: pointer; }
.atalhos button:hover, .atalhos button.ativo { border-color: var(--acento); color: var(--acento); background: var(--acento-fundo); }
.botoes { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.previa { border: 1px dashed var(--borda-forte); border-radius: var(--raio-p); padding: 14px 16px; background: var(--surface-2); }
.previa-topo { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: .9rem; }
.previa-topo span { color: var(--suave); }
.previa ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 240px; overflow: auto; }
.previa li { white-space: nowrap; display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; padding: 6px 10px; background: var(--surface); border: 1px solid var(--borda); border-radius: 7px; }
.previa li b { font-weight: 650; }
.previa li.ultima { border-color: var(--cartao); }
.previa li.ultima em { color: var(--cartao); }
.previa em { font-style: normal; color: var(--suave); }

.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.form-inline label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; }
.form-inline input, .form-inline select { min-height: 34px; padding: 5px 10px; width: auto; }
.fi-titulo { font-weight: 650; align-self: center; margin-right: 6px; }

.filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.filtros input[type=search] { flex: 1 1 220px; width: auto; }
.filtros select { width: auto; flex: 0 1 auto; }

/* Detalhes recolhíveis */
.dobravel > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dobravel > summary::-webkit-details-marker { display: none; }
.dobravel > summary::before { content: "▸"; color: var(--suave); }
.dobravel[open] > summary::before { content: "▾"; }
.dobravel[open] > summary { margin-bottom: 18px; }

/* Abas de cartões */
.abas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: thin; }
.abas a { display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--borda); background: var(--surface); color: var(--texto); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.abas a:hover { border-color: var(--borda-forte); }
.abas a.ativo { border-color: var(--acento); box-shadow: inset 0 0 0 1px var(--acento); }
.abas .aba-mais { color: var(--suave); padding: 9px 11px; }

/* Cadastros */
.cad-lista { list-style: none; margin: 0 0 14px; padding: 0; }
.cad-lista > li { display: flex; align-items: flex-start; gap: 6px; border-bottom: 1px solid var(--borda); }
.cad-lista > li > details { flex: 1; min-width: 0; }
.cad-lista > li > form { padding-top: 8px; }
.cad-lista summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 2px; cursor: pointer; }
.cad-lista summary::-webkit-details-marker { display: none; }
.cad-lista details[open] summary { color: var(--acento); }
.cad-lista li.inativo .cad-nome { opacity: .55; }
.cad-nome { flex: 1; display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.cad-nome small { font-weight: 450; color: var(--suave); }
.form-cad { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; padding: 4px 0 16px; }
.form-cad label.estreito { max-width: 120px; }
.form-add { padding-bottom: 0; }
.cad-novo > summary { list-style: none; width: fit-content; margin-top: 4px; }
.cad-novo > summary::-webkit-details-marker { display: none; }
.cad-novo[open] > summary { margin-bottom: 14px; }

/* ---------- Login ---------- */
.pagina-login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-caixa { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--borda); border-radius: 18px; padding: 32px 28px; box-shadow: var(--sombra); }
.login-caixa .marca { padding: 0; margin-bottom: 26px; align-items: center; }
.login-caixa .marca img { max-width: 240px; }
.login-caixa h1 { font-size: 1.35rem; margin-bottom: 18px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conteudo { padding: 24px 22px 48px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; background: none; }
  .lateral { display: none; }
  .conteudo { padding: 14px 16px 96px; }
  .marca-mobile { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
  .marca-mobile img { width: 124px; height: auto; display: block; }
  .marca-mobile .marca-app { border-left: 1px solid var(--borda-forte); padding-left: 10px; }
  .barra-inferior {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--borda); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .barra-inferior a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: var(--suave); padding: 4px 0; }
  .barra-inferior a.ativo { color: var(--acento); }
  .barra-inferior a.novo .ic { width: 38px; height: 38px; padding: 9px; margin-top: -16px; border-radius: 50%; background: var(--acento); color: #fff; box-shadow: 0 4px 12px rgba(47, 91, 234, .35); }
  .grade { grid-template-columns: 1fr; gap: 0; }
  .topo { align-items: stretch; flex-direction: column; }
  .seletor-mes { justify-content: space-between; }
  h1 { font-size: 1.35rem; }
  .colunas { gap: 3px; height: 190px; }
  .col-valor { display: none; }
  .col-pilha { margin: 0 8%; }
  .linha, .linha.tres { grid-template-columns: 1fr; }
  .linha.tres { grid-template-columns: 1.4fr 1fr 1fr; }
  /* Tabela vira cartões */
  .tabela.responsiva thead { display: none; }
  .tabela.responsiva, .tabela.responsiva tbody, .tabela.responsiva tr, .tabela.responsiva td { display: block; width: 100%; }
  .tabela.responsiva tr:not(.linha-edicao) { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--borda); }
  .tabela.responsiva td { border: 0; padding: 0; background: none !important; }
  .tabela.responsiva td[data-rot]::before { content: attr(data-rot); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); font-weight: 600; }
  .tabela.responsiva td.cel-desc { grid-column: 1 / -1; font-size: 1rem; order: -1; }
  .tabela.responsiva td.cel-desc::before { display: none; }
  .tabela.responsiva td.num { text-align: left; }
  .tabela.responsiva td.acoes-col { grid-column: 1 / -1; width: auto; border-top: 1px dashed var(--borda); padding-top: 6px; margin-top: 4px; }
  .tabela.responsiva .acoes { justify-content: flex-start; }
  .tabela.responsiva tfoot tr { display: flex; justify-content: space-between; padding: 12px 16px; }
  .tabela.responsiva tfoot td:empty { display: none; }
  .tabela.responsiva tfoot td { width: auto; }
  .linha-edicao td { padding: 12px 16px !important; }
}
@media (max-width: 520px) {
  .kpis, .kpis-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpis-3 .kpi:first-child { grid-column: 1 / -1; }
  .kpi { padding: 14px; }
  .kpi-valor { font-size: 1.2rem; }
  .barras-h li { grid-template-columns: 1fr auto; }
  .bh-trilho { grid-column: 1 / -1; order: 3; }
  .filtros select { flex: 1 1 45%; }
  .alternar { margin-left: 0; }
}
