/* ============================================================
   QUARTA CATEGORIA — estilo
   Mesma identidade do painel financeiro (marinho, Saira Condensed +
   Barlow) para o grupo reconhecer que é a mesma casa.
   ============================================================ */
:root {
  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #e9edf6; --line: #d9deeb;
  --ink: #0d1638; --ink-2: #4a5373; --ink-3: #7c84a0;
  --navy: #101b45; --royal: #1d4fc4; --pos: #2a78d6; --good: #128a4a; --warn: #b26b00; --neg: #e34948;
  --gold: #c99a06;
  --font-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --font-display: "Saira Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f22; --surface: #121a35; --surface-2: #1b2547; --line: #26305a;
    --ink: #eef1fa; --ink-2: #b4bbd3; --ink-3: #828aa6;
    --navy: #0a0f22; --royal: #5b8cf0; --pos: #3987e5; --good: #3fbf78; --warn: #e0a030; --neg: #e66767;
    --gold: #f0c419; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f22; --surface: #121a35; --surface-2: #1b2547; --line: #26305a;
  --ink: #eef1fa; --ink-2: #b4bbd3; --ink-3: #828aa6;
  --navy: #0a0f22; --royal: #5b8cf0; --pos: #3987e5; --good: #3fbf78; --warn: #e0a030; --neg: #e66767;
  --gold: #f0c419; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--font-body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button, input, select { font: inherit; color: inherit; }
.oculto { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: .3px; margin: 0; }

/* ---------- topo ---------- */
.topo {
  background: #101b45; color: #fff; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; position: sticky; top: 0; z-index: 20;
}
.topo img { width: 40px; height: 40px; }
.topo .titulo { flex: 1; min-width: 0; }
.topo h1 { font-size: 22px; line-height: 1; }
.topo small { opacity: .75; font-size: 13px; }
.topo button { background: rgba(255,255,255,.12); border: 0; color: #fff; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.topo-dir { display: flex; align-items: center; gap: 8px; }
.selo { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; padding: 4px 4px 4px 12px; color: #fff; white-space: nowrap; }
.selo b { font-weight: 700; }
.selo .ponto { width: 8px; height: 8px; border-radius: 50%; background: #3fbf78; box-shadow: 0 0 0 3px rgba(63,191,120,.25); }
.selo .ponto.local { background: #f0c419; box-shadow: 0 0 0 3px rgba(240,196,25,.25); }
.selo button { width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 16px; line-height: 1; }
.btn-tema { width: 40px; height: 40px; padding: 0 !important; font-size: 18px; }
@media (max-width: 420px) { .topo .titulo small { display: none; } }

main { max-width: 980px; margin: 0 auto; padding: 16px; }
.aviso-local {
  background: #fff4d6; color: #6b4a00; border: 1px solid #f0d58a; border-radius: var(--radius);
  padding: 8px 12px; font-size: 14px; margin-bottom: 12px;
}

/* ---------- cartões ---------- */
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.cartao h2 { font-size: 20px; margin-bottom: 8px; }
.cartao h3 { font-size: 17px; margin: 12px 0 6px; }
.sub { color: var(--ink-2); font-size: 14px; }
.linha-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); padding: 10px 14px;
  border-radius: 8px; cursor: pointer; font-weight: 600; min-height: 42px;
}
.btn:hover { filter: brightness(.97); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.btn.prim { background: var(--royal); border-color: var(--royal); color: #fff; }
.btn.bom { background: var(--good); border-color: var(--good); color: #fff; }
.btn.perigo { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn.zap { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.peq { min-height: 32px; padding: 5px 10px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- rodada pública ---------- */
.rodada-cab { display: flex; gap: 14px; align-items: center; }
.rodada-cab .dia { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.barra { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.barra > i { display: block; height: 100%; background: var(--good); }
.barra.cheia > i { background: var(--warn); }
.contadores { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.grande-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.grande-acoes .btn { min-height: 54px; font-size: 18px; }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista .n { width: 28px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lista .nome { flex: 1; min-width: 0; }
.lista .nome small { display: block; color: var(--ink-3); font-size: 13px; }
.lista .hora { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.etq { font-size: 12px; padding: 2px 7px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.etq.gol { background: #e7f0ff; color: #1d4fc4; }
.etq.p1 { background: #e3f6ec; color: #0f6e3b; }
.etq.p3 { background: #fdecec; color: #a12b2b; }
.etq.alerta { background: #fff1d6; color: #8a5600; }
.estrelas { color: var(--gold); letter-spacing: -1px; white-space: nowrap; }

/* ---------- início em cartões (padrão USECONTAI) ----------
   O cartão INTEIRO é o alvo de toque; a linha de baixo ENUMERA o que
   há lá dentro, e o número aparece só para pendência. */
.secao-titulo { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 6px 0 8px; }
.secao-desc { border-left: 3px solid var(--navy); background: var(--surface-2); padding: 8px 12px; border-radius: 0 8px 8px 0; color: var(--ink-2); font-size: 14px; margin-bottom: 14px; }
.inicio-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.tema {
  display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 16px; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 3px rgba(13,22,56,.06);
  cursor: pointer; text-align: left; color: inherit; font: inherit; text-decoration: none;
}
.tema:hover { border-color: var(--royal); }
.tema.ativo { border: 2px solid var(--royal); }
.tema-icone { font-size: 30px; line-height: 1; flex: 0 0 auto; }
.tema-txt { display: flex; flex-direction: column; min-width: 0; }
.tema-txt b { font-size: 17px; }
.tema-txt small { color: var(--ink-3); font-size: 13px; line-height: 1.35; }
.tema-badge { display: inline-block; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 999px; margin-left: 4px;
  background: var(--neg); color: #fff; font-size: 12px; font-weight: 800; vertical-align: middle; }
.voltar { display: inline-flex; align-items: center; margin-bottom: 12px; text-decoration: none; }
.filtros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 8px; margin-top: 10px; }
.filtros .busca:first-child { grid-column: 1 / -1; }
@media (max-width: 760px) { .filtros { grid-template-columns: 1fr 1fr; } }
.emprestimo { border: 1px dashed var(--warn); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }

h2.ola { font-size: 26px; margin: 4px 0 2px; }
.resumo { margin: 0 0 14px; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 760px) { .grade-2 { grid-template-columns: 1fr; } }
/* Modo Desenvolvedor (MAD) — mesmo desenho do Batuta */
/* Cores do Quarta Categoria (marinho + azul royal), não as do Batuta. */
.tema[data-aba="dev"] .tema-txt b { color: var(--royal); }
.dev-hero { border-left: 4px solid var(--royal); }
.dev-hero h2 span { color: var(--royal); }
.dev-info { margin-top: 6px; }
.di-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.di-row:last-child { border-bottom: none; }
.di-row > span { color: var(--ink-3); }
.di-row > b { text-align: right; word-break: break-word; }

/* ---------- entrar (padrão MAD: Batuta / Maria Pudim / USECONTAI) ---------- */
body.modo-login .topo, body.modo-login #avisoLocal { display: none !important; }
body.modo-login main { min-height: calc(100vh - 110px); display: flex; flex-direction: column; justify-content: center; }
.login-cartao {
  width: 100%; max-width: 400px; margin: 24px auto 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 8px 30px rgba(13,22,56,.10); padding: 28px 26px 22px; text-align: center;
}
.login-logo { width: 110px; height: 110px; object-fit: contain; display: block; margin: 0 auto 12px; }
.login-titulo { font-family: var(--font-body); font-weight: 700; font-size: 22px; color: var(--ink); margin: 0 0 6px; }
.login-sub { color: var(--ink-2); margin: 0 0 18px; }
.login-campo {
  display: block; width: 100%; padding: 13px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); font-size: 16px; text-align: center; color: var(--ink);
}
.login-campo:focus { outline: 2px solid var(--royal); outline-offset: 1px; }
.login-botao {
  display: block; width: 100%; min-height: 48px; border: 0; border-radius: 10px; background: #101b45; color: #fff;
  font-weight: 700; font-size: 17px; cursor: pointer; margin-top: 4px;
}
:root[data-theme="dark"] .login-botao { background: var(--royal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-botao { background: var(--royal); } }
.login-botao:hover { filter: brightness(1.1); }
.login-link { background: none; border: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; margin-top: 14px; font-size: 15px; }
.login-assinatura { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; font-weight: 700; letter-spacing: .22em; font-size: 12px; color: var(--ink-2); }
.login-fora { text-align: center; margin: 0; }
#erroEntrar .alerta-box { text-align: left; }

/* ---------- WhatsApp ---------- */
.ico-zap { width: 20px; height: 20px; vertical-align: -4px; }
.btn.zap { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }

/* ---------- painel de jogo (no jeito do MeuRanking) ---------- */
.placar-lado { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.placar-caixa {
  min-width: 92px; padding: 6px 18px; border-radius: 14px; font-family: var(--font-display); font-size: 60px; line-height: 1.1; text-align: center;
  color: #fff; background: var(--cor, var(--navy)); box-shadow: inset 0 0 0 3px rgba(255,255,255,.15);
}
.placar-nome { font-weight: 700; }
.times-jogo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.times-jogo > * { min-width: 0; }
.jog-linha { min-width: 0; overflow: hidden; }
.times-jogo.um { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 0; }
@media (max-width: 640px) { .times-jogo { grid-template-columns: 1fr; } }
.time-jogo { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--cor); border-radius: 12px; padding: 10px; }
.time-jogo h3 { margin: 2px 4px 8px; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.jog-linha {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; margin-bottom: 4px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left; color: inherit; font: inherit;
}
.jog-linha:hover { background: var(--surface-2); border-color: var(--line); }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.3px; color: #fff; background: var(--cor, var(--royal)); }
.avatar.grande { width: 48px; height: 48px; font-size: 20px; }
.jog-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.jog-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jog-txt small { color: var(--ink-3); font-size: 12px; }
.marca { font-size: 13px; white-space: nowrap; }
.prox { padding: 8px 0; border-bottom: 1px solid var(--line); }
.prox:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.jog-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.acoes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.acao { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; color: inherit; font: inherit; min-height: 78px; }
.acao span { font-size: 26px; line-height: 1; }
.acao:hover { border-color: var(--royal); }
.acao-larga { display: block; width: 100%; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer; color: inherit; font: inherit; font-weight: 600; }
.acao-larga:hover { border-color: var(--royal); }
.perigo-txt { color: var(--neg); }

/* ---------- painel do Início (KPIs, atalhos, top 5) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 860px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-rot { font-size: 13px; color: var(--ink-2); }
.kpi-num { font-family: var(--font-display); font-size: 34px; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-nota { font-size: 13px; color: var(--ink-3); }
.atalhos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
@media (max-width: 700px) { .atalhos { grid-template-columns: 1fr; } }
.atalho { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.atalho:hover { border-color: var(--royal); }
.atalho .seta { margin-left: auto; font-size: 22px; color: var(--ink-3); }
.cab-cartao { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cab-cartao h2 { margin: 0; }
.link { color: var(--royal); text-decoration: none; font-weight: 600; font-size: 14px; }
.top5 { list-style: none; margin: 0; padding: 0; }
.top5 li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.top5 li:last-child { border-bottom: 0; }
.top5 .nome { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top5 .nome small { color: var(--ink-3); font-size: 13px; }
.top5 .pts { text-align: right; display: flex; flex-direction: column; line-height: 1.1; }
.top5 .pts b { font-family: var(--font-display); font-size: 22px; color: var(--ink); }
.top5 .pts small { color: var(--ink-3); font-size: 12px; }
.medalha { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-weight: 800; font-size: 13px;
  background: var(--surface-2); color: var(--ink-2); flex: 0 0 auto; }
.medalha.m1 { background: linear-gradient(145deg, #f7d774, #c99a06); color: #3a2c00; }
.medalha.m2 { background: linear-gradient(145deg, #e9edf3, #a9b2c0); color: #222a36; }
.medalha.m3 { background: linear-gradient(145deg, #e8b48a, #a8643a); color: #2e1606; }
.avatar.mini { width: 26px; height: 26px; border-radius: 50%; font-size: 12px; display: inline-grid; margin-right: 8px; vertical-align: middle; background: var(--surface-2); color: var(--ink-2); }

/* ---------- ranking ---------- */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow-x: auto; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button.ativa { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(13,22,56,.12); }
.filtros-rank { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 10px; align-items: start; }
.filtros-rank .busca { margin: 0; }
@media (max-width: 600px) { .filtros-rank { grid-template-columns: 1fr; } }
.tab-rank td { vertical-align: middle; }
.tab-rank td.pts { font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.tab-rank th.foco { color: var(--royal); }
.metrica { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
.metrica.desligada { opacity: .55; }
.metrica .sigla { flex: 0 0 auto; min-width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--ink-2); }
.metrica .m-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.metrica .m-txt small { color: var(--ink-3); }
.metrica input.m-peso { width: 64px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.metrica select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.metrica .ordem { display: flex; gap: 4px; }
.chave { position: relative; width: 46px; height: 26px; flex: 0 0 auto; }
.chave input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.chave input:focus-visible + i { box-shadow: 0 0 0 2px var(--royal); }
.chave i { position: absolute; inset: 0; border-radius: 13px; background: var(--line); transition: .15s; cursor: pointer; }
.chave i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.chave input:checked + i { background: var(--royal); }
.chave input:checked + i::after { left: 23px; }
.linha-link { display: flex; gap: 8px; margin: 10px 0; }
.linha-link .busca { margin: 0; }
.dia-hist { font-family: var(--font-display); font-size: 26px; line-height: 1; display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.dia-hist small { font-size: 12px; color: var(--ink-3); font-family: var(--font-body); }
.barra-pub { margin: 0 0 12px; }

/* ---------- gráficos (uma série, azul royal; texto sempre em cor de texto) ---------- */
.graf-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 760px) { .graf-grade { grid-template-columns: 1fr; } }
.graf h3 { margin: 0 0 2px; font-size: 18px; }
.barras { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.barra-linha { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; align-items: center; gap: 10px; outline: none; border-radius: 6px; }
.barra-linha:focus-visible { box-shadow: 0 0 0 2px var(--royal); }
.barra-rot { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-trilho { display: flex; align-items: center; gap: 6px; min-width: 0; }
.barra { display: block; height: 18px; border-radius: 0 4px 4px 0; background: var(--s1); transition: filter .1s; }
.barra-linha:hover .barra { filter: brightness(1.15); }
.barra-val { font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.colunas-area { display: grid; grid-template-columns: auto 1fr; gap: 6px; margin-top: 10px; }
.eixo-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--ink-3); height: 180px; text-align: right; padding-bottom: 20px; }
.eixo-y span { line-height: 1; transform: translateY(50%); }
.eixo-y span:first-child { transform: none; }
.colunas { position: relative; box-sizing: border-box; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; height: 180px; padding-bottom: 20px; align-items: end; }
.colunas .grade { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; z-index: 1; }
.col:focus-visible .coluna { box-shadow: 0 0 0 2px var(--ink); }
.coluna { position: relative; width: min(22px, 70%); background: var(--royal); border-radius: 4px 4px 0 0; min-height: 0; }
.col:hover .coluna { filter: brightness(1.15); }
.col-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--ink); padding-bottom: 2px; white-space: nowrap; }
.col-rot { position: absolute; bottom: -18px; font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.dica-graf { position: fixed; z-index: 90; display: none; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; box-shadow: 0 6px 20px rgba(13,22,56,.18); font-size: 13px; }
.dica-graf b { display: block; font-size: 16px; }
.dica-graf span { color: var(--ink-2); }

/* ---------- linhas e pilhas (cores de categoria validadas: 3 séries) ---------- */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; }
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #3987e5; --s2: #d95926; --s3: #199e70; } }
.g-caixa { margin-top: 6px; touch-action: pan-y; }
.linha-svg { display: block; overflow: visible; }
.g-grade { stroke: var(--line); stroke-width: 1; }
.g-eixo { fill: var(--ink-3); font-size: 11px; font-family: var(--font-body); }
.g-linha { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-area { opacity: .1; }
.g-ponto { stroke: var(--surface); stroke-width: 2; }
.g-rotulo { fill: var(--ink-2); font-size: 12px; font-weight: 600; font-family: var(--font-body); }
.g-mira { stroke: var(--ink-3); stroke-width: 1; }
.g-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.g-legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pilha { display: flex; gap: 2px; flex: 0 1 auto; min-width: 0; width: 100%; max-width: calc(100% - 40px); }
.seg-pilha { display: block; height: 18px; }
.seg-pilha:last-child { border-radius: 0 4px 4px 0; }
.barra-trilho .pilha + .barra-val { flex: 0 0 auto; }
.dica-lin { display: flex; align-items: center; gap: 6px; }
.dica-lin i { display: inline-block; width: 12px; height: 2px; border-radius: 1px; }
.dica-lin b { display: inline; font-size: 15px; }

/* ---------- imagem dos times ---------- */
.img-times { display: block; width: 100%; height: auto; border-radius: 10px; margin: 6px 0 10px; }

/* ---------- mesa do jogo ---------- */
.mesa-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mesa-aviso { border-left: 4px solid var(--royal); }
.avatar.mini { width: 30px; height: 30px; font-size: 11px; letter-spacing: -.3px; }

/* ---------- score e votação (2º lote) ---------- */
.score-selo { display: inline-block; padding: 2px 8px; border-radius: 10px; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.score-selo.s-destaque { background: #fff4d6; color: #6b4a00; }
.score-selo.s-sumido, .score-selo.s-sem { color: var(--ink-3); }
.quadro-score { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; }
.sc-topo { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 600; }
.sc-linha { display: grid; grid-template-columns: 1fr 90px 34px; gap: 8px; align-items: center; padding: 3px 0; font-size: 14px; }
.sc-linha small { display: block; color: var(--ink-3); font-size: 12px; }
.sc-barra { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.sc-barra i { display: block; height: 100%; background: var(--royal); border-radius: 0 4px 4px 0; }
.sc-linha b { text-align: right; font-variant-numeric: tabular-nums; }
.voto-cat { padding: 8px 0; border-top: 1px solid var(--line); }
.voto-cat:first-of-type { border-top: 0; }
.faixa-votacao { display: block; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #e7f0ff; color: #1d3f9a; text-decoration: none; border: 1px solid #c9dafc; }
:root[data-theme="dark"] .faixa-votacao { background: #1b2a55; color: #cfe0ff; border-color: #2c4380; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .faixa-votacao { background: #1b2a55; color: #cfe0ff; border-color: #2c4380; } }

/* ---------- financeiro ---------- */
.frame-painel { width: 100%; min-height: 900px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: block; }
.neg-txt { color: var(--neg); }
.lista li b { white-space: nowrap; }

/* ---------- abas ---------- */
.abas { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.abas button {
  border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 20px;
  cursor: pointer; white-space: nowrap; font-weight: 600; color: var(--ink-2);
}
.abas button.ativa { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .abas button.ativa { background: var(--royal); border-color: var(--royal); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .abas button.ativa { background: var(--royal); border-color: var(--royal); } }

/* ---------- formulários ---------- */
label.campo { display: block; margin-bottom: 10px; font-size: 14px; color: var(--ink-2); }
label.campo input, label.campo select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 16px; color: var(--ink);
}
.grade2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.marcar { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 15px; }
.marcar input { width: 20px; height: 20px; }
.busca { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-bottom: 8px; font-size: 16px; }
.pin-entrada { font-size: 32px; letter-spacing: 12px; text-align: center; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

/* ---------- tabela ---------- */
/* Listas longas rolam DENTRO do cartão (pedido do David, 20/11 — o
   mesmo "top 15 com rolagem" do painel financeiro): a página não vira
   um rolo, e o cabeçalho da tabela fica preso no alto enquanto rola. */
.tabela-rolagem { overflow: auto; max-height: min(62vh, 560px); border: 1px solid var(--line); border-radius: 8px; }
.tabela-rolagem thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; box-shadow: 0 1px 0 var(--line); }
.rolagem { max-height: min(62vh, 560px); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.janela .rolagem { max-height: 40vh; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--ink-3); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td { background: var(--surface-2); }

/* ---------- sorteio ---------- */
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.time { border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--surface); }
.time.vez { border-color: var(--royal); box-shadow: 0 0 0 3px rgba(29,79,196,.15); }
.time h3 { font-size: 18px; margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.time .soma { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.time ul { list-style: none; padding: 0; margin: 0; }
.time li { padding: 5px 6px; border-radius: 6px; display: flex; gap: 6px; align-items: center; cursor: pointer; font-size: 14px; }
.time li:hover { background: var(--surface-2); }
.time li.sel { background: #dfe8ff; outline: 2px solid var(--royal); }
:root[data-theme="dark"] .time li.sel { background: #23336b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .time li.sel { background: #23336b; } }
.time li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.time li .pts { color: var(--ink-3); font-size: 12px; }
.bolinha { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.2); }
.sel-colete { font-size: 15px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.diferenca { padding: 8px 12px; border-radius: 8px; background: #e3f6ec; color: #0f6e3b; font-weight: 600; margin: 10px 0; }
.diferenca.alta { background: #fdecec; color: #a12b2b; }
.disponiveis li { cursor: pointer; }
.disponiveis li:hover { background: var(--surface-2); }

/* ---------- partida ---------- */
.placar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.placar .lado h3 { font-size: 20px; }
.placar .gols { font-family: var(--font-display); font-size: 64px; line-height: 1; }
.placar .x { font-family: var(--font-display); font-size: 32px; color: var(--ink-3); }
.cronometro { font-family: var(--font-display); font-size: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.cronometro.esgotado { color: var(--neg); }
.faixa { text-align: center; padding: 8px; border-radius: 8px; font-weight: 600; margin: 8px 0; }
.faixa.esgotado { background: #fdecec; color: #a12b2b; }
.faixa.fim { background: #e3f6ec; color: #0f6e3b; }
.fila { font-size: 14px; color: var(--ink-2); }

.contador { display: inline-flex; align-items: center; gap: 4px; }
.contador button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.contador b { min-width: 18px; text-align: center; }

/* ---------- modal e pergunta ---------- */
.fundo-modal { position: fixed; inset: 0; background: rgba(5,10,30,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .fundo-modal { align-items: center; } }
.janela {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
}
.janela.larga { max-width: 980px; }
@media (min-width: 700px) { .janela { border-radius: 16px; } }
.janela h2 { font-size: 22px; margin-bottom: 8px; }
.opcao { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface-2); padding: 12px; border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.opcao strong { display: block; }
.opcao span { color: var(--ink-2); font-size: 14px; }
.alerta-box { background: #fff4d6; color: #6b4a00; border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.ok-box { background: #e3f6ec; color: #0f6e3b; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: #101b45; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 80; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.toast.erro { background: #a12b2b; }

/* ---------- rodapé ---------- */
.rodape { text-align: center; color: var(--ink-3); font-size: 13px; padding: 20px 16px 30px; }
.rodape > div { margin: 3px 0; }
.rodape strong { color: var(--ink-2); }
.rodape .rod-nome { color: var(--navy); }
:root[data-theme="dark"] .rodape .rod-nome { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rodape .rod-nome { color: var(--ink); } }
.rodape img { width: 22px; vertical-align: middle; margin-right: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rodape img { filter: brightness(0) invert(1); opacity: .8; } }
:root[data-theme="dark"] .rodape img { filter: brightness(0) invert(1); opacity: .8; }

@media (max-width: 520px) {
  .grade2 { grid-template-columns: 1fr; }
  .placar .gols { font-size: 48px; }
  .cronometro { font-size: 40px; }
}

/* Seletores dos formulários com a mesma seta e a mesma altura dos campos. */
label.campo input, label.campo select { min-height: 44px; }
label.campo select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237c84a0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
/* ---------- acessos da equipe ---------- */
.sel-app {
  appearance: none; -webkit-appearance: none; padding: 8px 34px 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237c84a0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-size: 15px; color: var(--ink); cursor: pointer; min-height: 38px;
}
.sel-app:hover { border-color: var(--ink-3); }
.sel-app:focus-visible { outline: 2px solid var(--royal); outline-offset: 1px; }
.form-acesso { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr auto; gap: 0 12px; align-items: end; }
.form-acesso .btn { margin-bottom: 10px; min-height: 44px; }
.acessos-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.acessos-cab h2 { margin: 0; }
.acessos-cont { display: flex; gap: 6px; }
ul.acessos { list-style: none; margin: 0; padding: 0; }
.acesso {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 190px 210px; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.acesso:last-child { border-bottom: 0; }
.acesso .avatar { width: 40px; height: 40px; border-radius: 50%; font-size: 14px; }
.acesso.papel-desenvolvedor .avatar { background: var(--navy); }
.acesso.papel-administrador .avatar { background: var(--royal); }
.acesso.papel-organizador .avatar { background: var(--good); }
.acesso-quem { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.acesso-quem b { font-weight: 600; }
.acesso-quem small { flex-basis: 100%; color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acesso-papel .sel-app { width: 100%; }
.papel-fixo { display: flex; align-items: center; min-height: 38px; padding: 0 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-2); font-size: 15px; }
.acesso-acoes { display: flex; gap: 6px; justify-content: flex-end; }
.acesso-acoes .btn { min-width: 96px; }
.btn.contorno-neg { background: transparent; border-color: var(--neg); color: var(--neg); }
.btn.contorno-neg:hover { background: var(--neg); color: #fff; }
.btn.contorno-pos { background: transparent; border-color: var(--good); color: var(--good); }
.btn.contorno-pos:hover { background: var(--good); color: #fff; }
.acesso.inativo .avatar { background: var(--surface-2); color: var(--ink-3); }
.acesso.inativo .acesso-quem b, .acesso.inativo .acesso-papel { opacity: .6; }
@media (max-width: 760px) {
  .form-acesso { grid-template-columns: 1fr; }
  .form-acesso .btn { width: 100%; }
  .acesso { grid-template-columns: 40px minmax(0, 1fr); row-gap: 8px; }
  .acesso-papel, .acesso-acoes { grid-column: 2; }
  .acesso-acoes { justify-content: flex-start; }
}

/* ---------- auditoria ---------- */
.aud-filtros { display: grid; grid-template-columns: repeat(3, 1fr) 1.4fr; gap: 8px; }
.aud-busca { display: flex; gap: 8px; }
.aud-busca .busca { margin: 0; min-height: 42px; }
.aud-busca .btn { min-width: 44px; font-size: 18px; padding: 0 12px; }
.aud-filtros .sel-app { width: 100%; min-height: 42px; }
.aud-total { margin: 10px 0 6px; }
.aud-rolagem { padding: 0 14px; }
.aud-dia h3 {
  position: sticky; top: 0; z-index: 1; margin: 0; padding: 10px 0 6px; background: var(--surface);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700;
}
.aud-dia ul { list-style: none; margin: 0 0 6px; padding: 0; }
.aud-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.aud-dia:last-child .aud-item:last-child { border-bottom: 0; }
.aud-av { width: 34px; height: 34px; border-radius: 50%; font-size: 12px; background: var(--surface-2); color: var(--ink-2); position: relative; }
.aud-av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: var(--royal); }
.aud-criou .aud-av::after { background: var(--good); }
.aud-apagou .aud-av::after { background: var(--neg); }
.aud-linha { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 15px; }
.aud-linha b { font-weight: 600; }
.aud-acao { color: var(--ink-2); }
.aud-onde { align-self: center; }
.aud-hora { margin-left: auto; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.aud-sobre { font-size: 15px; margin-top: 2px; }
.aud-mud { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.aud-mud b { color: var(--ink); }
.aud-campo { color: var(--ink-3); }
.vazio-aud { padding: 28px 12px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 10px; }
@media (max-width: 760px) {
  .aud-filtros { grid-template-columns: 1fr 1fr; }
  .aud-busca { grid-column: 1 / -1; }
  #audQuem { grid-column: 1 / -1; }
}
/* No escuro o marinho do desenvolvedor some no fundo: ganha um anel. */
:root[data-theme="dark"] .acesso.papel-desenvolvedor .avatar { box-shadow: 0 0 0 1.5px var(--ink-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .acesso.papel-desenvolvedor .avatar { box-shadow: 0 0 0 1.5px var(--ink-3); } }
