/* Papyllon · Panel de pantallas — mismo estilo que la maqueta aprobada */
:root {
  --fondo: #0A0807; --sup: #15110E; --sup2: #1E1814; --hondo: #0F0C0A;
  --linea: #2E241D; --linea2: #3A2E25; --texto: #FFF7EE; --suave: #BFAE9C;
  --naranja: #FF6A00; --naranja2: #FF8A1F; --oro: #FFC300; --verde: #3DDC84; --verde2: #5BE49B; --rojo: #FF5A4E;
  --fuego: linear-gradient(135deg, #FF3D00, #FF8A00 55%, #FFC300);
  --titulo: "Unbounded", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--naranja2); } a:hover { color: var(--oro); }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Botones ── */
.btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--linea2); background: var(--sup); color: var(--texto);
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--naranja); }
.btn-fuego { border: none; background: var(--fuego); color: #1A0B02; font-weight: 800; box-shadow: 0 6px 24px rgba(255,90,0,.35); }
.btn-fuego:hover:not(:disabled) { filter: brightness(1.06); }
.btn-borde { background: transparent; }
.btn-peligro { background: transparent; border-color: rgba(255,90,78,.5); color: var(--rojo); }
.btn-peligro:hover:not(:disabled) { border-color: var(--rojo); background: rgba(255,90,78,.08); }
.btn-grande { min-height: 54px; border-radius: 14px; font-size: 16px; width: 100%; }
.btn-icono { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 10px; }
.btn svg { flex-shrink: 0; }

/* ── Carga ── */
.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--suave); }
.splash-llama { width: 64px; animation: respirar 1.8s ease-in-out infinite; }
@keyframes respirar { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(255,90,0,.3)); } 50% { transform: scale(1.08); filter: drop-shadow(0 0 22px rgba(255,140,0,.7)); } }
.girando { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(26,11,2,.3); border-top-color: currentColor; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ── Entrar ── */
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.entrar::before { content: ""; position: absolute; left: 50%; top: -260px; width: 900px; height: 560px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,90,0,.25), rgba(255,90,0,0)); pointer-events: none; }
.caja-entrar { position: relative; width: min(420px, 100%); background: var(--sup); border: 1px solid var(--linea); border-radius: 22px; padding: 32px 28px; display: grid; gap: 18px; }
.caja-entrar h1 { margin: 0; font: 800 24px var(--titulo); }
.caja-entrar p { margin: 0; color: var(--suave); font-size: 14px; }
.marca { display: flex; justify-content: center; }
.marca img { height: 120px; width: auto; }
.campo { display: grid; gap: 6px; }
.campo label, .etiqueta { font-size: 14px; font-weight: 600; }
.campo input, .campo select { height: 48px; border-radius: 10px; border: 1px solid var(--linea2); background: var(--fondo); color: var(--texto); padding: 0 14px; font-size: 16px; width: 100%; }
.campo input:focus, .campo select:focus { border-color: var(--naranja); outline: none; box-shadow: 0 0 0 3px rgba(255,106,0,.18); }
.ayuda { font-size: 13px; color: var(--suave); }
.error { padding: 12px 14px; border-radius: 12px; background: rgba(255,90,78,.1); color: #FF9C93; font-size: 14px; font-weight: 600; }

/* ── Cabecera ── */
.cab { position: sticky; top: 0; z-index: 20; overflow: hidden; border-bottom: 1px solid var(--linea); background: rgba(10,8,7,.92); backdrop-filter: blur(10px);
  padding: 12px 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.cab::before { content: ""; position: absolute; left: -120px; top: -160px; width: 520px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,90,0,.28), rgba(255,90,0,0)); pointer-events: none; }
.cab > * { position: relative; }
.cab-marca { display: flex; align-items: center; gap: 14px; }
.cab-marca img { height: 56px; width: auto; }
.cab-txt { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--linea); padding-left: 14px; }
.cab-txt b { font: 800 17px var(--titulo); letter-spacing: .02em; }
.cab-txt span { font-size: 13px; color: var(--suave); }
.cab-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.cab-nav a { min-height: 40px; display: flex; align-items: center; padding: 0 14px; border-radius: 10px; color: var(--suave); text-decoration: none; font-weight: 600; }
.cab-nav a[aria-current="page"] { background: var(--sup2); color: var(--texto); font-weight: 700; }
.cab-acc { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Estructura ── */
main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 40px; }
.fila { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.col-tvs { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.titulo-sec { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.titulo-sec h1, .titulo-sec h2 { margin: 0; font: 800 30px var(--titulo); }
.titulo-sec h2 { font-size: 26px; }
.titulo-sec span { color: var(--suave); font-size: 14px; }

/* ── Tarjetas de TV ── */
.rejilla-tvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tv { text-align: left; padding: 0; background: var(--sup); border-radius: 18px; border: 2px solid var(--linea); overflow: hidden; display: flex; flex-direction: column; color: var(--texto); transition: border-color .15s, box-shadow .15s; }
.tv:hover { border-color: var(--linea2); }
.tv[aria-pressed="true"] { border-color: var(--naranja); box-shadow: 0 0 0 4px rgba(255,106,0,.18), 0 12px 40px rgba(255,90,0,.25); }
.tv-pantalla { position: relative; aspect-ratio: 16/9; width: 100%; background: #000; overflow: hidden; }
.tv-imagen { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #000; }
.tv-imagen.vertical { width: 32%; }
.tv-imagen img { width: 100%; height: 100%; object-fit: cover; }
.tv-imagen .logo-espera { width: auto; height: 80%; object-fit: contain; }
.tv.apagado .tv-imagen { opacity: .4; }
.chip { position: absolute; top: 10px; display: flex; align-items: center; gap: 6px; background: rgba(10,8,7,.82); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.chip.izq { left: 10px; } .chip.der { right: 10px; }
.punto { width: 8px; height: 8px; border-radius: 50%; }
.en-vivo { color: var(--verde2); } .en-vivo .punto { background: var(--verde); box-shadow: 0 0 8px var(--verde); }
.sin-senal { color: var(--suave); } .sin-senal .punto { background: #7A6E62; }
.chip-bucle { color: var(--oro); }
.chip-pend { left: 10px; top: auto; bottom: 10px; color: var(--oro); background: rgba(40,25,0,.9); }
.tv-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.tv-nombre { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tv-nombre b { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pastilla { font-size: 12px; color: var(--suave); border: 1px solid var(--linea2); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.tv-sub { font-size: 13px; color: var(--suave); } .tv-sub strong { color: var(--texto); }
.tv-nuevo { min-height: 240px; border-radius: 18px; border: 2px dashed var(--linea2); background: transparent; color: var(--suave); font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.tv-nuevo:hover { border-color: var(--naranja); color: var(--texto); }
.tv-nuevo small { font-weight: 400; font-size: 13px; }

/* ── Editor lateral ── */
.editor { flex: 1 1 400px; max-width: 480px; min-width: 0; background: var(--sup); border: 1px solid var(--linea); border-radius: 22px; padding: 24px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 100px; }
.editor-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.editor-cab > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-tit { font-size: 12px; font-weight: 700; color: var(--naranja2); text-transform: uppercase; letter-spacing: .1em; }
.editor h2 { margin: 0; font: 800 24px var(--titulo); overflow-wrap: anywhere; }
.editor-cab span { font-size: 14px; color: var(--suave); } .editor-cab strong { color: var(--texto); }
.caja { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--sup2); border: 1px solid var(--linea); }
.interruptor-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.interruptor-fila b { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.interruptor-fila span { font-size: 13px; color: var(--suave); }
.interruptor { width: 60px; height: 34px; flex-shrink: 0; border-radius: 999px; border: none; padding: 3px; background: var(--linea2); display: flex; justify-content: flex-start; transition: background .2s; }
.interruptor[aria-checked="true"] { background: linear-gradient(135deg, #FF3D00, #FFB300); justify-content: flex-end; }
.interruptor i { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: block; }
.modo { text-align: left; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--linea); background: transparent; color: var(--texto); display: flex; flex-direction: column; gap: 2px; width: 100%; }
.modo[aria-pressed="true"] { border-color: var(--naranja); background: rgba(255,106,0,.12); }
.modo b { font-size: 14px; } .modo span { font-size: 12px; color: var(--suave); }
.lista-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lista-cab b { font-size: 15px; } .lista-cab span { font-size: 12px; color: var(--suave); }
.item { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--linea); border-radius: 14px; background: var(--hondo); }
.item.inactivo { opacity: .45; }
.item-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.item-n { width: 18px; text-align: center; font-weight: 700; color: var(--suave); flex-shrink: 0; }
.miniatura { width: 64px; height: 40px; border-radius: 8px; background: var(--sup2); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--suave); }
.miniatura img { width: 100%; height: 100%; object-fit: cover; }
.item-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-txt b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-txt span { font-size: 12px; color: var(--suave); }
.item-quitar { width: 32px; height: 32px; flex-shrink: 0; border: none; border-radius: 9px; background: transparent; color: var(--suave); display: grid; place-items: center; }
.item-quitar:hover { color: var(--rojo); background: rgba(255,90,78,.08); }
.item-ctrl { display: flex; align-items: center; gap: 6px; padding-left: 28px; }
.contador { display: flex; align-items: center; gap: 2px; background: var(--sup2); border-radius: 10px; padding: 2px; }
.contador button { width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; color: var(--texto); font-size: 18px; font-weight: 700; }
.contador button:hover:not(:disabled) { background: var(--linea); }
.contador output { min-width: 30px; text-align: center; font-size: 13px; font-weight: 700; color: var(--oro); }
.segundos { max-width: 118px; height: 34px; border-radius: 10px; border: none; background: var(--sup2); color: var(--oro); font-weight: 700; font-size: 13px; padding: 0 8px; }
.item-acc { display: flex; gap: 2px; margin-left: auto; }
.item-acc button { width: 34px; height: 34px; border: none; border-radius: 9px; background: var(--sup2); color: var(--suave); font-size: 12px; padding: 0; }
.item-acc button:hover:not(:disabled) { background: var(--linea); color: var(--texto); }
.vacio { padding: 18px; border-radius: 14px; border: 1px dashed var(--linea2); color: var(--suave); text-align: center; font-size: 14px; }
.nota-bucle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--oro); padding: 2px 4px; }
.btn-agregar { min-height: 44px; border-radius: 12px; border: 1px dashed var(--linea2); background: transparent; color: var(--texto); font-weight: 600; }
.btn-agregar:hover { border-color: var(--naranja); }
.pendiente { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255,195,0,.08); border: 1px solid rgba(255,195,0,.3); color: var(--oro); font-size: 13px; font-weight: 600; }
.enviado { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--suave); }

/* ── Biblioteca ── */
.rejilla-medios { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.soltar { min-height: 172px; border-radius: 16px; border: 2px dashed var(--naranja); background: rgba(255,106,0,.08); color: #FFB066; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px; cursor: pointer; }
.soltar.encima { background: rgba(255,106,0,.18); border-color: var(--oro); }
.soltar b { font-size: 14px; } .soltar span { font-size: 12px; color: var(--suave); }
.medio { border-radius: 16px; background: var(--sup); border: 1px solid var(--linea); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.medio-img { position: relative; aspect-ratio: 16/9; background: var(--sup2); display: flex; align-items: center; justify-content: center; color: var(--suave); }
.medio-img img { width: 100%; height: 100%; object-fit: cover; }
.duracion { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.75); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: 12px; font-weight: 700; }
.medio-txt { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.medio-txt b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medio-txt span { font-size: 12px; color: var(--suave); }
.medio-borrar { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 9px; border: none; background: rgba(10,8,7,.8); color: var(--suave); display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.medio:hover .medio-borrar, .medio-borrar:focus-visible { opacity: 1; }
.medio-borrar:hover { color: var(--rojo); }
.subiendo { border-color: var(--naranja); }
.barra { height: 6px; border-radius: 99px; background: var(--linea); overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--fuego); width: 0; transition: width .2s; }

/* ── Ventanas ── */
.velo { position: fixed; inset: 0; z-index: 50; background: rgba(5,4,3,.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.ventana { width: min(560px, 100%); background: var(--sup); color: var(--texto); border-radius: 22px; border: 1px solid var(--linea); padding: 28px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 40px); overflow-y: auto; }
.ventana.ancha { width: min(880px, 100%); }
.ventana-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ventana-cab > div { display: flex; align-items: center; gap: 12px; }
.ventana-cab img { height: 46px; }
.ventana h2 { margin: 0; font: 800 22px var(--titulo); }
.ventana-cab p { margin: 4px 0 0; font-size: 14px; color: var(--suave); }
.dos { display: flex; gap: 16px; } .dos > * { flex: 1; min-width: 0; }
.opciones { display: flex; gap: 12px; }
.opcion { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--linea2); font-weight: 600; cursor: pointer; }
.opcion:has(input:checked) { border: 2px solid var(--naranja); background: rgba(255,106,0,.12); }
.opcion input { accent-color: var(--naranja); width: 18px; height: 18px; }
.marcar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--sup2); border: 1px solid var(--linea); font-weight: 600; cursor: pointer; }
.marcar span { display: flex; flex-direction: column; gap: 2px; } .marcar small { font-weight: 400; font-size: 13px; color: var(--suave); }
.marcar input { width: 22px; height: 22px; accent-color: var(--naranja); }
.ventana-pie { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.elegir { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.elegible { position: relative; border-radius: 14px; border: 2px solid var(--linea); background: var(--hondo); padding: 0; overflow: hidden; text-align: left; color: var(--texto); }
.elegible[aria-pressed="true"] { border-color: var(--naranja); box-shadow: 0 0 0 3px rgba(255,106,0,.18); }
.elegible .medio-img { border-radius: 0; }
.elegible .marca-sel { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(10,8,7,.8); border: 2px solid var(--suave); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #1A0B02; }
.elegible[aria-pressed="true"] .marca-sel { background: var(--fuego); border-color: transparent; }
.zona-peligro { border-top: 1px solid var(--linea); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── Avisos ── */
#avisos { pointer-events: none; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(480px, calc(100% - 32px)); }
.aviso { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 14px; background: #0F2A1A; color: var(--verde2); font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: entra .25s ease; }
.aviso.mal { background: #2E1210; color: #FF9C93; }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } }

/* ── Móvil ── */
@media (max-width: 900px) {
  .cab { padding: 10px 16px; position: static; }
  .cab-marca img { height: 40px; }
  main { padding: 20px 16px; gap: 32px; }
  .editor { position: static; max-width: none; padding: 18px; }
  .titulo-sec h1 { font-size: 24px; } .titulo-sec h2 { font-size: 22px; }
  .rejilla-tvs { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 560px) {
  .cab-acc .btn { flex: 1; }
  .cab-acc { width: 100%; }
  .dos, .opciones { flex-direction: column; }
  .ventana { padding: 20px; }
  .rejilla-medios { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .medio-borrar { opacity: 1; }
}
