/* LSC-Lab · Fire TV kiosk framework (10-foot UI)
   Herda tokens/glass do DS canônico (ds.lsc-lab.com/core.css).
   Aqui mora só o que é específico de TELA GRANDE + controle remoto. */

html, body { height: 100%; }
body {
  overflow: hidden;                 /* nada de scroll na TV */
  padding: 0; margin: 0;
  /* safe area de overscan — TVs cortam ~4% das bordas */
  --tv-pad: clamp(24px, 3.2vw, 64px);
  cursor: none;                     /* sem mouse na sala */
}
body.aurora::before { opacity: .9; }

/* ── Escala de texto pra 3 metros de distância ── */
:root {
  --tv-h1: clamp(28px, 3.4vw, 62px);
  --tv-h2: clamp(20px, 2.0vw, 34px);
  --tv-num: clamp(34px, 4.6vw, 88px);
  --tv-label: clamp(12px, 1.05vw, 20px);
  --tv-body: clamp(16px, 1.4vw, 26px);
}

/* ── Shell ── */
.tv {
  height: 100vh;
  display: flex; flex-direction: column;
  padding: var(--tv-pad);
  gap: clamp(14px, 1.6vh, 28px);
}

/* ── Top bar ── */
.tv-top {
  display: flex; align-items: center; gap: 20px;
  flex: 0 0 auto;
}
.tv-brand {
  display: flex; align-items: center; gap: 16px;
  font-size: var(--tv-h1); font-weight: 800; letter-spacing: -.03em;
  line-height: 1;
}
.tv-brand .dot {
  width: .62em; height: .62em; border-radius: 50%;
  background: var(--ds-accent); box-shadow: 0 0 24px var(--ds-accent);
}
.tv-sub { font-size: var(--tv-label); color: var(--lsc-muted);
  text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.tv-spacer { flex: 1 1 auto; }
.tv-clock {
  font-size: var(--tv-h2); font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.tv-conn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--tv-label); font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; padding: 8px 16px; border-radius: 999px;
}
.tv-conn[data-state="live"]    { color: var(--lsc-success); background: rgba(74,222,128,.12); }
.tv-conn[data-state="cache"]   { color: var(--lsc-warn);    background: rgba(251,191,36,.12); }
.tv-conn[data-state="offline"] { color: var(--lsc-danger);  background: rgba(239,68,68,.12); }
.tv-conn::before { content:""; width:.72em; height:.72em; border-radius:50%;
  background: currentColor; box-shadow: 0 0 12px currentColor; }
.tv-conn[data-state="live"]::before { animation: tvpulse 2s infinite; }
@keyframes tvpulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── Área principal ── */
.tv-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: clamp(14px,1.6vh,26px); }
.tv-grid { display: grid; gap: clamp(14px, 1.4vw, 26px); min-height: 0; }
.tv-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.tv-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.tv-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Tile de número grande (o "número que pega fogo" na TV) ── */
.tv-stat { padding: clamp(18px,2vw,34px); border-radius: 20px;
  display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.tv-stat .k { font-size: var(--tv-label); font-weight: 800; color: #8aa0b8;
  text-transform: uppercase; letter-spacing: .1em; }
.tv-stat .v { font-size: var(--tv-num); font-weight: 800; line-height: .92;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.tv-stat .u { font-size: var(--tv-body); color: var(--lsc-muted); font-weight: 600; }
.v.ok { color: var(--lsc-success); } .v.warn { color: var(--lsc-warn); }
.v.danger { color: var(--lsc-danger); } .v.primary { color: var(--ds-accent); }

/* ── Lista (incidents, pedidos, ativos) ── */
.tv-list { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.tv-row { display: flex; align-items: center; gap: 18px; padding: clamp(12px,1.3vh,20px) clamp(16px,1.4vw,26px);
  border-radius: 16px; font-size: var(--tv-body); }
.tv-row .grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-row .mono { font-variant-numeric: tabular-nums; font-family: ui-monospace,'JetBrains Mono',Menlo,monospace; }

.tv-section-title { font-size: var(--tv-h2); font-weight: 800; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 14px; }
.tv-section-title .count { font-size: var(--tv-label); color: var(--lsc-muted); font-weight: 700; }

/* ── Foco por controle remoto (D-pad) ── */
.tv-focusable { outline: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
.tv-focusable:focus, .tv-focusable.tv-focus {
  transform: translateY(-3px) scale(1.015);
  border-color: var(--ds-accent) !important;
  box-shadow: 0 0 0 3px var(--ds-accent), 0 18px 50px rgba(0,0,0,.5);
}

/* ── Rodapé ── */
.tv-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 20px;
  font-size: var(--tv-label); color: var(--lsc-muted); }
.tv-foot .hint { display:inline-flex; align-items:center; gap:8px; }
.tv-foot kbd { border:1px solid var(--lsc-line); border-radius:6px; padding:2px 9px;
  font-family: inherit; font-weight: 700; color: var(--lsc-text); }
.tv-updated { margin-left: auto; font-variant-numeric: tabular-nums; }

/* progress bar de auto-refresh */
.tv-refresh-bar { position: fixed; top: 0; left: 0; height: 4px; width: 0;
  background: linear-gradient(90deg, var(--ds-accent), #5eb4ff); box-shadow: 0 0 12px var(--ds-accent);
  z-index: 50; transition: width .25s linear; }

@media (prefers-reduced-motion: reduce) {
  .tv-focusable, .tv-conn[data-state="live"]::before { transition: none; animation: none; }
}
