:root {
  --bg: #07090a;
  --bg-grad: radial-gradient(140% 80% at 80% -20%, #0c1712 0%, #07100c 40%, #06090a 100%);
  --surface: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
  --linha: rgba(255, 255, 255, .07);
  --linha-forte: rgba(255, 255, 255, .09);
  --txt: #f2f6f2;
  --txt-2: #7c857e;
  --txt-3: #9aa39c;
  --green: #35d98a;
  --green-light: #5be6a6;
  --green-deep: #28c47e;
  --off: #f5544f;
  --off-text: #f58a86;
  --azul: #3aa0ff;
  --sombra: 0 30px 90px rgba(0, 0, 0, .6);
  /* aliases legados (modal/QR) */
  --card: linear-gradient(180deg, rgba(20, 26, 22, .96), rgba(12, 16, 13, .98));
  --ok: #35d98a;
  --bg-2: rgba(255, 255, 255, .03);
  --cyan: #35d98a;
}
[data-theme="light"] {
  --bg: #eef2ee;
  --bg-grad: radial-gradient(140% 80% at 80% -20%, #ffffff 0%, #eef3ef 45%, #e9efe9 100%);
  --surface: linear-gradient(180deg, rgba(10, 40, 25, .028), rgba(10, 40, 25, .01));
  --linha: rgba(10, 30, 20, .10);
  --linha-forte: rgba(10, 30, 20, .14);
  --txt: #0f1712;
  --txt-2: #5c655e;
  --txt-3: #46514a;
  --green: #12a05f;
  --green-light: #0f9457;
  --green-deep: #0e8a50;
  --off: #dc2626;
  --off-text: #c0322e;
  --sombra: 0 24px 60px rgba(20, 40, 30, .14);
  --card: linear-gradient(180deg, #ffffff, #f6faf7);
  --ok: #12a05f;
  --bg-2: rgba(10, 30, 20, .03);
  --cyan: #12a05f;
}

@keyframes aur { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.18); } }
@keyframes aur2 { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(-50px, 20px) scale(1); } }
@keyframes pdot { 0% { box-shadow: 0 0 0 0 rgba(53, 217, 138, .5); } 70% { box-shadow: 0 0 0 7px rgba(53, 217, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(53, 217, 138, 0); } }
@keyframes pdotA { 0% { box-shadow: 0 0 0 0 rgba(245, 84, 79, .5); } 70% { box-shadow: 0 0 0 8px rgba(245, 84, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 84, 79, 0); } }
@keyframes flow { 0% { background-position: 0 0; } 100% { background-position: 200px 0; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.ico { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; display: block; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
button { font: inherit; cursor: pointer; border: none; }

/* ---------- LOGIN ---------- */
.login {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% -10%, #0d1a13 0%, #08100c 45%, #06090a 100%);
}
[data-theme="light"] .login { background: radial-gradient(120% 90% at 50% -10%, #eaf6ef 0%, #eef3ef 45%, #e9efe9 100%); }
.aurora { position: absolute; border-radius: 50%; filter: blur(20px); pointer-events: none; }
.aurora-1 { width: 640px; height: 640px; left: -160px; top: -220px; background: radial-gradient(closest-side, rgba(53, 217, 138, .18), transparent 70%); animation: aur 14s ease-in-out infinite; }
.aurora-2 { width: 560px; height: 560px; right: -160px; bottom: -200px; background: radial-gradient(closest-side, rgba(37, 150, 120, .14), transparent 70%); animation: aur2 18s ease-in-out infinite; }
.grid-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(80% 60% at 50% 40%, #000, transparent);
  mask-image: radial-gradient(80% 60% at 50% 40%, #000, transparent);
}
.login-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 34px; width: 100%; }

.card-login {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(20, 26, 22, .72), rgba(12, 16, 13, .72));
  backdrop-filter: blur(18px);
  border: 1px solid var(--linha-forte);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
}
[data-theme="light"] .card-login { background: linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(245, 249, 246, .8)); box-shadow: 0 24px 70px rgba(20, 40, 30, .12), inset 0 1px 0 rgba(255, 255, 255, .6); }
.acesso { display: flex; align-items: center; gap: 8px; font: 600 11px/1 'IBM Plex Mono', monospace; color: var(--green); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px; }
.acesso-dot { font-size: 9px; }
.card-login h1 { font-size: 26px; font-weight: 700; color: var(--txt); letter-spacing: -.3px; }
.card-login .sub { font-size: 13px; color: var(--txt-2); margin-top: 6px; }
.campo-lbl { display: block; margin-top: 22px; font-size: 12px; font-weight: 500; color: var(--txt-3); letter-spacing: .3px; }
.campo {
  margin-top: 8px;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--linha-forte);
  font-family: 'IBM Plex Mono', monospace; font-size: 15px; color: var(--txt);
}
[data-theme="light"] .campo { background: rgba(10, 30, 20, .03); }
input.campo, .campo-senha input { width: 100%; background: none; border: none; outline: none; color: var(--txt); font: inherit; font-family: 'IBM Plex Mono', monospace; letter-spacing: .5px; }
input.campo::placeholder, .campo-senha input::placeholder { color: var(--txt-2); opacity: .7; }
.campo:focus-within { border-color: rgba(53, 217, 138, .5); box-shadow: 0 0 0 3px rgba(53, 217, 138, .1); }
.campo-senha { justify-content: space-between; }
.olho { background: none; border: none; color: #5a635c; display: flex; padding: 0; }
.olho:hover { color: var(--txt-2); }
#btn-entrar {
  width: 100%;
  margin-top: 26px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px;
  border-radius: 12px;
  background: linear-gradient(180deg, #4ded9c, #28c47e);
  color: #03130b;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(53, 217, 138, .35), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .15s, box-shadow .15s;
}
#btn-entrar .ico { stroke: #03130b; width: 18px; height: 18px; }
#btn-entrar:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(53, 217, 138, .45), inset 0 1px 0 rgba(255, 255, 255, .4); }
#btn-entrar:disabled { opacity: .6; cursor: default; transform: none; }
.erro { color: var(--off-text); font-size: 13px; text-align: center; margin-top: 12px; }
.login-rodape { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #5a635c; }
.login-rodape .zauto { color: var(--txt-3); font-weight: 600; }

/* ---------- Branding zapon (compartilhado: login, painel, TV) ---------- */
.zlogo {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--txt);
  text-decoration: none;
  display: flex; align-items: center; gap: 2px;
}
.zlogo .zon { color: var(--green); }
.zlogo .zdot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px 2px rgba(53, 217, 138, .8);
  display: inline-block; margin-left: 2px;
}
.zlogo-top { font-size: 34px; }
.zauto { color: var(--txt-3); font-weight: 600; }
.auto-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--azul); margin-left: 3px;
}

/* ---------- PAINEL ---------- */
.painel { max-width: 1160px; margin: 0 auto; padding: 34px 40px 40px; position: relative; overflow: hidden; }
.aurora-p {
  position: absolute; width: 520px; height: 520px; right: -140px; top: -180px; z-index: 0;
  border-radius: 50%; filter: blur(20px); pointer-events: none;
  background: radial-gradient(closest-side, rgba(53, 217, 138, .12), transparent 70%);
  animation: aur 16s ease-in-out infinite;
}
.topo, .cabecalho, .lista, .painel-rodape, .vazio { position: relative; z-index: 1; }
.topo {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 36px;
}
.zlogo-header { font-size: 1.5rem; }
a.zlogo-header { cursor: pointer; transition: opacity .15s; }
a.zlogo-header:hover { opacity: .82; }
.topo-acoes { display: flex; align-items: center; gap: 10px; }
.btn-sair {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .03);
  color: var(--txt-3);
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--linha-forte);
  border-radius: 11px;
  height: 42px; padding: 0 18px;
  transition: .15s;
}
[data-theme="light"] .btn-sair { background: rgba(10, 30, 20, .03); }
.btn-sair:hover { border-color: var(--off); color: var(--off); }
.btn-sair .ico { width: 17px; height: 17px; }
.btn-tema {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--linha-forte);
  color: var(--txt-3);
  border-radius: 11px;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: .15s;
}
[data-theme="light"] .btn-tema { background: rgba(10, 30, 20, .03); color: var(--txt-2); }
.btn-tema:hover { color: var(--txt); border-color: var(--txt-2); }
.btn-tema-fixo { position: absolute; top: 26px; right: 26px; z-index: 2; }
/* ícone = modo de destino: no escuro mostra sol; no claro mostra lua */
.btn-tema .icone-lua { display: none; }
[data-theme="light"] .btn-tema .icone-sol { display: none; }
[data-theme="light"] .btn-tema .icone-lua { display: block; }

/* Resumo X/Y */
.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.resumo-lbl { font: 600 12px/1 'IBM Plex Mono', monospace; letter-spacing: 2px; color: var(--green); }
.resumo-linha { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
.resumo-num { font-size: 44px; font-weight: 700; letter-spacing: -1px; color: var(--green); line-height: 1; }
.resumo-num.alerta { color: var(--off); }
.resumo-y { color: #4a534c; font-size: 30px; font-weight: 700; }
[data-theme="light"] .resumo-y { color: #9aa39c; }
.resumo-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: rgba(53, 217, 138, .10); border: 1px solid rgba(53, 217, 138, .28); color: var(--green-light);
}
.resumo-pill .pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pdot 2.4s infinite; }
.resumo-pill.alerta { background: rgba(245, 84, 79, .10); border-color: rgba(245, 84, 79, .28); color: var(--off-text); }
.resumo-pill.alerta .pill-dot { background: var(--off); animation: pdotA 2s infinite; }

.cabecalho-acoes { display: flex; align-items: center; gap: 10px; }
.secundario {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--linha-forte);
  color: var(--txt);
  height: 44px; padding: 0 18px;
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  transition: .15s;
}
[data-theme="light"] .secundario { background: rgba(10, 30, 20, .03); }
.secundario:hover, .secundario:focus, .secundario:focus-visible { border-color: var(--txt-2); }
.secundario .ico { width: 18px; height: 18px; }
#btn-atualizar { border-color: rgba(53, 217, 138, .3); background: rgba(53, 217, 138, .08); color: var(--green-light); }
#btn-atualizar .ico { stroke: var(--green-light); }
#btn-atualizar:hover { border-color: rgba(53, 217, 138, .5); }
@media (max-width: 620px) { #btn-modo-tv { display: none; } }
/* Sem anel de foco azul do navegador nos botões — a borda já indica o foco */
button:focus, button:focus-visible { outline: none; }

/* Lista (integrações) */
.lista { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.conexao {
  background: var(--surface);
  border: 1px solid var(--linha);
  border-radius: 14px;
  padding: 13px 22px;
  display: grid;
  grid-template-columns: 22px 200px 1fr 150px 96px 128px;
  align-items: center;
  column-gap: 20px;
}
.conexao .dot { grid-column: 1; }
.conexao .nome {
  grid-column: 2;
  font-size: 16.5px; font-weight: 600; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conexao .numero {
  grid-column: 3;
  font-family: 'IBM Plex Mono', monospace; font-size: 15px; color: var(--txt-3); letter-spacing: .2px;
}
.conexao .meta { grid-column: 4; min-width: 0; }
.conexao .badge { grid-column: 5; justify-self: start; }
.conexao .acao { grid-column: 6; }

.meta-txt { font: 12px 'IBM Plex Mono', monospace; color: var(--txt-2); white-space: nowrap; }
.meta.off .meta-txt { color: #ef7b76; }
.bar { margin-top: 6px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; }
.bar.on > span { width: 88%; background: linear-gradient(90deg, #28c47e, #4ded9c, #28c47e); background-size: 200px 100%; animation: flow 3s linear infinite; }
.bar.off > span { width: 14%; background: var(--off); }

.badge { font: 600 11px 'IBM Plex Mono', monospace; padding: 5px 11px; border-radius: 999px; letter-spacing: 1px; display: inline-flex; align-items: center; }
.badge.on { background: rgba(53, 217, 138, .12); border: 1px solid rgba(53, 217, 138, .22); color: var(--green-light); }
.badge.off { background: rgba(245, 84, 79, .12); border: 1px solid rgba(245, 84, 79, .28); color: var(--off-text); }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 8px rgba(53, 217, 138, .7); animation: pdot 2.4s infinite; }
.dot.off { background: var(--off); animation: pdotA 2s infinite; }

.acao {
  width: 100%; padding: 9px 0;
  border-radius: 10px;
  font-weight: 600; font-size: 13px;
  white-space: nowrap; text-align: center;
  background: transparent;
  transition: .15s;
}
.acao.conectar { border: 1px solid rgba(53, 217, 138, .32); background: rgba(53, 217, 138, .06); color: var(--green-light); }
.acao.conectar:hover { background: rgba(53, 217, 138, .12); }
.acao.desconectar { border: 1px solid rgba(255, 120, 120, .28); background: rgba(255, 80, 80, .06); color: #e88; }
.acao.desconectar:hover { background: rgba(255, 80, 80, .12); }
.acao:disabled { opacity: .55; cursor: default; }

.vazio { text-align: center; color: var(--txt-2); padding: 40px; }

/* ---------- MODAL ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, .72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}
.modal-caixa {
  background: var(--card);
  border: 1px solid var(--linha);
  border-radius: 20px;
  box-shadow: var(--sombra);
  width: 100%;
  max-width: 400px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 22px;
  position: relative;
  text-align: center;
}
.fechar {
  position: absolute; top: 12px; right: 14px;
  background: none; color: var(--txt-2); font-size: 26px; line-height: 1;
}
.fechar:hover { color: var(--txt); }
.modal-caixa h2 { font-size: 18px; margin-bottom: 16px; }
.qr-area {
  background: #fff;
  border-radius: 14px;
  width: 240px; height: 240px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.qr-area img { width: 100%; height: 100%; object-fit: contain; }
.loader { color: #64748b; font-size: 13px; }

.pair-area { margin: 4px 0 16px; }
.pair-label { color: var(--txt-2); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.pair-code {
  font-size: 30px; font-weight: 800; letter-spacing: 6px;
  margin-top: 6px; color: var(--ok);
  font-variant-numeric: tabular-nums;
}
.pair-aviso { color: #f5b942; font-size: 13px; margin-top: 8px; }

#btn-modo-codigo { width: 100%; margin-bottom: 18px; }
#btn-gerar-codigo { width: 100%; margin-bottom: 8px; }
#btn-modo-qr { width: 100%; margin-bottom: 18px; }
.btn-copiar {
  margin-top: 10px;
  background: rgba(52, 211, 153, .16);
  color: #fff;
  border: 1px solid rgba(52, 211, 153, .5);
  padding: 7px 20px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13.5px;
}
.btn-copiar:hover { background: rgba(52, 211, 153, .28); }
.link-modo { background: none; color: var(--txt-2); font-size: 13px; }
.link-modo:hover { color: var(--txt); }

/* Modal de confirmação */
.confirma-caixa { max-width: 400px; text-align: left; padding: 26px 24px; }
.confirma-caixa h2 { font-size: 18px; margin-bottom: 10px; }
.confirma-texto { color: var(--txt-2); font-size: 14px; line-height: 1.55; margin-bottom: 22px; }
.confirma-acoes { display: flex; gap: 10px; justify-content: flex-end; }
.confirma-acoes .secundario { min-width: 104px; }

.instrucoes { text-align: left; background: var(--bg-2); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; color: var(--txt-2); }
.instrucoes strong { color: var(--txt); display: block; margin-bottom: 8px; }
.instrucoes ol { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.instrucoes b { color: var(--txt); }

/* Rodapé do painel — "um produto automasys" (padrão dashboard zapon) */
.painel-rodape {
  text-align: center;
  color: var(--txt-2);
  font-size: .82rem;
  padding: 28px 0 6px;
  margin-top: 8px;
}
.painel-rodape .zauto { color: var(--txt); font-weight: 600; }

/* Skeleton de carregamento das conexões */
.conexao.sk { pointer-events: none; }
.sk-dot { grid-column: 1; grid-row: 1; width: 11px; height: 11px; border-radius: 50%; }
.sk-bar { height: 12px; border-radius: 6px; }
.sk-nome { grid-column: 2; grid-row: 1; width: 120px; }
.sk-num { grid-column: 3; grid-row: 1; width: 130px; }
.sk-meta { grid-column: 4; grid-row: 1; width: 120px; height: 10px; }
.sk-badge { grid-column: 5; grid-row: 1; justify-self: start; width: 44px; height: 20px; border-radius: 999px; }
.sk-btn { grid-column: 6; grid-row: 1; width: 100%; height: 40px; border-radius: 11px; align-self: center; }
.sk-dot, .sk-bar {
  background: linear-gradient(90deg, #1a1f26 25%, #262d37 37%, #1a1f26 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Mobile: nome (linha 1); telefone + tag na linha 2 (tag após o número, descolada do botão); tempo (linha 3); botão à direita centralizado */
@media (max-width: 620px) {
  .painel { padding: 18px 14px 44px; }
  .conexao {
    grid-template-columns: 14px auto 1fr auto;
    column-gap: 8px;
    row-gap: 3px;
    align-items: center;
    padding: 12px 14px;
  }
  .conexao .dot { grid-column: 1; grid-row: 1; }
  .conexao .nome { grid-column: 2 / 4; grid-row: 1; max-width: 46vw; }
  .conexao .numero { grid-column: 2; grid-row: 2; }
  .conexao .badge { grid-column: 3; grid-row: 2; justify-self: start; margin-left: 10px; }
  .conexao .meta { grid-column: 2 / 4; grid-row: 3; white-space: nowrap; }
  .conexao .meta .bar { display: none; }
  .conexao .meta-txt { font-size: 12px; }
  .conexao .acao { grid-column: 4; grid-row: 1 / span 3; align-self: center; width: auto; min-width: 118px; margin-top: 0; }
  .sk-dot { grid-column: 1; grid-row: 1; }
  .sk-nome { grid-column: 2 / 4; grid-row: 1; width: 84px; }
  .sk-num { grid-column: 2; grid-row: 2; width: 130px; }
  .sk-badge { grid-column: 3; grid-row: 2; justify-self: start; margin-left: 10px; }
  .sk-meta { grid-column: 2 / 4; grid-row: 3; width: 92px; }
  .sk-btn { grid-column: 4; grid-row: 1 / span 3; align-self: center; width: 118px; margin-top: 0; }
}

/* ============ MODO TV (visualização, sem rota) ============ */
body.tv { overflow-x: hidden; }
.tv-app {
  position: relative; min-height: 100vh; display: flex; flex-direction: column;
  padding: 40px 48px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% -20%, #0b1510 0%, #070f0b 40%, #05080a 100%);
}
[data-theme="light"] .tv-app { background: radial-gradient(120% 80% at 50% -20%, #eaf6ef 0%, #eef3ef 40%, #e9efe9 100%); }
.tv-app::before {
  content: ""; position: absolute; width: 700px; height: 700px; left: 50%; top: -320px;
  transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(53, 217, 138, .12), transparent 70%);
  filter: blur(24px); animation: aur 18s ease-in-out infinite;
}
/* Cabeçalho, grid e rodapé compartilham a MESMA faixa central: o logo encosta
   na borda esquerda dos cards e o contador/fechar na borda direita. */
.tv-topo, .tv-grid, .tv-rodape { width: 100%; max-width: 1380px; margin-inline: auto; }
.tv-topo {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 2vw;
  padding-bottom: 22px; border-bottom: 1px solid var(--linha);
}
.tv-logo { font-size: clamp(1.6rem, 2vw, 2rem); }
.tv-titulo { flex: 1; text-align: center; }
.tv-titulo .tv-cliente { display: block; color: var(--txt); font-weight: 700; font-size: clamp(1.25rem, 1.7vw, 1.7rem); letter-spacing: -.2px; }
.tv-titulo .tv-sub { display: block; color: var(--txt-2); font-weight: 500; font-size: clamp(.78rem, .95vw, .98rem); margin-top: 3px; letter-spacing: .2px; }
.tv-resumo { text-align: right; white-space: nowrap; }
.tv-online { font-family: 'IBM Plex Mono', monospace; font-size: clamp(1.9rem, 2.6vw, 2.6rem); font-weight: 700; color: var(--green); line-height: 1; letter-spacing: -1px; }
.tv-online.alerta { color: var(--off); }
.tv-online .tv-barra { color: #4a534c; font-weight: 700; }
.tv-online-lbl { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: var(--txt-2); font-size: .42em; letter-spacing: 0; }
.tv-atualizado { color: var(--txt-2); font-size: clamp(.78rem, .95vw, 1rem); margin-top: 4px; }
.tv-count { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; color: var(--txt-3); font-weight: 500; }
.tv-sair {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--linha-forte);
  color: var(--txt-3);
  border-radius: 12px;
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: .15s;
}
[data-theme="light"] .tv-sair { background: rgba(10, 30, 20, .03); }
.tv-sair svg { width: 20px; height: 20px; }
.tv-sair:hover { color: var(--txt); border-color: var(--txt-2); }
.tv-grid {
  position: relative; z-index: 1;
  flex: 1;                 /* ocupa o espaço entre topo e rodapé... */
  align-content: center;   /* ...e centraliza os cards verticalmente (TV) */
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.tv-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 128px;
  padding: 24px 26px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--linha-forte);
}
.tv-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.tv-card.on::before { background: linear-gradient(#4ded9c, #28c47e); box-shadow: 0 0 18px rgba(53, 217, 138, .6); }
.tv-card.off::before { background: var(--off); box-shadow: 0 0 18px rgba(245, 84, 79, .6); }
.tv-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tv-card-nome { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tv-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.tv-dot.on { background: var(--green); box-shadow: 0 0 10px rgba(53, 217, 138, .8); animation: pdot 2.4s infinite; }
.tv-dot.off { background: var(--off); animation: pdotA 2s infinite; }
.tv-nome { font-size: clamp(1.4rem, 1.9vw, 1.9rem); font-weight: 700; letter-spacing: -.4px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-badge { flex-shrink: 0; padding: 6px 13px; border-radius: 999px; font: 600 13px 'IBM Plex Mono', monospace; letter-spacing: 1px; }
.tv-badge.on { background: rgba(53, 217, 138, .14); border: 1px solid rgba(53, 217, 138, .25); color: var(--green-light); }
.tv-badge.off { background: rgba(245, 84, 79, .14); border: 1px solid rgba(245, 84, 79, .3); color: var(--off-text); }
.tv-info { margin-top: 18px; }
.tv-num { font-family: 'IBM Plex Mono', monospace; font-size: clamp(.9rem, 1.05vw, 1.05rem); color: var(--txt-3); letter-spacing: .3px; }
.tv-uptime { margin-top: 10px; font-family: 'IBM Plex Mono', monospace; font-size: clamp(.95rem, 1.1vw, 1.12rem); font-weight: 400; color: var(--txt); }
.tv-uptime.off { color: #ef7b76; }
.tv-rodape {
  position: relative; z-index: 1;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--linha);
  text-align: center; color: var(--txt-2); font-size: clamp(.8rem, .95vw, 1rem);
}
.tv-rodape .zauto { color: var(--txt-3); font-weight: 600; }
