/* Centro de TV de PROVISION TIME (specs/tv-centro). Prefijos propios; sin animaciones continuas (RNF-4). */
@font-face { font-family: "Orbitron"; src: url("/fonts/orbitron-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("/fonts/jakarta-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root { --bg: #0A0A0C; --ink: #E8EDF7; --mut: #8B95AA; --mut2: #A9B3C7; --blue: #3598FA; --orange: #FFB347;
  --green: #2FCB86; --red: #FF5D6C; --line: #1C2130; }
html, body { margin: 0; width: 100vw; height: 100vh; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 16px/1.3 Inter, system-ui, sans-serif; cursor: default; }
[hidden] { display: none !important; }
button { font-family: inherit; }

/* ---------- Emparejar ---------- */
#pair { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(70% 60% at 50% 0%, rgba(53,152,250,.20), transparent 65%), var(--bg); }
.pr-box { width: min(1100px, 90vw); text-align: center; }
.pr-logo { height: clamp(28px, 6vh, 56px); width: auto; }
.pr-box h1 { margin: 3vh 0 .6vh; font: 700 clamp(22px, 4.6vh, 44px)/1.1 Jakarta, Inter, sans-serif; letter-spacing: -.01em; }
.pr-lead { margin: 0 0 5vh; color: var(--mut2); font-size: clamp(14px, 2.6vh, 24px); }
.pr-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 5vw; align-items: center; text-align: left; }
.pr-steps { display: flex; flex-direction: column; gap: 2.2vh; }
.pr-step { display: flex; gap: 1.4vw; align-items: flex-start; }
.pr-step span { flex: none; width: 4.4vh; height: 4.4vh; border-radius: 50%; display: grid; place-items: center;
  background: rgba(53,152,250,.15); border: 1px solid rgba(53,152,250,.5); color: #8EC5FF; font-weight: 700; font-size: 2.2vh; }
.pr-step p { margin: .5vh 0 0; font-size: clamp(14px, 2.5vh, 24px); color: var(--ink); }
.pr-step b { color: #fff; }
.pr-code { margin-top: 1.5vh; font: 800 clamp(34px, 9vh, 96px)/1 Jakarta, Inter, sans-serif; letter-spacing: .08em; color: #fff;
  padding: 2vh 2.4vw; border-radius: 2vh; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); text-align: center; white-space: nowrap; }
.pr-state { margin: 0; color: var(--orange); font-size: clamp(12px, 2.2vh, 20px); text-align: center; }
.pr-qr { justify-self: center; padding: 2vh; border-radius: 2.4vh; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.pr-qr img { display: block; width: clamp(180px, 42vh, 420px); height: auto; image-rendering: pixelated; }

/* ---------- Cuadrícula ---------- */
#grid { position: absolute; inset: 0; display: grid; gap: .5vh; padding: .5vh; box-sizing: border-box; }
#grid.g6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
#grid.g4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
#grid.g1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.cell { position: relative; overflow: hidden; background: #121318; border: 2px solid var(--line); border-radius: 8px;
  transition: box-shadow .4s, border-color .4s; container-type: size; }
.cell.sel { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,179,71,.55); }
.cell.glow { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,152,250,.75), 0 0 28px rgba(53,152,250,.45); }
.cell.glow-urgent { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,93,108,.8), 0 0 28px rgba(255,93,108,.45); }
.frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.frame iframe.behind { visibility: hidden; }
.tag { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 6px; background: rgba(0,0,0,.72);
  font-size: max(11px, 3.4cqh); color: #D5DBE8; }
.tv-badge { position: absolute; left: 8px; bottom: 40px; max-width: 85%; padding: 4px 11px; border-radius: 99px;
  background: rgba(53,152,250,.94); color: #fff; font: 600 max(11px, 3.6cqh)/1.3 Inter, system-ui, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-badge.urgent { background: rgba(255,93,108,.95); }

/* ---------- Tarjeta de estado (RF-12, RF-24) ---------- */
.st { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.2cqh; padding: 6cqh 6cqw; text-align: center; color: var(--ink);
  background: radial-gradient(90% 70% at 50% 0%, rgba(53,152,250,.18), transparent 60%), linear-gradient(170deg, #151925, #0C0F16); }
.st-logo { width: min(74cqw, 440px); height: auto; margin-bottom: 2cqh; opacity: .95; }
.st-app { display: flex; align-items: center; gap: 1.6cqw; padding: .8cqh 2.4cqw .8cqh 1cqw; border-radius: 99px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); font-size: max(11px, 4.6cqh); font-weight: 600; }
.st-app img { width: max(16px, 6.5cqh); height: max(16px, 6.5cqh); border-radius: 26%; }
.st-t { font-size: max(15px, 8cqh); font-weight: 800; letter-spacing: -.01em; }
.st-m { font-size: max(12px, 4.8cqh); color: var(--mut2); max-width: 82cqw; }
.st-c { margin-top: 1cqh; font-size: max(10px, 4cqh); color: #FFC877; font-weight: 600; padding: .6cqh 2.4cqw;
  border-radius: 99px; background: rgba(255,179,71,.10); border: 1px solid rgba(255,179,71,.28); }

/* ---------- Paneles (RF-19) ---------- */
.pn { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 5cqh 5cqw 6cqh; color: var(--ink);
  background: radial-gradient(120% 90% at 100% 0%, rgba(53,152,250,.16), transparent 55%), linear-gradient(160deg, #161A24 0%, #0F121A 100%); }
.pn-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 2cqw; margin-bottom: 3.5cqh; }
.pn-t { display: flex; align-items: center; gap: 2cqw; font-family: Orbitron, Inter, sans-serif; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; font-size: max(11px, 5.2cqh); color: #fff; }
.pn-t .pn-logo { width: max(14px, 7cqh); height: max(14px, 7cqh); }
.pn-s { font-size: max(10px, 4cqh); color: var(--mut); }
.pn-b { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 3cqh; }
.pn-empty { margin: auto; color: var(--mut); font-size: max(11px, 4.6cqh); text-align: center; }
.pn-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqh 3cqw; flex: 1; }
.pn-kpi { display: flex; flex-direction: column; justify-content: center; padding: 2cqh 4cqw; border-radius: 2.5cqh;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); border-left: 4px solid var(--blue); min-width: 0; }
.pn-kpi b { font-family: Jakarta, Inter, sans-serif; font-weight: 800; font-size: max(18px, 12cqh); line-height: 1.05; white-space: nowrap; }
.pn-kpi span { font-size: max(10px, 4.2cqh); color: var(--mut2); }
.pn-kpi.warn { border-left-color: var(--orange); } .pn-kpi.warn b { color: #FFC877; }
.pn-kpi.ok { border-left-color: var(--green); }
.pn-kpi.bad { border-left-color: var(--red); } .pn-kpi.bad b { color: #FF8A95; }
.pn-list { display: flex; flex-direction: column; justify-content: space-between; flex: 1; }
.pn-row { display: flex; align-items: center; gap: 3cqw; min-height: 0; }
.pn-logo { width: max(14px, 8cqh); height: max(14px, 8cqh); border-radius: 22%; flex: none; }
.pn-al { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pn-al b { font-size: max(11px, 5.4cqh); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-al span { font-size: max(10px, 4.2cqh); color: var(--mut); }
.pn-when { font-size: max(10px, 4.4cqh); color: var(--mut); white-space: nowrap; }
.pn-dot { width: max(8px, 3.4cqh); height: max(8px, 3.4cqh); border-radius: 50%; flex: none; background: var(--green);
  box-shadow: 0 0 0 .8cqh rgba(47,203,134,.15); }
.pn-dot.warn { background: var(--orange); box-shadow: 0 0 0 .8cqh rgba(255,179,71,.15); }
.pn-dot.bad { background: var(--red); box-shadow: 0 0 0 .8cqh rgba(255,93,108,.18); }
.pn-dot.off { background: #4A5266; box-shadow: none; }
.pn-tag { font-style: normal; font-size: max(9px, 3.6cqh); font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #FF8A95; border: 1px solid rgba(255,93,108,.5); border-radius: 99px; padding: .4cqh 2cqw; }
.pn-hot .pn-row:first-child { background: rgba(53,152,250,.12); border-radius: 2cqh; padding: 1cqh 2cqw; margin: 0 -2cqw; }
.pn-big { display: flex; align-items: center; gap: 4cqw; }
.pn-big .pn-logo { width: max(22px, 15cqh); height: max(22px, 15cqh); }
.pn-big b { display: block; font-family: Jakarta, Inter, sans-serif; font-weight: 800; font-size: max(22px, 17cqh); line-height: 1; }
.pn-big span { font-size: max(10px, 4.6cqh); color: var(--mut2); }
.pn-up { margin-left: auto; font-style: normal; font-weight: 700; font-size: max(11px, 5.4cqh); color: var(--green); }
.pn-up.down { color: #FF8A95; }
.pn-bars { flex: 1; display: flex; align-items: flex-end; gap: 1.2cqw; min-height: 0; }
.pn-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 1cqh; }
.pn-bar i { display: block; width: 100%; border-radius: 1cqh 1cqh 0 0; background: linear-gradient(180deg, #5BB0FF, #2A7FE0); }
.pn-bar.hot i { background: linear-gradient(180deg, #FFC877, #FFB347); }
.pn-bar span { font-size: max(9px, 3.6cqh); color: var(--mut); min-height: 1em; }
.pn-funnel { display: flex; flex-direction: column; justify-content: space-around; flex: 1; }
.pn-fr { display: grid; grid-template-columns: 30% 1fr 14%; align-items: center; gap: 3cqw; }
.pn-fr span { font-size: max(10px, 4.8cqh); color: var(--mut2); }
.pn-fr b { font-family: Jakarta, Inter, sans-serif; font-weight: 800; font-size: max(12px, 7cqh); text-align: right; }
.pn-fw { height: max(10px, 6cqh); background: rgba(255,255,255,.05); border-radius: 1.2cqh; overflow: hidden; }
.pn-fw i { display: block; height: 100%; background: linear-gradient(90deg, #2A7FE0, #5BB0FF); border-radius: 1.2cqh; }
.pn-clock { font-family: Jakarta, Inter, sans-serif; font-weight: 800; font-size: max(26px, 19cqh); line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.pn-date { font-size: max(12px, 6cqh); color: var(--mut2); }
.pn-date::first-letter { text-transform: uppercase; }

/* ---------- Barra superior (RF-5) ---------- */
#bar { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: rgba(10,10,12,.94); border-bottom: 1px solid #22252E; transform: translateY(-110%); transition: transform .25s; }
#bar.on { transform: none; }
#bar .brand { height: 24px; width: auto; }
.b-name { color: var(--mut2); font-size: 15px; }
#bar .lbl { color: var(--mut); font-size: 14px; }
#bar .sep { width: 1px; height: 26px; background: #2A2E3A; margin: 0 4px; }
#bar .hint { margin-left: auto; color: var(--mut); font-size: 13px; }
#bar button { min-width: 46px; height: 42px; padding: 0 14px; border: 1px solid #333A4A; border-radius: 8px; background: #1A1C22;
  color: #fff; font-size: 16px; font-weight: 600; }
#bar button.sel, #bar button:focus { background: var(--orange); color: #111; border-color: var(--orange); outline: none; }
#bar button.muted { color: #FF8A95; }

/* ---------- Franja de conexión (RF-12) ---------- */
#net { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 99px; background: rgba(20,12,14,.94); border: 1px solid rgba(255,93,108,.45); color: #FFD3D7;
  font: 500 15px/1.2 Inter, system-ui, sans-serif; white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
#net b { color: #fff; font-weight: 700; }
.net-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255,93,108,.2); }

/* ---------- Selector de celda (RF-20) ---------- */
.pk { position: fixed; inset: 0; z-index: 10; background: rgba(5,6,9,.8); display: flex; align-items: center; justify-content: center; }
.pk-box { width: min(980px, 92vw); height: min(600px, 86vh); display: flex; flex-direction: column; border-radius: 16px;
  background: linear-gradient(160deg, #181C27, #10131B); border: 1px solid #2A3042; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  padding: 22px 24px; box-sizing: border-box; color: var(--ink); }
.pk-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.pk-hd b { font: 700 20px/1.2 Orbitron, Inter, sans-serif; letter-spacing: .04em; }
.pk-hd span { color: var(--mut); font-size: 15px; }
.pk-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.pk-groups, .pk-items { overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.pk-g, .pk-i { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 14px; border-radius: 10px;
  border: 1px solid transparent; background: rgba(255,255,255,.03); color: #D5DBE8; font: 600 17px/1.2 Inter, system-ui, sans-serif; }
.pk-g img { width: 24px; height: 24px; border-radius: 6px; }
.pk-g.on { background: rgba(53,152,250,.16); color: #fff; }
.pk-i.cur::after { content: "actual"; margin-left: auto; font-size: 12px; color: #8EC5FF; text-transform: uppercase; letter-spacing: .06em; }
.pk-g:focus, .pk-i:focus { outline: none; border-color: var(--orange); background: rgba(255,179,71,.16); color: #fff; }
.pk-help { margin-top: 12px; color: var(--mut); font-size: 14px; }

/* ---------- Noche (RF-14): negro puro, reloj que se mueve cada minuto ---------- */
#night { position: absolute; inset: 0; background: #000; }
#night-box { position: absolute; left: 30%; top: 35%; text-align: left; }
#night-clock { font: 300 clamp(48px, 16vh, 180px)/1 Jakarta, Inter, sans-serif; color: #9AA3B5; letter-spacing: -.02em; }
#night-date { margin-top: 1vh; color: #5A6275; font-size: clamp(14px, 2.8vh, 28px); }
#night-date::first-letter { text-transform: uppercase; }
#night-logo { margin-top: 3vh; height: clamp(14px, 2.6vh, 26px); width: auto; opacity: .35; }
