/* VORVEX Pantallas · panel. Dirección: «sala de control» de transmisión. Superficies planas y claras,
   tinta azul marino, azul VORVEX para acciones y luces de estado como las de un estudio:
   rojo «al aire», verde en línea, ámbar atención, gris apagada. */
:root {
  --tinta: #121a2e;
  --tinta-2: #3b4560;
  --gris: #5d6782;
  --linea: #d9dde6;
  --fondo: #eef1f6;
  --hoja: #ffffff;
  --azul: #0a5cff;
  --azul-osc: #0846c4;
  --aire: #d92d20;
  --verde: #12804a;
  --ambar: #a15c00;
  --apagada: #8a93a8;
  --radio: 10px;
  --titulo: 'Barlow Semi Condensed', 'Bahnschrift', 'Arial Narrow', sans-serif;
  --texto: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 400 16px/1.5 var(--texto); }
img, video, svg { max-width: 100%; }
a { color: var(--azul); }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 4px; }
.saltar { position: absolute; left: -999px; top: 8px; background: var(--hoja); padding: 8px 12px; z-index: 10; }
.saltar:focus { left: 8px; }
h1, h2, h3 { font-family: var(--titulo); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: 2rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.15rem; }

/* barra superior */
.barra { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px 24px; background: var(--tinta); color: #fff; }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 600 1.15rem/1 var(--titulo); letter-spacing: .02em; }
.marca b { font-weight: 700; color: #9fc0ff; }
.marca-icono { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2; }
.marca-icono .luz { fill: var(--aire); stroke: none; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #cfd6e6; text-decoration: none; padding: 10px 12px; border-radius: 8px; white-space: nowrap; font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 -3px 0 var(--aire); }
.salir { margin-left: auto; }
.barra .btn.fantasma { color: #fff; border-color: rgba(255, 255, 255, .35); }
.ayudando { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 8px 16px; background: var(--ambar); color: #fff; font-weight: 500; }

.contenido { max-width: 1180px; margin: 0 auto; padding: 24px; }
.solo .contenido { padding-top: 8vh; }
.hoja { background: var(--hoja); border: 1px solid var(--linea); border-radius: var(--radio); padding: 24px; margin-bottom: 20px; }
.hoja.angosta { max-width: 460px; margin-left: auto; margin-right: auto; }
.cabeza { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cabeza h1, .cabeza h2 { margin: 0; }
.nota { color: var(--gris); margin: 0 0 1em; }
.chica { font-size: .875rem; }

/* formularios */
.formulario { display: grid; gap: 16px; margin: 16px 0; }
.formulario.dos { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
label { display: grid; gap: 6px; font-weight: 600; color: var(--tinta-2); }
input, select, textarea { font: inherit; color: var(--tinta); background: #fff; border: 1px solid #b9c0cf; border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%; }
input[type="checkbox"], input[type="color"] { width: auto; min-height: 0; }
input[type="color"] { width: 64px; height: 44px; padding: 4px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--aire); }
.casilla { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.campo-error { color: var(--aire); font-size: .875rem; margin: 0; font-weight: 500; }
.codigo { font: 600 1.6rem/1 var(--titulo); letter-spacing: .3em; text-align: center; }
.clave-manual { font: 700 1.25rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--fondo); border: 1px dashed var(--tinta-2); border-radius: 8px; padding: 12px; text-align: center; word-break: break-all; user-select: all; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--azul); background: var(--azul); color: #fff; font: 600 1rem/1 var(--texto); text-decoration: none; cursor: pointer; transition: background-color .15s ease; }
.btn:hover { background: var(--azul-osc); }
.btn.fantasma { background: transparent; color: var(--azul); }
.btn.fantasma:hover { background: rgba(10, 92, 255, .08); }
.btn.peligro { background: #fff; color: var(--aire); border-color: var(--aire); }
.btn.peligro:hover { background: #fdecea; }
.btn.claro { background: #fff; color: var(--tinta); border-color: #fff; }
.btn.chico { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.botones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.botones form { margin: 0; }

/* avisos */
.aviso { padding: 12px 14px; border-radius: 8px; border-left: 4px solid; background: #fff; margin: 0 0 16px; }
.aviso.bien { border-color: var(--verde); background: #eaf6ef; }
.aviso.mal { border-color: var(--aire); background: #fdecea; }
.aviso.info { border-color: var(--azul); background: #e9f0ff; }
.aviso.atencion { border-color: var(--ambar); background: #fff4e0; }

/* luces de estado */
.luz { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.luz::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--apagada); flex: none; }
.luz.en-linea::before { background: var(--verde); box-shadow: 0 0 0 3px rgba(18, 128, 74, .18); }
.luz.caida::before { background: var(--aire); }
.luz.atencion::before { background: var(--ambar); }
.al-aire { display: inline-flex; align-items: center; gap: 6px; background: var(--aire); color: #fff; font: 700 .8rem/1 var(--titulo); letter-spacing: .12em; padding: 5px 9px; border-radius: 4px; }

/* listas y tablas */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla th { font: 600 .85rem/1.2 var(--texto); color: var(--gris); }
.lista { list-style: none; margin: 0; padding: 0; }
.fila { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.fila:last-child { border-bottom: 0; }
.fila .principal { flex: 1 1 220px; min-width: 0; }
.fila .principal strong { display: block; }
.miniatura { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: var(--tinta); flex: none; }
.medidor { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border: 0; border-radius: 99px; background: var(--fondo); overflow: hidden; margin: 0 0 16px; }
.medidor::-webkit-progress-bar { background: var(--fondo); }
.medidor::-webkit-progress-value { background: var(--azul); border-radius: 99px; }
.medidor::-moz-progress-bar { background: var(--azul); border-radius: 99px; }
.medidor.lleno::-webkit-progress-value { background: var(--aire); }
.medidor.lleno::-moz-progress-bar { background: var(--aire); }
.vacio { text-align: center; padding: 32px 16px; color: var(--gris); }
.vacio .btn { margin-top: 12px; }
.rejilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* inicio */
.pasos { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; gap: 12px; }
.pasos li { counter-increment: paso; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--linea); border-radius: var(--radio); }
.pasos li::before { content: counter(paso); grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--tinta); color: #fff; font: 700 1.2rem/1 var(--titulo); }
.pasos li.hecho::before { content: '✓'; background: var(--verde); }
.canales-aire { list-style: none; margin: 0; padding: 0; }
.canal-aire { border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; display: grid; gap: 8px; align-content: start; background: linear-gradient(180deg, #f7f9fc, #fff 40%); }
.canal-aire-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 700 1.2rem/1.2 var(--titulo); }
.suena { margin: 0; display: grid; gap: 2px; font: 600 1.15rem/1.3 var(--texto); }
.vacio-chico { color: var(--gris); font-weight: 500; font-size: 1rem; }
.canal-aire .btn { justify-self: start; }
.tele .ajustes .formulario.dos { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 12px 0; }
.tele .ajustes .en-linea { align-items: end; }
.tele .ajustes .en-linea label { flex: 1; }

/* canal: lista de anuncios */
.anuncios .numero { font: 700 1.1rem/1 var(--titulo); color: var(--gris); width: 1.6em; text-align: right; flex: none; }
.anuncios .apagado .principal, .anuncios .apagado .miniatura { opacity: .5; }
.miniatura.escena { display: grid; place-items: center; color: #fff; font: 600 .8rem/1 var(--titulo); letter-spacing: .08em; background: linear-gradient(135deg, var(--tinta), #34405e); }
.en-linea { display: flex; gap: 6px; align-items: center; }
.corto input { width: 76px; min-height: 36px; padding: 6px 8px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }

/* escenas */
.plantillas { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.plantilla { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--linea); border-radius: var(--radio); color: var(--tinta); text-decoration: none; height: 100%; }
.plantilla:hover { border-color: var(--azul); }
.plantilla-dibujo { display: block; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--tinta); position: relative; overflow: hidden; margin-bottom: 4px; }
.plantilla-dibujo::before, .plantilla-dibujo::after { content: ''; position: absolute; background: #fff; border-radius: 2px; }
.plantilla-dibujo.promo { background: linear-gradient(90deg, #5d6782 58%, var(--tinta) 58%); }
.plantilla-dibujo.promo::before { right: 10%; top: 28%; width: 26%; height: 10%; }
.plantilla-dibujo.promo::after { right: 12%; top: 50%; width: 22%; height: 18%; background: var(--aire); transform: rotate(-4deg); }
.plantilla-dibujo.estrella { background: linear-gradient(0deg, var(--tinta) 30%, #5d6782 75%); }
.plantilla-dibujo.estrella::before { left: 8%; bottom: 14%; width: 50%; height: 12%; }
.plantilla-dibujo.estrella::after { left: 8%; bottom: 32%; width: 14%; height: 4%; background: var(--aire); }
.plantilla-dibujo.evento::before { left: 8%; top: 22%; width: 26%; height: 20%; background: var(--aire); }
.plantilla-dibujo.evento::after { left: 8%; top: 52%; width: 60%; height: 14%; }
.plantilla-dibujo.aviso::before { left: 18%; top: 36%; width: 64%; height: 16%; }
.plantilla-dibujo.aviso::after { left: 36%; top: 60%; width: 28%; height: 5%; background: var(--aire); }
.plantilla-dibujo.redes::before { left: 10%; top: 30%; width: 34%; height: 10%; }
.plantilla-dibujo.redes::after { right: 10%; top: 18%; width: 28%; height: 64%; box-shadow: 4px 4px 0 var(--aire); }
.editor-escena { display: grid; gap: 20px; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
.editor-escena .hoja { margin: 0; }
.vista-previa { position: sticky; top: 16px; }
.marco-tele { aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; border: 6px solid var(--tinta); margin: 0 auto; }
.marco-tele.vertical { aspect-ratio: 9 / 16; max-height: 70vh; }
.marco-tele iframe { width: 100%; height: 100%; border: 0; display: block; }
.elegir-foto { border: 1px solid var(--linea); border-radius: 8px; padding: 12px; margin: 0; }
.elegir-foto legend { font-weight: 600; color: var(--tinta-2); padding: 0 4px; }
.fotos { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); max-height: 260px; overflow: auto; }
.foto-op { position: relative; display: block; cursor: pointer; }
.foto-op input { position: absolute; opacity: 0; }
.foto-op img, .foto-op .sin { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; border: 3px solid transparent; background: var(--fondo); font-size: .85rem; color: var(--gris); }
.foto-op input:checked + * { border-color: var(--azul); }
.foto-op input:focus-visible + * { outline: 3px solid var(--azul); outline-offset: 2px; }
.logo-actual { border: 1px solid var(--linea); border-radius: 8px; padding: 12px; margin: 0; display: grid; gap: 10px; }
.logo-actual legend { font-weight: 600; color: var(--tinta-2); padding: 0 4px; }
.logo-muestra { max-width: 200px; max-height: 100px; object-fit: contain; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 6px; padding: 8px; }
.ajustes summary { cursor: pointer; color: var(--azul); font-weight: 600; min-height: 32px; }
.ajustes { flex-basis: 100%; }

@media (max-width: 980px) { .editor-escena { grid-template-columns: 1fr; } .vista-previa { position: static; } }
@media (max-width: 760px) {
  .barra { padding: 8px 16px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 32px; }
  .contenido { padding: 16px; }
  .hoja { padding: 16px; }
  h1 { font-size: 1.6rem; }
  .tabla thead { display: none; }
  .tabla tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--linea); }
  .tabla td { border: 0; padding: 4px 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
