* { box-sizing: border-box; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #0e1116; color: #e6e9ef; line-height: 1.5;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }
.wrap.narrow { max-width: 440px; }
.wrap.ancho { max-width: 1180px; }
header { margin-bottom: 24px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; margin-bottom: 12px; color: #9fb3d1; }
.sub { color: #8a93a3; font-size: .92rem; }
.center { text-align: center; }
.muted { color: #8a93a3; font-size: .88rem; }
code { background: #1a2029; padding: 2px 6px; border-radius: 4px; font-size: .85em; }

.card {
  background: #161b23; border: 1px solid #232b38; border-radius: 12px;
  padding: 20px; margin-bottom: 18px;
}
label { display: block; margin-bottom: 12px; font-size: .92rem; }
input[type=text], input:not([type]), select {
  width: 100%; padding: 10px 12px; margin-top: 6px;
  background: #0e1116; color: #e6e9ef;
  border: 1px solid #2c3547; border-radius: 8px; font-size: 1rem;
}
fieldset { border: 1px solid #232b38; border-radius: 8px; padding: 12px; margin-bottom: 14px; }
legend { color: #8a93a3; font-size: .85rem; padding: 0 6px; }
.langs { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  background: #0e1116; border: 1px solid #2c3547; border-radius: 20px;
  padding: 6px 12px; cursor: pointer; font-size: .88rem;
}
.chip:has(input:checked) { border-color: #4a8fe7; background: #14243a; }

button, .btn {
  display: inline-block; background: #2563eb; color: #fff; border: none;
  border-radius: 8px; padding: 10px 18px; font-size: .95rem; cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: #1d4fd7; }
button:disabled { background: #2c3547; cursor: not-allowed; }
button.danger, .btn.danger { background: #b91c1c; }
button.big { font-size: 1.15rem; padding: 14px 26px; margin-right: 10px; }

.event-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid #232b38; flex-wrap: wrap;
}
.event-row:first-of-type { border-top: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions .btn, .actions button { font-size: .82rem; padding: 7px 12px; }
.badge.live { color: #ef4444; font-size: .8rem; font-weight: 700; margin-left: 8px; }

.vu { height: 14px; background: #0e1116; border: 1px solid #2c3547; border-radius: 7px; margin-top: 12px; overflow: hidden; }
#vu-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #22c55e, #eab308, #ef4444); transition: width .08s linear; }

#lang-status { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.lang-row { display: flex; justify-content: space-between; background: #0e1116; border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.qr { border-radius: 8px; background: #fff; padding: 8px; margin-top: 8px; }

/* Cabecera con sesión iniciada */
.barra {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap;
}
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav .btn, .nav button { font-size: .85rem; padding: 8px 14px; }
button.ghost { background: transparent; border: 1px solid #2c3547; color: #93a0b4; }
button.ghost:hover { background: #1a2029; }
.saldo-chip {
  font-size: .82rem; padding: 6px 12px; border-radius: 100px;
  background: #14243a; border: 1px solid #2c3547; color: #9fb3d1;
}
.saldo-chip.alerta { background: #3a1a1a; border-color: #6b2626; color: #f0a0a0; }
.error {
  background: #3a1a1a; border: 1px solid #6b2626; color: #f0a0a0;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem;
}
.aviso {
  background: #3a2f14; border: 1px solid #6b5626; color: #f0d9a0;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: .9rem;
}
.fila-campos { display: grid; gap: 14px; grid-template-columns: 2fr 1fr; }
@media (max-width: 560px) { .fila-campos { grid-template-columns: 1fr; } }

/* Métricas de consumo */
.metricas {
  display: grid; gap: 14px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.metrica {
  background: #161b23; border: 1px solid #232b38; border-radius: 12px; padding: 16px;
}
.metrica .et {
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: #6b7789; margin-bottom: 6px;
}
.metrica .v { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.metrica .v small { font-size: .82rem; font-weight: 400; color: #8a93a3; }
.metrica.destaca .v { color: #7dd3fc; }
.metrica.alerta .v { color: #f0a0a0; }
.metrica .pie { font-size: .78rem; color: #6b7789; margin-top: 6px; }
/* Nombre propio: llamarla .barra chocaba con la cabecera .barra y le imponía
   5px de alto con overflow oculto, dejándola ilegible. */
.barra-saldo { height: 5px; background: #232b38; border-radius: 100px; overflow: hidden; margin-top: 10px; }
.barra-saldo i { display: block; height: 100%; background: #7dd3fc; border-radius: 100px; }

/* Tablas de consumo */
.tabla-envoltura { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
th {
  text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: #6b7789; font-weight: 700; padding: 0 12px 10px 0; border-bottom: 1px solid #232b38;
}
td { padding: 11px 12px 11px 0; border-bottom: 1px solid #1a212c; color: #8a93a3; }
td.destaca { color: #e6e9ef; font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }
tr:last-child td { border-bottom: none; }
.pill {
  font-size: .7rem; padding: 2px 8px; border-radius: 100px; font-weight: 600;
  background: #14243a; color: #7dd3fc; margin-left: 6px;
}
#gasto-vivo { margin-top: 10px; font-size: .85rem; color: #8a93a3; }
#gasto-vivo strong { color: #e6e9ef; }

td.negativo { color: #f0a0a0; }
.card.resaltada { border-color: #6b5626; background: #1c1a13; }
/* Si el correo está configurado pero el envío falló, hay que verlo: si no,
   el técnico espera un mensaje que nunca llega. */
.pill.fallo { background: #3a1a1a; color: #f0a0a0; }
.reset-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 10px 0; border-top: 1px solid #232b38; flex-wrap: wrap;
}
.reset-row:first-of-type { border-top: none; }
.enlace-reset {
  flex: 1; min-width: 280px; margin: 0; padding: 8px 10px; font-size: .78rem;
  font-family: ui-monospace, Menlo, monospace;
  background: #0e1116; color: #9fb3d1; border: 1px solid #2c3547; border-radius: 6px;
}
.form-horas { display: flex; gap: 6px; align-items: center; }
.form-horas input {
  width: 76px; margin: 0; padding: 6px 8px; font-size: .82rem;
  background: #0e1116; color: #e6e9ef; border: 1px solid #2c3547; border-radius: 6px;
}
.form-horas button { padding: 6px 12px; font-size: .78rem; }

/* Bonos de saldo */
.bonos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.bono {
  background: #0e1116; border: 1px solid #2c3547; border-radius: 12px;
  padding: 18px 16px; text-align: center; margin: 0;
}
.bono:hover { border-color: #4a8fe7; }
.bono-saldo { font-size: 1.8rem; font-weight: 750; letter-spacing: -.03em; }
.bono-horas { font-size: .78rem; color: #8a93a3; margin: 4px 0 8px; }
.bono-extra {
  display: inline-block; font-size: .74rem; font-weight: 700; margin-bottom: 10px;
  background: #14532d; color: #bbf7d0; padding: 3px 9px; border-radius: 100px;
}
.bono button { width: 100%; margin-top: 6px; }

button.warn { background: #b45309; }
button.warn:hover { background: #92400e; }

/* Monitor de escucha del técnico */
.monitor-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.monitor-btn {
  background: #0e1116; border: 1px solid #2c3547; color: #e6e9ef;
  font-size: .9rem; padding: 10px 16px;
}
.monitor-btn:hover { background: #14243a; border-color: #4a8fe7; }
.monitor-btn.activo { background: #14532d; border-color: #22c55e; color: #bbf7d0; }
.monitor-btn.activo::before { content: "🎧 "; }
.actas { display: flex; flex-wrap: wrap; gap: 8px; }
.actas .btn { font-size: .88rem; }

/* ---------- Marca Miami Live Streaming ----------
   Solo en las pantallas que ve el asistente: es el escaparate del servicio
   ante cientos de personas en cada evento, muchas de ellas organizadores. */
body.marca {
  background: #07090f;
  color: #e8edf5;
}
.cabecera-marca { padding-top: 12px; margin-bottom: 26px; }
.cabecera-marca .logo {
  width: 200px; max-width: 62%; height: auto; display: block;
  margin: 0 auto 22px;
}
.marca h1 {
  font-size: 1.45rem; line-height: 1.2; letter-spacing: -.02em;
  text-wrap: balance; margin-bottom: 8px;
}
.marca .lema {
  font-size: 1.05rem; color: #edf24e; font-weight: 600; margin: 0;
}
.marca .pista {
  color: #8a93a3; font-size: .88rem; margin-top: 18px;
}
.marca .lang-btn {
  background: #121722; border: 1px solid #2c3547; color: #e8edf5;
}
.marca .lang-btn:hover, .marca .lang-btn:active {
  border-color: #edf24e; background: #171a12;
}
.marca .pulse { background: #edf24e; }
@keyframes pulse-marca {
  0% { box-shadow: 0 0 0 0 rgba(237,242,78,.5); }
  100% { box-shadow: 0 0 0 26px rgba(237,242,78,0); }
}
.marca .pulse { animation: pulse-marca 1.6s ease-out infinite; }
.marca #player-lang { color: #edf24e; }
/* Subtítulos: se leen en un móvil, en una sala, a veces de pie. Tamaño
   generoso y altura fija para que el resto de la pantalla no baile. */
.subs {
  margin: 22px 0 18px; padding: 16px 18px; text-align: left;
  background: #121722; border: 1px solid #2c3547; border-radius: 12px;
}
.subs p {
  margin: 0; max-height: 42vh; overflow-y: auto;
  font-size: 1.08rem; line-height: 1.55; color: #e8edf5;
  overflow-wrap: break-word;
}
.subs p:empty::before {
  content: "Los subtítulos aparecerán aquí en cuanto empiece a hablar.";
  color: #6b7789; font-size: .92rem;
}
.acciones-oyente {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 10px;
}
.acciones-oyente .btn { font-size: .88rem; }

.pie-marca {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid #1f2734;
  font-size: .8rem; color: #6b7789; line-height: 1.7;
}
.pie-marca strong { color: #e8edf5; font-weight: 700; }
.pie-marca .web { display: block; color: #edf24e; margin-top: 2px; }

/* Página del oyente */
.listen-body { display: block; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.lang-btn {
  padding: 22px 10px; font-size: 1.1rem; border-radius: 14px;
  background: #161b23; border: 1px solid #2c3547; color: #e6e9ef;
}
.lang-btn:hover { border-color: #4a8fe7; background: #14243a; }
.hidden { display: none !important; }
.now-playing { margin: 40px 0 24px; }
#player-lang { font-size: 1.4rem; font-weight: 700; margin-top: 16px; }
.pulse {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto;
  background: #2563eb; animation: pulse 1.6s ease-out infinite;
}
/* Un corte de red no es un error: se avisa sin alarmar y se recupera solo */
#player-status.reconectando { color: #eab308; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,99,235,.55); }
  100% { box-shadow: 0 0 0 26px rgba(37,99,235,0); }
}
