:root {
  --fondo: #0b0d0c;
  --panel: #141816;
  --borde: #232a26;
  --texto: #f1f4f2;
  --suave: #9aa59f;
  --verde: #2fbf5b;
  --marca: #1b8a3c;
  --rojo: #e5484d;
  --ambar: #f0b429;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; overflow: hidden; }
body.oculto-cursor, body.oculto-cursor * { cursor: none !important; }

/* barra superior */
.barra { height: 56px; display: flex; align-items: center; gap: 24px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--borde); }
.marca { font-size: 18px; letter-spacing: .08em; color: var(--suave); white-space: nowrap; }
.marca b { color: var(--marca); font-weight: 700; }
.resumen { display: flex; gap: 18px; font-size: 18px; flex: 1; }
.resumen span { white-space: nowrap; }
.resumen .ok::before, .resumen .mal::before { content: ""; display: inline-block; width: 12px; height: 12px;
  border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.resumen .ok::before { background: var(--verde); }
.resumen .mal { color: #ffb3b5; }
.resumen .mal::before { background: var(--rojo); }
.pagina { font-size: 16px; color: var(--suave); white-space: nowrap; }
.reloj { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.reloj span { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.reloj small { font-size: 13px; color: var(--suave); }

/* grilla de camaras */
.grilla { position: absolute; top: 56px; left: 0; right: 0; bottom: 0; display: grid; gap: 6px; padding: 6px; }
.cuadro { position: relative; background: #000; border-radius: 6px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; }
.cuadro:hover { border-color: #3a463f; }
.cuadro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.etiqueta { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.85)); display: flex; align-items: baseline; gap: 10px; }
.etiqueta .local { font-size: clamp(14px, 1.6vw, 24px); font-weight: 600; text-shadow: 0 1px 2px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etiqueta .cam { font-size: clamp(11px, 1vw, 15px); color: #c9d2cd; white-space: nowrap; }
.estado { position: absolute; top: 8px; right: 8px; padding: 3px 10px; border-radius: 999px; font-size: 13px;
  font-weight: 700; letter-spacing: .04em; background: rgba(0,0,0,.6); }
.estado.vivo { color: var(--verde); }
.estado.vivo::before { content: "● "; }
.estado.conectando { color: var(--ambar); }

/* sin señal: muy visible */
.cuadro.caido { background: #1a0f10; border-color: #5b2427; }
.cuadro.caido video { display: none; }
.caido-msg { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; text-align: center; padding-bottom: 40px; }
.cuadro.caido .caido-msg { display: flex; }
.caido-msg strong { font-size: clamp(18px, 2.2vw, 34px); color: var(--rojo); }
.caido-msg span { font-size: clamp(12px, 1.1vw, 17px); color: #e8c3c4; }
.cuadro.caido .estado { display: none; }

/* camara en grande */
.grande { position: fixed; inset: 0; background: #000; z-index: 10; }
.grande-video { position: absolute; inset: 0; }
.grande-video .cuadro { position: absolute; inset: 0; border-radius: 0; border: 0; cursor: default; }
.grande-video .etiqueta .local { font-size: 34px; }
.grande-video .etiqueta .cam { font-size: 20px; }
.grande-video .etiqueta { padding: 40px 28px 20px; }
.volver { position: absolute; top: 20px; left: 20px; z-index: 11; font: inherit; font-size: 26px; font-weight: 600;
  color: #fff; background: var(--marca); border: 0; border-radius: 12px; padding: 14px 30px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.volver:hover { background: #22a349; }

/* avisos de pantalla completa (fuera de horario, sin camaras) */
.aviso { position: fixed; inset: 56px 0 0 0; display: flex; align-items: center; justify-content: center; z-index: 5;
  background: var(--fondo); }
.aviso-caja { text-align: center; max-width: 900px; padding: 24px; }
.grande-marca { font-size: 30px; margin-bottom: 28px; }
.aviso p { font-size: clamp(22px, 3vw, 40px); line-height: 1.3; margin: 0 0 16px; }
.aviso small { font-size: 20px; color: var(--suave); }

.sin-red { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; background: var(--rojo);
  color: #fff; font-size: 22px; font-weight: 600; padding: 12px 28px; border-radius: 10px; }

/* entrar */
body.login { display: flex; align-items: center; justify-content: center; overflow: auto; }
.login-box { width: min(420px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--borde);
  border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.login-box h1 { margin: 0 0 8px; font-size: 30px; }
.login-box label { display: flex; flex-direction: column; gap: 6px; font-size: 18px; color: var(--suave); }
.login-box input { font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 8px; border: 1px solid #34403a;
  background: #0e1110; color: var(--texto); }
.login-box button { font: inherit; font-size: 22px; font-weight: 600; padding: 14px; border: 0; border-radius: 10px;
  background: var(--marca); color: #fff; cursor: pointer; margin-top: 8px; }
.login-box .error { margin: 0; color: #ffb3b5; font-size: 18px; }

@media (max-width: 700px) {
  .barra { gap: 12px; padding: 0 12px; }
  .marca { display: none; }
  .resumen { font-size: 15px; gap: 12px; }
  .volver { font-size: 20px; padding: 10px 20px; }
}
