/* Painel da Fábrica · tema escuro de sala de controle.
   Cores de dado: um azul só para quantidade (rampa clara→escura) e a paleta de estado (bom/atenção/sério/crítico),
   sempre com ícone e texto junto. Texto usa as tintas de texto, nunca a cor do dado. */
:root {
  color-scheme: dark;
  --fundo: #12141c;
  --surface-1: #1a1d28;
  --surface-2: #222636;
  --surface-3: #2b3044;
  --borda: #323852;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #8e93a6;
  --series-1: #3987e5;            /* quantidade */
  --seq-1: #184f95; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #6da7ec; --seq-5: #9ec5f4;
  --series-2: #d95926;            /* "ao vivo" */
  --bom: #0ca30c; --atencao: #fab219; --serio: #ec835a; --critico: #d03b3b;
  --ouro: #e7c36a;                /* estrelas e troféus (enfeite, não dado) */
  --raio: 16px;
  --sombra: 0 10px 30px rgba(0, 0, 0, .35);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--text-primary); }
body { min-height: 100vh; background:
  radial-gradient(900px 500px at 85% -10%, rgba(57, 135, 229, .16), transparent 60%),
  radial-gradient(700px 420px at -10% 10%, rgba(217, 89, 38, .10), transparent 60%), var(--fundo); background-attachment: fixed; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--seq-4); }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- entrada ---------- */
.porta { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.porta .caixa { width: min(420px, 100%); background: var(--surface-1); border: 1px solid var(--borda); border-radius: 24px; padding: 28px; box-shadow: var(--sombra); text-align: center; }
.porta .emblema { font-size: 54px; line-height: 1; }
.porta h1 { font-size: 24px; margin: 10px 0 6px; }
.porta p { color: var(--text-secondary); font-size: 15px; line-height: 1.45; }
.porta input { width: 100%; margin: 18px 0 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--borda); background: var(--surface-2); font-size: 17px; text-align: center; letter-spacing: .04em; }
.porta input:focus { outline: 2px solid var(--series-1); outline-offset: 1px; }
.porta .erro { color: var(--text-primary); background: rgba(208, 59, 59, .18); border: 1px solid var(--critico); border-radius: 12px; padding: 10px; margin-bottom: 12px; font-size: 14px; }
.btn { border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 800; background: var(--series-1); color: #fff; box-shadow: 0 4px 0 #1c5cab; transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1c5cab; }
.btn.largo { width: 100%; }
.btn.calmo { background: var(--surface-3); box-shadow: 0 4px 0 #1b1f2e; }

/* ---------- casca ---------- */
.painel { max-width: 1360px; margin: 0 auto; padding: 16px 16px 80px; }
.hud { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; background: linear-gradient(var(--fundo) 72%, transparent); }
.hud .marca { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.hud .marca .emb { font-size: 28px; }
.hud .marca b { font-size: 18px; display: block; line-height: 1.1; }
.hud .marca small { color: var(--text-muted); font-size: 12px; }
.seg { display: inline-flex; background: var(--surface-1); border: 1px solid var(--borda); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--text-secondary); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-primary); }
.chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-1); border: 1px solid var(--borda); border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 13px; color: var(--text-secondary); }
button.chip[aria-pressed="true"] { color: var(--text-primary); border-color: var(--series-1); }
.vivo { color: var(--text-primary); }
.vivo i { width: 9px; height: 9px; border-radius: 50%; background: var(--series-2); box-shadow: 0 0 0 0 rgba(217, 89, 38, .7); animation: pulso 1.6s infinite; }
.vivo.parado i { background: var(--text-muted); animation: none; }
@keyframes pulso { 70% { box-shadow: 0 0 0 9px rgba(217, 89, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 89, 38, 0); } }
.faixa-demo { background: rgba(250, 178, 25, .14); border: 1px solid var(--atencao); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

.grade { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.cartao { background: var(--surface-1); border: 1px solid var(--borda); border-radius: var(--raio); padding: 16px; min-width: 0; }
.cartao > header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.cartao > header h2 { font-size: 16px; }
.cartao > header small { color: var(--text-muted); font-size: 12.5px; margin-left: auto; text-align: right; }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c7 { grid-column: span 7; } .c6 { grid-column: span 6; } .c5 { grid-column: span 5; } .c4 { grid-column: span 4; }
@media (max-width: 1020px) { .c8, .c7, .c6, .c5, .c4 { grid-column: span 12; } }
.vazio { color: var(--text-muted); font-size: 14px; padding: 18px 6px; text-align: center; line-height: 1.5; }

/* ---------- placar ---------- */
.placar { display: grid; gap: 10px; grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1020px) { .placar { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .placar { grid-template-columns: repeat(2, 1fr); } }
.fase { position: relative; background: var(--surface-1); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px 14px 12px; min-width: 0; }
.fase .rot { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 12.5px; font-weight: 700; }
.fase .valor { font-size: 34px; font-weight: 800; line-height: 1.1; margin-top: 6px; }
.fase .taxa { color: var(--text-secondary); font-size: 12.5px; min-height: 17px; }
.fase .taxa b { color: var(--text-primary); }
.medidor { height: 6px; border-radius: 99px; background: var(--surface-3); margin-top: 9px; position: relative; overflow: visible; }
.medidor > i { display: block; height: 100%; border-radius: 99px; background: var(--series-1); transition: width .5s; }
.medidor > u { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--text-secondary); border-radius: 2px; }
.fase .valor { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.estrelas { font-size: 13px; letter-spacing: 1px; color: var(--surface-3); font-weight: 400; }
.estrelas b { color: var(--ouro); font-weight: 400; }
.fase.nova { animation: brilho 1.1s; }
@keyframes brilho { 0% { box-shadow: 0 0 0 0 rgba(57, 135, 229, .7); } 100% { box-shadow: 0 0 0 16px rgba(57, 135, 229, 0); } }

/* ---------- nível ---------- */
.nivel { display: flex; gap: 16px; align-items: center; }
.anel { --p: 0; width: 92px; height: 92px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--series-1) calc(var(--p) * 1%), var(--surface-3) 0); }
.anel > div { width: 74px; height: 74px; border-radius: 50%; background: var(--surface-1); display: grid; place-items: center; text-align: center; }
.anel b { font-size: 24px; line-height: 1; } .anel small { display: block; font-size: 10px; color: var(--text-muted); }
.nivel h3 { font-size: 18px; } .nivel p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.45; margin-top: 4px; }

/* ---------- missões e diagnóstico ---------- */
.lista { display: grid; gap: 8px; }
.missao { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.missao .ic { font-size: 20px; text-align: center; }
.missao b { font-size: 14px; display: block; } .missao small { color: var(--text-muted); font-size: 12px; }
.missao .q { font-size: 13px; color: var(--text-secondary); font-weight: 700; white-space: nowrap; }
.missao.feita { outline: 1px solid var(--bom); }
.missao .medidor { grid-column: 2 / 4; margin-top: 2px; }
.achado { display: grid; grid-template-columns: 30px 1fr; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 11px 12px; border-left: 4px solid var(--borda); }
.achado.critico { border-left-color: var(--critico); } .achado.serio { border-left-color: var(--serio); }
.achado.atencao { border-left-color: var(--atencao); } .achado.bom { border-left-color: var(--bom); }
.achado .ic { font-size: 19px; text-align: center; }
.achado b { font-size: 14px; display: block; } .achado p { color: var(--text-secondary); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.achado .sel { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 2px; }

/* ---------- mapa da jornada ---------- */
.mapa { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1020px) { .mapa { grid-template-columns: 1fr; } }
.trilha { position: relative; display: grid; gap: 4px; }
.trecho { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 10px 0 2px 44px; }
.no { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1.25fr) minmax(90px, 1fr) 132px; gap: 10px; align-items: center; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 7px 8px; }
.no:hover, .no:focus-visible { background: var(--surface-2); outline: none; }
.no[aria-current="true"] { background: var(--surface-2); border-color: var(--series-1); }
.no::before { content: ""; position: absolute; left: 24px; top: -6px; bottom: -6px; width: 2px; background: var(--surface-3); z-index: 0; }
.no:first-of-type::before { top: 50%; } .no.ultimo::before { bottom: 50%; }
.no .bola { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: var(--surface-3); border: 2px solid var(--fundo); color: var(--text-primary); }
.no .bola[data-e="critico"] { background: var(--critico); } .no .bola[data-e="serio"] { background: var(--serio); color: #1b1309; }
.no .bola[data-e="atencao"] { background: var(--atencao); color: #1b1309; } .no .bola[data-e="bom"] { background: var(--bom); }
.no .txt { min-width: 0; }
.no .txt b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.no .txt small { display: flex; gap: 6px; align-items: center; color: var(--text-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.no .barra { height: 14px; border-radius: 0 4px 4px 0; background: var(--surface-3); position: relative; }
.no .barra > i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; transition: width .5s; }
.no .conta { text-align: right; font-size: 13px; }
.no .conta b { font-size: 15px; } .no .conta small { display: block; color: var(--text-muted); font-size: 11.5px; }
.no .conta small.perde { color: var(--text-secondary); }
.gente { position: absolute; left: 44px; top: -9px; display: flex; gap: 2px; z-index: 2; pointer-events: none; }
.gente span { font-size: 15px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); animation: quica 1.2s infinite; }
.gente span:nth-child(2) { animation-delay: .2s; } .gente span:nth-child(3) { animation-delay: .4s; }
@keyframes quica { 50% { transform: translateY(-3px); } }
@media (max-width: 560px) { .no { grid-template-columns: 34px minmax(0, 1fr) 118px; } .no .barra { grid-column: 2 / 4; grid-row: 2; height: 8px; } }
@media (prefers-reduced-motion: reduce) { .gente span, .vivo i { animation: none; } }

/* celular de prévia com calor */
.previa { position: sticky; top: 76px; }
.fone { background: #0d0f16; border: 2px solid var(--borda); border-radius: 28px; padding: 14px 12px 16px; }
.fone .topo-f { display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 11.5px; font-weight: 700; margin-bottom: 10px; }
.fone .balao { background: var(--surface-2); border-radius: 14px; padding: 11px 12px; font-size: 14px; line-height: 1.4; margin-bottom: 10px; }
.fone .balao .jp { display: block; font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.fone .img { height: 86px; border-radius: 14px; background: var(--surface-3) center/cover; margin-bottom: 10px; }
.opc { position: relative; overflow: hidden; border: 1px solid var(--borda); border-radius: 12px; padding: 9px 11px; margin-bottom: 7px; font-size: 13.5px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; background: var(--surface-1); }
.opc > i { position: absolute; inset: 0 auto 0 0; background: var(--series-1); opacity: .34; border-radius: 0 4px 4px 0; }
.opc > span, .opc > em { position: relative; } .opc > em { font-style: normal; color: var(--text-secondary); font-weight: 700; white-space: nowrap; }
.opc.certa { border-color: var(--bom); }
.fone .botao-f { border-radius: 12px; padding: 10px; text-align: center; font-weight: 800; font-size: 13.5px; background: var(--surface-3); margin-top: 4px; display: flex; justify-content: space-between; }
.fatos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.fato { background: var(--surface-2); border-radius: 12px; padding: 9px 10px; }
.fato small { color: var(--text-muted); font-size: 11.5px; display: block; } .fato b { font-size: 17px; }
.outros { margin-top: 10px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.outros span { display: inline-block; background: var(--surface-2); border-radius: 8px; padding: 2px 8px; margin: 2px 4px 2px 0; }

/* ---------- oferta ---------- */
.of-linha { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(80px, 1fr) 74px; gap: 10px; align-items: center; padding: 7px 4px; font-size: 13.5px; }
.of-linha + .of-linha { border-top: 1px solid var(--surface-2); }
.of-linha .rot { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-linha .barra { height: 12px; background: var(--surface-3); border-radius: 0 4px 4px 0; }
.of-linha .barra > i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.of-linha .q { text-align: right; } .of-linha .q small { color: var(--text-muted); }
.subtit { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 12px 0 4px; }

/* ---------- ranking ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: right; color: var(--text-muted); font-size: 11.5px; font-weight: 700; padding: 6px 8px; white-space: nowrap; }
td { text-align: right; padding: 8px; border-top: 1px solid var(--surface-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
td .mini { display: inline-block; vertical-align: middle; width: 54px; height: 6px; border-radius: 99px; background: var(--surface-3); margin-left: 6px; }
td .mini > i { display: block; height: 100%; border-radius: 99px; background: var(--series-1); }
td small { color: var(--text-muted); }
.rolar { overflow-x: auto; }

/* ---------- ao vivo ---------- */
.agora { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pessoa { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 7px 10px; font-size: 12.5px; }
.pessoa .av { font-size: 20px; } .pessoa b { display: block; font-size: 13px; } .pessoa small { color: var(--text-muted); }
.feed { display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.feed .ev { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 6px 6px; border-radius: 10px; font-size: 13px; }
.feed .ev.novo { animation: entra .6s; background: var(--surface-2); }
.feed .ev.forte { background: rgba(12, 163, 12, .14); }
.feed .ev small { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
.feed .ev span.q { color: var(--text-secondary); }
@keyframes entra { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- horas e aparelhos ---------- */
.horas { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.horas i { display: block; height: 30px; border-radius: 4px; background: var(--surface-3); }
.horas-eixo { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; color: var(--text-muted); font-size: 10px; margin-top: 4px; text-align: center; }
.legenda-seq { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11.5px; margin-top: 8px; }
.legenda-seq i { width: 16px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- caixa ---------- */
.caixa-n { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 560px) { .caixa-n { grid-template-columns: repeat(2, 1fr); } }
.caixa-f { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.caixa-f input { width: 130px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--borda); background: var(--surface-2); }
.caixa-f label { color: var(--text-secondary); font-size: 13px; }
.estado { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; border-radius: 99px; padding: 4px 10px; background: var(--surface-2); }
.estado i { width: 9px; height: 9px; border-radius: 50%; }

#dica { position: fixed; z-index: 60; pointer-events: none; max-width: 260px; background: #0b0d13; border: 1px solid var(--borda); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--sombra); }
#dica b { display: block; margin-bottom: 2px; }
.rodape { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 22px; line-height: 1.6; }
.rodape button { background: none; border: 0; color: var(--seq-4); text-decoration: underline; padding: 0; }

/* ---------- celular ---------- */
.so-cel { display: none; }
@media (max-width: 1020px) { .so-cel { display: block; } .previa { position: static; scroll-margin-top: 12px; } #mapa { scroll-margin-top: 8px; } }
@media (max-width: 700px) { .hud { position: static; } .painel { padding: 10px 12px 60px; } .cartao > header { flex-wrap: wrap; } .cartao > header small { margin-left: 0; text-align: left; flex-basis: 100%; } }

/* ---------- caminho de cada visitante ---------- */
.pessoa-l { background: var(--surface-2); border-radius: 12px; border: 1px solid transparent; }
.pessoa-l.aberta { border-color: var(--series-1); }
.pessoa-l .cab { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center; background: none; border: 0; padding: 9px 12px; text-align: left; border-radius: 12px; }
.pessoa-l .cab:focus-visible { outline: 2px solid var(--series-1); }
.pessoa-l .av { font-size: 22px; text-align: center; }
.pessoa-l b { display: block; font-size: 13.5px; } .pessoa-l small { color: var(--text-muted); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pessoa-l .prog .barra { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--surface-3); margin-bottom: 4px; }
.pessoa-l .prog .barra > i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); }
.pessoa-l .prog small { color: var(--text-secondary); }
.pessoa-l .quando { text-align: right; }
.linha-t { list-style: none; margin: 0; padding: 4px 12px 12px 14px; display: grid; gap: 1px; max-height: 420px; overflow: auto; }
.linha-t li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--surface-3); }
.linha-t small { color: var(--text-muted); font-size: 11.5px; }
@media (max-width: 560px) { .pessoa-l .cab { grid-template-columns: 30px minmax(0, 1fr) auto; } .pessoa-l .prog { grid-column: 2 / 4; grid-row: 2; } }
