/* ===========================================================================
   O TEMA DO PAINEL — escuro, sóbrio, "tech" (pedido do dono, 19/10/2026:
   "deixe no padrão sofisticado e tech, foque na usabilidade").

   UM LUGAR SÓ para cor, fonte, cartão, tabela, botão e campo. Antes cada tela
   tinha o seu claro-ou-escuro e o seu tom de azul; a pessoa trocava de tela e
   parecia ter trocado de sistema. As telas agora só cuidam do que é delas
   (o layout), e pegam daqui o resto.

   As regras de componente valem dentro de `body.tema`. A TV e as estações usam
   só as variáveis (`:root`): elas têm desenho próprio, feito para ser lido de
   longe ou de pé.
=========================================================================== */
:root {
  --fundo: #060a13;
  --fundo-2: #0a1120;
  --superficie: rgba(17, 25, 44, .86);
  --superficie-solida: #111a2c;
  --superficie-2: #152037;
  --superficie-3: #1b2945;
  --borda: rgba(148, 163, 184, .13);
  --borda-forte: rgba(148, 163, 184, .26);
  --texto: #e7eefb;
  --texto-2: #a9b8d0;
  --texto-3: #70809a;
  --ciano: #22d3ee;
  --azul: #3b82f6;
  --indigo: #818cf8;
  --violeta: #a78bfa;
  --verde: #34d399;
  --ambar: #fbbf24;
  --laranja: #fb923c;
  --vermelho: #f87171;
  --grad: linear-gradient(135deg, #22d3ee 0%, #3b82f6 48%, #8b5cf6 100%);
  --grad-botao: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --sombra: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 14px 34px rgba(0, 0, 0, .34);
  --raio: 16px;
  --raio-p: 10px;
  --fonte: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fonte-tit: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
}

html { color-scheme: dark; }
body.tema {
  margin: 0; min-height: 100vh; font-family: var(--fonte); color: var(--texto);
  background: var(--fundo);
  background-image:
    radial-gradient(1100px 620px at -10% -20%, rgba(34, 211, 238, .08), transparent 60%),
    radial-gradient(900px 540px at 110% -10%, rgba(139, 92, 246, .10), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.tema *, .tema *::before, .tema *::after { box-sizing: border-box; }
.tema a { color: var(--ciano); }
.tema ::selection { background: rgba(34, 211, 238, .3); }
.tema ::-webkit-scrollbar { width: 10px; height: 10px; }
.tema ::-webkit-scrollbar-thumb { background: #22304d; border-radius: 10px; border: 2px solid var(--fundo); }
.tema ::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------ o topo --- */
.app-topo {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center;
  gap: 10px 14px; padding: 10px 20px; flex-wrap: wrap;
  background: rgba(6, 10, 19, .8); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--borda);
}
.app-marca, .tema a.app-marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texto); }
.app-logo {
  width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid;
  place-items: center; color: #07101f; font-weight: 900; font-size: 15px; letter-spacing: -.02em;
  box-shadow: 0 0 20px rgba(59, 130, 246, .45);
}
.app-marca b { display: block; font-size: 12.5px; letter-spacing: .16em; line-height: 1.1; }
.app-marca small { display: block; font-size: 11px; color: var(--texto-3); letter-spacing: .04em; }
.app-sep { width: 1px; height: 26px; background: var(--borda-forte); }
.app-titulo { font-family: var(--fonte-tit); font-size: 19px; font-weight: 700; margin: 0; white-space: nowrap; }
.app-titulo small { font-size: 13px; color: var(--texto-3); font-weight: 400; margin-left: 8px; }
/* A navegação mora numa linha só dela, sempre: o topo tem o mesmo desenho em
   toda tela, e o nome de quem entrou não pula de linha conforme o título. */
.app-nav { order: 3; flex-basis: 100%; display: flex; gap: 2px; flex-wrap: wrap; margin: 0 -4px; }
.app-nav a {
  color: var(--texto-2); text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; border: 1px solid transparent; transition: all .15s;
}
.app-nav a:hover { color: var(--texto); background: rgba(148, 163, 184, .08); }
.app-nav a.ativo {
  color: #fff; background: rgba(59, 130, 246, .16); border-color: rgba(59, 130, 246, .5);
  box-shadow: 0 0 18px rgba(59, 130, 246, .2);
}
.app-nav a.admin { color: var(--ambar); }
.app-nav a.admin.ativo { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .45); color: #fde68a; box-shadow: none; }
.app-usuario { order: 2; margin-left: auto; display: flex; align-items: center; gap: 9px; padding-left: 12px;
  border-left: 1px solid var(--borda); }
.app-usuario .avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--superficie-3); border: 1px solid var(--borda-forte); color: var(--ciano);
  font-size: 12px; font-weight: 800;
}
.app-usuario span { font-size: 13px; font-weight: 600; }
.app-usuario a { color: var(--texto-3); font-size: 12.5px; text-decoration: none; }
.app-usuario a:hover { color: var(--vermelho); }

/* ← Voltar / ☰ Menu */
.volta-menu { display: inline-flex; gap: 6px; align-items: center; }
.volta-menu a {
  margin: 0; color: var(--texto-2); text-decoration: none; font-size: 13px; font-weight: 700;
  border: 1px solid var(--borda-forte); padding: 6px 11px; border-radius: 9px; white-space: nowrap;
  background: rgba(148, 163, 184, .05); transition: all .15s;
}
.volta-menu a:hover { color: var(--texto); border-color: var(--ciano); background: rgba(34, 211, 238, .08); }

/* --------------------------------------------------------- o conteúdo --- */
.tema .caixa { max-width: 1240px; margin: 22px auto 40px; padding: 0 20px; }
.tema .card {
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--sombra);
}
.tema .card h2 {
  display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--texto-2);
}
.tema .card h2::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--grad); flex: none;
  box-shadow: 0 0 10px rgba(34, 211, 238, .6);
}
.tema .dica { color: var(--texto-2); font-size: 14px; line-height: 1.6; }
.tema .dica b { color: var(--texto); }
.tema .vazio { color: var(--texto-3); font-size: 14px; padding: 6px 0; }
.tema label { color: var(--texto-2); }

/* botões */
.tema button, .tema .botao {
  font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--grad-botao); color: #fff; border: 1px solid rgba(129, 140, 248, .45);
  padding: 10px 17px; border-radius: var(--raio-p); font-size: 14.5px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: transform .08s, box-shadow .15s, filter .15s;
  box-shadow: 0 6px 18px rgba(59, 130, 246, .25);
}
.tema button:hover, .tema .botao:hover { filter: brightness(1.1); box-shadow: 0 8px 24px rgba(79, 70, 229, .35); }
.tema button:active, .tema .botao:active { transform: translateY(1px); }
.tema button:disabled { opacity: .5; cursor: wait; }
.tema button.cinza, .tema .botao.cinza {
  background: var(--superficie-2); border-color: var(--borda-forte); color: var(--texto); box-shadow: none;
}
.tema button.cinza:hover, .tema .botao.cinza:hover { border-color: var(--ciano); }
.tema button.perigo, .tema .botao.perigo { background: linear-gradient(135deg, #dc2626, #b91c1c); border-color: rgba(248, 113, 113, .5); box-shadow: 0 6px 18px rgba(220, 38, 38, .25); }
.tema button.ambar, .tema .botao.ambar { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: rgba(251, 191, 36, .5); color: #1c1307; box-shadow: 0 6px 18px rgba(245, 158, 11, .25); }
.tema button.pequeno, .tema .botao.pequeno { padding: 6px 11px; font-size: 13px; border-radius: 8px; }

/* campos */
.tema input[type=text], .tema input[type=password], .tema input[type=number],
.tema input[type=search], .tema input[type=datetime-local], .tema input[type=date], .tema input:not([type]),
.tema select, .tema textarea {
  background: var(--superficie-2); color: var(--texto); border: 1px solid var(--borda-forte);
  border-radius: var(--raio-p); padding: 10px 12px; font-size: 15px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.tema input:focus, .tema select:focus, .tema textarea:focus {
  border-color: var(--ciano); box-shadow: 0 0 0 3px rgba(34, 211, 238, .16);
}
.tema input::placeholder { color: var(--texto-3); }
.tema input[type=checkbox] { accent-color: var(--azul); width: 16px; height: 16px; }

/* tabelas */
.tema .tabela { overflow-x: auto; }
.tema table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tema th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--texto-3); padding: 8px 10px; border-bottom: 1px solid var(--borda-forte); white-space: nowrap;
}
.tema td { padding: 10px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tema tbody tr { transition: background .12s; }
.tema tbody tr:hover td { background: rgba(148, 163, 184, .05); }
.tema td.num { font-weight: 800; font-variant-numeric: tabular-nums; }

/* selos */
.tema .chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 700; background: rgba(148, 163, 184, .12); color: var(--texto-2);
  border: 1px solid transparent; white-space: nowrap;
}
.tema .chip.verde { background: rgba(52, 211, 153, .12); color: #6ee7b7; border-color: rgba(52, 211, 153, .3); }
.tema .chip.ambar { background: rgba(251, 191, 36, .12); color: #fcd34d; border-color: rgba(251, 191, 36, .3); }
.tema .chip.vermelho { background: rgba(248, 113, 113, .12); color: #fca5a5; border-color: rgba(248, 113, 113, .3); }
.tema .chip.azul { background: rgba(59, 130, 246, .14); color: #93c5fd; border-color: rgba(59, 130, 246, .35); }
.tema .chip.indigo { background: rgba(129, 140, 248, .14); color: #c7d2fe; border-color: rgba(129, 140, 248, .35); }

/* recados */
.tema .msg { border-radius: 12px; padding: 11px 14px; margin-bottom: 16px; font-weight: 600; font-size: 14.5px; }
.tema .msg.ok { background: rgba(52, 211, 153, .1); color: #a7f3d0; border: 1px solid rgba(52, 211, 153, .35); }
.tema .msg.erro { background: rgba(248, 113, 113, .1); color: #fecaca; border: 1px solid rgba(248, 113, 113, .4); }
.tema .aviso { background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .32); color: #fde68a;
  border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.55; }

/* números grandes (painéis) */
.tema .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tema .kpi {
  position: relative; overflow: hidden; background: var(--superficie); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 15px 16px 14px; box-shadow: var(--sombra);
}
.tema .kpi::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--cor, var(--grad));
  box-shadow: 0 0 14px var(--cor, rgba(59, 130, 246, .7));
}
.tema .kpi b { display: block; font-family: var(--fonte-tit); font-size: 36px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tema .kpi span { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-2); }
.tema .kpi small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--texto-3); }
.tema .kpi.alerta b { color: var(--vermelho); text-shadow: 0 0 18px rgba(248, 113, 113, .35); }

@media (max-width: 760px) {
  .app-topo { padding: 10px 14px; }
  .app-nav { overflow-x: auto; flex-wrap: nowrap; }
  .app-sep, .app-marca small { display: none; }
  .tema .caixa { padding: 0 14px; }
}
