/* Painel VICTUS — visual único e escuro: grafite em camadas + o metal da logo.
   Destaque (ícone ativo, links, foco): --steel e --steel-soft.
   Botão principal: --primary. Letras: --f (texto) e --f-mono (DNS, IP, números). */

:root {
  --page: #0A0B0D;
  --app: #0F1114;
  --side: #131519;
  --card: #16191D;
  --card-2: #1B1E23;
  --line: #24282E;
  --line-2: #30353C;
  --ink: #EDEFF2;
  --muted: #A2A8B1;
  --faint: #7A808A;
  --primary: #F1F3F6;
  --primary-hover: #FFFFFF;
  --primary-ink: #0B0C0E;
  --steel: #9FB0C6;
  --steel-soft: #1C222B;
  --ok: #4ADE80;
  --ok-soft: #15261C;
  --warn: #FBBF24;
  --warn-soft: #2A2313;
  --bad: #F87171;
  --bad-soft: #2B1818;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;
  --f: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--app); color: var(--ink); font: 14.5px/1.55 var(--f); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------- Estrutura: menu lateral + área principal ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.lateral { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; }
.marca { display: flex; align-items: center; padding: 4px 10px; }
.marca img { height: 34px; width: auto; max-width: 180px; display: block; }
.grupo { display: grid; gap: 4px; }
.grupo-titulo { padding: 0 12px 6px; font-size: 11.5px; font-weight: 500; color: var(--faint); }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.nav:hover { background: var(--card); color: var(--ink); }
.nav.ativo { background: var(--card-2); color: var(--ink); }
.nav.ativo .ic { color: var(--steel); }
.contador { margin-left: auto; font: 500 11.5px/1 var(--f-mono); color: var(--faint); background: var(--app); padding: 4px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.usuario { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.usuario div { display: grid; line-height: 1.25; min-width: 0; }
.usuario b { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.usuario div span { font-size: 12px; color: var(--faint); }
.sair { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--faint); text-decoration: none; }
.sair .ic { width: 16px; height: 16px; }
.sair:hover { background: var(--bad-soft); color: var(--bad); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--steel-soft); color: var(--steel); font-weight: 600; font-size: 12.5px; text-decoration: none; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.topo { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 32px; border-bottom: 1px solid var(--line); background: var(--app); }
.migalha { font-size: 13px; color: var(--faint); }
.migalha b { color: var(--ink); font-weight: 500; }
.topo-direita { display: flex; align-items: center; gap: 8px; }
.marca-topo, .avatar-topo, .sair-topo { display: none; }
.chip-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12.5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.chip-status.sem { background: var(--bad-soft); color: var(--bad); }
.ponto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulsa 2.4s ease-in-out infinite; }
.chip-status.sem .ponto { animation: none; }
@keyframes pulsa { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.aviso-senha { margin: 20px 32px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, .25); font-size: 14px; }
.aviso-senha b { color: var(--warn); font-weight: 600; }
.aviso-senha .btn { padding: 8px 14px; }

.conteudo { width: 100%; max-width: 1320px; padding: 28px 32px 48px; }
.cabeca { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.cabeca h1 { margin: 0; font: 600 26px/1.15 var(--f); letter-spacing: -.02em; }
.cabeca p { margin: 6px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }

/* ---------- Cartões ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; align-content: start; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-top span { font-size: 13px; color: var(--muted); font-weight: 500; }
.chip-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--steel-soft); color: var(--steel); }
.chip-ic .ic { width: 16px; height: 16px; }
.num { font: 600 30px/1 var(--f); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sub { font-size: 12.5px; color: var(--faint); }
.sub.ok { color: var(--ok); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.col { display: grid; gap: 14px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.card-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.card-cab h2 { margin: 0; font: 600 15px/1.25 var(--f); }
.card-cab p { margin: 3px 0 0; font-size: 12.5px; color: var(--faint); }
.card-corpo { padding: 4px 18px 18px; display: grid; gap: 14px; }
.link { padding: 6px 10px; border-radius: 8px; color: var(--steel); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.link:hover { background: var(--steel-soft); }
.msg { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.msg b { color: var(--ink); font-weight: 600; }
.vazio { margin: 0; padding: 32px 18px; text-align: center; color: var(--faint); font-size: 14px; }
.form-estreito { max-width: 640px; }

.alerta { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; font-weight: 500; margin-bottom: 18px; }
.alerta svg { width: 16px; height: 16px; flex: none; }
.alerta.ok { background: var(--ok-soft); color: var(--ok); }
.alerta.erro { background: var(--bad-soft); color: var(--bad); }

/* ---------- Pessoas e status ---------- */
.lista { list-style: none; margin: 0; padding: 0 8px 8px; }
.lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r-sm); }
.lista li:hover { background: var(--card-2); }
.quem-cel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.quem { display: grid; min-width: 0; }
.quem b { font-weight: 500; overflow-wrap: anywhere; }
.quem span { font-size: 12.5px; color: var(--faint); }
.mono { font: 12.5px/1.3 var(--f-mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.online { background: var(--ok-soft); color: var(--ok); }
.pill.recente { background: var(--warn-soft); color: var(--warn); }
.pill.offline { background: var(--card-2); color: var(--faint); }
.ov { font: 12.5px var(--f-mono); color: var(--steel); white-space: nowrap; }
.ov.nenhum { color: var(--faint); }

/* ---------- Formulários ---------- */
.campo { display: grid; gap: 7px; min-width: 0; }
.campo label, .lbl { font-size: 13px; font-weight: 500; color: var(--ink); }
.dica { margin: 0; font-size: 12.5px; color: var(--faint); }
.input { width: 100%; padding: 10px 13px; background: var(--app); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--ink); font: 14px/1.4 var(--f); }
.input.mono-in { font-family: var(--f-mono); font-size: 13.5px; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px var(--steel-soft); }
textarea.input { min-height: 116px; resize: vertical; }
.duas-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.botoes { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; justify-self: start; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.sec { background: var(--card-2); color: var(--ink); border-color: var(--line-2); }
.btn.sec:hover { border-color: var(--steel); }
.btn.cheio { width: 100%; justify-self: stretch; padding: 12px; }

.opcao { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--app); cursor: pointer; }
.opcao b { display: block; font-weight: 500; }
.opcao small { color: var(--faint); font-size: 12.5px; }
.toggle { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; transition: transform .15s; }
.toggle:checked { background: var(--ok); }
.toggle:checked::after { transform: translateX(16px); }

.ic-btn { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: transparent; color: var(--faint); cursor: pointer; }
.ic-btn .ic { width: 15px; height: 15px; }
.ic-btn:hover { color: var(--ink); border-color: var(--steel); background: var(--steel-soft); }
.ic-btn.perigo:hover { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.ic-btn:disabled { opacity: .35; cursor: not-allowed; }
.ic-btn:disabled:hover { color: var(--faint); border-color: var(--line-2); background: transparent; }

/* ---------- Servidores (DNS) ---------- */
.dns-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dns-linha { display: grid; grid-template-columns: 30px minmax(0, 1fr) 38px; gap: 10px; align-items: center; }
.indice { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--muted); font: 500 12px/1 var(--f-mono); }
.add-linha { appearance: none; width: 100%; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r-md); background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.add-linha:hover { border-color: var(--steel); color: var(--ink); background: var(--steel-soft); }
.passos { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: passo; }
.passos li { counter-increment: passo; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; font-size: 14px; color: var(--muted); }
.passos li::before { content: counter(passo); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--steel-soft); color: var(--steel); font: 600 12.5px/1 var(--f); }
.passos b { color: var(--ink); font-weight: 500; }
.endpoints { list-style: none; margin: 0; padding: 0; display: grid; }
.endpoints li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.endpoints li:last-child { border-bottom: 0; }
.endpoints code { font: 12.5px/1.4 var(--f-mono); color: var(--ink); }
.endpoints a { text-decoration: none; }
.endpoints a code { color: var(--steel); }
.endpoints span { color: var(--muted); text-align: right; }

/* ---------- Avisos: prévia na TV ---------- */
.tv { aspect-ratio: 16 / 9; max-width: 100%; border: 8px solid #1E2126; border-radius: 16px; background: #060708; position: relative; overflow: hidden; display: grid; place-items: center; padding: 18px; }
.tv-grade { position: absolute; inset: 18px; display: grid; grid-template-rows: 12px 1fr 1fr; gap: 12px; opacity: .45; }
.tv-grade i { display: block; border-radius: 6px; background: repeating-linear-gradient(90deg, #1A1D22 0 23%, transparent 23% 25.5%); }
.tv-grade i:first-child { background: #1A1D22; width: 28%; }
.tv-modal { position: relative; width: min(78%, 360px); background: #121417; border: 1px solid #2C3137; border-radius: 12px; padding: 16px 18px; display: grid; gap: 10px; color: #EDEFF2; }
.tv-modal strong { font-size: 14px; font-weight: 600; }
.tv-modal p { margin: 0; font-size: 13px; line-height: 1.45; color: #B3B9C1; overflow-wrap: anywhere; white-space: pre-line; max-height: 9em; overflow: hidden; }
.tv-modal span { justify-self: end; background: #F1F3F6; color: #0B0C0E; border-radius: 8px; padding: 6px 14px; font-size: 12px; font-weight: 600; }
.tv-off { position: relative; font-size: 13px; color: #737982; text-align: center; }
.tv-leg { margin: 8px 0 0; font-size: 12.5px; color: var(--faint); }

/* ---------- Conexões ---------- */
.ferramentas { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--app); border: 1px solid var(--line); }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card-2); color: var(--ink); }
.seg .n { margin-left: 6px; color: var(--faint); font-variant-numeric: tabular-nums; }
.busca { position: relative; width: 280px; }
.busca .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.busca .input { padding-left: 36px; border-radius: 999px; }
.tabela-rola { overflow-x: auto; }
table.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.tab th { text-align: left; padding: 12px 18px; font-size: 12.5px; font-weight: 500; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tab td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tab tbody tr:last-child td { border-bottom: 0; }
.tab tbody tr:hover td { background: var(--card-2); }
.tab .direita { text-align: right; }
.acoes { display: flex; gap: 6px; justify-content: flex-end; }
.acoes form { margin: 0; }
.acoes .ic-btn { width: 32px; height: 32px; border-radius: 8px; }

dialog { border: 1px solid var(--line-2); border-radius: 18px; background: var(--card); color: var(--ink); padding: 0; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 6, 8, .72); }
dialog form { padding: 22px; display: grid; gap: 16px; }
dialog h2 { margin: 0; font: 600 18px/1.2 var(--f); }

/* ---------- Login ---------- */
.pagina-login { display: grid; place-items: center; padding: 32px 16px; background: var(--page); }
.cartao-login { width: 100%; max-width: 400px; display: grid; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px 26px; }
.topo-login { display: grid; justify-items: center; gap: 14px; text-align: center; margin-bottom: 4px; }
.topo-login img { width: 200px; height: auto; }
.topo-login h1 { margin: 0; font: 600 21px/1.25 var(--f); letter-spacing: -.01em; }
.topo-login p { margin: 0; font-size: 13.5px; color: var(--muted); }
.cartao-login .alerta { margin: 0; }
.cartao-login .pe { margin: 0; text-align: center; font-size: 12px; color: var(--faint); }

/* ---------- Celular: menu vira barra flutuante embaixo ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral { position: fixed; top: auto; left: 12px; right: 12px; bottom: 12px; height: auto; z-index: 30; flex-direction: row; padding: 6px; gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: visible; }
  .lateral .marca, .lateral .grupo-titulo, .lateral .usuario, .lateral .grupo-conta { display: none; }
  .lateral .grupo { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .nav { flex-direction: column; justify-content: center; gap: 3px; padding: 8px 2px; font-size: 10.5px; border-radius: 12px; text-align: center; }
  .contador { display: none; }
  .principal { padding-bottom: 92px; }
  .topo { padding: 12px 16px; }
  .migalha { display: none; }
  .marca-topo { display: flex; align-items: center; }
  .marca-topo img { height: 28px; width: auto; }
  .avatar-topo { display: grid; width: 32px; height: 32px; font-size: 12px; }
  .sair-topo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--faint); }
  .aviso-senha { margin: 16px 16px 0; }
  .conteudo { padding: 20px 16px 24px; }
  .cabeca h1 { font-size: 22px; }
  .duas-col { grid-template-columns: minmax(0, 1fr); }
  .busca { width: 100%; }
  .tab.larga { min-width: 720px; }
  .so-largo { display: none; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .num { font-size: 24px; }
  .chip-status { padding: 6px 10px; font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .ponto { animation: none; }
  .toggle, .toggle::after { transition: none; }
}
