/* Entrecontas · identidade Acordo · tokens centralizados (identidade/tokens.json) */
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap; src: url('/fontes/manrope/manrope-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url('/fontes/manrope/manrope-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap; src: url('/fontes/manrope/manrope-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 400; font-display: swap; src: url('/fontes/dm-sans/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-display: swap; src: url('/fontes/dm-sans/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 600; font-display: swap; src: url('/fontes/dm-sans/dm-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-display: swap; src: url('/fontes/dm-sans/dm-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --navy: #14234B; --cobalto: #3156E8; --cobalto-esc: #2445C4; --lima: #D3F56A; --lima-esc: #BFE24F;
  --fundo: #EEF2FF; --painel: #FFFFFF; --borda: #E2E7EE; --borda-forte: #CBD3DF;
  --texto: #20293A; --texto-2: #5E6B7E;
  --ok-t: #246442; --ok-f: #E1F2E8; --at-t: #855C10; --at-f: #FFF2D9;
  --er-t: #A13D38; --er-f: #FCECEB; --in-t: #355D94; --in-f: #EAF1FC; --ne-t: #626F80; --ne-f: #F0F3F7;
  --f-titulo: 'Manrope', system-ui, sans-serif; --f-texto: 'DM Sans', system-ui, sans-serif;
  --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 24px; --e6: 32px; --e7: 40px; --e8: 48px;
  --r-ctrl: 8px; --r-painel: 12px;
  --sombra: 0 1px 2px rgba(20, 35, 75, .06), 0 2px 8px rgba(20, 35, 75, .04);
  --foco: 0 0 0 3px rgba(49, 86, 232, .35);
  --lateral: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 400 15px/1.5 var(--f-texto); }
a { color: var(--cobalto-esc); }
:focus-visible { outline: 2px solid var(--cobalto); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; stroke-width: 1.9; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pular { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--painel); padding: var(--e2) var(--e3); border-radius: var(--r-ctrl); }
.pular:focus { left: 8px; }
h1, h2, h3, .marca-nome { font-family: var(--f-titulo); color: var(--navy); }
h1 { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 var(--e3); }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 var(--e2); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sec { color: var(--texto-2); }
.peq { font-size: 13px; }

/* Estrutura */
.app { display: grid; grid-template-columns: var(--lateral) 1fr; min-height: 100vh; }
.lateral { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: var(--e5) var(--e4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marca { display: flex; align-items: center; gap: var(--e3); text-decoration: none; color: #fff; padding: 0 var(--e2) var(--e5); }
.marca img { width: 36px; height: 32px; display: block; }
.marca-nome { color: #fff; font-weight: 700; font-size: 21px; letter-spacing: -.03em; line-height: 1; }
.marca-nome small { display: block; font: 500 10.5px/1 var(--f-texto); letter-spacing: .18em; color: #B9C3DA; margin-top: 6px; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; }
.nav-grupo { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #9AA6C2; margin: var(--e4) var(--e2) var(--e2); }
.nav-item { display: flex; align-items: center; gap: var(--e3); padding: 9px var(--e3); border-radius: var(--r-ctrl); color: #DCE2F0; text-decoration: none; font-weight: 500; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item[aria-current="page"] { background: var(--cobalto); color: #fff; }
.nav-item .cont { margin-left: auto; background: var(--lima); color: var(--navy); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 7px; min-width: 22px; text-align: center; }
.nav-item.futuro { color: #8692B0; cursor: default; }
.nav-item.futuro:hover { background: none; }
.nav-item.futuro em { white-space: nowrap; margin-left: auto; font-style: normal; font-size: 11px; border: 1px solid #44527A; border-radius: 999px; padding: 0 6px; }
.lateral-pe { margin-top: auto; padding-top: var(--e5); border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: #B9C3DA; }
.lateral-pe strong { color: #fff; display: block; font-weight: 600; }
.lateral-pe form { margin-top: var(--e3); }
.lateral-pe button { background: none; border: 1px solid #44527A; color: #DCE2F0; border-radius: var(--r-ctrl); padding: 6px 10px; font: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }

.principal { min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.topo { display: flex; align-items: center; gap: var(--e4); padding: var(--e3) var(--e6); background: var(--painel); border-bottom: 1px solid var(--borda); position: sticky; top: 0; z-index: 3; }
.topo .contexto { font-size: 14px; color: var(--texto-2); min-width: 0; }
.topo .contexto strong { color: var(--texto); }
.topo .acoes { margin-left: auto; display: flex; align-items: center; gap: var(--e3); }
.botao-icone { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; border: 1px solid var(--borda); background: var(--painel); border-radius: var(--r-ctrl); color: var(--navy); text-decoration: none; position: relative; cursor: pointer; font: inherit; }
.botao-icone .cont { position: absolute; top: -6px; right: -6px; background: var(--cobalto); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--fundo); color: var(--navy); font: 700 13px var(--f-titulo); display: grid; place-items: center; border: 1px solid var(--borda); }
.menu-movel { display: none; }
.aviso-ambiente { background: var(--in-f); color: var(--in-t); font-size: 13px; padding: 6px var(--e6); border-bottom: 1px solid var(--borda); }
main { padding: var(--e6); max-width: 1320px; width: 100%; }
.cab { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e4); flex-wrap: wrap; margin-bottom: var(--e5); }
.cab p { margin: 6px 0 0; color: var(--texto-2); max-width: 70ch; }
.cab .botoes { display: flex; gap: var(--e2); flex-wrap: wrap; }
.rodape { margin-top: auto; padding: var(--e4) var(--e6); color: var(--texto-2); font-size: 13px; }

/* Painéis e indicadores */
.painel { background: var(--painel); border: 1px solid var(--borda); border-radius: var(--r-painel); padding: var(--e5); box-shadow: var(--sombra); }
.painel + .painel, .grade + .painel, .painel + .grade { margin-top: var(--e4); }
.grade > .painel { margin-top: 0; }
main > * + form > .painel:first-child, main > form + form > .painel { margin-top: var(--e4); }
.grade { display: grid; gap: var(--e4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-detalhe { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .rot { font-size: 13px; color: var(--texto-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .val { font: 700 28px/1.15 var(--f-titulo); color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi .det { font-size: 13px; color: var(--texto-2); }
.kpi-destaque { border-top: 4px solid var(--cobalto); }
.kpi-destaque.pagar { border-top-color: var(--navy); }
.rotulo-estoque { font-size: 12px; color: var(--texto-2); border: 1px solid var(--borda); border-radius: 999px; padding: 1px 8px; }
.lista-simples { list-style: none; margin: 0; padding: 0; }
.lista-simples li { display: flex; flex-wrap: wrap; gap: var(--e2) var(--e3); align-items: center; padding: var(--e3) 0; border-top: 1px solid var(--borda); min-width: 0; }
.lista-simples li > div { min-width: 0; flex: 1 1 180px; overflow-wrap: anywhere; }
.grade > * { min-width: 0; }
.lista-simples a { overflow-wrap: anywhere; }
.lista-simples li:first-child { border-top: 0; }
.lista-simples .dir { margin-left: auto; text-align: right; }
.vazio { text-align: center; padding: var(--e7) var(--e4); color: var(--texto-2); }
.vazio .ic { width: 28px; height: 28px; color: var(--borda-forte); }

/* Selos de estado (texto + cor) */
.selo { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.selo-sucesso { color: var(--ok-t); background: var(--ok-f); } .selo-atencao { color: var(--at-t); background: var(--at-f); }
.selo-erro { color: var(--er-t); background: var(--er-f); } .selo-info { color: var(--in-t); background: var(--in-f); }
.selo-neutro { color: var(--ne-t); background: var(--ne-f); }
.mensagem { border-radius: var(--r-ctrl); padding: var(--e3) var(--e4); margin-bottom: var(--e4); display: flex; gap: var(--e3); align-items: flex-start; }
.mensagem.ok { background: var(--ok-f); color: var(--ok-t); } .mensagem.erro { background: var(--er-f); color: var(--er-t); }
.mensagem.info { background: var(--in-f); color: var(--in-t); } .mensagem.atencao { background: var(--at-f); color: var(--at-t); }

/* Botões */
.botao { display: inline-flex; align-items: center; justify-content: center; gap: var(--e2); min-height: 40px; padding: 0 var(--e4); border-radius: var(--r-ctrl); border: 1px solid transparent; font: 600 14px var(--f-texto); cursor: pointer; text-decoration: none; white-space: nowrap; }
.botao.primario { background: var(--cobalto); color: #fff; } .botao.primario:hover { background: var(--cobalto-esc); }
.botao.destaque { background: var(--lima); color: var(--navy); } .botao.destaque:hover { background: var(--lima-esc); }
.botao.secundario { background: var(--painel); color: var(--navy); border-color: var(--borda-forte); } .botao.secundario:hover { border-color: var(--navy); }
.botao.perigo { background: var(--painel); color: var(--er-t); border-color: #E6B9B6; } .botao.perigo:hover { background: var(--er-f); }
.botao:disabled, .botao[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.botao:focus-visible { box-shadow: var(--foco); outline: none; }
.botao.peq { min-height: 32px; padding: 0 var(--e3); font-size: 13px; }

/* Formulários */
.form { display: grid; gap: var(--e4); }
.form .linha { display: grid; gap: var(--e4); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo label, .campo .rot { font-weight: 600; font-size: 14px; color: var(--texto); }
.campo .ajuda { font-size: 12.5px; color: var(--texto-2); }
.campo .erro { font-size: 13px; color: var(--er-t); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=search], select, textarea {
  font: 400 15px var(--f-texto); color: var(--texto); background: var(--painel); border: 1px solid var(--borda-forte); border-radius: var(--r-ctrl); padding: 9px 12px; min-height: 42px; width: 100%; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalto); box-shadow: var(--foco); }
[aria-invalid="true"] { border-color: var(--er-t) !important; }
.opcoes { display: flex; gap: var(--e2); flex-wrap: wrap; }
.opcao { display: flex; align-items: center; gap: var(--e2); border: 1px solid var(--borda-forte); border-radius: var(--r-ctrl); padding: 10px 14px; cursor: pointer; background: var(--painel); }
.opcao:has(input:checked) { border-color: var(--cobalto); background: var(--in-f); }
.opcao input { accent-color: var(--cobalto); width: 18px; height: 18px; margin: 0; }
.caixa { display: flex; gap: var(--e2); align-items: center; }
.caixa input { accent-color: var(--cobalto); width: 18px; height: 18px; }
.filtros { display: flex; gap: var(--e3); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--e4); }
.filtros .campo { min-width: 160px; flex: 1 1 160px; }
.filtros .campo.busca { flex: 2 1 240px; }
.rapidos { display: flex; gap: var(--e2); flex-wrap: wrap; margin-bottom: var(--e4); }
.rapido { text-decoration: none; color: var(--navy); border: 1px solid var(--borda-forte); background: var(--painel); border-radius: 999px; padding: 5px 14px; font-weight: 500; font-size: 14px; }
.rapido[aria-current="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
details.acao { border: 1px solid var(--borda); border-radius: var(--r-ctrl); }
details.acao > summary { cursor: pointer; padding: var(--e3) var(--e4); font-weight: 600; list-style: none; display: flex; align-items: center; gap: var(--e2); }
details.acao > summary::-webkit-details-marker { display: none; }
details.acao[open] > summary { border-bottom: 1px solid var(--borda); }
details.acao > div { padding: var(--e4); }
.acoes-pilha { display: grid; gap: var(--e3); }

/* Tabelas: valores à direita; viram cartões no celular */
.tabela-envoltorio { overflow-x: auto; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-weight: 600; color: var(--texto-2); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--borda); white-space: nowrap; }
.tabela td { padding: 12px; border-bottom: 1px solid var(--borda); vertical-align: top; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: #F7F9FE; }
.tabela .d { text-align: right; }
.tabela a.id { font-weight: 600; text-decoration: none; white-space: nowrap; }
.tabela a.id:hover { text-decoration: underline; }
.tabela tfoot td { font-weight: 700; border-top: 2px solid var(--borda); }
.dados { display: grid; grid-template-columns: max-content 1fr; gap: var(--e2) var(--e5); margin: 0; }
.dados dt { color: var(--texto-2); font-size: 14px; } .dados dd { margin: 0; font-weight: 500; }
.valores { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--e3); }
.valores div { background: var(--fundo); border-radius: var(--r-ctrl); padding: var(--e3); }
.valores span { display: block; font-size: 12.5px; color: var(--texto-2); }
.valores strong { font: 700 20px var(--f-titulo); color: var(--navy); font-variant-numeric: tabular-nums; }
.valores .saldo { background: var(--navy); } .valores .saldo span { color: #B9C3DA; } .valores .saldo strong { color: var(--lima); }
.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { padding: var(--e3) 0 var(--e3) var(--e5); border-left: 2px solid var(--borda); position: relative; margin-left: 6px; }
.linha-tempo li::before { content: ''; position: absolute; left: -6px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--painel); border: 2px solid var(--borda-forte); }
.linha-tempo li.humano::before { background: var(--cobalto); border-color: var(--cobalto); }
.linha-tempo .meta { font-size: 12.5px; color: var(--texto-2); }
.linha-tempo .texto { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Etapa 2 */
.barra { height: 6px; background: var(--fundo); border-radius: 999px; margin-top: 4px; overflow: hidden; }
.barra span { display: block; height: 100%; background: var(--cobalto); border-radius: 999px; }
table.demonstrativo td { padding: 10px 4px; } table.demonstrativo tr.total td { border-top: 2px solid var(--navy); font-size: 16px; }
code { font-size: 12.5px; background: var(--fundo); padding: 1px 5px; border-radius: 4px; }

/* Acesso */
.tela-acesso { min-height: 100vh; display: grid; place-items: center; padding: var(--e5) var(--e4); background: var(--fundo); }
.cartao-acesso { width: 100%; max-width: 420px; }
.cartao-acesso .assinatura { display: block; width: 260px; max-width: 100%; height: auto; margin: 0 auto var(--e5); }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-detalhe { grid-template-columns: 1fr; } .valores { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 20; transform: translateX(-100%); transition: transform .2s ease; }
  .app.menu-aberto .lateral { transform: none; box-shadow: 0 0 0 100vmax rgba(20,35,75,.45); }
  .menu-movel { display: inline-flex; }
  .topo { padding: var(--e2) var(--e4); }
  .topo .contexto { display: none; }
  .aviso-ambiente { padding: 6px var(--e4); }
  main { padding: var(--e4); }
  h1 { font-size: 24px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .kpi .val { font-size: 26px; }
  input, select, textarea { font-size: 16px !important; }
  .rodape { padding: var(--e4); }
  table.tabela.cartoes thead { display: none; }
  table.tabela.cartoes, .tabela.cartoes tbody, .tabela.cartoes tr, .tabela.cartoes td { display: block; width: 100%; }
  .tabela.cartoes tr { border: 1px solid var(--borda); border-radius: var(--r-ctrl); margin-bottom: var(--e3); padding: var(--e3); background: var(--painel); display: grid; grid-template-columns: 1fr 1fr; gap: var(--e3) var(--e4); }
  .tabela.cartoes td { border: 0; padding: 0; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  .tabela.cartoes td.d { text-align: left; }
  .tabela.cartoes td::before { content: attr(data-rot); display: block; color: var(--texto-2); font-size: 12px; margin-bottom: 2px; }
  .tabela.cartoes td:empty { display: none; }
  .tabela.cartoes td.titulo-cartao { grid-column: 1 / -1; font-weight: 600; }
  .tabela.cartoes td.titulo-cartao::before { display: none; }
  .tabela.cartoes tfoot { display: block; }
  .dados { grid-template-columns: 1fr; gap: 2px; } .dados dd { margin-bottom: var(--e2); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .lateral, .topo, .aviso-ambiente, .botao, details.acao, .filtros, .rapidos { display: none !important; } .app { display: block; } body { background: #fff; } .painel { box-shadow: none; } }
