/* ====================================================================
   Dashboard Transbocayuva — identidade "Razão"
   O painel é o livro-razão vivo do faturamento: fundo papel, régua a
   linha fina, um número editorial, vermelho gasto uma vez.
   Paleta ancorada na logomarca (navy #172B70 / vermelho #D12632).
   ==================================================================== */

:root {
  color-scheme: only light; /* sem tema escuro: o painel foi desenhado só para o claro */

  --paper:        #FAF8F3;
  --surface:      #FFFFFF;
  --surface-2:    #FCFBF7;
  --ink:          #14171B;
  --muted:        #6E6A60;
  --rule:         #E7E3D8;
  --rule-strong:  #D6D0C1;
  --navy:         #172B70;
  --navy-ink:     #172B70;
  --navy-soft:    #ECEEF6;
  --blue:         #394A9B;
  --red:          #D12632;
  --red-soft:     #FBECED;
  --proj:         #A8571F;
  --meta:         #C9960B;
  --positive:     #0E7C63;
  --focus:        #394A9B;

  /* apelidos usados pelos gráficos (charts/*.js) e pela tela de config */
  --brand-navy:  var(--navy);
  --brand-blue:  var(--blue);
  --brand-red:   var(--red);
  --success:     var(--positive);
  --line:        var(--rule);
  --canvas:      var(--paper);

  --radius: 10px;
  --sidebar-w: 64px;
  --gutter: 30px;
  --maxw: 1500px;
  --dur: 150ms;
  --dur-fast: 150ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  /* sombra dos cards herói/filtros — ambiente, quase imperceptível */
  --shadow-card: 0 2px 4px rgba(17, 22, 33, 0.035), 0 12px 30px rgba(17, 22, 33, 0.045);

  --font-fig: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-ui:  "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono:"IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;
}

/* Sem tema escuro, de propósito: o painel é sempre claro, igual no desktop e no celular
   (o modo escuro do aparelho não muda nada aqui — ver color-scheme "only light" acima e no index.html). */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background-color: var(--paper);
  /* fundo papel: grão feTurbulence + luz diagonal suave — pra não ficar liso.
     Tudo em tokens/color-mix, adapta ao tema escuro sozinho. */
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.85'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='180'%20height='180'%20filter='url(%23n)'%20opacity='0.85'/%3E%3C/svg%3E"),
    radial-gradient(135% 100% at 12% -12%,
      color-mix(in srgb, var(--surface) 55%, var(--paper)) 0%,
      var(--paper) 44%,
      color-mix(in srgb, var(--navy) 5%, var(--paper)) 100%);
  background-size: 180px 180px, cover;
  background-repeat: repeat, no-repeat;
  background-attachment: scroll, fixed;
  background-blend-mode: overlay, normal;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-fig); margin: 0; text-wrap: balance; }
button { font-family: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.u-num, .num { font-variant-numeric: tabular-nums; }
.u-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 21px;
  line-height: 1;
  user-select: none;
}

/* -------------------------------- layout -------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* -------------------------------- sidebar ------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  width: var(--sidebar-w);
  background-color: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 18px 10px 14px;
  z-index: 20;
  /* leve sombra p/ a barra descolar da página */
  box-shadow: 2px 4px 18px rgba(15, 20, 30, 0.06);
}
.sidebar__brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 0 16px;
  margin-bottom: 10px;
}
.sidebar__brand::after {
  content: "";
  position: absolute; left: 6px; right: 6px; bottom: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--rule) 28%, var(--rule) 72%, transparent);
}
.sidebar__symbol {
  height: 60px;
  width: 60px;
  object-fit: contain;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  justify-content: center; /* ícones centrados verticalmente na barra */
}
.navitem {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
/* ícones da navegação: tamanho normal, só mais finos/suaves */
.navitem .material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 260, 'GRAD' -25, 'opsz' 24;
}
.navitem__label { display: none; }
.navitem:hover { background: var(--surface-2); color: var(--ink); }
.navitem.is-active { background: var(--navy-soft); color: var(--navy-ink); }
.navitem[data-locked],
.navitem[aria-disabled="true"] {
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  cursor: default;
}
.navitem[data-locked]:hover,
.navitem[aria-disabled="true"]:hover { background: transparent; }

.sidebar__foot {
  position: relative;
  margin-top: 10px;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar__foot::before {
  content: "";
  position: absolute; left: 6px; right: 6px; top: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--rule) 28%, var(--rule) 72%, transparent);
}

/* -------------------------------- content ------------------------------ */
.content { min-width: 0; }
.content__inner {
  /* sem teto de largura — nada de lacunas centralizadas em monitores largos */
  padding: var(--gutter);
}
.content:focus { outline: none; }

/* .page-head__row: usado só pelo cabeçalho da tabela "Detalhamento" agora */
.page-head__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* -------------------------------- filters ------------------------------ */
.filters {
  display: grid;
  grid-template-columns: repeat(6, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 13px;
  border-radius: var(--radius);
  /* degradê + textura vêm de .tex; sombra vem do wrapper .softcast */
}
.filters.filters--frota { grid-template-columns: repeat(7, 1fr) auto; }
/* o card de filtro não deve ficar apagado: degradê navy-soft um pouco mais
   presente que o .tex padrão (navy 3%), mas ainda calmo. Só troca a camada de
   degradê — grão/size/repeat/blend continuam vindo de .tex. */
.filters.tex {
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%3E%3Cfilter%20id='paper'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='160'%20height='160'%20filter='url(%23paper)'%20opacity='0.7'/%3E%3C/svg%3E"),
    linear-gradient(145deg,
      color-mix(in srgb, var(--navy-soft) 30%, var(--surface)) 0%,
      color-mix(in srgb, var(--navy-soft) 72%, var(--surface)) 55%,
      color-mix(in srgb, var(--navy-soft) 48%, var(--surface)) 100%);
}
/* título "Faturamento" + divisória com degradê nas pontas, dentro do card */
.filters__head {
  grid-column: 1 / -1;
  position: relative;
  padding-bottom: 10px;
}
.filters__head::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--rule) 28%, var(--rule) 72%, transparent);
}
.filters__title {
  font-family: var(--font-fig);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy-ink);
}
.filters .field {
  position: relative;
  display: block;
  min-width: 0;
}
.filters .field label { display: none; }
.filters input,
.filters select {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 7px;
  /* mesma cor de superfície dos cards (branco puro), não o --surface-2 morno */
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  padding: 0 10px;
  /* base contínua leve (~10% também no centro); os cantos ganham profundidade
     extra pelos pseudo-elementos abaixo */
  box-shadow: 0 2px 6px rgba(15, 20, 30, 0.20);
}
/* Sombra de canto: duas manchas independentes nos cantos inferiores do campo,
   somadas à base. Ficam atrás do campo (z-index 0 < 1) e não interceptam
   clique, foco ou o calendário/select. */
.filters .field::before,
.filters .field::after {
  content: "";
  position: absolute;
  z-index: 0;
  bottom: -3px;
  height: 12px;
  width: 40%;
  pointer-events: none;
  filter: blur(4px);
}
.filters .field::before {
  left: -2px;
  background: radial-gradient(ellipse 120% 120% at 15% 100%,
    rgba(15, 20, 30, 0.46) 0%,
    rgba(15, 20, 30, 0.18) 45%,
    transparent 78%);
}
.filters .field::after {
  right: -2px;
  background: radial-gradient(ellipse 120% 120% at 85% 100%,
    rgba(15, 20, 30, 0.46) 0%,
    rgba(15, 20, 30, 0.18) 45%,
    transparent 78%);
}
.filters select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E6A60' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.filters input::-webkit-calendar-picker-indicator { opacity: .5; }
.filters__clear {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.filters__clear:hover { background: var(--surface-2); color: var(--ink); }

/* -------------------------- linha de topo: 3 stat cards + Meta -------- */
.u-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}
.cardgrid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
/* Mesmo padrao visual de .cardgrid4, mas com numero de colunas configuravel
   via --cardgrid-cols — usado quando a quantidade de stat cards nao e 4 (ex.:
   pagina de Frota, total + N categorias), sempre numa unica linha que se
   adapta a largura da pagina (nunca quebra linha), igual a regra do Faturamento.
   min-height replica a altura que, no Faturamento, vem "de graca" do card
   Meta (mais alto, com barra de progresso) esticando a linha toda via grid
   stretch — aqui nao ha card irmao mais alto, entao fixamos a mesma altura
   medida (132px) para o respiro em baixo do statcard ficar identico. */
.cardgrid-n {
  display: grid;
  grid-template-columns: repeat(var(--cardgrid-cols, 4), 1fr);
  gap: 16px;
}
.cardgrid-n > .top-card-shadow { min-height: 132px; }
.card--meta { display: flex; flex-direction: column; justify-content: center; }

/* stat cards: conteúdo compacto, centrado verticalmente — a linha inteira
   tem a altura do card Meta (já enxugado), sem folga sobrando */
.cardgrid4 > .top-card-shadow > .card,
.cardgrid-n > .top-card-shadow > .card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  /* corpo (`.statcard__body`, flex:1) vai até a borda de baixo do card, então
     "valor + infos" centram no vão inteiro entre o filete e o fim do card */
  padding-bottom: 0;
  /* grão fino tipo papel por cima do degradê — só nos 3 stat cards.
     feTurbulence dessaturado + blend overlay = textura quase imperceptível. */
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%3E%3Cfilter%20id='paper'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='160'%20height='160'%20filter='url(%23paper)'%20opacity='0.7'/%3E%3C/svg%3E"),
    linear-gradient(145deg,
      var(--surface) 0%,
      color-mix(in srgb, var(--navy) 3%, var(--surface)) 100%);
  background-size: 160px 160px, cover;
  background-repeat: repeat, no-repeat;
  background-blend-mode: overlay, normal;
}

/* Mesma estrutura de camadas e os mesmos valores usados em .filters .field:
   o wrapper projeta os cantos e o card, em z-index 1, mascara a parte interna. */
.top-card-shadow {
  position: relative;
  display: block;
  min-width: 0;
}
.top-card-shadow > .card {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border: 0;
  background: linear-gradient(145deg,
    var(--surface) 0%,
    color-mix(in srgb, var(--navy) 3%, var(--surface)) 100%);
  box-shadow: 0 2px 6px rgba(15, 20, 30, 0.20);
}
.top-card-shadow::before,
.top-card-shadow::after {
  content: "";
  position: absolute;
  z-index: 0;
  bottom: -3px;
  height: 12px;
  width: 40%;
  pointer-events: none;
  filter: blur(4px);
}
.top-card-shadow::before {
  left: -2px;
  background: radial-gradient(ellipse 120% 120% at 15% 100%,
    rgba(15, 20, 30, 0.46) 0%,
    rgba(15, 20, 30, 0.18) 45%,
    transparent 78%);
}
.top-card-shadow::after {
  right: -2px;
  background: radial-gradient(ellipse 120% 120% at 85% 100%,
    rgba(15, 20, 30, 0.46) 0%,
    rgba(15, 20, 30, 0.18) 45%,
    transparent 78%);
}

/* mesma sombra dos 4 cards do topo, mas SÓ a sombra — sem mexer no fundo do
   elemento embrulhado (filtros, gráfico, Ritmo, Status) */
.softcast { position: relative; display: block; min-width: 0; }
.softcast > * {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  box-shadow: 0 2px 6px rgba(15, 20, 30, 0.20);
}
/* precisa de +1 de especificidade p/ vencer `.card { border: 1px … }` */
.softcast > .card { border: 0; }
.softcast::before,
.softcast::after {
  content: "";
  position: absolute;
  z-index: 0;
  bottom: -3px;
  height: 12px;
  width: 40%;
  pointer-events: none;
  filter: blur(4px);
}
.softcast::before {
  left: -2px;
  background: radial-gradient(ellipse 120% 120% at 15% 100%,
    rgba(15, 20, 30, 0.46) 0%,
    rgba(15, 20, 30, 0.18) 45%,
    transparent 78%);
}
.softcast::after {
  right: -2px;
  background: radial-gradient(ellipse 120% 120% at 85% 100%,
    rgba(15, 20, 30, 0.46) 0%,
    rgba(15, 20, 30, 0.18) 45%,
    transparent 78%);
}
/* filete entre o rótulo e o valor — mesmo degradê das divisórias da sidebar */
.statcard__rule {
  height: 1px;
  align-self: stretch;
  margin-top: 7px; /* respiro rótulo → filete (o gap do card agora é 0) */
  background: linear-gradient(to right,
    transparent, var(--rule) 28%, var(--rule) 72%, transparent);
}
.statcard__body {
  display: flex;
  flex-direction: column;
  /* ocupa o espaço abaixo do filete e centra valor + infos nele */
  flex: 1;
  justify-content: center;
  /* valor colado nas informações de baixo */
  gap: 6px;
}
.statcard__valrow {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.statcard__value {
  font-family: var(--font-fig);
  font-weight: 600;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.statcard__value .cents { font-size: 0.55em; color: var(--muted); font-weight: 500; }
/* % neutro ao lado do valor (card Projeção) — mesmo tamanho do chip de variação */
.statcard__pct {
  font-family: var(--font-fig);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--navy-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.statcard__sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.statcard__sub b {
  color: var(--ink); font-weight: 600;
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
}
.statcard__foot {
  font-size: 10.5px;
  color: var(--muted);
}

.hero__delta {
  font-family: var(--font-fig);
  font-weight: 600;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: default;
}
.hero__delta--up { color: var(--positive); }
.hero__delta--down { color: var(--red); }
/* seta de direção depois do % — pulsa suave (animação no bloco de motion) */
.hero__delta__arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.68em;
  line-height: 1;
  vertical-align: baseline;
}

/* meter */
.meter { display: flex; flex-direction: column; gap: 14px; }
.meter__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; line-height: 1.25; }
.meter__head .u-label { color: var(--muted); flex: none; font-size: 12.5px; }
.meter__pct {
  flex: none;
  font-family: var(--font-fig); font-weight: 600; font-size: 18px; line-height: 1.1;
  color: var(--navy-ink); font-variant-numeric: tabular-nums;
}
.meter__track {
  position: relative;
  height: 11px;
  border-radius: 6px;
  background: var(--navy-soft);
  overflow: visible;
  margin: 4px 0;
}
.meter__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--meter-target, 0%);
  /* efeito de vidro discreto: leve realce no topo do trecho preenchido */
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--navy) 80%, #fff) 0%,
    var(--navy) 45%,
    color-mix(in srgb, var(--navy) 94%, #000) 100%);
  border-radius: 6px;
  overflow: hidden;
}
.meter__fill::after { content: ""; position: absolute; inset: 0; }
.meter__tick {
  position: absolute; top: -3px; bottom: -3px;
  left: var(--meter-proj, 24%);
  width: 0;
  border-left: 2px dotted var(--proj);
}
.meter__ends { display: flex; justify-content: space-between; margin-top: 4px; }
.meter__end { display: flex; flex-direction: column; gap: 2px; }
.meter__end.is-right { align-items: flex-end; text-align: right; }
.meter__end .cap {
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  line-height: 1.2; color: var(--muted);
}
.meter__end .v {
  font-family: var(--font-fig); font-weight: 600; font-size: 14px; line-height: 1.1;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.meter__end.is-right .v { color: var(--muted); }
.meter__empty { font-size: 12px; color: var(--muted); }

/* -------------------------------- grid & cards --------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card__title { font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 0 0 2px; }
.card__hint { font-size: 11px; color: var(--muted); margin: 0 0 12px; }

/* cabeçalho com título à esquerda e legenda à direita, mesma linha */
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.card__head .card__title { margin: 0; }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chart-legend__dot--fat { background: var(--navy); }
.chart-legend__dot--meta { background: var(--meta); }

/* card do gráfico: sem borda; degradê + textura vêm de .tex, sombra de .softcast.
   Ocupa toda a altura da linha, sem lacuna embaixo. */
.card--chart {
  display: flex;
  flex-direction: column;
  border: 0;
}
.card--chart .chart { flex: 1; min-height: 240px; }
.card--chart .chart svg { height: 100%; }

/* "Faturamento diário": nunca aperta mais de 15 dias no mesmo espaço — acima
   disso o SVG fica mais largo que o card (ver line.js) e o card rola na
   horizontal. Barra quase imperceptível: fundo transparente, fio translúcido,
   só um pouco mais visível no hover. `margin-bottom` negativo + `padding-bottom`
   empurram a barra pra baixo, coladinha na borda inferior do card (sem mudar
   a altura/posição do gráfico em si — só estica a área rolável por baixo).
   Fica só em #chartDaily — os demais `.chart` do painel não mudam. */
#chartDaily {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: -14px;
  padding-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--navy) 8%, transparent) transparent;
}
#chartDaily::-webkit-scrollbar { height: 4px; }
#chartDaily::-webkit-scrollbar-track { background: transparent; }
#chartDaily::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--navy) 7%, transparent);
  border-radius: 999px;
}
#chartDaily::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--navy) 16%, transparent);
}

/* textura de papel: grão feTurbulence dessaturado sobre o degradê 145°, blend
   overlay — quase imperceptível. Mesmo grão dos cards do topo. */
.tex {
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%3E%3Cfilter%20id='paper'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='160'%20height='160'%20filter='url(%23paper)'%20opacity='0.7'/%3E%3C/svg%3E"),
    linear-gradient(145deg,
      var(--surface) 0%,
      color-mix(in srgb, var(--navy) 3%, var(--surface)) 100%);
  background-size: 160px 160px, cover;
  background-repeat: repeat, no-repeat;
  background-blend-mode: overlay, normal;
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* -------------------------------- charts --------------------------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
/* .chart-line__area: preenchimento é um <linearGradient> vertical definido no
   próprio SVG (charts/line.js) — sem regra de `fill` aqui para não sobrescrever
   o url(#fatdaily-area-grad). */
.chart-line__path {
  /* stroke vem de um <linearGradient> horizontal (some p/ a esquerda), definido
     no SVG — sem `stroke` no CSS p/ não sobrescrever o url(#…) */
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
}
.chart-line__dot {
  fill: var(--navy);
  stroke: var(--surface);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
/* halo azul discreto no ponto em interação — sem brilho neon */
.chart-line__halo { fill: var(--navy); pointer-events: none; transition: opacity 150ms var(--ease); }
/* meta do dia (varia dia a dia): linha tracejada amarela + um ponto por dia.
   O stroke vem de um <linearGradient> (some da direita p/ a esquerda), definido
   no SVG — sem `stroke` no CSS p/ não sobrescrever o url(#…). */
.chart-line__meta {
  fill: none;
  stroke-width: 1.25;
  stroke-dasharray: 3 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.chart-line__meta-dot { fill: var(--meta); pointer-events: none; }

/* Rótulos por dia do "Faturamento diário" (só quando há poucos dias).
   Prefixados com #chartDaily p/ vencer `.chart text { font-size: 11px }` da
   linha ~702 — é AQUI que se ajusta o tamanho dos números desse card. */
#chartDaily .chart-ann__fat {
  fill: var(--muted); font-size: 14px; font-weight: 600;   /* valor faturado do dia — mesma cor do valor "meta" do card Meta */
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
}
#chartDaily .chart-ann__pct {
  fill: var(--muted); font-size: 12px; font-weight: 400;   /* % vs. mês passado */
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
}
/* a cor fica só na setinha, não no número */
#chartDaily .chart-ann__arrow { font-size: 0.8em; }
#chartDaily .chart-ann__pct.is-up .chart-ann__arrow { fill: var(--positive); }
#chartDaily .chart-ann__pct.is-down .chart-ann__arrow { fill: var(--red); }
/* valor da meta do dia (na linha amarela) — bem discreto */
#chartDaily .chart-ann__meta {
  fill: color-mix(in srgb, var(--meta) 24%, var(--muted));
  opacity: 0.62;
  font-size: 12px; font-weight: 400;
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
}
.chart-line__dot:focus { outline: none; }
.chart-line__dot:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--navy) 42%, transparent);
  outline-offset: 2px;
}
.chart-tooltip__delta { display: block; margin-top: 2px; opacity: 0.78; font-variant-numeric: tabular-nums; }
.chart-axis text, .chart text { fill: var(--muted); font-size: 11px; }
.chart-axis line, .chart-grid line { stroke: var(--rule); }
/* grade de fundo do Faturamento diário — quase imperceptível, só orienta */
#chartDaily .chart-grid line { stroke-opacity: 0.3; }
.chart-label, #chartDaily .chart-label { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--font-fig); }

/* Top pagadores — colunas verticais. Preenchimento = degradê <linearGradient>
   no SVG (charts/bars.js); sem `fill` aqui p/ não sobrescrever o url(#…). */
.col-item { cursor: default; }
.col-item__base { stroke: var(--rule); }
/* Rótulos do "Top pagadores". Prefixados com #chartClientes p/ vencer
   `.chart text { font-size: 11px }` (linha ~702) — é AQUI que se ajusta o
   tamanho dos números desse gráfico. */
#chartClientes .col-item__lbl { fill: var(--muted); font-size: 12px; }        /* nome embaixo da coluna */
.col-item:first-of-type .col-item__lbl { fill: var(--ink); font-weight: 600; }
#chartClientes .col-item__val {
  fill: var(--muted); font-size: 14px; font-weight: 600;   /* valor faturado acima da coluna — mesma cor do valor "meta" do card Meta */
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
}
#chartClientes .col-item__pct {
  fill: var(--muted); font-size: 12px;   /* variação % vs. mês anterior */
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
}
#chartClientes .col-item__arrow { font-size: 0.82em; }   /* setinha ▲▼ (relativo à %) */
.col-item__pct.is-up .col-item__arrow { fill: var(--positive); }
.col-item__pct.is-down .col-item__arrow { fill: var(--red); }

/* botão discreto no cabeçalho de um card (ex.: "Ver todos") */
.card__more {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--navy-ink);
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background var(--dur) var(--ease);
}
.card__more:hover { background: var(--navy-soft); }

/* modal (lista completa de pagadores) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 20, 30, 0.42); }
.modal__panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(15, 20, 30, 0.38);
  overflow: hidden;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}
.modal__head h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.modal__count { font-size: 11px; color: var(--muted); font-weight: 400; }
.modal__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__close .material-symbols-rounded { font-size: 18px; }
.modal__close:hover { background: var(--surface-2); color: var(--ink); }
.modal__body { overflow: auto; }
.modal__table { width: 100%; border-collapse: collapse; font-size: 12px; }
.modal__table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  text-align: left;
  padding: 9px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}
.modal__table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}
.modal__table tr:last-child td { border-bottom: 0; }
.modal__table th.num,
.modal__table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.modal__table td.num { font-family: var(--font-fig); }
.modal__rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 34px; }
.modal__proj { color: var(--proj); }
@media (prefers-reduced-motion: no-preference) {
  .modal__panel { animation: modalIn 170ms var(--ease); }
  @keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

.donut__seg-0 { fill: var(--navy); }
.donut__seg-1 { fill: var(--blue); }
.donut__seg-2 { fill: var(--positive); }
/* Prefixo .chart p/ vencer `.chart text { fill: var(--muted); font-size: 11px }`
   (regra generica de eixo, linha ~765) — mesmo padrao ja usado em #chartDaily
   e .evo-chart neste arquivo. */
.chart .donut-center__total { fill: var(--ink); font-size: 16px; font-weight: 700; font-family: var(--font-fig); }
.chart .donut-center__cap { fill: var(--muted); font-size: 10px; }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend__item { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend__item .legend__val { margin-left: auto; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Rótulo dentro da fatia do donut "explodido" (donut.js): só o percentual,
   grande e em negrito, sempre branco (as fatias usam as cores escuras/
   saturadas do tema, nunca pastel, entao texto branco sempre contrasta). */
.chart .donut-slice__pct { fill: #fff; font-family: var(--font-fig); font-weight: 700; font-size: 27px; }

/* Legenda em blocos solidos de cor (donut.js) — retangulo de cor cheio,
   texto embaixo do bloco (nao ao lado), mesma mecanica de um infografico de
   referencia que o usuario pediu para replicar, com a paleta/tipografia do
   dashboard no lugar das cores vibrantes do exemplo original. */
.legend--blocks { display: flex; flex-direction: column; gap: 10px; min-width: 112px; flex: 1; }
.legend__block { display: flex; flex-direction: column; gap: 5px; }
.legend__swatch {
  display: block; width: 100%; height: 3px; border-radius: 999px;
  /* linha fina: cor cheia da esquerda até o meio, esmaecendo até transparente à direita */
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 50%, transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 50%, transparent 100%);
}
.legend__block-txt { display: flex; flex-direction: column; gap: 1px; }
.legend__block-name { font-size: 12px; font-weight: 600; color: var(--ink); }
.legend__block-val { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* coluna direita: Ritmo do mês + Status de faturamento (mesma largura, 16px).
   "Status de faturamento" é o último card — cresce pra acompanhar a altura
   do card vizinho (Faturamento diário) e fecha alinhado embaixo, em vez de
   deixar uma lacuna. */
.rightcol { display: flex; flex-direction: column; gap: 16px; }
.rightcol > .softcast:last-child { display: flex; flex-direction: column; flex: 1; }

/* Sem linha de borda; degradê + textura vêm de .tex, sombra do wrapper .softcast */
.rightcol .card { border: 0; }

/* Ritmo do mês — fontes um passo acima do padrão dos cards da coluna direita */
#cardRitmo .card__title { font-size: 14.5px; }
#cardRitmo .card__hint { font-size: 12px; margin-bottom: 13px; }
/* título + "N dias restantes" na mesma linha (à direita) */
.ritmo__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ritmo__remain {
  flex: none;
  font-family: var(--font-ui); font-weight: 400; font-size: 11.5px;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.ritmo__msg { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.ritmo__ruler { margin: 12px 0 6px; }
.ritmo__track {
  position: relative;
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
}
/* trecho até a bolinha preenchido na cor da bolinha */
.ritmo__fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--navy);
  border-radius: 2px;
}
.ritmo__dot {
  position: absolute;
  top: 50%;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--navy);
  transform: translate(-50%, -50%);
}
.ritmo__ends {
  display: flex; justify-content: space-between;
  margin-top: 7px;
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.ritmo__list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.ritmo__row { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
/* divisória com degradê nas pontas entre os rótulos, centrada no espaço */
.ritmo__row:not(:last-child)::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -7px; height: 1px;
  background: linear-gradient(to right, transparent, var(--rule) 18%, var(--rule) 82%, transparent);
}
.ritmo__row > span:first-child { font-size: 13.5px; color: var(--muted); }
.ritmo__v {
  font-family: var(--font-fig); font-weight: 600; font-size: 14.5px;
  color: var(--ink); font-variant-numeric: tabular-nums; text-align: right;
}
.ritmo__v small {
  display: block; font-family: var(--font-ui); font-weight: 400;
  font-size: 11px; color: var(--muted);
}
.ritmo__na { font-family: var(--font-ui); font-weight: 400; font-size: 12px; color: var(--muted); }

/* Status de faturamento — três linhas, fontes/espaços alinhados ao Ritmo do mês.
   Card cresce (ver .rightcol acima) pra fechar alinhado com o vizinho; o
   título fica no topo e as três linhas ficam centralizadas no espaço que
   sobra, em vez de grudadas embaixo do título com uma lacuna depois. */
#cardStatus { display: flex; flex-direction: column; flex: 1; }
#cardStatus .card__title { font-size: 14.5px; margin-bottom: 2px; }
/* o conteúdo de verdade (.statusrows) fica dentro de #chartStatus, não direto
   em #cardStatus — sem isso, só o card externo crescia e a folga sobrava
   depois de #chartStatus (que ficava do tamanho natural do conteúdo). */
#chartStatus { display: flex; flex-direction: column; flex: 1; }
.statusrows { display: flex; flex-direction: column; gap: 14px; margin-top: auto; margin-bottom: auto; }
.statusrow__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 13.5px; color: var(--muted);
}
.statusrow__name { color: var(--ink); }
.statusrow__fig { font-variant-numeric: tabular-nums; white-space: nowrap; }
.statusrow__fig b { font-family: var(--font-fig); font-weight: 600; font-size: 14.5px; color: var(--ink); }
.statusrow__bar {
  display: block; height: 6px; margin-top: 8px;
  background: var(--navy-soft); border-radius: 3px; overflow: hidden;
}
.statusrow__bar i { display: block; height: 100%; border-radius: 2px; }

/* CT-e por tipo — lista KPI: nome + valor, e abaixo qtd + variação vs. mês
   anterior. Sem barra. Cada tipo é uma faixa igual que ocupa a altura do card,
   com filete degradê entre elas — nada de lacuna. */
.card--tipos { display: flex; flex-direction: column; }
.card--tipos .chart { flex: 1; display: flex; flex-direction: column; min-height: 0; }
/* fontes/espaços alinhados ao Ritmo do mês e Status de faturamento */
.card--tipos .card__title { font-size: 14.5px; }
.card--tipos .card__hint { font-size: 12px; }
.tiporows { display: flex; flex-direction: column; flex: 1; margin-top: 8px; }
.tiporow {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  gap: 6px;
}
.tiporow:not(:last-child)::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--rule) 18%, var(--rule) 82%, transparent);
}
.tiporow__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.tiporow__name { font-size: 13.5px; color: var(--ink); }
.tiporow__val {
  font-family: var(--font-fig); font-weight: 600; font-size: 17.5px; line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tiporow__sub {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.tiporow__var .tiporow__arrow { font-size: 0.85em; margin-left: 1px; }
.tiporow__var.is-up .tiporow__arrow { color: var(--positive); }
.tiporow__var.is-down .tiporow__arrow { color: var(--red); }
.tiporow__var--na { font-style: italic; opacity: 0.7; }

/* barra grossa única no pé do card — segmentos por tipo se sobrepondo */
.tipobar {
  display: flex;
  height: 18px;
  margin-top: 18px;
}
.tipobar__seg {
  min-width: 24px;
  border-radius: 9px;
  cursor: default;
}
.tipobar__seg:not(:first-child) {
  margin-left: -8px;
  box-shadow: -5px 0 8px rgba(15, 20, 30, 0.30);
}
.tipobar__legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 11px;
  font-size: 11px; color: var(--muted);
}
.tipobar__lg { display: inline-flex; align-items: center; gap: 5px; }
.tipobar__lg i { width: 8px; height: 8px; border-radius: 2px; flex: none; }

.col-chart__col { fill: var(--navy); }
.col-chart__col--alt { fill: var(--rule-strong); }
.col-chart__cap { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--font-fig); }
.col-chart__sub { fill: var(--muted); font-size: 11px; }

/* ------------------------- Evolução mensal ------------------------- */
/* filtro da Evolução: 4 campos + botão limpar, distribuídos por toda a largura.
   `.filters.filters--evo` (2 classes) p/ vencer as media queries de `.filters`. */
.filters.filters--evo { grid-template-columns: repeat(4, 1fr) auto; }
@media (max-width: 1100px) { .filters.filters--evo { grid-template-columns: repeat(2, 1fr) auto; } }
@media (max-width: 640px) { .filters.filters--evo { grid-template-columns: 1fr auto; } }
/* charts de evolução preenchem menos altura que os do dashboard (poucos pontos) */
.card--chart .evo-chart--card { min-height: 160px; }
.evo__base { stroke: var(--rule); }
/* barra: preenchimento vem do <linearGradient> (url(#…)); nada de fill aqui */
/* área + linha do total (Composição mensal) */
.evo-grid { stroke: var(--rule); stroke-opacity: 0.35; }
/* linha única do total — sem stroke aqui: vem do degradê url(#…) no atributo */
.evo-area__total { fill: none; stroke-width: 1.75; stroke-linejoin: round; }
.evo-area__dot { fill: var(--navy); stroke: var(--surface); stroke-width: 1.5; }
/* rótulos — prefixo .evo-chart p/ vencer `.chart text { font-size: 11px }`.
   Valores de faturamento no MESMO tamanho dos gráficos do dashboard (14px,
   como #chartDaily .chart-ann__fat / #chartClientes .col-item__val). */
.evo-chart .evo-col__val {
  fill: var(--muted); font-size: 14px; font-weight: 600;
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
}
/* variação % abaixo do valor (Composição mensal) — igual ao gráfico de linha
   do dashboard: nº em --muted, peso normal, cor só na setinha */
.evo-chart .evo-col__pct {
  fill: var(--muted); font-size: 12px; font-weight: 400;
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
}
.evo-chart .evo-col__arrow { font-size: 0.8em; }
.evo-col__pct.is-up .evo-col__arrow { fill: var(--positive); }
.evo-col__pct.is-down .evo-col__arrow { fill: var(--red); }
.evo-chart .evo-col__lbl {
  fill: var(--muted); font-size: 11px; font-family: var(--font-fig);
}
.evo-chart .evo-col__lbl.is-last { fill: var(--ink); font-weight: 600; }

.chart-tooltip {
  position: fixed;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  max-width: 220px;
}
.chart-tooltip.is-visible { opacity: 1; }
.chart-tooltip b { display: block; font-weight: 600; }

.empty { padding: 34px 10px; text-align: center; color: var(--muted); }
.empty__title { font-weight: 700; color: var(--ink); margin-bottom: 4px; font-size: 13px; }

/* -------------------------------- table --------------------------- */
.table-wrap { margin-top: 24px; }
.table-wrap > .page-head__row { margin-bottom: 12px; }
.table-wrap h1 { font-size: 15px; font-weight: 600; color: var(--navy-ink); }
.table-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.table-tools .field { display: flex; flex-direction: column; gap: 4px; }
.table-tools .field label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.table-tools .field input {
  height: 32px;
  min-width: 240px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
}
.table-tools label.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table.ctes { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 980px; }
table.ctes th, table.ctes td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.ctes th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 600;
  position: sticky;
  top: 0;
}
table.ctes td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-fig); font-weight: 600; }
table.ctes tr:hover td { background: var(--surface-2); }
table.ctes tr.is-anulado td { color: var(--muted); }

.tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  color: var(--muted);
}
.tag--armazem { border-color: color-mix(in srgb, var(--positive) 45%, var(--rule)); color: var(--positive); }
.tag--transporte { border-color: color-mix(in srgb, var(--blue) 40%, var(--rule)); color: var(--blue); }
.tag--anulado { border-color: color-mix(in srgb, var(--red) 40%, var(--rule)); color: var(--red); }
.tag--pendente { border-color: color-mix(in srgb, var(--proj) 45%, var(--rule)); color: var(--proj); }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--muted); }
.pager__btns { display: flex; gap: 8px; }

/* -------------------------------- buttons ------------------------- */
.btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.btn:hover { border-color: var(--rule-strong); }
.btn--primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--blue); border-color: var(--blue); }
.btn--ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .material-symbols-rounded { font-size: 18px; }

/* -------------------------------- import / config ---------------- */
.section-tabs { display: flex; gap: 8px; margin: 18px 0 22px; border-bottom: 1px solid var(--rule); }
.section-tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 4px;
  margin-right: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.section-tabs button.is-active { color: var(--navy-ink); border-bottom-color: var(--red); }

.dropzone {
  display: block;
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--radius);
  padding: 34px;
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.dropzone.is-over { border-color: var(--blue); background: var(--surface-2); }
.dropzone input { display: none; }

.filelist { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.filelist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
}
.filelist .material-symbols-rounded { color: var(--blue); }
.filelist .rm { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; }

.preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.preview-cell { border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.preview-cell .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.preview-cell .v { font-size: 18px; font-weight: 700; margin-top: 4px; font-family: var(--font-fig); font-variant-numeric: tabular-nums; }

.warn-list { margin: 14px 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.warn-list li { margin-bottom: 4px; }

.batch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.batch-table th, .batch-table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; }
.status-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule); }
.status-chip--ok { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 40%, var(--rule)); }
.status-chip--warn { color: var(--proj); border-color: color-mix(in srgb, var(--proj) 40%, var(--rule)); }
.status-chip--fail { color: #fff; background: var(--red); border-color: var(--red); }
.status-chip--run { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, var(--rule)); }

.review-item { border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; background: var(--surface); margin-bottom: 12px; }
.review-item h4 { margin: 0 0 4px; font-size: 14px; color: var(--navy-ink); }
.review-item p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.review-item .cands { font-size: 12px; color: var(--ink); margin-bottom: 12px; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.review-actions input { height: 32px; width: 130px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 80;
  max-width: 360px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.toast--error { background: var(--red); color: #fff; }

.skeleton { color: var(--muted); font-size: 13px; padding: 40px; text-align: center; }

/* -------------------------------- login -------------------------- */
.login {
  /* cobre a janela inteira (inclusive a coluna do menu lateral, que na tela de login não existe) */
  position: fixed;
  inset: 0;
  z-index: 500;
  overflow: auto;
  display: grid;
  align-items: center;
  justify-items: end;
  background: #f7f9fe url("/assets/novodash.png") center / cover no-repeat;
  padding: 24px clamp(56px, 9vw, 176px);
}
.login__card {
  position: relative;
  isolation: isolate;
  width: 340px;
  max-width: 100%;
  border: 0;
  border-radius: 42px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  box-shadow:
    0 1px 3px rgba(18, 30, 49, 0.10),
    0 12px 32px -12px rgba(18, 30, 49, 0.22);
}
.login__glass {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(244, 247, 251, 0.18), rgba(209, 222, 239, 0.09));
  -webkit-backdrop-filter: blur(2px) saturate(1.03);
  backdrop-filter: blur(2px) saturate(1.03);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.30),
    inset 0 -1px 1px rgba(255, 255, 255, 0.38),
    inset 1px 0 1px rgba(255, 255, 255, 0.12),
    inset -1px 0 1px rgba(29, 43, 70, 0.14);
}
.login__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(145deg,
    rgba(255, 255, 255, 0.60),
    rgba(255, 255, 255, 0.12) 36%,
    rgba(25, 37, 54, 0.18) 59%,
    rgba(255, 255, 255, 0.60));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.login__campo { position: relative; display: block; }
.login__campo > input { width: 100%; }
/* só o Pegasus, centralizado; o PNG tem margem transparente grande, aparada com margens negativas */
.login__logo { width: 130px; height: 130px; object-fit: contain; align-self: center; margin: -28px 0 -40px; }
.login__card h1 { font-size: 18px; color: #172b70; margin: 0; text-align: center; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6); }
.login__sub { font-size: 13px; color: #355287; margin: 0 0 8px; text-align: center; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6); }
.login__card label { font-size: 12px; font-weight: 600; color: #263c6e; display: flex; flex-direction: column; gap: 4px; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6); }
.login__card input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 2px rgba(23, 43, 112, 0.08), 0 1px 0 rgba(255, 255, 255, 0.32);
  color: #14171b;
  text-shadow: none;
}
.login__card input:focus { outline: 3px solid rgba(57, 113, 184, 0.20); outline-offset: 1px; border-color: var(--blue); }
.login__card .btn { justify-content: center; height: 40px; margin-top: 6px; }
.login__err { color: #fff0f0; font-size: 12px; min-height: 16px; margin: 4px 0 0; }
.login__err:not(:empty) { padding: 8px 10px; border-radius: 8px; background: rgba(107, 23, 39, 0.78); }

/* -------------------------------- animation ---------------------- */
.enter { opacity: 0; transform: translateY(10px); animation: enter 280ms var(--ease) forwards; }
@keyframes enter { to { opacity: 1; transform: translateY(0); } }

.chart-anim-out { opacity: 0; transition: opacity 120ms var(--ease); }
.chart-anim-in { animation: fadein 220ms var(--ease); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  /* barra da meta: preenche no load e um brilho lento a mantém viva */
  .meter__fill { width: 0; animation: meterFill 1s var(--ease) 0.2s forwards; }
  .meter__fill::after {
    background: linear-gradient(110deg, transparent 12%, rgba(255, 255, 255, 0.45) 50%, transparent 88%);
    transform: translateX(-120%);
    animation: meterSheen 3s ease-in-out 1.4s infinite;
  }
  @keyframes meterFill { from { width: 0; } to { width: var(--meter-target, 0%); } }
  @keyframes meterSheen { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(340%); } }

  /* seta de direção do chip de variação: pulso lento e discreto */
  .hero__delta__arrow { animation: deltaArrowPulse 2s ease-in-out infinite; }
  @keyframes deltaArrowPulse {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.4; transform: translateY(0.5px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-delay: 0 !important; transition-duration: 0.001ms !important; }
  .enter { opacity: 1; transform: none; }
}

/* -------------------------------- responsive -------------------- */
@media (max-width: 1200px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
  .filters.filters--frota { grid-template-columns: repeat(3, 1fr); }
  .filters__clear { grid-column: 3; justify-self: end; }
  .filters.filters--evo .filters__clear { grid-column: auto; justify-self: center; }
  .grid > [class*="col-"] { grid-column: span 12; }
  .cardgrid4, .cardgrid-n { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .login { place-items: center; padding: 24px; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters.filters--frota { grid-template-columns: repeat(2, 1fr); }
  table.ctes { min-width: 760px; }
}

/* ----------------------- Faturamento por placa (Frota) ---------------- */
.tabela-placas { margin-top: 10px; }
/* rolagem com barra fina e discreta: some quase por completo ate o mouse chegar */
.tabela-placas__scroll {
  max-height: 316px; overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 28%, transparent) transparent;
}
.tabela-placas__scroll:hover { scrollbar-color: color-mix(in srgb, var(--muted) 50%, transparent) transparent; }
.tabela-placas__scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.tabela-placas__scroll::-webkit-scrollbar-track { background: transparent; }
.tabela-placas__scroll::-webkit-scrollbar-thumb {
  border-radius: 999px; background: color-mix(in srgb, var(--muted) 28%, transparent);
}
.tabela-placas__scroll:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 50%, transparent); }
.tabela-placas table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabela-placas th, .tabela-placas td { padding: 8px 10px; text-align: left; white-space: nowrap; border: 0; }
.tabela-placas th {
  position: sticky; top: 0; z-index: 1; background: var(--surface);
  font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}
.tabela-placas .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-fig); }
.tabela-placas td.num { font-weight: 600; }
/* separador de linha: traço fino que esmaece da esquerda para a direita */
.tabela-placas tbody tr {
  background: linear-gradient(to right, var(--rule-strong), transparent 92%) bottom / 100% 1px no-repeat;
  transition: background-color var(--dur) var(--ease);
}
.tabela-placas tbody tr:hover { background-color: var(--surface-2); }
.tabela-placas__placa { font-family: var(--font-fig); font-weight: 600; color: var(--navy-ink); letter-spacing: 0.02em; }
.tabela-placas tfoot td { position: sticky; bottom: 0; background: var(--surface); font-weight: 700; color: var(--ink); }
.tabela-placas__delta--up { color: var(--success); }
.tabela-placas__delta--down { color: var(--red); }
.tabela-placas__nd { color: var(--muted); font-weight: 400; }

/* card de categoria selecionado: filete fino e claro na cor da categoria, e a
   sombra (do card e dos cantos do wrapper) tingida com essa mesma cor */
.top-card-shadow.is-selecionado > .card {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--sel) 45%, var(--surface)),
    0 2px 7px color-mix(in srgb, var(--sel) 36%, transparent);
}
.top-card-shadow.is-selecionado::before {
  background: radial-gradient(ellipse 120% 120% at 15% 100%,
    color-mix(in srgb, var(--sel) 55%, transparent) 0%,
    color-mix(in srgb, var(--sel) 22%, transparent) 45%,
    transparent 78%);
}
.top-card-shadow.is-selecionado::after {
  background: radial-gradient(ellipse 120% 120% at 85% 100%,
    color-mix(in srgb, var(--sel) 55%, transparent) 0%,
    color-mix(in srgb, var(--sel) 22%, transparent) 45%,
    transparent 78%);
}

/* ------------------------- Ranking em barras (Frota) ------------------ */
.rank { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
/* card do ranking acompanha a altura da linha da grade: as linhas se
   distribuem pelo espaço disponivel em vez de deixar vazio embaixo */
.card--rank { display: flex; flex-direction: column; }
.chart--rank { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chart--rank > .rank { flex: 1; margin-top: 10px; }
.chart--rank .rank__row { flex: 1; min-height: 40px; }
.chart--rank .rank__trilho { height: 70%; min-height: 28px; max-height: 46px; }
.rank__row { display: grid; grid-template-columns: 128px minmax(0, 1fr) 92px; align-items: center; gap: 16px; }
.rank__lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rank__nome { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank__leg { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* trilho: degradê bem suave na cor da categoria, mais marcado à direita e sumindo à esquerda */
.rank__trilho {
  height: 30px; border-radius: 3px;
  background: linear-gradient(to left,
    color-mix(in srgb, var(--cor) 16%, var(--surface)) 0%,
    color-mix(in srgb, var(--cor) 8%, var(--surface)) 55%,
    color-mix(in srgb, var(--cor) 2%, var(--surface)) 100%);
}
/* .rank__fill: so a posicao/largura e as manchas de sombra nos cantos de baixo;
   .rank__barra: a barra colorida. Mesma sombra dos campos de filtro. */
.rank__fill { position: relative; height: 100%; min-width: 46px; transform-origin: left center; }
.rank__barra {
  position: relative; z-index: 1; box-sizing: border-box; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 10px;
  border-radius: 3px; background: var(--cor);
  /* base dos filtros + reforço nas laterais */
  box-shadow:
    0 2px 6px rgba(15, 20, 30, 0.20),
    -3px 0 6px -2px rgba(15, 20, 30, 0.26),
    3px 0 6px -2px rgba(15, 20, 30, 0.26);
}
.rank__fill::before,
.rank__fill::after {
  content: ""; position: absolute; z-index: 0; bottom: -3px; height: 12px; width: 40%;
  pointer-events: none; filter: blur(4px);
}
.rank__fill::before {
  left: -2px;
  background: radial-gradient(ellipse 120% 120% at 15% 100%,
    rgba(15, 20, 30, 0.46) 0%, rgba(15, 20, 30, 0.18) 45%, transparent 78%);
}
.rank__fill::after {
  right: -2px;
  background: radial-gradient(ellipse 120% 120% at 85% 100%,
    rgba(15, 20, 30, 0.46) 0%, rgba(15, 20, 30, 0.18) 45%, transparent 78%);
}
.rank__pct { font-size: 11px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.rank__val { text-align: right; font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; font-family: var(--font-fig); white-space: nowrap; }

.grid[hidden] { display: none; }

/* card da pizza acompanha a altura da linha: o anel fica centralizado no espaço */
.card--donut { display: flex; flex-direction: column; }
.card--donut > .chart { flex: 1; display: flex; align-items: center; }
.card--donut > .chart > * { width: 100%; }

/* ---------------------- Transição de marca (Pegasus) ------------------ */
/* mesmo fundo (papel) do corpo do dashboard, com os valores do tema claro */
.splash {
  background-color: #FAF8F3;
  background-image:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.85'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%3C/filter%3E%3Crect%20width='180'%20height='180'%20filter='url(%23n)'%20opacity='0.85'/%3E%3C/svg%3E"),
    radial-gradient(135% 100% at 12% -12%,
      color-mix(in srgb, #FFFFFF 55%, #FAF8F3) 0%, #FAF8F3 44%, color-mix(in srgb, #172B70 5%, #FAF8F3) 100%);
  background-size: 180px 180px, cover;
  background-repeat: repeat, no-repeat;
  background-attachment: fixed, fixed;
  background-blend-mode: overlay, normal;
}
/* Tema claro fixo (cores próprias, independentes do tema do sistema).
   O reflexo anda por transform (compositor): não congela enquanto a página
   monta nem depende de repaint. Camadas fixas usam 100vw/100vh para não
   mudar de tamanho quando a barra de rolagem aparece. */
.splash {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1000;
  display: grid; place-items: center; isolation: isolate; overflow: hidden;
  transition: opacity 340ms ease, visibility 340ms step-end;
}
/* tela aberta por script (troca de página/pós-login): o fundo entra suave sobre a página atual.
   A do carregamento inicial é opaca desde o primeiro quadro, para não revelar o que está por baixo. */
.splash--suave { animation: marca-fundo-entrada 300ms ease backwards; }
.splash.finished { opacity: 0; visibility: hidden; pointer-events: none; }

.brand-lockup {
  position: relative; width: min(276px, 52vw); aspect-ratio: 1;
  display: grid; place-items: center;
  filter: drop-shadow(0 18px 35px #8a1c2820);
  animation: marca-entrada 560ms ease 140ms backwards;
}
.brand-lockup img { display: block; width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 0; }
/* o símbolo aparece com a cor original (vermelho da marca), direto do PNG */
.brand-lockup__tint { display: none; }
/* reflexo: faixa clara que cruza só os traços do símbolo (máscara) */
.brand-lockup__sheen {
  position: absolute; inset: 0; z-index: 2; overflow: hidden;
  mix-blend-mode: screen;
  -webkit-mask: url("/assets/simbolo.png") center / contain no-repeat;
  mask: url("/assets/simbolo.png") center / contain no-repeat;
}
.brand-lockup__sheen > i {
  position: absolute; top: 0; bottom: 0; left: 0; width: 100%;
  background: linear-gradient(108deg, transparent 22%, #ffb4b445 36%, #ffe6e6cc 45%, #ffffff 50%, #ffd2d2cc 56%, #ff8c8c44 66%, transparent 80%);
  transform: translate3d(-95%, 0, 0);
  will-change: transform;
}
.splash.playing .brand-lockup__sheen > i { animation: marca-reflexo 2200ms cubic-bezier(.43, .08, .18, .98) infinite both; }

.loading-word {
  position: absolute; left: 50%; bottom: max(8vh, 44px); transform: translateX(-50%);
  color: #607093; font-size: 12px; letter-spacing: .16em; white-space: nowrap; opacity: 0;
}
.splash.playing .loading-word { animation: marca-legenda 2200ms ease 80ms infinite both; }

@keyframes marca-fundo-entrada { from { opacity: 0; } }
@keyframes marca-entrada { from { opacity: 0; } }
@keyframes marca-reflexo { to { transform: translate3d(95%, 0, 0); } }
@keyframes marca-legenda { 22%, 76% { opacity: .8; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .splash, .splash--suave { transition: none; animation: none; }
  .brand-lockup { animation: none; }
  .splash.playing .brand-lockup__sheen > i, .splash.playing .loading-word { animation: none; }
}
@media (max-width: 640px) { .brand-lockup { width: min(240px, 62vw); } }

/* ---------------- Ajuste à tela (Visão geral, Frota, Evolução) -------- */
/* A página ocupa exatamente a altura da janela (src/fit.js define --ui-zoom e
   --fit-h): filtros no topo e as linhas de cards dividem o resto por peso
   (--peso), sem rolagem e sem lacuna. --min protege a legibilidade; abaixo dele
   a página volta a rolar em vez de espremer. */
.content__inner.fit {
  zoom: var(--ui-zoom, 1);
  height: var(--fit-h, 100vh);
  min-height: 700px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fit > .softcast:first-child { flex: none; }
.fit > .grid {
  margin-top: 0;
  flex: var(--peso, 1) 1 0;
  min-height: var(--min, 0);
  grid-template-rows: minmax(0, 1fr);
}
.fit > .grid.grid--2linhas { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.fit > .grid > * { min-height: 0; }
.fit .cardgrid4, .fit .cardgrid-n { grid-template-rows: minmax(0, 1fr); }
.fit .cardgrid-n > .top-card-shadow { min-height: 0; }
.fit .softcast > .card, .fit .top-card-shadow > .card { height: 100%; }
/* cards com gráfico: o gráfico ocupa tudo o que sobra abaixo do título */
.fit .card:has(> .chart) { display: flex; flex-direction: column; min-height: 0; }
.fit .card > .chart { flex: 1; min-height: 0; }
.fit .card--chart .chart, .fit .card--chart .evo-chart--card { min-height: 0; }
.fit .rightcol { min-height: 0; }
.fit .rightcol > .softcast { min-height: 0; }
/* tabela de placas e demais blocos de altura própria preenchem o card */
.fit .card:has(> .tabela-placas) { display: flex; flex-direction: column; min-height: 0; }
.fit .tabela-placas { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fit .tabela-placas__scroll { flex: 1; min-height: 0; max-height: none; }

/* ícones próprios da barra lateral (imagens), no tamanho dos ícones de fonte */
.navitem__icone { display: block; width: 21px; height: 21px; object-fit: contain; }

.navitem[hidden] { display: none; }

/* "Atualizado em ..." — discreto, canto inferior direito, dentro da margem inferior da página */
.atualizado {
  position: fixed; right: 18px; bottom: 5px; z-index: 6;
  font-size: 10.5px; line-height: 1.2; color: var(--muted); opacity: 0.78;
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em; cursor: default; user-select: none;
}
.atualizado.is-defasado { color: var(--proj); opacity: 0.95; }
@media print { .atualizado { display: none; } }

/* =====================================================================
   BASE MOBILE (celular e tablet em pé: até 900 px)
   O desktop não muda. Aqui: navegação na barra inferior, página em coluna
   única com rolagem normal, campos grandes o bastante para o toque (16 px
   evita o zoom automático do iPhone), tabelas que rolam por dentro e
   respeito às áreas seguras (notch / barra do iPhone).
   Mantenha 900 px em sincronia com LARGURA_MOVEL em src/fit.js.
   ===================================================================== */
@media (max-width: 900px) {
  :root { --gutter: 14px; --bottom-nav-h: 60px; }
  html, body { overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  /* fundo "fixo" é pesado e treme na rolagem do celular */
  body { background-attachment: scroll, scroll; min-height: 100dvh; }
  .app { display: block; min-height: 100dvh; }

  /* navegação: barra inferior (o menu lateral de ícones vira abas) */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: auto; align-self: auto;
    flex-direction: row; align-items: center; justify-content: space-between; gap: 6px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    z-index: 60;
    border-top: 1px solid var(--rule);
    box-shadow: 0 -3px 16px rgba(15, 20, 30, 0.10);
  }
  .sidebar__brand, .sidebar__foot::before { display: none; }
  .sidebar__nav { flex-direction: row; flex: 1; gap: 4px; justify-content: space-evenly; }
  .sidebar__foot { flex-direction: row; margin: 0; padding: 0; gap: 4px; }
  .navitem { width: auto; flex: 1 1 0; min-width: 46px; height: 46px; padding: 0; }
  .navitem__icone { width: 25px; height: 25px; }
  .navitem .material-symbols-rounded { font-size: 24px; }
  .navitem:hover { background: transparent; }
  .navitem.is-active { background: var(--navy-soft); }

  .content__inner { padding: 12px 12px calc(var(--bottom-nav-h) + 34px + env(safe-area-inset-bottom)); }
  .grid { gap: 12px; margin-top: 12px; }
  .grid > [class*="col-"] { grid-column: 1 / -1; }
  .card { padding: 14px; }
  .card__title { font-size: 14px; }

  /* filtros: dois por linha, título e "limpar" em linha inteira */
  .filters,
  .filters.filters--frota,
  .filters.filters--evo { grid-template-columns: 1fr 1fr; gap: 9px; padding: 11px; }
  .filters .field { min-width: 0; }
  .filters input, .filters select { height: 42px; font-size: 16px; }
  .filters select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; padding-right: 30px; }
  .filters__clear { grid-column: 1 / -1; justify-self: stretch; width: 100%; height: 42px; }
  .filters.filters--evo .filters__clear { grid-column: 1 / -1; justify-self: stretch; }

  /* cards de indicadores */
  .cardgrid4, .cardgrid-n { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cardgrid-n > .top-card-shadow { min-height: 0; }
  .statcard__value { font-size: 22px; }

  /* gráficos: altura mínima própria (não há mais linha do desktop para esticá-los) */
  .card--chart .chart { min-height: 240px; }
  .card--chart .evo-chart--card { min-height: 190px; }
  .chart svg { max-width: 100%; }
  .donut-wrap { flex-wrap: wrap !important; justify-content: center; gap: 14px !important; }
  .donut-wrap .legend--blocks { flex: 1 1 100%; min-width: 0; }
  .rank__row { grid-template-columns: 82px minmax(0, 1fr) 78px; gap: 8px; }
  .rank__nome { font-size: 12px; }
  .rank__val { font-size: 11.5px; }
  .chart--rank .rank__row { min-height: 48px; }

  /* tabelas rolam por dentro do card, nunca alargam a página */
  .tabela-placas__scroll { max-height: 380px; -webkit-overflow-scrolling: touch; }
  .tabela-placas table { min-width: 560px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .batch-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* Configurações: abas rolam na horizontal; botões e campos em linha quebram */
  .section-tabs { overflow-x: auto; white-space: nowrap; gap: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .section-tabs::-webkit-scrollbar { display: none; }
  .review-actions { flex-wrap: wrap; }
  .page-head__row { flex-direction: column; align-items: stretch; }
  input, select, textarea { font-size: 16px; }

  /* janelas (modais): ocupam a largura toda */
  .modal { padding: 10px; }
  .modal__panel { width: 100%; max-width: 100%; max-height: 90dvh; padding: 16px 14px; }

  /* "Atualizado em": no topo da página (rola junto, nunca fica por cima do conteúdo) */
  .atualizado { position: absolute; top: 6px; left: 12px; right: 12px; bottom: auto; text-align: right; }
  .content__inner { padding-top: 26px; }

  /* login */
  .login { justify-items: center; padding: 16px; background-position: 15% center; }
  .login__card { width: min(360px, 100%); border-radius: 32px; padding: 26px 22px; }
  .login__card input { height: 46px; font-size: 16px; }
  .login__card .btn { height: 48px; font-size: 15px; }
}

/* telas bem estreitas: indicadores em coluna única */
@media (max-width: 480px) {
  .cardgrid4, .cardgrid-n { grid-template-columns: 1fr; }
  .statcard__value { font-size: 24px; }
}

/* celular deitado / tablet em pé: mais campos por linha */
@media (min-width: 600px) and (max-width: 900px) {
  .filters,
  .filters.filters--frota,
  .filters.filters--evo { grid-template-columns: repeat(3, 1fr); }
  .cardgrid4, .cardgrid-n { grid-template-columns: repeat(3, 1fr); }
}
