/* =====================================================================================
   Painel Max Force — folha de estilo única.

   Três coisas que não são óbvias lendo o código e explicam quase todas as decisões:

   1. O caminho da fonte é RELATIVO A ESTE ARQUIVO. Como o arquivo é servido em
      /static/painel.css, "fonts/anton.woff2" vira /static/fonts/anton.woff2.
      Escrever "static/fonts/..." aqui apontaria para /static/static/... e a Anton
      cairia para Arial EM SILÊNCIO — ninguém veria erro, só um painel feio.
   2. A CSP do painel é `default-src 'self'` SEM 'unsafe-inline'. Logo não existe
      atributo style="" em lugar nenhum: toda medida que depende de dado (largura de
      barra, altura de coluna) é atributo geométrico de SVG, que não é CSS.
   3. Mobile é o caso principal (os donos abrem no celular). O desktop é o caso
      excepcional, atrás de @media (min-width: 1024px).
   ===================================================================================== */

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/anton.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/archivo-var.woff2') format('woff2');
}

/* ===================================================================================
   1. Fichas de cor e medida
   =================================================================================== */

:root {
  --bg: #0E0E0E;
  --surface: #1A1415;
  --surface2: #221A1B;
  --border: #2E2426;

  --ink: #F5F2F1;
  --muted: #A89C9A;
  --faint: #6E6362;

  --red: #E2231A;
  --red-deep: #A9211F;
  /* O --red puro dá 4,1:1 no fundo escuro: passa em texto GRANDE, reprova em texto
     pequeno (AA pede 4,5:1). Texto vermelho miúdo usa este tom clarinho (6,1:1). */
  --red-texto: #FF5347;

  --good: #3ECF7A;
  --warn: #F0B429;
  --crit: #FF5C4D;

  --display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --body: 'Archivo', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --raio: 12px;
  --raio-peq: 8px;
  --lateral: 232px;      /* largura da barra lateral no desktop */
  --altura-nav: 60px;    /* altura da barra inferior no celular */
  --toque: 44px;         /* área mínima de toque */
}

/* ===================================================================================
   2. Base
   =================================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

button { font: inherit; color: inherit; }

/* Foco visível de verdade: teclado é como o Xandoka confere a tela, e no celular
   o anel some sozinho porque :focus-visible não dispara em toque. */
:focus-visible {
  outline: 2px solid var(--red-texto);
  outline-offset: 2px;
  border-radius: 4px;
}

.pular {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--red);
  padding: 10px 16px;
  border-radius: 0 0 var(--raio-peq) 0;
}
.pular:focus { left: 0; }

/* Some da tela mas continua no leitor de tela. */
.oculto-visual {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.num { font-variant-numeric: tabular-nums; }

/* ===================================================================================
   3. Esqueleto
   =================================================================================== */

.painel { min-height: 100vh; display: flex; flex-direction: column; }

.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marca .hex { width: 32px; height: 32px; flex: none; }
.marca-texto {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: .4px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marca-texto em { font-style: normal; color: var(--red-texto); }
.topo-direita { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.quem {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.corpo { flex: 1; display: block; }
.coluna { flex: 1 1 auto; min-width: 0; width: 100%; }

.conteudo {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: 16px 16px calc(var(--altura-nav) + 28px);
}

.rodape {
  padding: 18px 16px calc(var(--altura-nav) + 24px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}
.rodape b { color: var(--ink); font-weight: 600; }
.rodape-linha + .rodape-linha { margin-top: 4px; }

/* ===================================================================================
   4. Navegação — mesma marcação, dois formatos
   =================================================================================== */

.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  /* Uma coluna por item de NAVEGACAO (main.py). Item novo sem mexer aqui fica fora do
     grid explícito, calado. São 8 desde 05/08/2026, quando entrou /financeiro. */
  grid-template-columns: repeat(8, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
  /* Respeita a barra de gestos do iPhone: sem isto o último item fica embaixo dela. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--altura-nav);
  /* `min-width: var(--toque)` (44px) estourava a barra com 8 itens em tela de 320px:
     320/8 = 40px, e o grid passava a rolar por baixo do conteúdo. A área de toque
     continua confortável pela ALTURA (60px), que é a dimensão que o polegar erra. */
  min-width: 0;
  /* 2px de respiro lateral cortava "Comissões" com 8 itens (precisa de 47px e sobravam
     43). Medido no navegador a 375px, não estimado. */
  padding: 6px 1px;
  color: var(--muted);
  /* 9,5px cabia com 7 itens e passou a cortar com 8. A 8,5px o rótulo mais largo
     ("Comissões") mede 44,4px contra 45 de espaço — cabe inteiro. */
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-align: center;
  overflow: hidden;
}
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-rotulo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav-item[aria-current="page"] { color: var(--ink); }
.nav-item[aria-current="page"] svg { color: var(--red-texto); }

.nav-sair { display: none; }

/* ===================================================================================
   5. Tarja de frescor — sempre no topo, sempre clicável
   =================================================================================== */

.tarja-linha {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tarja-limite {
  display: flex;
  align-items: stretch;
  gap: 1px;
  max-width: 1016px;   /* 960 do conteúdo + os 28px de folga de cada lado */
  margin: 0 auto;
  background: var(--border);
}
.tarja {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: var(--toque);
  padding: 8px 14px;
  font-size: 12.5px;
  line-height: 1.35;
  background: var(--surface);
  min-width: 0;
}
.tarja-ponto { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tarja-texto { min-width: 0; }
.tarja-motivo { display: block; color: var(--muted); font-size: 11.5px; }
.tarja-seta { margin-left: auto; flex: none; width: 16px; height: 16px; color: var(--muted); }

.tarja--verde { color: var(--ink); background: linear-gradient(90deg, rgba(62,207,122,.10), var(--surface) 60%); }
.tarja--verde .tarja-ponto { background: var(--good); }
.tarja--amarela { color: var(--ink); background: linear-gradient(90deg, rgba(240,180,41,.12), var(--surface) 60%); }
.tarja--amarela .tarja-ponto { background: var(--warn); }
.tarja--vermelha { color: var(--ink); background: linear-gradient(90deg, rgba(255,92,77,.16), var(--surface) 60%); }
.tarja--vermelha .tarja-ponto { background: var(--crit); }

.tarja-acao {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--toque);
  min-height: var(--toque);
  padding: 0 12px;
  background: var(--surface);
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tarja-acao:hover { color: var(--ink); background: var(--surface2); }
.tarja-acao svg { width: 17px; height: 17px; }

/* ===================================================================================
   6. Cabeçalho de página
   =================================================================================== */

.chapeu {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.titulo {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: .3px;
  text-wrap: balance;
}
.subtitulo { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 62ch; }
.pagina-cabecalho { margin-bottom: 18px; }

/* ===================================================================================
   7. Cartões e indicadores
   =================================================================================== */

.cartao {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 16px;
  margin-top: 14px;
}
.cartao > h2, .cartao > h3 { font-size: 14px; font-weight: 700; }
/* Ícone dentro de título de cartão. O tamanho já vem do 1em do próprio SVG (ver o macro
   `icone`); aqui só o assentamento na linha de base, senão ele fica pendurado no texto. */
.cartao > h2 svg, .cartao > h3 svg { vertical-align: -.13em; flex: none; }
.cartao-dica { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cartao-corpo { margin-top: 14px; }

.indicadores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.indicador {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 14px 16px;
  min-width: 0;
}
.indicador-rotulo {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.indicador-valor {
  font-family: var(--display);
  font-size: 25px;
  line-height: 1.1;
  margin-top: 6px;
  letter-spacing: .2px;
  overflow-wrap: anywhere;
}
.indicador-nota { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.indicador-nota svg { width: 14px; height: 14px; vertical-align: -2px; flex: none; }
.indicador-nota.subiu { color: var(--good); }
.indicador-nota.caiu { color: var(--crit); }

.indicador--heroi {
  grid-column: 1 / -1;
  border-color: var(--red-deep);
  background: linear-gradient(160deg, #241416 0%, var(--surface) 60%);
}
.indicador--heroi .indicador-valor { color: var(--red); font-size: 40px; }
/* Cancelada tem cartão próprio, tracejado e riscado: precisa ser lida como
   "isto NÃO está nos totais acima", não como mais um indicador. */
.indicador--cancelada { border-style: dashed; margin-top: 10px; }
.indicador--cancelada .indicador-valor { color: var(--muted); text-decoration: line-through; }
.indicadores .indicador--cancelada { margin-top: 0; }

/* --- /financeiro ------------------------------------------------------------------
   Dinheiro que ENTRA e dinheiro que SAI precisam ser distinguíveis antes da leitura:
   nesta tela os dois aparecem lado a lado, com valores da mesma ordem de grandeza, e
   trocar um pelo outro inverte a conclusão. A cor é reforço, não a informação — o
   rótulo já diz "ainda vai ENTRAR" / "ainda vai SAIR" em maiúscula, para quem não
   distingue verde de vermelho. */
.indicador--entrada { border-left: 3px solid var(--good); }
.indicador--saida { border-left: 3px solid var(--warn); }

/* Título que separa "o que já aconteceu" de "o que ainda vai acontecer". Não é um
   .cartao: só uma régua na leitura, sem caixa em volta. */
.secao-titulo {
  margin: 26px 0 12px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: .01em;
  color: var(--ink);
}

/* Os dois lados da conferência lançamento × cheque, sempre lado a lado: é a comparação
   que é o assunto, então empilhar em telas estreitas destruiria o sentido do bloco. */
.conferencia {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.conferencia-lado {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}
.conferencia-valor {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* Parágrafo de explicação dentro de um cartão. Mais largo e mais legível que a
   .cartao-dica, porque aqui o texto É o conteúdo, não a legenda de um número. */
.explica {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 68ch;
}
.explica + .explica { margin-top: 10px; }
.explica strong, .explica b { color: var(--ink); font-weight: 600; }

/* ===================================================================================
   8. Barras (SVG) — largura vem de atributo, nunca de style inline
   =================================================================================== */

.barra {
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface2);
  line-height: 0;
}
.barra svg { display: block; width: 100%; height: 22px; }
.barra--fina svg { height: 12px; }
.barra-trilho { fill: var(--surface2); }
.barra-preenchimento { fill: url(#gradiente-vermelho); }
.barra-preenchimento--bateu { fill: url(#gradiente-verde); }
.barra-preenchimento--vazia { fill: var(--border); }

.grafico { overflow-x: auto; }
.grafico svg { display: block; width: 100%; height: auto; min-width: 320px; }
.eixo { stroke: var(--border); stroke-width: 1; }
.eixo-fraco { stroke: var(--surface2); stroke-width: 1; }
.coluna { fill: url(#gradiente-vermelho); }
.coluna--parcial { fill: var(--red-deep); }
.coluna--vazia { fill: var(--surface2); }
.rotulo-eixo { fill: var(--muted); font-family: var(--body); font-size: 12px; }
.rotulo-valor { fill: var(--ink); font-family: var(--body); font-size: 12px; font-weight: 600; }
/* --faint dá só 3,3:1 e reprova em AA para texto miúdo. Dentro do gráfico o texto é
   12px, então rótulo de "sem dado" usa --muted (6,8:1). O --faint fica para traço e
   borda, onde 3:1 basta. */
.rotulo-ausente { fill: var(--muted); font-family: var(--body); font-size: 12px; }

/* ===================================================================================
   9. Ranking
   =================================================================================== */

.ranking { display: grid; gap: 16px; }
.ranking-linha { display: grid; gap: 6px; }
.ranking-topo { display: flex; align-items: baseline; gap: 10px; }
.ranking-posicao {
  font-family: var(--display);
  font-size: 15px;
  color: var(--muted);
  min-width: 2ch;
}
.ranking-nome { font-weight: 600; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.ranking-valor { margin-left: auto; font-weight: 700; white-space: nowrap; }
.ranking-nota { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }

/* ===================================================================================
   10. Chips
   =================================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip--boa { color: var(--good); background: rgba(62,207,122,.12); }
.chip--aviso { color: var(--warn); background: rgba(240,180,41,.12); }
.chip--critica { color: var(--crit); background: rgba(255,92,77,.14); }
.chip--neutra { color: var(--muted); background: rgba(168,156,154,.12); }
.chip--sem-ponto::before { display: none; }

/* ===================================================================================
   11. Avisos
   =================================================================================== */

.aviso {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--raio-peq);
  background: var(--surface);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
}
.aviso b, .aviso strong { color: var(--ink); font-weight: 600; }
.aviso a { color: var(--red-texto); text-decoration: underline; }
.aviso svg { width: 15px; height: 15px; vertical-align: -3px; flex: none; }
.aviso--atencao { border-left-color: var(--warn); }
.aviso--critico { border-left-color: var(--crit); }
.aviso--informativo { border-left-color: var(--faint); }
/* Usado só quando uma conferência PASSOU. Aviso verde é raro de propósito: se tudo
   fosse verde, o verde não diria nada. */
.aviso--bom { border-left-color: var(--good); }

/* Bloco dos sócios: tem que ser visivelmente OUTRA COISA, não mais uma linha do
   ranking. Fundo listrado + borda tracejada fazem esse trabalho sem texto. */
.bloco-socios {
  margin-top: 26px;
  border: 1px dashed var(--faint);
  border-radius: var(--raio);
  padding: 16px;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.014) 0 10px, transparent 10px 20px),
    var(--surface);
}
.bloco-socios-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bloco-socios-titulo svg { width: 16px; height: 16px; flex: none; }

/* ===================================================================================
   11.5 Calendário de vencimentos (/financeiro)

   As três faixas dizem QUANTO; o calendário diz QUANDO — o caixa não aperta no mês,
   aperta no dia. Medido em 05/08/2026: 64 cheques em 44 datas, quase todas em dia
   5, 8, 10, 15, 19 e 28. Esse desenho só aparece numa grade.

   ⚠️ A intensidade é CLASSE (--n1..--n4), não `style` inline: a CSP do painel não tem
   `unsafe-inline`, então altura/cor calculada em atributo `style` simplesmente não
   pinta. Mesma razão pela qual a barra das faixas é SVG com atributo geométrico.
   =================================================================================== */
.cal-regua {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
.cal-mes {
  flex: none; min-width: 62px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  text-align: center; text-decoration: none; color: var(--muted);
}
.cal-mes:hover { border-color: var(--red-deep); color: var(--ink); }
.cal-mes--aberto { border-color: var(--red-deep); background: rgba(226, 35, 26, .12); color: var(--ink); }
.cal-mes-rotulo { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.cal-mes-valor { display: block; font-size: 12px; font-weight: 700; margin-top: 2px; }

.cal-cabeca { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-titulo { flex: 1; text-align: center; line-height: 1.35; }
/* sem `text-transform: capitalize`: ele maiusculiza TODA palavra e vira
   "Agosto De 2026". A primeira letra sobe no Python, onde dá pra fazer certo. */
.cal-titulo strong { display: block; font-size: 14px; }
.cal-sub { display: block; font-size: 12px; color: var(--muted); }
.cal-passo {
  flex: none; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--ink); font-size: 15px;
}
.cal-passo:hover { border-color: var(--red-deep); }
.cal-passo--off { opacity: .28; }

/* ⚠️ TUDO AQUI É ESCOPADO EM `.cal-grade` DE PROPÓSITO (conserto de 06/08/2026).
   O calendário é `<table>` — e deve ser, porque dia x dia-da-semana É tabular e o leitor
   de tela precisa da estrutura. Mas com isso ele herda as regras das TABELAS DE DADOS
   desta folha, escritas para outra coisa. A que mordeu: `tbody tr:hover td { background }`,
   que tem especificidade 0-1-2 e portanto GANHAVA de `.cal-dia--n3` (0-1-0): passar o
   mouse repintava a linha inteira e os dias com valor PERDIAM a cor. Dia vazio não mudava
   nada — a cor de hover é a mesma do fundo dele — então o defeito aparecia só onde havia
   dinheiro, que é justamente onde não podia aparecer.
   Escopar em `.cal-grade` leva as regras para 0-2-0 e o calendário deixa de depender de
   sorte de especificidade contra CSS que não foi escrito pensando nele. */
.cal-grade { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.cal-grade thead th {
  font-size: 10px; font-weight: 700; color: var(--muted); background: transparent;
  text-transform: uppercase; letter-spacing: .06em;
  text-align: center; padding: 0 0 2px; white-space: nowrap;
}
.cal-grade .cal-dia {
  height: 46px; vertical-align: top; padding: 4px 3px; border-radius: 7px;
  background: var(--surface2); border: 1px solid transparent; border-top: 1px solid transparent;
  text-align: center;
}
.cal-numero { display: block; font-size: 11px; color: var(--muted); line-height: 1.1; }
.cal-valor { display: block; font-size: 11px; font-weight: 700; margin-top: 2px; line-height: 1.1; }
.cal-grade .cal-dia--fora { background: transparent; }
.cal-dia--fora .cal-numero { opacity: .25; }
/* dia já passado fica recuado, mas NÃO some: cheque vencido e não compensado é
   exatamente o que precisa continuar visível. */
.cal-dia--passado .cal-numero { opacity: .45; }
.cal-grade .cal-dia--hoje { border-color: var(--red-deep); }
.cal-dia--hoje .cal-numero { color: var(--ink); font-weight: 700; }
.cal-grade .cal-dia--n1 { background: #3a2422; }
.cal-grade .cal-dia--n2 { background: #4d2a26; }
.cal-grade .cal-dia--n3 { background: #67302a; }
.cal-grade .cal-dia--n4 { background: #85372e; }
.cal-dia--n1 .cal-numero, .cal-dia--n2 .cal-numero,
.cal-dia--n3 .cal-numero, .cal-dia--n4 .cal-numero { color: var(--ink); opacity: .8; }
/* Hover do calendário: CONTORNO, nunca fundo. O fundo é o que carrega a informação aqui —
   mexer nele para dar retorno de mouse apaga o dado em troca de um efeito.
   ⚠️ NÃO adicionar `.cal-grade tbody tr:hover td { background: ... }` para "neutralizar" a
   regra herdada: esse seletor pesa 0-2-3 e passaria a ganhar das próprias classes de cor
   (0-2-0), deixando a célula transparente — trocaria o defeito por um pior. O escopo em
   `.cal-grade` já basta: 0-2-0 vence o `tbody tr:hover td` original, que é 0-1-2. */
.cal-grade .cal-dia:hover { border-color: var(--faint); }
.cal-grade .cal-dia--hoje:hover { border-color: var(--red-deep); }
.cal-legenda { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

@media (max-width: 767px) {
  .cal-dia { height: 42px; padding: 3px 1px; }
  .cal-valor { font-size: 10px; }
  .cal-grade { border-spacing: 2px; }
}
.bloco-socios .aviso { margin-top: 10px; background: transparent; }
.separador-socios { border: 0; border-top: 1px solid var(--border); margin: 26px 0 0; }

/* ===================================================================================
   12. Tabelas — tabela no desktop, cartão no celular
   =================================================================================== */

.tabela-caixa {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--raio);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  padding: 10px 14px;
  font-weight: 700;
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-top: 1px solid var(--border); background: var(--surface); vertical-align: top; }
tfoot td {
  padding: 12px 14px;
  border-top: 2px solid var(--border);
  background: var(--surface2);
  font-weight: 700;
  vertical-align: top;
}
td.dir, th.dir { text-align: right; }
.celula-principal { font-weight: 600; }
.sub { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }

/* Cancelada: riscada em toda tela onde apareça, e fora de qualquer total. */
tr.cancelada .celula-principal,
tr.cancelada .valor { text-decoration: line-through; color: var(--muted); }

@media (max-width: 767px) {
  /* A tabela vira lista de cartões. Os papéis ARIA na marcação seguram a semântica
     que o display:block derruba em alguns leitores de tela. */
  .tabela-caixa { border: 0; border-radius: 0; overflow: visible; }
  .tabela-cartoes thead {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .tabela-cartoes, .tabela-cartoes tbody, .tabela-cartoes tfoot,
  .tabela-cartoes tr, .tabela-cartoes td { display: block; }
  .tabela-cartoes tr {
    border: 1px solid var(--border);
    border-radius: var(--raio);
    background: var(--surface);
    margin-bottom: 10px;
    padding: 6px 0;
  }
  .tabela-cartoes tfoot tr { border-color: var(--faint); background: var(--surface2); }
  .tabela-cartoes tfoot td { border-top: 0; font-weight: 700; }
  .tabela-cartoes td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border: 0;
    padding: 5px 14px;
    text-align: right;
    background: transparent;
  }
  .tabela-cartoes td::before {
    content: attr(data-rotulo);
    flex: none;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: left;
  }
  .tabela-cartoes td.celula-principal {
    display: block;
    text-align: left;
    font-size: 15px;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }
  .tabela-cartoes td.celula-principal::before { display: none; }
  .tabela-cartoes .sub { display: inline; margin-left: 6px; }
  .tabela-cartoes td.celula-principal .sub { display: block; margin-left: 0; }
}

@media (min-width: 768px) {
  tbody tr:hover td { background: var(--surface2); }
}

/* ===================================================================================
   13. Formulários (login, filtro, busca)
   =================================================================================== */

.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-top: 14px;
}
.campo { display: flex; flex-direction: column; gap: 5px; flex: 1 1 160px; min-width: 0; }
.campo label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
input[type="text"], input[type="search"], input[type="password"], select {
  width: 100%;
  min-height: var(--toque);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--raio-peq);
  color: var(--ink);
  font: inherit;
  font-size: 15px; /* abaixo de 16px o iOS dá zoom sozinho ao focar o campo */
  padding: 9px 12px;
}
select {
  /* Seta desenhada em data:URI porque a CSP libera img-src data: e não libera CDN. */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A89C9A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 34px;
}
input::placeholder { color: var(--muted); }

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--toque);
  padding: 10px 18px;
  border-radius: var(--raio-peq);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.botao svg { width: 17px; height: 17px; flex: none; }
.botao:hover { background: var(--border); }
.botao--principal { background: var(--red-deep); border-color: var(--red); }
.botao--principal:hover { background: var(--red); }
.botao--discreto { background: transparent; color: var(--muted); }
.botao--discreto:hover { color: var(--ink); background: var(--surface2); }
.botao--largo { width: 100%; }

.paginacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.paginacao-conta { font-size: 12.5px; color: var(--muted); }
.paginacao-botoes { display: flex; gap: 8px; margin-left: auto; }
.paginacao .botao--inativo { opacity: .38; pointer-events: none; }

.vazio {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--raio);
  margin-top: 14px;
}

/* ===================================================================================
   14. Login
   =================================================================================== */

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-caixa {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--raio);
  padding: 28px 24px;
}
.login-marca { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-marca .hex { width: 42px; height: 42px; flex: none; }
.login-marca-texto { font-family: var(--display); font-size: 20px; line-height: 1.1; letter-spacing: .4px; }
.login-marca-texto span { display: block; font-family: var(--body); font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.login form { display: grid; gap: 14px; }
.login-erro {
  border: 1px solid var(--crit);
  background: rgba(255,92,77,.10);
  color: var(--ink);
  border-radius: var(--raio-peq);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.login-nota { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.login-nota svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ===================================================================================
   15. Saúde
   =================================================================================== */

.lista-dados { display: grid; gap: 0; }
.lista-dados > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}
.lista-dados > div:first-child { border-top: 0; }
.lista-dados dt { color: var(--muted); font-size: 13px; }
.lista-dados dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
.lista-dados dd .sub { white-space: normal; }

.selo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--raio-peq);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
}
.selo--verde { color: var(--good); background: rgba(62,207,122,.12); }
.selo--amarela { color: var(--warn); background: rgba(240,180,41,.12); }
.selo--vermelha { color: var(--crit); background: rgba(255,92,77,.14); }
.selo svg { width: 18px; height: 18px; }

.motivos { margin-top: 12px; display: grid; gap: 6px; }
.motivos li {
  font-size: 13px;
  color: var(--ink);
  padding-left: 18px;
  position: relative;
}
.motivos li::before {
  content: "";
  position: absolute;
  left: 4px; top: .55em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warn);
}

/* ===================================================================================
   16. Desktop — a partir daqui a barra vira lateral
   =================================================================================== */

@media (min-width: 1024px) {
  body { font-size: 15px; }

  .corpo { display: flex; align-items: flex-start; }

  .nav {
    position: sticky;
    top: 0;
    left: auto; right: auto; bottom: auto;
    align-self: flex-start;
    height: 100vh;
    width: var(--lateral);
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    grid-template-columns: none;
    padding: 16px 12px;
    border-top: 0;
    border-right: 1px solid var(--border);
    background: var(--surface);
  }
  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: var(--toque);
    padding: 10px 12px;
    border-radius: var(--raio-peq);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
  }
  .nav-item:hover { background: var(--surface2); color: var(--ink); }
  .nav-item[aria-current="page"] { background: var(--surface2); }
  .nav-rotulo { max-width: none; }

  .nav-sair { display: block; margin-top: auto; }
  .nav-sair .botao { width: 100%; }

  .conteudo { padding: 26px 28px 60px; }
  .rodape { padding: 22px 28px 40px; }
  .tarja { padding: 10px 28px; font-size: 13px; }
  .titulo { font-size: 28px; }
  .indicador--heroi .indicador-valor { font-size: 52px; }
  .indicadores { gap: 12px; }
  .cartao { padding: 20px; }

  .topo { padding-left: 28px; padding-right: 28px; }
  .quem { max-width: none; }
}


/* Entre 1024 e 1180 a lateral rouba largura demais do conteúdo. */
@media (min-width: 1024px) and (max-width: 1180px) {
  :root { --lateral: 200px; }
}

/* ===================================================================================
   17. Movimento e impressão
   =================================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .nav, .tarja-acao, .filtros, .paginacao { display: none !important; }
  body { background: #fff; color: #000; }
  .cartao, .indicador, tbody td { background: #fff; border-color: #999; }
}
