/* ===================================================================
   Painel — estilo
   Mesa de operação: tipografia firme, números tabulares, uma cor por bot.
   Tema claro/escuro segue o sistema; o botão de tema força um dos dois.
   =================================================================== */

:root {
  --fundo: #f4f3ef;
  --superficie: #fbfaf7;
  --superficie-2: #efede7;
  --linha: #e2dfd7;
  --linha-forte: #cfcbc0;
  --texto: #1b1c1e;
  --texto-2: #55575c;
  --texto-3: #8a8c91;
  --tinta: #111214;
  --positivo: #17803d;
  --positivo-fundo: #e3f1e6;
  --negativo: #b42318;
  --negativo-fundo: #f8e4e1;
  --atencao: #a15c00;
  --atencao-fundo: #f6ead6;
  --foco: #2458d6;
  --sombra: 0 1px 0 rgba(17, 18, 20, .04), 0 8px 24px -12px rgba(17, 18, 20, .12);
  --sombra-modal: 0 24px 64px -16px rgba(17, 18, 20, .35);

  --bot-recarga: #1f9d55;
  --bot-wpp: #2f6fd6;
  --bot-ssh: #7a52c7;
  --bot-ios: #c08a12;
  --bot-revenda: #d4573b;

  --raio: 10px;
  --raio-p: 6px;
  --lateral: 248px;
  --topo: 64px;
  --fonte: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fonte-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --fundo: #0b0c0e;
    --superficie: #121417;
    --superficie-2: #181b1f;
    --linha: #22262c;
    --linha-forte: #2f343b;
    --texto: #ecebe6;
    --texto-2: #a3a6ad;
    --texto-3: #6d7179;
    --tinta: #f4f3ef;
    --positivo: #4cc27a;
    --positivo-fundo: rgba(76, 194, 122, .12);
    --negativo: #f07167;
    --negativo-fundo: rgba(240, 113, 103, .12);
    --atencao: #e8a948;
    --atencao-fundo: rgba(232, 169, 72, .12);
    --foco: #7aa2ff;
    --sombra: 0 1px 0 rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .6);
    --sombra-modal: 0 24px 80px -12px rgba(0, 0, 0, .8);
    --bot-recarga: #45c27a;
    --bot-wpp: #5b93ef;
    --bot-ssh: #a383e6;
    --bot-ios: #e0ad3a;
    --bot-revenda: #ee7a5e;
    color-scheme: dark;
  }
}
:root[data-tema="escuro"] {
  --fundo: #0b0c0e;
  --superficie: #121417;
  --superficie-2: #181b1f;
  --linha: #22262c;
  --linha-forte: #2f343b;
  --texto: #ecebe6;
  --texto-2: #a3a6ad;
  --texto-3: #6d7179;
  --tinta: #f4f3ef;
  --positivo: #4cc27a;
  --positivo-fundo: rgba(76, 194, 122, .12);
  --negativo: #f07167;
  --negativo-fundo: rgba(240, 113, 103, .12);
  --atencao: #e8a948;
  --atencao-fundo: rgba(232, 169, 72, .12);
  --foco: #7aa2ff;
  --sombra: 0 1px 0 rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .6);
  --sombra-modal: 0 24px 80px -12px rgba(0, 0, 0, .8);
  --bot-recarga: #45c27a;
  --bot-wpp: #5b93ef;
  --bot-ssh: #a383e6;
  --bot-ios: #e0ad3a;
  --bot-revenda: #ee7a5e;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--fonte);
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mono { font-family: var(--fonte-mono); font-size: .92em; }
.mudo { color: var(--texto-2); }
.mudo-3 { color: var(--texto-3); }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: var(--lateral) 1fr; min-height: 100vh; min-height: 100dvh;
  /* fundo da coluna do menu vai até o fim da página, mesmo rolando */
  background: linear-gradient(90deg, var(--superficie) calc(var(--lateral) - 1px), var(--linha) calc(var(--lateral) - 1px), var(--linha) var(--lateral), transparent var(--lateral)); }

.lateral {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--linha);
  background: var(--superficie);
  padding: 18px 12px 12px;
  overflow-y: auto;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; text-decoration: none; }
.marca svg { width: 28px; height: 28px; flex: none; }
.marca .m-fundo { fill: var(--tinta); }
.marca .m-barra { fill: var(--fundo); }
.marca .m-destaque { fill: var(--positivo); }
.marca b { font-size: 15px; letter-spacing: -.02em; font-weight: 650; }
.marca span { display: block; font-size: 11.5px; color: var(--texto-3); margin-top: -2px; letter-spacing: .01em; }

.nav-titulo { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-3); padding: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin: 1px 0;
  border-radius: var(--raio-p);
  text-decoration: none; color: var(--texto-2);
  font-weight: 500;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--superficie-2); color: var(--texto); }
.nav a[aria-current="page"] { background: var(--superficie-2); color: var(--texto); box-shadow: inset 2px 0 0 var(--tinta); }
.nav a svg { width: 17px; height: 17px; flex: none; stroke-width: 1.7; }
.nav a > span:not(.lado) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a .lado { margin-left: auto; font-size: 12px; color: var(--texto-3); flex: none; }
.nav .bot-cor { width: 8px; height: 8px; border-radius: 2px; flex: none; margin: 0 4.5px; }

.lateral-pe { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--linha); font-size: 12px; color: var(--texto-3); }
.lateral-pe .quem { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--texto-2); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topo {
  position: sticky; top: 0; z-index: 20;
  height: var(--topo);
  display: flex; align-items: center; gap: 12px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--fundo) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--linha);
}
.topo h1 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .acoes-topo { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ao-vivo { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--texto-3); white-space: nowrap; }
.ao-vivo i { width: 7px; height: 7px; border-radius: 50%; background: var(--positivo); box-shadow: 0 0 0 0 var(--positivo); animation: pulso 2.4s infinite; }
.ao-vivo.parado i { background: var(--texto-3); animation: none; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--positivo) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.conteudo { padding: 28px 32px 64px; max-width: 1440px; width: 100%; }
.conteudo:focus { outline: none; }

/* ---------- botões ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--linha-forte);
  border-radius: var(--raio-p);
  background: var(--superficie);
  color: var(--texto);
  font-weight: 550; font-size: 13px;
  white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.botao:hover { background: var(--superficie-2); }
.botao:active { transform: translateY(1px); }
.botao:disabled { opacity: .5; cursor: not-allowed; }
.botao svg { width: 15px; height: 15px; stroke-width: 1.9; }
.botao.primario { background: var(--tinta); border-color: var(--tinta); color: var(--fundo); }
.botao.primario:hover { background: color-mix(in srgb, var(--tinta) 86%, var(--fundo)); }
.botao.perigo { color: var(--negativo); border-color: color-mix(in srgb, var(--negativo) 35%, var(--linha-forte)); }
.botao.perigo:hover { background: var(--negativo-fundo); }
.botao.sutil { border-color: transparent; background: transparent; color: var(--texto-2); }
.botao.sutil:hover { background: var(--superficie-2); color: var(--texto); }
.botao.icone { width: 34px; padding: 0; }
.botao.grande { height: 44px; font-size: 14.5px; padding: 0 18px; width: 100%; }

.selo {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--superficie-2); color: var(--texto-2);
  white-space: nowrap;
}
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo.sem-ponto::before { display: none; }
.selo.ok { background: var(--positivo-fundo); color: var(--positivo); }
.selo.ruim { background: var(--negativo-fundo); color: var(--negativo); }
.selo.alerta { background: var(--atencao-fundo); color: var(--atencao); }

.elevado { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--atencao-fundo); color: var(--atencao); white-space: nowrap; }
.elevado svg { width: 14px; height: 14px; }

/* ---------- blocos ---------- */
.cabecalho-pagina { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cabecalho-pagina h2 { font-size: 26px; letter-spacing: -.03em; font-weight: 650; margin: 0; line-height: 1.15; }
.cabecalho-pagina p { margin: 4px 0 0; color: var(--texto-2); }
.cabecalho-pagina .lado { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.quadro {
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  min-width: 0;
}
.quadro > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.quadro > header h3 { font-size: 13.5px; font-weight: 650; margin: 0; letter-spacing: -.005em; }
.quadro > header .sub { font-size: 12.5px; color: var(--texto-3); }
.quadro .corpo { padding: 16px 20px 20px; }
.quadro .corpo.sem-lado { padding-left: 0; padding-right: 0; }

.grade { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.espaco { height: 16px; }

/* ---------- números de destaque ---------- */
.indicadores {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra);
  margin-bottom: 16px;
}
.indicador { padding: 18px 20px 20px; min-width: 0; }
.indicador + .indicador { border-left: 1px solid var(--linha); }
.indicador .rotulo { font-size: 12.5px; color: var(--texto-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.indicador .valor { font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1.15; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.indicador .valor small { font-size: .5em; font-weight: 550; color: var(--texto-3); letter-spacing: 0; margin-right: 3px; vertical-align: .55em; }
.indicador .rodape { margin-top: 6px; font-size: 12.5px; color: var(--texto-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.variacao { font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; }
.variacao.sobe { color: var(--positivo); }
.variacao.desce { color: var(--negativo); }
.variacao svg { width: 12px; height: 12px; stroke-width: 2.4; }

/* ---------- tabelas ---------- */
.tabela-rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-weight: 550; font-size: 11.5px; color: var(--texto-3);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 0 12px 10px; white-space: nowrap; border-bottom: 1px solid var(--linha);
}
td { padding: 11px 12px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td.d, th.d { text-align: right; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: color-mix(in srgb, var(--superficie-2) 60%, transparent); }
.celula-bot { display: flex; align-items: center; gap: 10px; min-width: 0; }
.celula-bot .bot-cor { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.celula-bot b { font-weight: 600; }
.celula-bot span { color: var(--texto-3); font-size: 12px; }
.linha-link { cursor: pointer; }
.vazio { padding: 36px 20px; text-align: center; color: var(--texto-3); }

/* ---------- gráfico ---------- */
.grafico { position: relative; width: 100%; }
.grafico svg { display: block; width: 100%; height: 240px; overflow: visible; }
.grafico .eixo { fill: var(--texto-3); font-size: 11px; font-family: var(--fonte); }
.grafico .grade-linha { stroke: var(--linha); stroke-width: 1; shape-rendering: crispEdges; }
.grafico .barra { transition: opacity .15s; }
.grafico.focando .barra { opacity: .35; }
.grafico.focando .barra.ativa { opacity: 1; }
.grafico .alvo { fill: transparent; cursor: crosshair; }
.dica {
  position: absolute; pointer-events: none; z-index: 5;
  min-width: 180px; padding: 10px 12px;
  background: var(--tinta); color: var(--fundo);
  border-radius: 8px; font-size: 12px; box-shadow: var(--sombra-modal);
  transform: translate(-50%, calc(-100% - 10px));
}
.dica b { display: block; font-size: 12px; margin-bottom: 6px; opacity: .75; font-weight: 550; }
.dica .l { display: flex; align-items: center; gap: 8px; justify-content: space-between; line-height: 1.7; }
.dica .l i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.dica .t { border-top: 1px solid color-mix(in srgb, var(--fundo) 25%, transparent); margin-top: 6px; padding-top: 6px; font-weight: 650; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--texto-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 9px; height: 9px; border-radius: 2px; }

.horas { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; align-items: end; height: 92px; }
.horas div { background: var(--tinta); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.horas-eixo { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10.5px; color: var(--texto-3); margin-top: 6px; }
.horas-eixo span:nth-child(6n+1) { visibility: visible; }
.horas-eixo span { visibility: hidden; }

/* ---------- lista de vendas ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 20px; border-top: 1px solid var(--linha); }
.feed li:first-child { border-top: 0; }
.feed .bot-cor { width: 8px; height: 30px; border-radius: 3px; }
.feed .o-que { min-width: 0; }
.feed .o-que b { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .o-que span { font-size: 12px; color: var(--texto-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.feed .quanto { text-align: right; }
.feed .quanto b { display: block; font-weight: 600; }
.feed .quanto span { font-size: 12px; color: var(--texto-3); }

/* ---------- pares (chave/valor) ---------- */
.pares { display: grid; grid-template-columns: 1fr auto; gap: 0; margin: 0; }
.pares dt, .pares dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--linha); }
.pares dt { color: var(--texto-2); }
.pares dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pares dt:first-of-type, .pares dt:first-of-type + dd { border-top: 0; }

/* ---------- medidores ---------- */
.medidor { margin-bottom: 18px; }
.medidor:last-child { margin-bottom: 0; }
.medidor .topo-m { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.medidor .topo-m span { color: var(--texto-2); }
.trilho { height: 6px; background: var(--superficie-2); border-radius: 999px; overflow: hidden; }
.trilho div { height: 100%; background: var(--tinta); border-radius: 999px; transition: width .4s; }
.trilho.alto div { background: var(--atencao); }
.trilho.critico div { background: var(--negativo); }

/* ---------- interruptor ---------- */
.interruptor { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 550; }
.interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.interruptor .trilho-i { width: 36px; height: 20px; border-radius: 999px; background: var(--linha-forte); position: relative; transition: background .15s; flex: none; }
.interruptor .trilho-i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--superficie); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.interruptor input:checked + .trilho-i { background: var(--atencao); }
.interruptor input:checked + .trilho-i::after { transform: translateX(16px); }
.interruptor.verde input:checked + .trilho-i { background: var(--positivo); }
.interruptor input:focus-visible + .trilho-i { outline: 2px solid var(--foco); outline-offset: 2px; }

/* ---------- formulários ---------- */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-size: 12.5px; font-weight: 550; color: var(--texto-2); margin-bottom: 6px; }
.entrada {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--linha-forte); border-radius: var(--raio-p);
  background: var(--superficie); color: var(--texto);
  transition: border-color .12s, box-shadow .12s;
}
.entrada:focus { outline: none; border-color: var(--foco); box-shadow: 0 0 0 3px color-mix(in srgb, var(--foco) 22%, transparent); }
.entrada.pequena { height: 32px; font-size: 13px; padding: 0 9px; }
.entrada.preco { width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.entrada.codigo { font-family: var(--fonte-mono); font-size: 26px; letter-spacing: .45em; text-align: center; height: 58px; padding-left: .45em; }
select.entrada { padding-right: 28px; }
.busca { position: relative; }
.busca svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--texto-3); pointer-events: none; }
.busca .entrada { padding-left: 32px; }

.abas { display: flex; gap: 2px; padding: 3px; background: var(--superficie-2); border-radius: 8px; width: max-content; max-width: 100%; overflow-x: auto; }
.abas button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; font-weight: 550; color: var(--texto-2); white-space: nowrap; }
.abas button[aria-selected="true"] { background: var(--superficie); color: var(--texto); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- avisos ---------- */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--raio-p); font-size: 13px; background: var(--atencao-fundo); color: var(--atencao); margin-bottom: 16px; }
.aviso.ruim { background: var(--negativo-fundo); color: var(--negativo); }
.aviso.ok { background: var(--positivo-fundo); color: var(--positivo); }
.aviso svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.aviso b { font-weight: 650; }

/* ---------- logs ---------- */
.terminal {
  font-family: var(--fonte-mono); font-size: 12px; line-height: 1.6;
  background: #0a0b0c; color: #d7d5cf;
  border-radius: 0 0 var(--raio) var(--raio);
  padding: 14px 0; max-height: 64vh; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}
.terminal div { padding: 0 20px; }
.terminal div:hover { background: rgba(255,255,255,.04); }
.terminal .erro { color: #ff8f86; }
.terminal .nada { color: #6d7179; padding: 20px; }

/* ---------- modal ---------- */
.veu { position: fixed; inset: 0; z-index: 100; background: rgba(8, 9, 10, .55); display: grid; place-items: center; padding: 16px; animation: aparecer .14s ease-out; }
.modal { width: min(420px, 100%); background: var(--superficie); border: 1px solid var(--linha); border-radius: 14px; box-shadow: var(--sombra-modal); padding: 24px; animation: subir .18s cubic-bezier(.2, .9, .3, 1.2); }
.modal h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.02em; }
.modal p { margin: 0 0 18px; color: var(--texto-2); }
.modal .botoes-modal { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal .erro-modal { color: var(--negativo); font-size: 13px; min-height: 20px; margin-top: 8px; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.notas { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.nota { background: var(--tinta); color: var(--fundo); padding: 11px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: var(--sombra-modal); max-width: 360px; animation: subir .18s ease-out; }
.nota.ruim { background: var(--negativo); color: #fff; }

/* ---------- carregando ---------- */
.esqueleto { background: linear-gradient(90deg, var(--superficie-2) 0%, var(--linha) 50%, var(--superficie-2) 100%); background-size: 200% 100%; animation: brilho 1.3s infinite; border-radius: 6px; }
@keyframes brilho { to { background-position: -200% 0; } }

/* ---------- tela de entrada ---------- */
.entrar { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.entrar-lado {
  position: relative; overflow: hidden;
  background: #0c0d0f; color: #ecebe6;
  padding: 40px 48px; display: flex; flex-direction: column;
}
.entrar-lado .marca b { color: #ecebe6; }
.entrar-lado .marca span { color: #6d7179; }
.entrar-lado .frase { margin-top: auto; max-width: 420px; }
.entrar-lado .frase p { font-size: 28px; line-height: 1.2; letter-spacing: -.03em; font-weight: 600; margin: 0 0 14px; }
.entrar-lado .frase small { color: #8b8f97; font-size: 13px; }
.entrar-lado .linhas { position: absolute; inset: 0; opacity: .5; pointer-events: none; }
.entrar-lado .linhas svg { width: 100%; height: 100%; }
.entrar-form { display: grid; place-items: center; padding: 32px 24px; }
.entrar-caixa { width: min(360px, 100%); }
.entrar-caixa h1 { font-size: 24px; letter-spacing: -.03em; margin: 0 0 6px; font-weight: 650; }
.entrar-caixa > p { margin: 0 0 26px; color: var(--texto-2); }
.entrar-caixa .erro-entrar { min-height: 22px; color: var(--negativo); font-size: 13px; margin: -4px 0 10px; }
.entrar-caixa .rodape-entrar { margin-top: 28px; font-size: 12px; color: var(--texto-3); display: flex; gap: 8px; align-items: center; }
.entrar-caixa .rodape-entrar svg { width: 14px; height: 14px; }
.link-botao { border: 0; background: none; padding: 0; color: var(--texto-2); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }

/* ---------- barra inferior (celular) ---------- */
.barra-baixo { display: none; }
.menu-mais { display: none; }

/* ===================================================================
   Responsivo
   =================================================================== */
@media (max-width: 1180px) {
  .indicadores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .indicador:nth-child(3) { border-left: 0; }
  .indicador:nth-child(n+3) { border-top: 1px solid var(--linha); }
  .g-21 { grid-template-columns: minmax(0, 1fr); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .lateral { display: none; }
  .topo { padding: 0 16px; height: 56px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .topo .ao-vivo span { display: none; }
  .conteudo { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .cabecalho-pagina h2 { font-size: 22px; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .indicador { padding: 14px 16px 16px; }
  .indicador .valor { font-size: 24px; }
  .quadro > header { padding: 14px 16px 0; }
  .quadro .corpo { padding: 14px 16px 16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .feed li { padding: 11px 16px; }
  .esconde-cel { display: none; }
  .celula-bot span { display: none; }
  .grafico svg { height: 200px; }
  .botao { height: 38px; }
  .botao.icone { width: 38px; }
  .terminal { font-size: 11.5px; max-height: 70vh; }
  .terminal div { padding: 0 14px; }

  .barra-baixo {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--superficie) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--linha);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .barra-baixo a, .barra-baixo button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 58px; border: 0; background: none; text-decoration: none;
    font-size: 11px; font-weight: 550; color: var(--texto-3);
  }
  .barra-baixo svg { width: 21px; height: 21px; stroke-width: 1.7; }
  .barra-baixo [aria-current="page"] { color: var(--texto); }

  .menu-mais[data-aberto] {
    display: block; position: fixed; left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 40;
    background: var(--superficie); border: 1px solid var(--linha); border-radius: 14px; box-shadow: var(--sombra-modal);
    padding: 8px; animation: subir .16s ease-out;
  }
  .menu-mais a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; text-decoration: none; font-weight: 550; }
  .menu-mais a:active { background: var(--superficie-2); }
  .menu-mais svg { width: 18px; height: 18px; stroke-width: 1.7; color: var(--texto-2); }
  .menu-mais .bot-cor { width: 10px; height: 10px; border-radius: 3px; margin: 0 4px; }
  .menu-mais hr { border: 0; border-top: 1px solid var(--linha); margin: 6px 4px; }

  .entrar { grid-template-columns: minmax(0, 1fr); }
  .entrar-lado { display: none; }
  .notas { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); align-items: stretch; }
  .nota { max-width: none; }
}

@media (max-width: 420px) {
  .indicador .valor { font-size: 21px; }
  .cabecalho-pagina .lado { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
