* { box-sizing: border-box; }
body {
  margin: 0; background: #0f172a; color: #e2e8f0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size: 15px;
}
.contenedor { max-width: 760px; margin: 0 auto; padding: 20px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h1 { font-size: 20px; margin: 0; }
h1 span { color: #10b981; }
.subtitulo { color: #94a3b8; font-size: 13px; margin-top: 2px; }
.tarjeta { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.tarjeta h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin: 0 0 12px; }
label { display: block; font-size: 13px; color: #cbd5e1; margin: 10px 0 4px; }
input, select {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid #475569;
  background: #0f172a; color: #f1f5f9; font-size: 14px;
}
.fila { display: flex; gap: 12px; }
.fila > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.check input { width: auto; }
button {
  padding: 12px 16px; border: none; border-radius: 8px; font-size: 14px; font-weight: 700;
  cursor: pointer; background: #059669; color: #fff;
}
button.rojo { background: #dc2626; }
button.gris { background: #334155; }
button:disabled { opacity: .5; cursor: default; }
.botones { display: flex; gap: 10px; margin-top: 14px; }
.botones button { flex: 1; }
.estado { display: inline-block; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; background: #334155; }
.estado.ok { background: #065f46; color: #a7f3d0; }
.estado.warn { background: #78350f; color: #fde68a; }
.estado.err { background: #7f1d1d; color: #fecaca; }
.vu { height: 22px; background: #0f172a; border: 1px solid #334155; border-radius: 6px; overflow: hidden; }
.vu-barra { height: 100%; width: 0; background: #10b981; transition: width 60ms linear; }
.vu-barra.amarillo { background: #f59e0b; }
.vu-barra.rojo { background: #ef4444; }
.datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.dato { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 10px; }
.dato b { display: block; font-size: 16px; margin-top: 2px; }
.dato small { color: #94a3b8; font-size: 12px; }
.modo { font-size: 26px; font-weight: 800; text-align: center; padding: 18px; border-radius: 12px; margin-bottom: 14px; }
.modo.principal { background: #065f46; color: #d1fae5; }
.modo.respaldo { background: #78350f; color: #fef3c7; }
.modo.mudo { background: #7f1d1d; color: #fee2e2; }
#registro { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow-y: auto; font-family: Consolas, monospace; font-size: 12px; }
#registro li { padding: 3px 0; border-bottom: 1px solid #1e293b; color: #94a3b8; }
#registro li.ok { color: #6ee7b7; }
#registro li.warn { color: #fcd34d; }
#registro li.err { color: #fca5a5; }
.aviso { background: #78350f; color: #fef3c7; padding: 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.oculto { display: none !important; }
.capa {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .92); display: flex;
  align-items: center; justify-content: center; z-index: 10;
}
.capa button { font-size: 20px; padding: 20px 30px; }

/* ---------- Paneles ---------- */
.ancho { max-width: 1180px; }
.barra-sup { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.barra-sup .usuario { color: #94a3b8; font-size: 13px; }
.pestanas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid #334155; }
.pestanas button { background: transparent; color: #94a3b8; border-radius: 8px 8px 0 0; padding: 10px 14px; }
.pestanas button.activa { background: #1e293b; color: #f8fafc; border: 1px solid #334155; border-bottom-color: #1e293b; margin-bottom: -1px; }
button.chico { padding: 6px 10px; font-size: 12px; font-weight: 600; }
button.azul { background: #2563eb; }
button.ambar { background: #d97706; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: #94a3b8; font-weight: 600; padding: 8px 6px; border-bottom: 1px solid #334155; white-space: nowrap; }
td { padding: 8px 6px; border-bottom: 1px solid #1e293b; vertical-align: middle; }
td .acciones { display: flex; gap: 4px; flex-wrap: wrap; }
.tabla-scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #334155; color: #cbd5e1; }
.pill.ok { background: #065f46; color: #a7f3d0; }
.pill.warn { background: #78350f; color: #fde68a; }
.pill.err { background: #7f1d1d; color: #fecaca; }
.grilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.formulario { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.ayuda { color: #94a3b8; font-size: 12px; margin-top: 4px; }
.mono { font-family: Consolas, "JetBrains Mono", monospace; }
.caja-credencial { background: #0f172a; border: 1px dashed #10b981; border-radius: 8px; padding: 12px; margin-top: 12px; font-family: Consolas, monospace; font-size: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.ok { background: #065f46; color: #ecfdf5; }
.toast.err { background: #991b1b; color: #fef2f2; }

/* ---------- Consola del estudio ---------- */
.tiras { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tira { background: #0f172a; border: 2px solid #334155; border-radius: 12px; padding: 12px; }
.tira.al-aire { border-color: #dc2626; }
.tira .nombre { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tira .vu { margin: 10px 0 8px; height: 14px; }
.tira .controles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tira .controles button { padding: 10px 6px; font-size: 12px; }
.tira button.btn-aire { background: #334155; grid-column: span 2; font-size: 14px; padding: 12px; }
.tira.al-aire button.btn-aire { background: #dc2626; }
.tira button.activo { background: #2563eb; }
.tira button.hablando { background: #d97706; }
.tira input[type=range] { margin-top: 8px; padding: 0; }
.vacio { color: #64748b; text-align: center; padding: 24px; border: 1px dashed #334155; border-radius: 12px; }

/* ---------- Cronista ---------- */
.grande { font-size: 30px; font-weight: 900; text-align: center; padding: 26px 12px; border-radius: 16px; margin-bottom: 14px; letter-spacing: .02em; background: #334155; }
.grande.espera { background: #1e3a5f; color: #bfdbfe; }
.grande.aire { background: #dc2626; color: #fff; }
.grande.talk { outline: 4px solid #f59e0b; }
.btn-enorme { width: 100%; font-size: 20px; padding: 18px; border-radius: 14px; }
@media (max-width: 600px) {
  .contenedor { padding: 12px; }
  .fila { flex-direction: column; gap: 0; }
  .datos { grid-template-columns: repeat(2, 1fr); }
}
