/* Velefant Admin — visual claro e sóbrio para o dia a dia; escuro automático. */

@font-face {
  font-family: "Inter";
  src: url("assets/fontes/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --fundo: #f5f6fa;
  --superficie: #ffffff;
  --superficie-2: #f0f1f7;
  --linha: #e1e3ec;
  --texto: #171a2b;
  --texto-medio: #4b5068;
  --texto-baixo: #747a94;
  --marca: #6a4cf5;
  --marca-forte: #5638e0;
  --marca-suave: #efebff;
  --azul: #2f7fd8;
  --ok: #138a52;
  --ok-suave: #e6f6ee;
  --alerta: #a35b00;
  --alerta-suave: #fff3e0;
  --perigo: #c42b3c;
  --perigo-suave: #fdecee;
  --info: #2462b8;
  --info-suave: #e8f0fc;
  --sombra: 0 1px 2px rgba(20, 22, 40, 0.06), 0 4px 16px rgba(20, 22, 40, 0.05);
  --raio: 12px;
  --menu: 232px;
  --topo: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0b0d1a;
    --superficie: #131628;
    --superficie-2: #1a1e35;
    --linha: #272c48;
    --texto: #eef0fb;
    --texto-medio: #b6bbd4;
    --texto-baixo: #8a90ad;
    --marca: #8b72ff;
    --marca-forte: #a08cff;
    --marca-suave: #221c47;
    --ok: #3ddc84;
    --ok-suave: #0f2a1d;
    --alerta: #ffb24d;
    --alerta-suave: #2e2210;
    --perigo: #ff6b7a;
    --perigo-suave: #33141a;
    --info: #6aaeff;
    --info-suave: #10213d;
    --sombra: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--marca); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font: 0.86em/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
code { background: var(--superficie-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--marca) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sutil { color: var(--texto-baixo); }
.forte { font-weight: 600; }
.bloco { display: block; }
.quebra { overflow-wrap: anywhere; }
.vazio { color: var(--texto-baixo); }
.texto-longo { display: inline-block; max-width: 34ch; overflow-wrap: anywhere; }

/* ── Pilhas e grades ── */
.pilha { display: flex; flex-direction: column; gap: 14px; }
.pilha-curta { display: flex; flex-direction: column; gap: 6px; }
.pilha-larga { display: flex; flex-direction: column; gap: 22px; }
.grade-cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.grade-fichas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.grade-formulario { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.largura-toda { grid-column: 1 / -1; }
.linha-selos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acoes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* ── Moldura ── */
.topo {
  position: sticky; top: 0; z-index: 20;
  height: var(--topo);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: var(--superficie);
  border-bottom: 1px solid var(--linha);
}
.marca { display: flex; align-items: center; gap: 10px; color: var(--texto); font-size: 1.05rem; white-space: nowrap; }
.marca:hover { text-decoration: none; }
.marca strong { color: var(--marca); }
.marca img { border-radius: 6px; }
.topo-direita { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.quem { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; line-height: 1.25; }
.quem-email { font-weight: 600; font-size: 0.9rem; max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quem-papel { color: var(--texto-baixo); font-size: 0.8rem; white-space: nowrap; }

.ambiente {
  display: inline-flex; align-items: center; align-self: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
}
.ambiente-local { background: var(--info-suave); color: var(--info); }
.ambiente-teste { background: var(--alerta-suave); color: var(--alerta); }
.ambiente-produção { background: var(--marca-suave); color: var(--marca); }

.corpo { display: grid; grid-template-columns: var(--menu) minmax(0, 1fr); min-height: calc(100vh - var(--topo)); }
.menu { border-right: 1px solid var(--linha); background: var(--superficie); padding: 16px 12px; }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topo) + 16px); }
.menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--texto-medio); font-weight: 500;
}
.menu a:hover { background: var(--superficie-2); text-decoration: none; color: var(--texto); }
.menu a[aria-current="page"] { background: var(--marca-suave); color: var(--marca); font-weight: 650; }
.menu-icone { width: 20px; text-align: center; font-size: 1.05rem; }
.menu-quem { display: none; flex-direction: column; gap: 2px; padding: 4px 12px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--linha); overflow-wrap: anywhere; }
.menu-quem small { color: var(--texto-baixo); }
.conteudo { padding: 28px 32px 64px; max-width: 1240px; width: 100%; outline: none; }
.so-celular, .icone-botao.so-celular { display: none; }
.veu { display: none; }

.cabecalho-tela { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.cabecalho-tela > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.voltar { font-weight: 500; font-size: 0.9rem; }

/* ── Cartões e seções ── */
.cartao {
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 18px 20px;
  box-shadow: var(--sombra);
}
.cartao h2 { margin-bottom: 12px; }
.cartao.destaque { border-color: var(--marca); }
a.cartao { color: inherit; }
a.cartao:hover { text-decoration: none; border-color: var(--marca); }
.cartao-numero { display: flex; flex-direction: column; gap: 6px; }
.cartao-numero span { color: var(--texto-medio); font-size: 0.88rem; }
.numero { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; }
.secao { display: flex; flex-direction: column; gap: 10px; }
.secao > .botao { align-self: flex-start; }

.lista-campos { margin: 0; display: flex; flex-direction: column; }
.campo { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--linha); }
.campo:last-child { border-bottom: 0; }
.campo dt { color: var(--texto-baixo); font-size: 0.9rem; }
.campo dd { margin: 0; overflow-wrap: anywhere; }

/* ── Selos ── */
.selo {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap; vertical-align: middle;
  background: var(--superficie-2); color: var(--texto-medio);
}
.selo + .selo, .forte .selo { margin-left: 6px; }
.selo-ok { background: var(--ok-suave); color: var(--ok); }
.selo-alerta { background: var(--alerta-suave); color: var(--alerta); }
.selo-info { background: var(--info-suave); color: var(--info); }
.selo-destaque { background: var(--marca-suave); color: var(--marca); }

/* ── Botões e campos ── */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--linha); border-radius: 10px;
  background: var(--superficie); color: var(--texto); font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.botao:hover:not(:disabled) { border-color: var(--marca); color: var(--marca); }
.botao:disabled { opacity: 0.5; cursor: not-allowed; }
.botao.primario { background: var(--marca); border-color: var(--marca); color: #fff; }
.botao.primario:hover:not(:disabled) { background: var(--marca-forte); color: #fff; }
.botao.perigo { color: var(--perigo); }
.botao.perigo:hover:not(:disabled) { border-color: var(--perigo); color: var(--perigo); background: var(--perigo-suave); }
.botao.discreto { border-color: transparent; background: transparent; color: var(--texto-medio); }
.botao.mini { min-height: 32px; padding: 4px 10px; font-size: 0.82rem; border-radius: 8px; }
.botao.largo { width: 100%; }
.icone-botao {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; font-size: 1.4rem; cursor: pointer; color: var(--texto-medio);
}
.icone-botao:hover { background: var(--superficie-2); }

label, legend { font-weight: 600; font-size: 0.9rem; color: var(--texto-medio); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  width: 100%; min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--linha); border-radius: 10px;
  background: var(--superficie);
}
textarea { resize: vertical; min-height: 84px; }
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%23747a94' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}
input:focus, select:focus, textarea:focus { border-color: var(--marca); outline: 3px solid color-mix(in srgb, var(--marca) 22%, transparent); outline-offset: 0; }
.erro-campo { color: var(--perigo); font-size: 0.9rem; min-height: 1.2em; }
.erro-campo:empty { min-height: 0; }

.radios { display: flex; flex-wrap: wrap; gap: 10px; }
.radio {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--linha); border-radius: 10px;
  cursor: pointer; font-weight: 500; color: var(--texto);
}
.radio:has(input:checked) { border-color: var(--marca); background: var(--marca-suave); }
.radio input { accent-color: var(--marca); width: 18px; height: 18px; margin: 0; }

.busca-grande { display: flex; gap: 10px; }
.busca-grande input { flex: 1; min-height: 48px; font-size: 1rem; }
.busca-grande .botao { min-height: 48px; }

.barra-filtros { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.barra-filtros select { width: auto; min-width: 220px; }
.filtros { display: flex; flex-wrap: wrap; gap: 6px; }
.filtro {
  min-height: 36px; padding: 6px 14px;
  border: 1px solid var(--linha); border-radius: 999px;
  background: var(--superficie); color: var(--texto-medio); font-weight: 600; font-size: 0.88rem; cursor: pointer;
}
.filtro.ativo { background: var(--texto); border-color: var(--texto); color: var(--superficie); }

/* ── Tabelas ── */
.tabela-rolagem { overflow-x: auto; border: 1px solid var(--linha); border-radius: var(--raio); background: var(--superficie); box-shadow: var(--sombra); }
.tabela { width: 100%; border-collapse: collapse; }
.tabela th {
  text-align: left; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--texto-baixo); background: var(--superficie-2);
  padding: 10px 14px; white-space: nowrap;
}
.tabela td { padding: 11px 14px; border-top: 1px solid var(--linha); vertical-align: top; }
.tabela.clicavel tbody tr { cursor: pointer; }
.tabela.clicavel tbody tr:hover, .tabela.clicavel tbody tr:focus-visible { background: var(--marca-suave); }
.acoes-celula { text-align: right; white-space: nowrap; }
.estado-vazio, .estado-falha, .carregando {
  padding: 26px; text-align: center; color: var(--texto-baixo);
  border: 1px dashed var(--linha); border-radius: var(--raio);
}
.estado-falha { color: var(--perigo); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.carregando { display: flex; align-items: center; justify-content: center; gap: 10px; border-style: solid; border-color: transparent; }
.giro { width: 16px; height: 16px; border: 2px solid var(--linha); border-top-color: var(--marca); border-radius: 50%; animation: giro 0.8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .giro { animation: none; } }

.paginacao { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.detalhe-json summary { cursor: pointer; color: var(--marca); font-weight: 600; }
.detalhe-json pre { margin: 8px 0 0; max-width: 60ch; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--superficie-2); padding: 10px; border-radius: 8px; }

/* ── Entrada ── */
.tela-central { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.cartao-entrada { width: min(440px, 100%); display: flex; flex-direction: column; gap: 18px; padding: 30px 28px; }
.entrada-marca { display: flex; align-items: center; gap: 14px; }
.entrada-marca img { border-radius: 8px; }
.aviso-entrada { padding: 10px 14px; border-radius: 10px; background: var(--info-suave); color: var(--info); }
.rodape-entrada { font-size: 0.82rem; color: var(--texto-baixo); }
.campo-codigo { font-size: 1.6rem !important; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { align-self: center; background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--linha); }
.segredo summary { cursor: pointer; color: var(--marca); font-weight: 600; }
.segredo .chave { display: block; margin-top: 8px; padding: 10px; font-size: 1rem; letter-spacing: 0.05em; text-align: center; }
.explicacao { color: var(--texto-medio); }

/* ── Diálogos ── */
.dialogo {
  width: 520px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); margin: auto;
  padding: 0; border: 1px solid var(--linha); border-radius: 16px;
  background: var(--superficie); color: var(--texto); box-shadow: 0 20px 60px rgba(10, 12, 30, 0.3);
}
.dialogo.largo { width: 720px; }
.dialogo::backdrop { background: rgba(12, 14, 30, 0.45); }
.dialogo-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--linha); position: sticky; top: 0; background: var(--superficie); z-index: 1; }
.dialogo-corpo { padding: 18px 20px 20px; }
.simulacao:empty { display: none; }
.resultado { padding: 12px 14px; border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.resultado.ok { background: var(--ok-suave); color: var(--ok); }
.resultado.ok p { color: var(--texto); }
.resultado.recusa { background: var(--perigo-suave); color: var(--perigo); }
.resultado.recusa p { color: var(--texto); }
.nota { padding: 10px 12px; border-radius: 10px; background: var(--superficie-2); color: var(--texto-medio); font-size: 0.92rem; }

/* ── Avisos ── */
.avisos { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.aviso { padding: 12px 16px; border-radius: 12px; background: var(--texto); color: var(--superficie); box-shadow: var(--sombra); font-weight: 500; transition: opacity 0.4s, transform 0.4s; }
.aviso-erro { background: var(--perigo); color: #fff; }
.aviso-alerta { background: var(--alerta); color: #fff; }
.aviso.saindo { opacity: 0; transform: translateY(6px); }

.codigos { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.codigos code { font-size: 1.05rem; letter-spacing: 0.04em; }
.exemplo { margin: 0; padding: 12px; border-radius: 10px; background: var(--superficie-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── Financeiro ── */
:root { --serie-1: #2a78d6; --serie-2: #eb6834; }
@media (prefers-color-scheme: dark) { :root { --serie-1: #3987e5; --serie-2: #d95926; } }
.selo-perigo { background: var(--perigo-suave); color: var(--perigo); }
.barra-financeiro { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.barra-financeiro select { width: auto; min-width: 110px; }
.rotulo-curto { display: flex; align-items: center; gap: 8px; }
.chave { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: var(--texto); cursor: pointer; }
.chave input { width: 18px; height: 18px; accent-color: var(--marca); margin: 0; }
.abas { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--linha); scrollbar-width: thin; }
.aba { padding: 10px 14px; white-space: nowrap; color: var(--texto-medio); font-weight: 600; font-size: 0.92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.aba:hover { color: var(--texto); text-decoration: none; }
.aba.ativa { color: var(--marca); border-bottom-color: var(--marca); }
.faixa { padding: 10px 14px; border-radius: 10px; font-size: 0.92rem; }
.faixa-info { background: var(--info-suave); color: var(--info); }
.faixa-alerta { background: var(--alerta-suave); color: var(--alerta); font-weight: 600; }
.cabecalho-secao { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.cabecalho-secao > div { display: flex; flex-direction: column; gap: 4px; }
.cabecalho-secao > .linha-selos { flex-direction: row; }
.cartao-numero.previsto { border-style: dashed; }
.cartao-numero small { font-size: 0.8rem; }
.cartao-numero .numero .valor { font-size: inherit; }
.grade-cartoes .cartao-numero .numero { font-size: clamp(1.25rem, 1.1vw + 0.75rem, 1.9rem); }
.tres-estados { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--linha); border-radius: var(--raio); background: var(--superficie); box-shadow: var(--sombra); overflow: hidden; }
.estado-fin { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.estado-fin + .estado-fin { border-left: 1px solid var(--linha); }
.estado-titulo { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texto-baixo); }
.estado-previsto .estado-titulo::after { content: " · previsão"; text-transform: none; letter-spacing: 0; font-weight: 500; }
.valor { font-variant-numeric: tabular-nums; white-space: nowrap; }
.valor.negativo { color: var(--perigo); }
.num { text-align: right; }
.tabela td.num, .tabela th.num { text-align: right; }
.figura { margin: 0; display: flex; flex-direction: column; gap: 8px; background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); padding: 14px 16px; box-shadow: var(--sombra); }
.figura figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; }
.legenda-item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; color: var(--texto-medio); }
.legenda-marca, .dica-marca { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legenda-marca.serie-1, .dica-marca.serie-1 { background: var(--serie-1); }
.legenda-marca.serie-2, .dica-marca.serie-2 { background: var(--serie-2); }
.grafico { width: 100%; height: auto; display: block; }
.grafico .grade { stroke: var(--linha); stroke-width: 1; }
.grafico .eixo { stroke: var(--texto-baixo); stroke-width: 1; }
.grafico .rotulo { fill: var(--texto-baixo); font-size: 11px; font-family: inherit; }
.grafico .barra.serie-1, .grafico .ponto.serie-1 { fill: var(--serie-1); }
.grafico .barra.serie-2, .grafico .ponto.serie-2 { fill: var(--serie-2); }
.grafico .ponto { stroke: var(--superficie); stroke-width: 2; }
.grafico .linha { fill: none; stroke-width: 2; stroke-linejoin: round; }
.grafico .linha.serie-1 { stroke: var(--serie-1); }
.grafico .alvo { fill: transparent; cursor: crosshair; }
.dica-grafico { position: fixed; z-index: 200; pointer-events: none; opacity: 0; transition: opacity 0.12s;
  background: var(--superficie); color: var(--texto); border: 1px solid var(--linha); border-radius: 10px; box-shadow: var(--sombra);
  padding: 8px 10px; font-size: 0.85rem; display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.dica-grafico.visivel { opacity: 1; }
.dica-linha { display: flex; align-items: center; gap: 8px; }
.dica-linha strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.tabela-do-grafico summary { cursor: pointer; color: var(--marca); font-weight: 600; margin: 6px 0; }
.matriz-rolagem { overflow-x: auto; border: 1px solid var(--linha); border-radius: var(--raio); background: var(--superficie); box-shadow: var(--sombra); }
.matriz { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.88rem; }
.matriz th, .matriz td { padding: 8px 7px; border-top: 1px solid var(--linha); white-space: nowrap; }
.matriz thead th { border-top: 0; background: var(--superficie-2); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--texto-baixo); text-align: right; }
.matriz td { text-align: right; }
.matriz .fixa { position: sticky; left: 0; background: var(--superficie); text-align: left; font-weight: 500; z-index: 1; min-width: 190px; white-space: normal; padding-left: 12px !important; }
.matriz thead .fixa { background: var(--superficie-2); }
.matriz tr.sub th, .matriz tr.sub td { color: var(--texto-medio); font-size: 0.84rem; }
.matriz tr.subtotal th, .matriz tr.subtotal td { font-weight: 650; background: var(--superficie-2); }
.matriz tr.subtotal .fixa { background: var(--superficie-2); }
.matriz tr.total th, .matriz tr.total td { font-weight: 700; border-top: 2px solid var(--texto-baixo); }
.matriz tr.destaque th, .matriz tr.destaque td { font-weight: 650; }
.matriz tr.informativo th, .matriz tr.informativo td { color: var(--texto-baixo); font-style: italic; }
.lista-alertas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lista-alertas li { display: flex; align-items: flex-start; gap: 10px; }
.grade-relatorios { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.relatorio h2 { margin-bottom: 0; }

/* ── Tablet ── */
@media (max-width: 1024px) {
  .conteudo { padding: 22px 20px 56px; }
  :root { --menu: 200px; }
}

/* ── Celular: menu recolhido, tabelas viram cartões ── */
@media (max-width: 760px) {
  :root { --topo: 56px; }
  .so-celular, .icone-botao.so-celular { display: inline-flex; }
  .topo { padding: 0 10px; gap: 8px; }
  .marca span { font-size: 0.98rem; }
  .quem { display: none; }
  .corpo { grid-template-columns: minmax(0, 1fr); }
  .menu {
    position: fixed; z-index: 30; top: var(--topo); bottom: 0; left: 0; width: min(280px, 82vw);
    transform: translateX(-102%); transition: transform 0.2s ease;
    border-right: 1px solid var(--linha); box-shadow: var(--sombra); overflow-y: auto;
  }
  .menu ul { position: static; }
  .menu-aberto .menu { transform: none; }
  .menu-aberto .veu { display: block; position: fixed; inset: var(--topo) 0 0 0; z-index: 25; background: rgba(12, 14, 30, 0.35); }
  .conteudo { padding: 18px 16px 48px; }
  h1 { font-size: 1.3rem; }
  .busca-grande { flex-direction: column; }
  .campo { grid-template-columns: 1fr; gap: 2px; }
  .cabecalho-tela .botao.primario { width: 100%; }
  .barra-filtros select { width: 100%; }
  .filtros { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }

  .tabela-rolagem { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .tabela, .tabela tbody, .tabela tr, .tabela td { display: block; width: 100%; }
  .tabela thead { display: none; }
  .tabela tr { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra); padding: 6px 14px; margin-bottom: 10px; }
  .tabela td { border-top: 0; padding: 7px 0; display: grid; grid-template-columns: 38% 1fr; gap: 10px; }
  .tabela td + td { border-top: 1px solid var(--linha); }
  .tabela td::before { content: attr(data-rotulo); color: var(--texto-baixo); font-size: 0.82rem; font-weight: 600; }
  .tabela td[data-rotulo=""] { display: block; }
  .tabela td[data-rotulo=""]::before { content: none; }
  .tabela td:empty { display: none; }
  .tabela td > .selo, .tabela td > .botao { justify-self: start; }
  .menu-quem { display: flex; }
  .acoes-celula { text-align: left; }
  .texto-longo { max-width: none; }
  .paginacao { flex-wrap: wrap; justify-content: center; }
  .avisos { left: 16px; right: 16px; max-width: none; }
  .tres-estados { grid-template-columns: 1fr; }
  .estado-fin + .estado-fin { border-left: 0; border-top: 1px solid var(--linha); }
  .barra-financeiro { width: 100%; justify-content: space-between; }
  .matriz .fixa { min-width: 150px; }
  .figura { overflow-x: auto; }
  .figura .grafico { min-width: 600px; }
}

@media print {
  .topo, .menu, .avisos, .acoes, .botao { display: none !important; }
  .corpo { display: block; }
  body { background: #fff; color: #000; }
}
