/* DAXA — visual do sistema
   Cores tiradas da logo: azul-marinho #032645 e dourado #C09F6F.
   Ideia central: a barra dourada vertical do símbolo (a "divisão" da cabeça) marca o que está ativo,
   e a leitura dos números lembra um exame de imagem: um feixe que varre o gráfico uma vez. */

:root {
  --navy-950: #021a30;
  --navy-900: #032645;
  --navy-800: #0a3359;
  --navy-700: #144270;
  --navy-100: #e3eaf3;
  --gold-500: #c09f6f;
  --gold-600: #a8874f;
  --gold-700: #84683a;   /* dourado para texto sobre branco (contraste 5,3:1) */
  --gold-100: #f4ece0;

  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --line: #e2e7ee;
  --line-strong: #cdd5df;
  --text: #0d1b2c;
  --muted: #5a6a7e;
  --faint: #8794a5;

  --pos: #1c7a57;  --pos-bg: #e4f3ec;
  --neg: #b23f35;  --neg-bg: #fbe9e7;
  --warn: #9a6410; --warn-bg: #fbf1dc;
  --info: #1f5f99; --info-bg: #e6f0fa;

  --side: var(--navy-900);
  --side-text: #c7d3e1;
  --side-hover: rgba(255,255,255,.06);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow-pop: 0 18px 50px -12px rgba(3, 38, 69, .35), 0 2px 6px rgba(3, 38, 69, .08);
  --shadow-soft: 0 1px 2px rgba(3, 38, 69, .06);

  --f-display: "Sora", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, sans-serif;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.36, .64, 1);

  color-scheme: light;
}

/* tema escuro: só pelo botão da lua (o claro é o padrão em todas as máquinas) */
:root[data-theme="dark"] {
  --bg: #061423;
  --surface: #0b1e33;
  --surface-2: #0f253d;
  --line: #1a3350;
  --line-strong: #24446a;
  --text: #e5ecf4;
  --muted: #9aabbf;
  --faint: #6f8399;
  --gold-700: #d6bb8e;
  --gold-100: #2a2416;
  --navy-100: #15304f;
  --pos: #4cc095;  --pos-bg: #0f3226;
  --neg: #f08177;  --neg-bg: #3a1714;
  --warn: #e7b25a; --warn-bg: #36280f;
  --info: #7fb4ea; --info-bg: #10294a;
  --side: #031426;
  --shadow-pop: 0 18px 50px -12px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); }
:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.01em; margin: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ estrutura */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; transition: grid-template-columns .3s var(--ease-out); }
.app.recolhido { grid-template-columns: 72px 1fr; }

.side {
  background: var(--side);
  color: var(--side-text);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.side .marca { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; text-decoration: none; color: #fff; }
.side .marca img { width: 36px; height: auto; flex: none; }
.side .marca b { font-family: var(--f-display); font-size: 20px; letter-spacing: .32em; font-weight: 600; }
.side .marca small { display: block; font-size: 11px; color: var(--gold-500); letter-spacing: .04em; font-weight: 600; margin-top: 1px; }
.app.recolhido .side .marca span { display: none; }

.menu { list-style: none; margin: 6px 0 0; padding: 0 10px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.menu .grupo { font-size: 12px; color: #7f93ab; padding: 16px 12px 6px; }
.app.recolhido .menu .grupo { visibility: hidden; height: 12px; padding: 0; }
.menu a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0;
  color: var(--side-text); text-decoration: none; border-radius: 8px;
  font-size: 14.5px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.menu a:hover { background: var(--side-hover); color: #fff; }
.menu a svg { width: 19px; height: 19px; flex: none; stroke: currentColor; }
.menu a .cont { margin-left: auto; font-size: 12px; background: rgba(192,159,111,.18); color: var(--gold-500); padding: 0 7px; border-radius: 999px; }
.app.recolhido .menu a span, .app.recolhido .menu a .cont { display: none; }
/* a barra dourada do símbolo */
.menu a::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 4px;
  background: var(--gold-500); border-radius: 0 3px 3px 0;
  transform: scaleY(0); transition: transform .3s var(--ease-spring);
}
.menu a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.08); }
.menu a[aria-current="page"]::before { transform: scaleY(1); }
.menu a[aria-current="page"] svg { stroke: var(--gold-500); }

.side .rodape { padding: 12px 10px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.side .rodape button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: none; border: 0; color: var(--side-text); border-radius: 8px; cursor: pointer; font-size: 14px; }
.side .rodape button:hover { background: var(--side-hover); color: #fff; }
.side .rodape svg { width: 19px; height: 19px; stroke: currentColor; flex: none; }
.app.recolhido .side .rodape span { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }

/* ------------------------------------------------------------------ topo */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.seletor-unidade {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); cursor: pointer; max-width: 360px;
}
.seletor-unidade select { border: 0; background: none; outline: none; cursor: pointer; font-weight: 500; max-width: 290px; text-overflow: ellipsis; }
.seletor-unidade .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); flex: none; }
.busca-btn {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--faint); cursor: pointer; text-align: left;
}
.busca-btn kbd { margin-left: auto; font: 12px var(--f-body); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 6px; color: var(--muted); }
.topo .esp { flex: 1; }
.icone-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); }
.icone-btn:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
.icone-btn svg { width: 19px; height: 19px; stroke: currentColor; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-900); color: var(--gold-500); display: grid; place-items: center; font-weight: 600; font-size: 13px; font-family: var(--f-display); }

.faixa-demo { background: var(--gold-100); color: var(--gold-700); font-size: 13px; padding: 6px 28px; border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------------ botões e campos */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: transform .12s var(--ease-out), background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; stroke: currentColor; }
.btn.prim { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.btn.prim:hover { background: var(--navy-800); }
:root[data-theme="dark"] .btn.prim { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); }
.btn.ouro { background: var(--gold-500); border-color: var(--gold-500); color: var(--navy-950); }
.btn.ouro:hover { background: var(--gold-600); }
.btn.fant { border-color: transparent; background: none; }
.btn.fant:hover { background: var(--surface-2); }
.btn.peq { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.campo { display: flex; flex-direction: column; gap: 5px; }
.campo > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.campo input, .campo select, .campo textarea {
  padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--gold-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-500) 22%, transparent); }
.campo .dica { font-size: 12.5px; color: var(--faint); }
.campo.erro input { border-color: var(--neg); }
.grade-campos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.grade-campos .inteiro { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ página */
.pagina { padding: 28px 28px 80px; max-width: 1400px; width: 100%; }
.cab { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cab h1 { font-size: 28px; font-weight: 600; line-height: 1.15; }
.cab p { margin: 4px 0 0; color: var(--muted); }
.cab .acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.painel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.painel > header { display: flex; align-items: center; gap: 6px 10px; padding: 16px 20px 0; flex-wrap: wrap; }
.painel > header h2 { white-space: nowrap; }
.painel > header h2 { font-size: 16px; font-weight: 600; }
.painel > header .acoes { margin-left: auto; display: flex; gap: 6px; }
.painel .corpo { padding: 16px 20px 20px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; cursor: pointer; color: var(--muted); transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--gold-500); color: var(--navy-950); border-color: var(--gold-500); }
.chip .n { margin-left: 4px; opacity: .7; }

.selo { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; white-space: nowrap; transition: background .3s, color .3s; }
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo.ok { background: var(--pos-bg); color: var(--pos); }
.selo.atr { background: var(--neg-bg); color: var(--neg); }
.selo.hoje { background: var(--warn-bg); color: var(--warn); }
.selo.abe { background: var(--navy-100); color: var(--navy-700); }
:root[data-theme="dark"] .selo.abe { color: #b9cde4; }
.selo.conf { background: var(--gold-100); color: var(--gold-700); }
.selo.neu { background: var(--surface-2); color: var(--muted); }

/* ------------------------------------------------------------------ painel do dia */
.saudacao h1 { font-size: 30px; }
.resumo { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0; margin-bottom: 18px; overflow: hidden; }
.resumo > div { padding: 20px 22px; }
.resumo > div + div { border-left: 1px solid var(--line); }
.resumo .rot { font-size: 13.5px; color: var(--muted); }
.resumo .val { font-family: var(--f-display); font-size: 30px; font-weight: 600; margin-top: 2px; letter-spacing: -.02em; }
.resumo .sub { font-size: 13px; color: var(--faint); margin-top: 2px; }
.resumo .destaque { background: var(--navy-900); color: #fff; position: relative; }
.resumo .destaque .rot { color: #a9bbd0; }
.resumo .destaque .sub { color: #8ea3bb; }
.resumo .destaque::after { content: ""; position: absolute; right: 22px; top: 20px; bottom: 20px; width: 4px; background: var(--gold-500); border-radius: 3px; }
.bancos-mini { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; font-size: 12.5px; color: #a9bbd0; }
.bancos-mini b { color: #fff; font-weight: 500; }

.grade-painel { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.coluna { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* gráfico do fluxo */
.fluxo-legenda { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.fluxo-legenda i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.fluxo-wrap { position: relative; }
.fluxo-svg { width: 100%; height: 280px; display: block; overflow: visible; }
.fluxo-svg .eixo { stroke: var(--line); stroke-width: 1; }
.fluxo-svg .eixo-txt { fill: var(--faint); font-size: 11px; font-family: var(--f-body); }
.fluxo-svg .area { fill: url(#gradArea); }
.fluxo-svg .linha { fill: none; stroke: var(--navy-900); stroke-width: 2.4; stroke-linejoin: round; }
:root[data-theme="dark"] .fluxo-svg .linha { stroke: #8fb3dc; }
.fluxo-svg .proj { fill: none; stroke: var(--gold-500); stroke-width: 2.4; stroke-dasharray: 5 5; }
.fluxo-svg .hoje { stroke: var(--gold-600); stroke-width: 1; stroke-dasharray: 2 3; }
.fluxo-svg .hoje-txt { fill: var(--gold-700); font-size: 11px; font-weight: 600; }
.fluxo-svg .zero { stroke: var(--neg); stroke-width: 1; opacity: .5; }
.fluxo-svg .barra-e { fill: var(--pos); opacity: .2; }
.fluxo-svg .barra-s { fill: var(--neg); opacity: .18; }
.fluxo-svg .cursor { stroke: var(--muted); stroke-width: 1; }
.fluxo-svg .ponto { fill: var(--surface); stroke: var(--navy-900); stroke-width: 2.4; }
/* o feixe que varre o gráfico uma vez, como num exame */
.fluxo-svg .revela { transform-origin: left; animation: revelar 1.5s var(--ease-out) .15s both; }
.fluxo-svg .feixe { animation: feixe 1.5s var(--ease-out) .15s both; }
@keyframes revelar { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes feixe { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(var(--larg)); opacity: 0; } }
.dica-graf {
  position: absolute; pointer-events: none; background: var(--navy-950); color: #fff; border-radius: 8px;
  padding: 8px 11px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow-pop); white-space: nowrap;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.dica-graf.vis { opacity: 1; transform: none; }
.dica-graf b { font-family: var(--f-display); font-weight: 600; }
.dica-graf .e { color: #7fd6b0; } .dica-graf .s { color: #f4a49c; }

/* indicadores */
.indicadores { display: grid; grid-template-columns: repeat(4, 1fr); }
.ind { padding: 16px 20px 18px; border-top: 1px solid var(--line); position: relative; cursor: help; transition: background .15s; }
.ind:hover, .ind:focus-visible { background: var(--surface-2); }
.ind:not(:nth-child(4n+1)) { border-left: 1px solid var(--line); }
.ind .nome { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ind .nome .sinal { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }
.ind.atencao .nome .sinal { background: var(--neg); box-shadow: 0 0 0 0 var(--neg); animation: pulso 2s infinite; }
.ind.alerta .nome .sinal { background: var(--warn); }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--neg) 50%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ind .v { font-family: var(--f-display); font-size: 24px; font-weight: 600; margin: 4px 0 2px; letter-spacing: -.02em; }
.ind.atencao .v { color: var(--neg); }
.ind .t { font-size: 12px; color: var(--faint); }
.ind svg.spark { display: block; width: 100%; max-width: 160px; height: 22px; margin-top: 8px; overflow: visible; }
.ind svg.spark path { fill: none; stroke: var(--gold-500); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.pop-ind {
  position: fixed; z-index: 60; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop); padding: 14px 16px; font-size: 13px; pointer-events: none;
  opacity: 0; transform: translateY(6px) scale(.98); transform-origin: top left; transition: opacity .15s, transform .2s var(--ease-out);
}
.pop-ind.vis { opacity: 1; transform: none; }
.pop-ind h4 { margin: 0 0 4px; font: 600 14px var(--f-display); }
.pop-ind .formula { background: var(--surface-2); border-radius: 6px; padding: 6px 9px; margin: 8px 0; font-size: 12.5px; }
.pop-ind table { width: 100%; border-collapse: collapse; }
.pop-ind td { padding: 2px 0; } .pop-ind td:last-child { text-align: right; }

/* lista "hoje" */
.lista-hoje { list-style: none; margin: 0; padding: 0; }
.lista-hoje li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.lista-hoje li:first-child { border-top: 0; }
.lista-hoje .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.lista-hoje .ico svg { width: 17px; height: 17px; stroke: currentColor; }
.lista-hoje .ico.neg { background: var(--neg-bg); color: var(--neg); }
.lista-hoje .ico.pos { background: var(--pos-bg); color: var(--pos); }
.lista-hoje .ico.warn { background: var(--warn-bg); color: var(--warn); }
.lista-hoje .ico.info { background: var(--info-bg); color: var(--info); }
.lista-hoje .t1 { font-weight: 500; font-size: 14px; line-height: 1.3; }
.lista-hoje .t2 { font-size: 12.5px; color: var(--muted); }
.lista-hoje .v { font-weight: 600; font-size: 14px; }
.lista-hoje a { text-decoration: none; color: inherit; }

/* ------------------------------------------------------------------ tabelas */
.barra-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.barra-filtros .busca-local { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; background: var(--surface); min-width: 220px; }
.barra-filtros .busca-local input { border: 0; outline: none; background: none; width: 100%; }
.barra-filtros .busca-local svg { width: 16px; height: 16px; stroke: var(--faint); }
.tabela-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr { transition: background .12s; cursor: pointer; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t tbody tr.sel { background: color-mix(in srgb, var(--gold-500) 12%, transparent); }
table.t .dir { text-align: right; }
table.t .cx { width: 36px; padding-right: 0; }
table.t input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy-900); cursor: pointer; }
table.t .t1 { font-weight: 500; }
table.t .t2 { font-size: 12.5px; color: var(--muted); }
table.t tr.baixando td { animation: baixou .7s var(--ease-out); }
@keyframes baixou { 0% { background: color-mix(in srgb, var(--pos) 18%, transparent); } 100% { background: transparent; } }
.rodape-tab { display: flex; gap: 22px; align-items: center; padding: 12px 14px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.rodape-tab b { color: var(--text); font-family: var(--f-display); font-weight: 600; }
.vazio { text-align: center; padding: 48px 20px; color: var(--muted); }
.vazio b { display: block; color: var(--text); font-family: var(--f-display); font-size: 16px; margin-bottom: 4px; }

/* caixa de busca com lista (fornecedor, cliente, categoria) */
.combo { position: relative; }
.combo-caixa { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 0 8px 0 11px; transition: border-color .15s, box-shadow .15s; }
.combo-caixa:focus-within { border-color: var(--gold-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-500) 22%, transparent); }
.combo-caixa > svg { width: 16px; height: 16px; stroke: var(--faint); flex: none; }
.combo-caixa input { border: 0; outline: none; background: none; padding: 9px 0; width: 100%; min-width: 0; }
.combo.escolhido .combo-caixa { background: var(--surface-2); }
.combo.escolhido .combo-caixa input { font-weight: 600; }
.combo.escolhido .combo-caixa > svg { stroke: var(--pos); }
.combo-limpar { border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--muted); display: grid; place-items: center; }
.combo-limpar:hover { background: var(--line); color: var(--text); }
.combo-limpar svg { width: 15px; height: 15px; stroke: currentColor; }
.combo-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; min-height: 0; }
.combo-sub:empty { display: none; }
.combo-lista {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
  max-height: 320px; overflow-y: auto; animation: entra .16s var(--ease-out);
}
.combo-lista li[role="option"] { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-lista li.foco, .combo-lista li[role="option"]:hover { background: var(--surface-2); }
.combo-lista li.atual .ct { color: var(--gold-700); }
.combo-lista .ct { font-weight: 500; font-size: 14px; }
.combo-lista .cs { font-size: 12.5px; color: var(--muted); }
.combo-grupo { font-size: 12px; color: var(--faint); padding: 8px 10px 4px; font-weight: 600; }
.combo-vazio { padding: 10px; color: var(--muted); font-size: 13.5px; }
.combo-extra { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--gold-700); font-weight: 500; border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 8px 8px !important; }
.combo-extra svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.cad-rapido { margin-top: 10px; border: 1px solid var(--gold-500); border-radius: var(--r-md); padding: 12px 14px 14px; background: color-mix(in srgb, var(--gold-500) 6%, var(--surface)); animation: entra .25s var(--ease-out); }
.cad-rapido .cr-tit { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cad-rapido .cr-tit svg { width: 17px; height: 17px; stroke: var(--gold-700); }
.cad-rapido .cr-tit .icone-btn { margin-left: auto; width: 30px; height: 30px; }

.resumo-pessoa { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 18px; background: var(--surface-2); }
.rp-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; }
.rp-nums div { display: flex; flex-direction: column; min-width: 0; }
.rp-nums span { font-size: 12.5px; color: var(--muted); }
.rp-nums b { font-family: var(--f-display); font-weight: 600; font-size: 16px; }
.rp-nums small { font-size: 12px; color: var(--faint); }
.rp-lista { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.rp-lista li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.rp-lista li:hover { background: var(--surface); }
.rp-lista .rp-d { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-acoes { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .rp-lista li { grid-template-columns: auto minmax(0, 1fr) auto; } .rp-lista li .selo { display: none; } }

/* relatórios: painel gerencial */
:root { --serie-rec: #0a3359; --serie-desp: #c09f6f; --serie-lucro: #1f5f99; }
:root[data-theme="dark"] { --serie-rec: #8fb3dc; --serie-desp: #d4b888; --serie-lucro: #7fb4ea; }
.rel-filtros { justify-content: space-between; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--navy-900); color: #fff; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--gold-500); color: var(--navy-950); }
.kpis-rel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi > span:first-child { font-size: 13px; color: var(--muted); }
.kpi b { font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi.destaque { background: var(--navy-900); color: #fff; }
.kpi.destaque > span:first-child { color: #a9bbd0; }
.kpi.destaque.preju { background: var(--neg); }
.kpi.destaque.preju > span:first-child { color: #fde3e0; }
.var { font-size: 12px; }
.var.bom { color: var(--pos); } .var.ruim { color: var(--neg); } .var.neu { color: var(--faint); }
.kpi.destaque .var { color: #d7e2ee; }
.grade-rel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grade-rel > .rel-larga { grid-column: 1 / -1; }
.graf-box { width: 100%; min-height: 200px; }
.graf { width: 100%; display: block; overflow: visible; }
.graf .eixo { stroke: var(--line); stroke-width: 1; }
.graf .eixo-txt { fill: var(--faint); font-size: 11px; font-family: var(--f-body); }
.graf .zero-l { stroke: var(--line-strong); stroke-width: 1.2; }
.graf .zero-l.neg { stroke: var(--neg); opacity: .5; }
.graf .barra.rec { fill: var(--serie-rec); }
.graf .barra.desp { fill: var(--serie-desp); }
.graf .barra.lucro { fill: var(--serie-lucro); }
.graf .barra.preju { fill: var(--neg); }
.graf .alvo { fill: transparent; cursor: crosshair; }
.graf .alvo:hover { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.graf .area-saldo { fill: color-mix(in srgb, var(--serie-rec) 10%, transparent); }
.graf .linha-saldo { fill: none; stroke: var(--serie-rec); stroke-width: 2.2; stroke-linejoin: round; }
.graf .linha-prev { fill: none; stroke: var(--gold-600); stroke-width: 2.2; stroke-dasharray: 5 5; }
.graf .pt-saldo { fill: var(--surface); stroke: var(--serie-rec); stroke-width: 2; }
.graf .pt-prev { fill: var(--surface); stroke: var(--gold-600); stroke-width: 2; }
.graf .barra { animation: subir .6s var(--ease-out) both; transform-box: fill-box; transform-origin: bottom; }
.graf .barra.preju { transform-origin: top; }
@keyframes subir { from { transform: scaleY(0); } }
.legenda-rel { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.lg.rec { background: var(--serie-rec); } .lg.desp { background: var(--serie-desp); }
.lg.linha { height: 3px; width: 16px; background: var(--serie-rec); vertical-align: 3px; }
.lg.prev { height: 0; width: 16px; border-top: 3px dashed var(--gold-600); border-radius: 0; vertical-align: 3px; }
.dica-rel { position: fixed; z-index: 90; pointer-events: none; background: var(--navy-950); color: #fff; border-radius: 9px; padding: 9px 12px; font-size: 12.5px; line-height: 1.55; box-shadow: var(--shadow-pop); white-space: nowrap; display: none; }
.dica-rel b { font-family: var(--f-display); font-weight: 600; display: block; margin-bottom: 2px; }
.dica-rel b::first-letter { text-transform: uppercase; }
.dica-rel .neg { color: #f4a49c; } .dica-rel .t2 { color: #a9bbd0; }
.dica-rel .lg { width: 9px; height: 9px; }
.nota-g { font-size: 12.5px; margin: 8px 0 0; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rk-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.rk-r { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rk-v { font-weight: 600; white-space: nowrap; }
.rk-v small { color: var(--faint); font-weight: 400; margin-left: 4px; }
.rk-barra { height: 8px; background: var(--surface-2); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.rk-barra i { display: block; height: 100%; border-radius: 99px; background: var(--serie-lucro); transform-origin: left; animation: crescer .7s var(--ease-out) both; }
.rk-barra i.desp { background: var(--serie-desp); } .rk-barra i.rec { background: var(--serie-rec); } .rk-barra i.neg { background: var(--neg); }
.rel-duas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.sub-h { font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 0 0 10px; font-family: var(--f-body); }
.cab-imp { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid #032645; padding-bottom: 10px; margin-bottom: 16px; }
.cab-imp img { width: 44px; } .cab-imp h2 { font-size: 17px; color: #032645; } .cab-imp div div { font-size: 12.5px; color: #5a6a7e; }
@media print {
  .so-imprimir .grade-rel { grid-template-columns: 1fr 1fr; gap: 10px; }
  .so-imprimir .painel { break-inside: avoid; border-color: #ccc; }
  .so-imprimir .graf .barra, .so-imprimir .rk-barra i { animation: none; }
  .so-imprimir .ind { cursor: default; }
}
@media (max-width: 1100px) { .kpis-rel { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpi:nth-child(4) { border-left: 0; } .kpi:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 860px) {
  .grade-rel, .rel-duas { grid-template-columns: 1fr; }
  .kpis-rel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 0 !important; border-top: 1px solid var(--line); }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .kpi.destaque { grid-column: 1 / -1; order: -1; border-left: 0 !important; }
  .kpi b { font-size: 18px; }
}

/* extrato importado e conciliação */
.conf-saldo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 14px; overflow: hidden; }
.conf-saldo > div { padding: 12px 16px; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.conf-saldo > div:first-child { border-left: 0; }
.conf-saldo span { font-size: 12.5px; color: var(--muted); }
.conf-saldo b { font-family: var(--f-display); font-weight: 600; font-size: 18px; }
.conf-saldo small { font-size: 12px; color: var(--faint); }
.conf-saldo .ok b { color: var(--pos); }
.conf-saldo .dif b { color: var(--warn); }
.cl-lista { list-style: none; margin: 0; padding: 0; }
.cl-linha { padding: 12px 18px; border-top: 1px solid var(--line); }
.cl-linha:first-child { border-top: 0; }
.cl-linha.conciliada { background: color-mix(in srgb, var(--pos) 4%, transparent); }
.cl-linha.ignorada { opacity: .65; }
.cl-banco { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.cl-data { color: var(--muted); font-size: 13px; }
.cl-desc { font-weight: 500; overflow-wrap: anywhere; }
.cl-banco b { font-family: var(--f-display); font-weight: 600; font-size: 15px; }
.cl-sug, .cl-ok, .cl-ign { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0 68px; font-size: 13.5px; }
.cl-sug { padding: 8px 10px 8px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.cl-sug.certa { border: 1px solid var(--gold-500); background: color-mix(in srgb, var(--gold-500) 7%, transparent); }
.cl-sug > span:nth-child(2) { flex: 1; min-width: 200px; }
.cl-sug-t { font-size: 11.5px; font-weight: 600; color: var(--gold-700); background: var(--gold-100); padding: 1px 8px; border-radius: 999px; }
.cl-ok { color: var(--pos); }
.cl-ok svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.cl-ok span { color: var(--text); flex: 1; min-width: 200px; }
.cl-ign { color: var(--muted); }
.cl-acoes { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0 68px; }
.cl-painel:empty { display: none; }
.cl-form { margin: 10px 0 0 68px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); animation: entra .2s var(--ease-out); }
.cl-bt { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 860px) {
  .conf-saldo { grid-template-columns: 1fr; }
  .conf-saldo > div { border-left: 0; border-top: 1px solid var(--line); }
  .conf-saldo > div:first-child { border-top: 0; }
  .cl-banco { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .cl-sug, .cl-ok, .cl-ign, .cl-acoes, .cl-form { margin-left: 0; }
}

/* filtros e abas de totais das contas */
.filtros-contas { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; position: relative; z-index: 6; }
.combo:focus-within { z-index: 40; }
.filtros-contas .fc-pessoa { flex: 1 1 280px; max-width: 420px; }
.filtros-contas .fc-pessoa .combo-caixa { border-radius: 999px; }
.filtros-contas .fc-data { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.filtros-contas .fc-data input { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; background: var(--surface); }
.abas-totais { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.aba-total { position: relative; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 13px 16px 12px; border: 0; background: none; cursor: pointer; border-left: 1px solid var(--line); transition: background .15s; }
.aba-total:first-child { border-left: 0; }
.aba-total:hover { background: var(--surface-2); }
.aba-total .at-rot { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.aba-total .at-rot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.aba-total.atr .at-rot::before { background: var(--neg); }
.aba-total.hoje .at-rot::before { background: var(--warn); }
.aba-total.abe .at-rot::before { background: var(--info); }
.aba-total.ok .at-rot::before { background: var(--pos); }
.aba-total .at-val { font-family: var(--f-display); font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.aba-total.atr .at-val { color: var(--neg); }
.aba-total .at-n { font-size: 12px; color: var(--faint); }
.aba-total::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold-500); transform: scaleX(0); transition: transform .3s var(--ease-spring); }
.aba-total[aria-pressed="true"] { background: var(--surface-2); }
.aba-total[aria-pressed="true"]::after { transform: scaleX(1); }

/* barra de ações em lote */
.lote {
  position: fixed; left: 50%; bottom: 24px; z-index: 40;
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 20px;
  background: var(--navy-950); color: #fff; border-radius: 999px; box-shadow: var(--shadow-pop);
  transform: translate(-50%, calc(100% + 140px)); transition: transform .35s var(--ease-spring);
}
.lote.vis { transform: translate(-50%, 0); }
.lote .btn { border-color: transparent; }

/* ------------------------------------------------------------------ gaveta lateral */
.veu { position: fixed; inset: 0; background: rgba(2, 20, 38, .38); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .25s; }
.veu.vis { opacity: 1; pointer-events: auto; }
.gaveta {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(560px, 100vw);
  background: var(--surface); box-shadow: var(--shadow-pop); display: flex; flex-direction: column;
  transform: translateX(104%); transition: transform .38s var(--ease-out);
}
.gaveta.vis { transform: none; }
.gaveta > header { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); }
.gaveta > header h2 { font-size: 19px; font-weight: 600; }
.gaveta > header p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.gaveta > header .icone-btn { margin-left: auto; }
.gaveta .conteudo { flex: 1; overflow-y: auto; padding: 20px 24px; }
.gaveta > footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.abas { display: flex; gap: 2px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.abas button { background: none; border: 0; padding: 10px 12px; cursor: pointer; color: var(--muted); position: relative; font-size: 14px; }
.abas button[aria-selected="true"] { color: var(--text); font-weight: 500; }
.abas button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--gold-500); border-radius: 2px; }
.secao-form { margin-top: 22px; }
.secao-form h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
details.mais { margin-top: 18px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
details.mais summary { cursor: pointer; color: var(--gold-700); font-weight: 500; font-size: 14px; list-style: none; }
details.mais summary::before { content: "+ "; }
details.mais[open] summary::before { content: "− "; }
details.mais > div { margin-top: 14px; }

.previa { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.previa .tit { padding: 10px 14px; background: var(--surface-2); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.previa ol { list-style: none; margin: 0; padding: 0; }
.previa li { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 14px; animation: entraLinha .35s var(--ease-out) both; }
@keyframes entraLinha { from { opacity: 0; transform: translateY(-4px); } }

.aviso { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--r-md); font-size: 13.5px; align-items: flex-start; }
.aviso svg { width: 18px; height: 18px; stroke: currentColor; flex: none; margin-top: 1px; }
.aviso.warn { background: var(--warn-bg); color: var(--warn); }
.aviso.info { background: var(--info-bg); color: var(--info); }
.aviso.neg { background: var(--neg-bg); color: var(--neg); }
.aviso.pos { background: var(--pos-bg); color: var(--pos); }
.aviso b { font-weight: 600; }

.anexo-zona { border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 16px; text-align: center; color: var(--muted); font-size: 13.5px; transition: all .15s; cursor: pointer; }
.anexo-zona:hover, .anexo-zona.sobre { border-color: var(--gold-500); background: var(--gold-100); color: var(--gold-700); }
.anexos-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.anexo { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.anexo .tipo { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: var(--neg-bg); color: var(--neg); }

/* passos */
.passos { display: flex; gap: 0; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.passo { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--faint); }
.passo .bola { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; font-weight: 600; transition: all .25s var(--ease-out); }
.passo.feito .bola { background: var(--pos); border-color: var(--pos); color: #fff; }
.passo.atual { color: var(--text); font-weight: 500; }
.passo.atual .bola { border-color: var(--gold-500); background: var(--gold-500); color: var(--navy-950); }
.passo + .passo::before { content: ""; flex: 0 0 18px; height: 1px; background: var(--line-strong); margin-right: 8px; }

/* linhas de itens */
.itens { display: flex; flex-direction: column; gap: 8px; }
.item-linha { display: grid; grid-template-columns: 2fr .7fr .9fr 1fr 1fr auto; gap: 8px; align-items: end; }
.item-linha .campo > span { font-size: 12px; }

/* ------------------------------------------------------------------ cartões de crédito */
.grade-cartoes { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.cartao-vis {
  aspect-ratio: 1.586; border-radius: 18px; padding: 22px 24px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, var(--navy-700) 0%, var(--navy-900) 45%, var(--navy-950) 100%);
  box-shadow: 0 24px 40px -18px rgba(3,38,69,.6);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .4s var(--ease-out);
}
.cartao-vis::before { content: ""; position: absolute; left: 54%; top: -10%; bottom: -10%; width: 6px; background: linear-gradient(var(--gold-500), var(--gold-600)); transform: rotate(0deg); opacity: .9; }
.cartao-vis::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.10) 45%, transparent 60%); transform: translateX(-100%); transition: transform .9s var(--ease-out); }
.cartao-vis:hover::after { transform: translateX(100%); }
.cartao-vis .topo-c { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.cartao-vis .nome-c { font-family: var(--f-display); font-weight: 600; font-size: 17px; }
.cartao-vis .bandeira { font-size: 12px; color: var(--gold-500); font-weight: 600; letter-spacing: .06em; }
.cartao-vis .final { font-family: var(--f-display); font-size: 19px; letter-spacing: .18em; position: relative; z-index: 1; }
.cartao-vis .base-c { display: flex; justify-content: space-between; font-size: 12.5px; color: #b5c5d8; position: relative; z-index: 1; }
.cartao-vis .base-c b { color: #fff; display: block; font-size: 14px; font-weight: 500; }
.lista-cartoes { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.limite { margin-top: 18px; }
.limite .barra { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 8px 0 6px; }
.limite .barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-900), var(--navy-700)); border-radius: 99px; transform-origin: left; animation: crescer .9s var(--ease-out) both; }
.limite .barra i.alto { background: linear-gradient(90deg, var(--warn), var(--neg)); }
@keyframes crescer { from { transform: scaleX(0); } }
.faturas-tl { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.fat { min-width: 130px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .15s, transform .15s var(--ease-out); text-align: left; }
.fat:hover { transform: translateY(-2px); }
.fat[aria-pressed="true"] { border-color: var(--gold-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-500) 20%, transparent); }
.fat .m { font-size: 13px; color: var(--muted); }
.fat .v { font-family: var(--f-display); font-weight: 600; font-size: 17px; margin-top: 2px; }

/* ------------------------------------------------------------------ estoque */
.nivel { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.nivel .barra { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: visible; }
.nivel .barra i { position: absolute; left: 0; top: -1px; bottom: -1px; border-radius: 99px; background: var(--pos); animation: crescer .8s var(--ease-out) both; transform-origin: left; }
.nivel .barra i.baixo { background: var(--neg); }
.nivel .barra i.medio { background: var(--warn); }
.nivel .barra .min { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .55; border-radius: 1px; }

/* ------------------------------------------------------------------ máquinas */
.unid-maq { margin-bottom: 22px; }
.unid-maq > h2 { font-size: 16px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.unid-maq > h2 .muted { font: 400 13px var(--f-body); }
.maq-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.maq {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 16px; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; transition: border-color .15s, transform .2s var(--ease-out);
}
.maq:hover { border-color: var(--gold-500); transform: translateY(-2px); }
.maq .ic { grid-row: span 3; width: 42px; height: 42px; border-radius: 12px; background: var(--navy-100); color: var(--navy-900); display: grid; place-items: center; }
:root[data-theme="dark"] .maq .ic { color: #b9cde4; }
.maq .ic svg { width: 22px; height: 22px; stroke: currentColor; }
.maq .n { font-weight: 600; font-size: 14.5px; }
.maq .d { font-size: 12.5px; color: var(--muted); }
.maq .s { margin-top: 6px; }

.ficha-maq-cab { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 22px 24px; background: var(--navy-900); color: #fff; border-radius: var(--r-lg); position: relative; overflow: hidden; }
.ficha-maq-cab::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 5px; background: var(--gold-500); }
.ficha-maq-cab h1 { font-size: 24px; }
.ficha-maq-cab .d { color: #a9bbd0; font-size: 14px; margin-top: 4px; }
.ficha-maq-cab .kpis { display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.ficha-maq-cab .kpis div { font-size: 12.5px; color: #a9bbd0; }
.ficha-maq-cab .kpis b { display: block; font-family: var(--f-display); font-size: 20px; color: #fff; font-weight: 600; }
.ficha-maq-cab .acoes-f { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

.linha-tempo { list-style: none; margin: 0; padding: 4px 0 0 0; position: relative; }
.linha-tempo::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.linha-tempo li { position: relative; padding: 0 0 22px 48px; animation: entraLinha .45s var(--ease-out) both; }
.linha-tempo .marco { position: absolute; left: 4px; top: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); }
.linha-tempo .marco svg { width: 12px; height: 12px; stroke: currentColor; }
.linha-tempo li.corr .marco { border-color: var(--neg); color: var(--neg); }
.linha-tempo li.prev .marco { border-color: var(--pos); color: var(--pos); }
.linha-tempo li.mov .marco { border-color: var(--info); color: var(--info); }
.linha-tempo li.prog .marco { border-style: dashed; border-color: var(--gold-500); color: var(--gold-700); }
.linha-tempo .quando { font-size: 12.5px; color: var(--muted); }
.linha-tempo .oque { font-weight: 600; margin: 1px 0 4px; }
.linha-tempo .det { font-size: 14px; color: var(--text); }
.linha-tempo .pecas { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13.5px; }
.linha-tempo .pecas div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; }
.linha-tempo .pecas div + div { border-top: 1px solid var(--line); }
.linha-tempo .pecas .cab-p { background: var(--surface-2); color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------------ unidades */
.arvore { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.unid { padding: 18px 20px; }
.unid h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.unid .tipo { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.unid ul { list-style: none; margin: 14px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--gold-500); }
.unid li { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.unid li code { font: 12px var(--f-body); color: var(--faint); }

/* DRE */
table.dre td, table.dre th { padding: 9px 14px; }
table.dre tr.total td { font-weight: 600; border-top: 1px solid var(--line-strong); }
table.dre tr.grande td { font-family: var(--f-display); font-size: 15px; background: var(--surface-2); }
table.dre tr.sub td:first-child { padding-left: 30px; color: var(--muted); }
table.dre tbody tr { cursor: default; }
.neg-v { color: var(--neg); }
.pos-v { color: var(--pos); }

/* ------------------------------------------------------------------ busca Ctrl+K */
.paleta { position: fixed; inset: 0; z-index: 70; display: grid; place-items: start center; padding-top: 12vh; background: rgba(2,20,38,.35); opacity: 0; pointer-events: none; transition: opacity .18s; }
.paleta.vis { opacity: 1; pointer-events: auto; }
.paleta .caixa { width: min(620px, 92vw); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); overflow: hidden; transform: translateY(-8px) scale(.98); transition: transform .25s var(--ease-out); }
.paleta.vis .caixa { transform: none; }
.paleta input { width: 100%; border: 0; outline: none; padding: 18px 20px; font-size: 17px; background: none; border-bottom: 1px solid var(--line); }
.paleta ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.paleta li { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; cursor: pointer; }
.paleta li[aria-selected="true"] { background: var(--surface-2); }
.paleta li .tp { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ------------------------------------------------------------------ avisos (toast) */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 14px; background: var(--navy-950); color: #fff; padding: 11px 12px 11px 16px; border-radius: 12px; box-shadow: var(--shadow-pop); font-size: 14px; animation: toastIn .35s var(--ease-spring) both; }
.toast.sai { animation: toastOut .25s var(--ease-out) both; }
.toast svg { width: 18px; height: 18px; stroke: #7fd6b0; flex: none; }
.toast button { background: none; border: 0; color: var(--gold-500); font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.toast button:hover { background: rgba(255,255,255,.08); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

.toast.erro { background: var(--neg); }
.toast.erro svg { stroke: #fff; }

/* ------------------------------------------------------------------ tela de entrada (login) */
.entrada {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(120% 90% at 85% 0%, var(--navy-700) 0%, var(--navy-900) 45%, var(--navy-950) 100%);
  position: relative; overflow: hidden;
}
.cartao-entrada { position: relative; z-index: 1; width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 32px 30px 28px; box-shadow: var(--shadow-pop); animation: entra .5s var(--ease-out) both; }
.cartao-entrada .topo-e { display: flex; align-items: center; gap: 16px; }
.cartao-entrada .logo-anim { width: 76px; }
.marca-e { margin: 0; }
.cartao-entrada .topo-e + * { margin-top: 22px; }

/* logo animada: as duas metades do símbolo (circuito dourado e cabeça azul) chegam de lados opostos e se encaixam;
   depois um feixe dourado passa de cima a baixo, como num exame de imagem. Ao passar o mouse, as metades se afastam um pouco. */
.logo-anim { position: relative; width: 120px; aspect-ratio: 345 / 405; flex: none; cursor: default; }
.logo-anim img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: transform .45s var(--ease-spring); }
.logo-anim .la-e { clip-path: inset(0 52% 0 0); animation: laEsq .9s var(--ease-out) both; }
.logo-anim .la-d { clip-path: inset(0 0 0 48%); animation: laDir .9s var(--ease-out) both; }
.logo-anim:hover .la-e { transform: translateX(-5%); }
.logo-anim:hover .la-d { transform: translateX(5%); }
.logo-anim .la-feixe { position: absolute; left: -8%; right: -8%; height: 18%; top: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(transparent, color-mix(in srgb, var(--gold-500) 55%, transparent) 50%, transparent);
  mix-blend-mode: screen; animation: laFeixe 2.4s ease-in-out .9s infinite; }
@keyframes laEsq { from { transform: translateX(-40%); opacity: 0; } }
@keyframes laDir { from { transform: translateX(40%); opacity: 0; } }
@keyframes laFeixe { 0% { top: -18%; opacity: 0; } 15% { opacity: 1; } 70% { opacity: 1; } 85%, 100% { top: 100%; opacity: 0; } }

/* tela de carregamento (ao abrir ou recarregar) */
.carregando-tela {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(90% 70% at 50% 40%, var(--surface) 0%, var(--bg) 70%);
}
.carregando-e { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.carregando-e .logo-anim { width: 132px; }
.carregando-e .nome-l { text-align: center; animation: entra .6s var(--ease-out) .35s both; }
.carregando-e .nome-l b { display: block; font: 600 30px var(--f-display); letter-spacing: .38em; padding-left: .38em; color: var(--navy-900); }
:root[data-theme="dark"] .carregando-e .nome-l b { color: #fff; }
.carregando-e .nome-l small { color: var(--gold-700); font-weight: 600; font-size: 13px; letter-spacing: .08em; }
.carregando-e .barra-l { width: 140px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; animation: entra .6s var(--ease-out) .5s both; }
.carregando-e .barra-l i { display: block; width: 40%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold-500), var(--navy-700)); animation: laBarra 1.2s ease-in-out infinite; }
@keyframes laBarra { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.marca-e b { font: 600 22px var(--f-display); letter-spacing: .32em; color: var(--navy-900); display: block; }
:root[data-theme="dark"] .marca-e b { color: #fff; }
.marca-e small { color: var(--gold-700); font-weight: 600; font-size: 12.5px; }
.form-e { display: flex; flex-direction: column; gap: 14px; }
.form-e h1 { font-size: 22px; }
.primeiro { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong); font-size: 14px; }
.primeiro p { margin: 4px 0 10px; }

/* ------------------------------------------------------------------ termo de entrega (impressão) */
.termo { font-size: 13.5px; color: #0d1b2c; background: #fff; }
.termo .cab-t { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #032645; padding-bottom: 12px; }
.termo .cab-t img { width: 54px; }
.termo .cab-t h2 { font-size: 18px; color: #032645; }
.termo .cab-t .n { margin-left: auto; text-align: right; font-size: 12.5px; color: #5a6a7e; }
.termo table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.termo th, .termo td { border: 1px solid #cdd5df; padding: 6px 8px; text-align: left; }
.termo th { background: #f2f4f7; font-weight: 600; font-size: 12.5px; }
.termo .assin { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.termo .assin div { border-top: 1px solid #0d1b2c; padding-top: 6px; font-size: 12.5px; text-align: center; }
.so-imprimir { display: none; }
@media print {
  body * { visibility: hidden; }
  .so-imprimir, .so-imprimir * { visibility: visible; }
  .so-imprimir { display: block; position: absolute; left: 0; top: 0; width: 100%; padding: 24px; }
}

/* ------------------------------------------------------------------ entrada da página */
.pagina > * { animation: entra .45s var(--ease-out) both; }
.pagina > *:nth-child(2) { animation-delay: .04s; }
.pagina > *:nth-child(3) { animation-delay: .08s; }
.pagina > *:nth-child(4) { animation-delay: .12s; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------------ celular */
.nav-cel { display: none; }
@media (max-width: 1100px) {
  .grade-painel { grid-template-columns: 1fr; }
  .indicadores { grid-template-columns: repeat(2, 1fr); }
  .ind:not(:nth-child(4n+1)) { border-left: 0; }
  .ind:nth-child(even) { border-left: 1px solid var(--line); }
  .grade-cartoes { grid-template-columns: 1fr; }
  .grade-cartoes .cartao-vis { max-width: 400px; }
}
@media (max-width: 860px) {
  .app, .app.recolhido { grid-template-columns: 1fr; }
  .side { display: none; }
  .topo { padding: 10px 16px; }
  .busca-btn kbd, .busca-btn span { display: none; }
  .busca-btn { flex: 0; padding: 8px 10px; }
  .topo .esp { display: none; }
  .seletor-unidade { flex: 1; max-width: none; min-width: 0; }
  .seletor-unidade select { max-width: none; width: 100%; }
  .faixa-demo { padding: 6px 16px; }
  .pagina { padding: 20px 16px 110px; }
  .cab h1 { font-size: 24px; }
  .resumo { grid-template-columns: 1fr; }
  .resumo > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .grade-campos { grid-template-columns: 1fr; }
  .item-linha { grid-template-columns: 1fr 1fr; }
  .abas-totais { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aba-total { border-top: 1px solid var(--line); }
  .aba-total:nth-child(odd) { border-left: 0; }
  .aba-total:nth-child(-n+2) { border-top: 0; }
  .aba-total:last-child { grid-column: 1 / -1; }
  .filtros-contas .fc-pessoa { max-width: none; flex-basis: 100%; }
  .filtros-contas .fc-data { flex: 1 1 40%; }
  .filtros-contas .busca-local { flex: 1 1 100%; }
  .item-linha .campo:first-child { grid-column: 1 / -1; }
  .ficha-maq-cab { grid-template-columns: 1fr; }
  .ficha-maq-cab .acoes-f { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .esconde-cel { display: none; }
  .nav-cel {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--side); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .nav-cel a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--side-text); text-decoration: none; padding: 6px 0; position: relative; }
  .nav-cel a svg { width: 21px; height: 21px; stroke: currentColor; }
  .nav-cel a[aria-current="page"] { color: var(--gold-500); }
  .nav-cel a[aria-current="page"]::before { content: ""; position: absolute; top: -6px; width: 26px; height: 3px; background: var(--gold-500); border-radius: 0 0 3px 3px; }
  .lote { bottom: 84px; }
  .toasts { right: 16px; left: 16px; bottom: 84px; align-items: stretch; }
  /* lista de contas no celular: cada conta vira um bloco (nome e valor em cima, data e situação embaixo) */
  table.t-contas thead { display: none; }
  table.t-contas, table.t-contas tbody { display: block; }
  table.t-contas tbody tr { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "cx desc val" "cx ven sit"; column-gap: 12px; row-gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
  table.t-contas td { border: 0; padding: 0; }
  table.t-contas td.cx { grid-area: cx; align-self: start; padding-top: 2px; }
  table.t-contas .c-desc { grid-area: desc; min-width: 0; }
  table.t-contas .c-val { grid-area: val; align-self: start; }
  table.t-contas .c-ven { grid-area: ven; font-size: 12.5px; color: var(--muted); }
  table.t-contas .c-sit { grid-area: sit; justify-self: end; }
  .indicadores { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
