/* ExpoTickets Check-in — tema claro y oscuro (sigue al teléfono o se fija con el botón de tema).
   El escáner y los resultados son SIEMPRE oscuros: van sobre la cámara, en puertas con poca luz.
   Colores de marca de expoticketevents.com: oro #C0892A sobre tinta #010102. */

/* ---------- Tokens: claro ---------- */
:root {
  --fondo: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #eef0f3;
  --panel-hover: #e4e7ec;
  --linea: #dcdfe5;
  --linea-fuerte: #c5cad3;
  --texto: #111317;
  --suave: #5a606c;
  --oro: #c0892a;
  --oro-hover: #ad7a22;
  --sobre-oro: #1a1103;
  --oro-texto: #8a5d12;      /* oro legible como texto sobre fondo claro */
  --oro-borde: #e6cf9f;
  --ok-texto: #0b7a3b;   --ok-borde: #b5e2c6;   --ok-suave: #e8f6ee;
  --alerta-texto: #8a5a00; --alerta-borde: #efd593; --alerta-suave: #fdf5dd;
  --mal-texto: #b4232a;  --mal-borde: #f0bcbf;  --mal-suave: #fdecec;
  --sombra: 0 1px 2px rgba(16, 19, 24, 0.06), 0 1px 1px rgba(16, 19, 24, 0.04);
  color-scheme: light;

  --ok-fondo: #0b7a3b;
  --alerta-fondo: #b77905;
  --mal-fondo: #b4232a;
  --radio: 14px;
  --radio-boton: 12px;
  --seguro-arriba: env(safe-area-inset-top, 0px);
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  --fuente: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Tokens: oscuro (automático, forzado, y siempre en el escáner) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --fondo: #010102; --panel: #111215; --panel-2: #1a1c21; --panel-hover: #23262d; --linea: #2a2d34; --linea-fuerte: #3a3e47;
    --texto: #f7f8f8; --suave: #a3a8b3; --oro-texto: #e0b366; --oro-borde: #5b431a; --oro-hover: #d19a37;
    --ok-texto: #6ee7a0; --ok-borde: #1d4d33; --ok-suave: #0e2419;
    --alerta-texto: #ffd27a; --alerta-borde: #5c4412; --alerta-suave: #251c08;
    --mal-texto: #ff8a8e; --mal-borde: #5a2426; --mal-suave: #2a1012;
    --sombra: none; color-scheme: dark;
  }
}
:root[data-theme='dark'],
.siempre-oscuro {
  --fondo: #010102; --panel: #111215; --panel-2: #1a1c21; --panel-hover: #23262d; --linea: #2a2d34; --linea-fuerte: #3a3e47;
  --texto: #f7f8f8; --suave: #a3a8b3; --oro-texto: #e0b366; --oro-borde: #5b431a; --oro-hover: #d19a37;
  --ok-texto: #6ee7a0; --ok-borde: #1d4d33; --ok-suave: #0e2419;
  --alerta-texto: #ffd27a; --alerta-borde: #5c4412; --alerta-suave: #251c08;
  --mal-texto: #ff8a8e; --mal-borde: #5a2426; --mal-suave: #2a1012;
  --sombra: none; color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--oro-texto); }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.oculto-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.solo-imprimir { display: none; }

/* ---------- Marca ---------- */
.marca { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.marca img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.marca > div { min-width: 0; }
.marca b { display: block; font-size: 20px; line-height: 1.15; letter-spacing: -0.01em; white-space: nowrap; }
.marca b span { color: var(--oro); }
.marca small.usuario { text-transform: none; letter-spacing: 0.02em; font-weight: 600; color: var(--oro-texto); }
.marca small { display: block; color: var(--suave); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Página ---------- */
.pagina {
  min-height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(16px + var(--seguro-arriba)) 16px calc(32px + var(--seguro-abajo));
}
.pagina.ancha { max-width: 1040px; }
.encabezado { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; min-height: 48px; }
.encabezado .botones { flex-wrap: nowrap; flex: none; }
h1 { font-size: 26px; line-height: 1.2; margin: 4px 0 6px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
h2 { font-size: 18px; line-height: 1.3; margin: 32px 0 12px; }
.nota { color: var(--suave); font-size: 14px; }
.error-txt { color: var(--mal-texto); font-size: 14px; min-height: 20px; margin: 8px 0; }
.volver { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-size: 14px; color: var(--suave); text-decoration: none; }
.volver:hover { color: var(--texto); }

.tarjeta { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); }
a.tarjeta { display: block; color: inherit; text-decoration: none; transition: border-color 120ms; }
a.tarjeta:hover { border-color: var(--linea-fuerte); }
.lista { display: grid; gap: 10px; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fila > div { min-width: 0; }
.titulo { font-weight: 600; overflow-wrap: anywhere; }
.cabecera-seccion { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 32px 0 12px; }
.cabecera-seccion h2 { margin: 0; }
.interruptor { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; color: var(--suave); cursor: pointer; }
.interruptor input { width: 18px; height: 18px; accent-color: var(--oro); margin: 0; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--radio-boton); border: 1px solid var(--linea);
  background: var(--panel-2); color: var(--texto); font-weight: 600; line-height: 1.2; text-align: center;
  text-decoration: none; white-space: nowrap; transition: background-color 120ms, border-color 120ms;
}
.boton:hover { background: var(--panel-hover); }
.boton:active { transform: translateY(1px); }
.boton.primario { background: var(--oro); border-color: var(--oro); color: var(--sobre-oro); }
.boton.primario:hover { background: var(--oro-hover); border-color: var(--oro-hover); }
.boton.peligro { background: transparent; border-color: var(--mal-borde); color: var(--mal-texto); }
.boton.peligro:hover { background: var(--mal-suave); }
.boton.chico { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.boton.icono { padding: 0; width: 40px; min-height: 40px; }
.boton.icono svg { width: 20px; height: 20px; }
.boton.bloque { width: 100%; }
.boton.con-icono svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 559px) {
  .boton.con-icono { width: 40px; padding: 0; }
  .boton.con-icono .texto { display: none; }
}
.fila-form { display: flex; gap: 8px; flex-wrap: wrap; }
.fila-form .campo { flex: 1 1 220px; margin: 0; }
.tarjeta.fila { flex-wrap: wrap; }
.vacio { padding: 16px; margin: 0; }
.boton[disabled] { opacity: 0.5; cursor: default; transform: none; }
.botones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* Rejilla de acciones: en teléfono los botones se reparten en columnas parejas, nunca sueltos */
.acciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.acciones .boton { width: 100%; white-space: normal; }
.acciones .principal { grid-column: 1 / -1; }
@media (min-width: 720px) { .acciones .principal { grid-column: auto; } }

/* ---------- Formularios ---------- */
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.campo { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.campo label { font-size: 14px; color: var(--suave); }
.campo input, .campo select {
  width: 100%; min-width: 0; min-height: 50px; padding: 0 14px;
  border-radius: var(--radio-boton); border: 1px solid var(--linea-fuerte); background: var(--panel);
}
.campo input:focus, .campo select:focus { border-color: var(--oro); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--oro) 30%, transparent); }
.campo input::placeholder { color: var(--suave); opacity: 0.8; }
.campo input[type='checkbox'], .campo input[type='radio'] { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; accent-color: var(--oro); }
.campo input.pin { font-size: 30px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.buscador { margin: 0; }

/* ---------- Pastillas, barras, cifras ---------- */
.pastilla { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--panel-2); border: 1px solid var(--linea); color: var(--suave); white-space: nowrap; }
.pastilla.ok { color: var(--ok-texto); border-color: var(--ok-borde); background: var(--ok-suave); }
.pastilla.alerta { color: var(--alerta-texto); border-color: var(--alerta-borde); background: var(--alerta-suave); }
.pastilla.mal { color: var(--mal-texto); border-color: var(--mal-borde); background: var(--mal-suave); }
.pastilla.oro { color: var(--oro-texto); border-color: var(--oro-borde); background: transparent; }

.barra { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.barra i { display: block; height: 100%; background: var(--oro); border-radius: 99px; }

.cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .cifras { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.cifra b { display: block; font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cifra span { color: var(--suave); font-size: 13px; }

/* ---------- Tabla ---------- */
.envoltura-tabla { overflow-x: auto; background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; color: var(--suave); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; overflow-wrap: anywhere; }
.tabla tr:last-child td { border-bottom: none; }
.tabla td:last-child { text-align: right; }

/* ---------- Bitácora de escaneos ---------- */
.registro { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
.renglon { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--linea); }
.renglon:last-child { border-bottom: none; }
.renglon .hora { font-size: 13px; color: var(--suave); font-variant-numeric: tabular-nums; min-width: 64px; }
.renglon .cuerpo { min-width: 0; }
.renglon .titulo { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.renglon .nota { font-size: 13px; }
.renglon .fin { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
@media (max-width: 559px) {
  .renglon { grid-template-columns: 1fr auto; }
  .renglon .hora { grid-column: 1 / -1; min-width: 0; }
}

/* ---------- Códigos de puerta ---------- */
.pin-lista { font-size: clamp(22px, 6.4vw, 28px); font-weight: 800; letter-spacing: 0.08em; color: var(--oro-texto); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tarjeta.codigo > .fila { flex-wrap: wrap; row-gap: 6px; }
.tarjeta.codigo .acciones { margin-top: 14px; }
.tarjeta.revocado { opacity: 0.55; }
pre.crudo { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--panel-2); padding: 12px; border-radius: 10px; max-height: 320px; overflow: auto; }

/* ---------- Pestañas ---------- */
.pestanas { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--linea); overflow-x: auto; scrollbar-width: none; }
.pestanas button { background: none; border: none; min-height: 44px; padding: 0 12px; color: var(--suave); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pestanas button:hover { color: var(--texto); }
.pestanas button[aria-selected='true'] { color: var(--texto); border-bottom-color: var(--oro); }

/* ---------- Escáner (siempre oscuro) ---------- */
.escaner { position: fixed; inset: 0; background: #000; color: var(--texto); overflow: hidden; }
.escaner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.escaner .arriba, .escaner .abajo { position: absolute; left: 0; right: 0; z-index: 4; padding-left: 16px; padding-right: 16px; }
.escaner .arriba { top: 0; padding-top: calc(12px + var(--seguro-arriba)); padding-bottom: 36px; background: linear-gradient(rgba(1, 1, 2, 0.92), rgba(1, 1, 2, 0)); }
.escaner .abajo { bottom: 0; padding-top: 36px; padding-bottom: calc(16px + var(--seguro-abajo)); background: linear-gradient(rgba(1, 1, 2, 0), rgba(1, 1, 2, 0.95)); }
.escaner .fila { align-items: flex-start; }
.escaner .evento-nombre { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.escaner .contador { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.escaner .contador small { font-size: 15px; color: var(--suave); font-weight: 600; }
.mira { position: absolute; z-index: 1; left: 50%; top: 47%; width: min(68vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.38); }
.mira i { position: absolute; width: 44px; height: 44px; border: 0 solid var(--oro-texto); }
.mira i:nth-child(1) { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 22px; }
.mira i:nth-child(2) { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 22px; }
.mira i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 22px; }
.mira i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 22px; }
.mira.leyendo i { border-color: #fff; }
.escaner .aviso-camara { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 120px 24px 140px; text-align: center; background: var(--fondo); }
.escaner .aviso-camara > div { max-width: 360px; }
.escaner .aviso-camara .botones { justify-content: center; margin-top: 16px; }
.escaner .fila-botones { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.escaner .fila-botones .boton { min-height: 60px; padding: 6px 4px; background: rgba(26, 28, 33, 0.88); border-color: rgba(255, 255, 255, 0.12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); flex-direction: column; gap: 4px; font-size: 13px; }
.escaner .fila-botones .boton.primario { background: var(--oro); color: var(--sobre-oro); }
.escaner .fila-botones .boton svg { width: 22px; height: 22px; }

/* ---------- Resultado a pantalla completa ---------- */
.resultado {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: calc(24px + var(--seguro-arriba)) 20px calc(24px + var(--seguro-abajo)); text-align: center; color: #fff;
  animation: entra 140ms ease-out;
}
@keyframes entra { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .resultado { animation: none; } .boton { transition: none; } }
.resultado.valido { background: var(--ok-fondo); }
.resultado.repetido { background: var(--alerta-fondo); }
.resultado.mal { background: var(--mal-fondo); }
.resultado .icono { width: 112px; height: 112px; margin-bottom: 14px; }
.resultado .veredicto { font-size: clamp(40px, 13vw, 72px); font-weight: 900; line-height: 1; letter-spacing: -0.02em; margin: 0 0 14px; }
.resultado .quien { font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.resultado .bienvenida { display: grid; justify-items: center; gap: 4px; margin-bottom: 10px; max-width: 560px; }
.resultado .bienvenida .saludo { font-size: 18px; font-weight: 600; opacity: 0.92; }
.resultado .bienvenida .quien { font-size: clamp(28px, 8vw, 40px); font-weight: 800; line-height: 1.1; }
.resultado .pase {
  display: inline-grid; justify-items: center; margin-top: 14px; padding: 10px 26px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.16); border: 2px solid rgba(255, 255, 255, 0.75); color: #fff; min-width: 180px;
}
.resultado .pase small { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.85; }
.resultado .pase b { font-size: clamp(28px, 9vw, 44px); font-weight: 900; line-height: 1.05; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.resultado .pase.premium { background: linear-gradient(135deg, #f3d892, #c9973f 55%, #a8741c); border-color: #fff3d0; color: #1a1103; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); }
.resultado .pase.cortesia { background: #fff; border-color: #fff; color: var(--ok-fondo); }
.resultado .detalle { font-size: 18px; opacity: 0.92; margin-top: 6px; max-width: 520px; }
.resultado .sin-red { margin-top: 14px; display: inline-block; padding: 6px 12px; border-radius: 99px; background: rgba(0, 0, 0, 0.25); font-size: 14px; font-weight: 600; }
.resultado .acciones-resultado { display: grid; gap: 10px; width: min(100%, 420px); margin-top: 28px; }
.resultado .boton { min-height: 58px; font-size: 18px; background: rgba(0, 0, 0, 0.22); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.resultado .boton:hover { background: rgba(0, 0, 0, 0.32); }
.resultado .boton.fuerte { background: #fff; color: #111; border-color: #fff; }
.resultado .progreso { position: absolute; left: 0; bottom: 0; height: 6px; background: rgba(255, 255, 255, 0.55); animation: vacia linear forwards; }
@keyframes vacia { from { width: 100%; } to { width: 0; } }

/* ---------- Hoja inferior (buscar / menú) ---------- */
.hoja-fondo { position: fixed; inset: 0; z-index: 8; background: rgba(0, 0, 0, 0.6); }
.hoja {
  position: fixed; z-index: 9; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow: auto; margin: 0 auto; max-width: 640px;
  background: var(--panel); color: var(--texto); border-radius: 20px 20px 0 0; border: 1px solid var(--linea); border-bottom: none;
  padding: 10px 16px calc(20px + var(--seguro-abajo));
}
.hoja .asa { width: 44px; height: 5px; background: var(--linea-fuerte); border-radius: 9px; margin: 0 auto 14px; }
.hoja .fila h2 { margin: 0; }

/* ---------- Administración en la vista del staff ---------- */
.banda-admin {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; font-size: 14px;
  background: color-mix(in srgb, var(--oro) 16%, var(--panel)); border: 1px solid var(--oro-borde);
}
.banda-admin > div { flex: 1 1 200px; }
.boton.sobre-camara { background: rgba(26, 28, 33, 0.88); border-color: rgba(255, 255, 255, 0.14); color: #f7f8f8; }

/* ---------- Portal de reportes ---------- */
:root { --dato: #ad7a22; } /* gold validado ≥3:1 sobre el panel claro */
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --dato: #c0892a; } }
:root[data-theme='dark'] { --dato: #c0892a; }
.cifra span:first-child { display: block; }
.cifra small { display: block; margin-top: 2px; }
.mini-cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.mini-cifras b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-cifras span { font-size: 12px; color: var(--suave); }
.cabeza-reporte { display: flex; gap: 16px; align-items: flex-start; margin-top: 8px; }
.cabeza-reporte h1 { margin-top: 2px; }
.seccion-reporte { margin-top: 16px; }
.seccion-reporte h2 { margin: 0 0 2px; }
.seccion-reporte > .nota { margin: 0 0 14px; }
.rejilla-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.incidencias { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.incidencias .cifra b { font-size: 24px; }
/* Columnas (tiempo) */
.grafica-col { display: grid; grid-template-columns: 40px 1fr; height: 220px; margin: 6px 0 34px; }
.eje-y { position: relative; }
.eje-y span { position: absolute; right: 8px; transform: translateY(50%); font-size: 11px; color: var(--suave); font-variant-numeric: tabular-nums; }
.grafica-col .area { position: relative; border-bottom: 1px solid var(--linea-fuerte); }
.grafica-col .guia { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--linea); }
.columnas { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.col { position: relative; flex: 1; height: 100%; min-width: 0; display: flex; align-items: flex-end; justify-content: center; background: none; border: 0; padding: 0; cursor: default; }
.col .barra-dato { display: block; width: 100%; max-width: 24px; background: var(--dato); border-radius: 4px 4px 0 0; min-height: 0; }
.col:hover .barra-dato, .col:focus-visible .barra-dato { filter: brightness(1.15); }
.col .etq-x { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--suave); white-space: nowrap; }
/* Barras horizontales (categorías) */
.filas-dato { display: grid; gap: 12px; }
.fila-dato .etq { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 4px; flex-wrap: wrap; }
.fila-dato .pista { display: flex; align-items: center; gap: 8px; }
.fila-dato .barra-dato { height: 20px; background: var(--dato); border-radius: 0 4px 4px 0; }
.fila-dato .pista b { font-size: 14px; font-variant-numeric: tabular-nums; }
.globo-dato { position: absolute; z-index: 20; pointer-events: none; background: var(--panel); color: var(--texto); border: 1px solid var(--linea-fuerte); border-radius: 10px; padding: 6px 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); display: grid; }
.globo-dato b { font-size: 15px; }
.globo-dato span { font-size: 12px; color: var(--suave); }
.solo-tel { display: none; }
/* Asistentes en teléfono: renglones en vez de tabla (nombre y estado arriba; lo demás abajo) */
@media (max-width: 599px) {
  .tabla-asistentes thead { display: none; }
  .tabla-asistentes tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--linea); }
  .tabla-asistentes tr:last-child { border-bottom: none; }
  .tabla-asistentes td { display: block; padding: 0; border: 0; text-align: left !important; }
  .tabla-asistentes .c-nombre { grid-column: 1; grid-row: 1; }
  .tabla-asistentes .c-estado { grid-column: 2; grid-row: 1; }
  .tabla-asistentes .c-pase, .tabla-asistentes .c-contacto, .tabla-asistentes .c-entrada { grid-column: 1 / -1; font-size: 13px; color: var(--suave); }
  .tabla-asistentes .c-entrada:empty { display: none; }
  .solo-tel { display: inline; }
}
.ver-tabla summary { cursor: pointer; font-size: 14px; color: var(--suave); margin-top: 4px; }
.ver-tabla .envoltura-tabla { margin-top: 8px; }

/* ---------- Permisos de los códigos ---------- */
.chips-permisos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips-permisos .pastilla { white-space: normal; }
.selector-eventos { display: grid; gap: 2px; background: var(--panel-2); border-radius: 12px; padding: 6px 12px; }
.fila-permiso { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--linea); }
.fila-permiso:last-child { border-bottom: none; }
.fila-permiso .interruptor { color: var(--texto); }
.interruptor.hasta input { width: auto; min-height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--linea-fuerte); background: var(--panel); }

/* ---------- Marcas: portadas y logos ---------- */
a.tarjeta.tarjeta-evento, .tarjeta-evento { display: flex; gap: 14px; align-items: stretch; border-left: 4px solid var(--acento-marca, var(--linea)); }
.tarjeta-evento .info { flex: 1; min-width: 0; }
.portada-mini { width: 76px; height: 95px; flex: none; object-fit: cover; border-radius: 10px; background: var(--panel-2); }
.logo-mini { display: block; height: 38px; width: auto; max-width: 170px; object-fit: contain; margin-bottom: 6px; }
.marca-evento:empty { display: none; }
.logo-marca { display: block; height: 42px; width: auto; max-width: 180px; object-fit: contain; margin-bottom: 4px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.logo-resultado { height: 64px; width: auto; max-width: 60%; object-fit: contain; margin-bottom: 18px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35)); }
.previa-logo { display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; overflow: hidden; border: 1px solid var(--linea); margin: 12px 0; }
.previa-logo > div { display: grid; place-items: center; padding: 16px; min-height: 110px; }
.previa-logo .oscuro { background: #010102; border-right: 4px solid var(--acento-marca, transparent); }
.previa-logo .claro { background: #f3f4f6; }
.previa-logo img { max-width: 100%; max-height: 90px; object-fit: contain; }
.marca-portada { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: start; }
.portada-grande { width: 140px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; background: var(--panel-2); }
.portada-vacia { width: 140px; aspect-ratio: 4 / 5; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; padding: 10px; text-align: center; font-size: 12px; }
@media (max-width: 420px) { .marca-portada { grid-template-columns: 100px 1fr; } .portada-grande, .portada-vacia { width: 100px; } }

/* ---------- Usuario del staff y avisos sin conexión ---------- */
.usuario-staff { font-size: 14px; font-weight: 700; color: var(--oro-texto); letter-spacing: 0.01em; }
.usuario-codigo { font-size: 13px; font-weight: 700; color: var(--oro-texto); margin: 2px 0; }
.aviso-sin-red {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.35;
  background: rgba(183, 121, 5, 0.94); color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.capa-alerta { z-index: 14; }
.lista-choques { display: grid; gap: 10px; margin: 16px 0 6px; width: min(100%, 420px); text-align: left; }
.lista-choques > div { background: rgba(0, 0, 0, 0.22); border-radius: 12px; padding: 10px 14px; }

/* ---------- Notificaciones internas ---------- */
.campana { position: relative; }
.campana.sobre-camara { background: rgba(26, 28, 33, 0.88); border-color: rgba(255, 255, 255, 0.14); color: #f7f8f8; }
.campana .insignia {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--mal-fondo); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  border: 2px solid var(--fondo); font-variant-numeric: tabular-nums;
}
.pila-avisos {
  position: fixed; z-index: 9; top: calc(76px + var(--seguro-arriba)); left: 50%; transform: translateX(-50%); /* debajo de la pantalla de resultado */
  width: min(100% - 24px, 440px); display: grid; gap: 8px; pointer-events: none;
}
/* En computadora: esquina superior derecha, debajo del encabezado (no tapa sus botones) */
@media (min-width: 720px) {
  .pila-avisos { left: auto; right: 20px; transform: none; width: 380px; top: calc(80px + var(--seguro-arriba)); }
}
.aviso-emergente {
  pointer-events: auto; text-align: left; width: 100%; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: var(--panel); color: var(--texto); border: 1px solid var(--linea); border-left: 5px solid var(--linea-fuerte);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); animation: baja 180ms ease-out;
}
.aviso-emergente.ok { border-left-color: var(--ok-fondo); }
.aviso-emergente.alerta { border-left-color: var(--alerta-fondo); }
.aviso-emergente.mal { border-left-color: var(--mal-fondo); }
.aviso-emergente .titulo { font-size: 15px; }
.aviso-emergente .nota { font-size: 13px; }
@keyframes baja { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .aviso-emergente { animation: none; } }
.capa-alta.hoja-fondo { z-index: 12; }
.capa-alta.hoja { z-index: 13; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--linea-fuerte); background: transparent; color: var(--suave); font-weight: 600; font-size: 14px; }
.chip.activo { background: var(--oro); border-color: var(--oro); color: var(--sobre-oro); }
.lista-actividad { display: grid; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
.renglon-actividad {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; background: var(--panel);
  border: none; border-bottom: 1px solid var(--linea); border-left: 4px solid transparent; color: var(--texto);
}
.renglon-actividad:last-child { border-bottom: none; }
.renglon-actividad.ok { border-left-color: var(--ok-fondo); }
.renglon-actividad.alerta { border-left-color: var(--alerta-fondo); }
.renglon-actividad.mal { border-left-color: var(--mal-fondo); }
.renglon-actividad:not([disabled]):hover { background: var(--panel-2); }
.renglon-actividad[disabled] { cursor: default; opacity: 1; }
.renglon-actividad .cuerpo { flex: 1; min-width: 0; }
.renglon-actividad .flecha { color: var(--suave); font-size: 22px; }
.con-ficha { cursor: pointer; }
.renglon.con-ficha:hover, .tarjeta.con-ficha:hover { background: var(--panel-2); }

/* ---------- Ficha del asistente ---------- */
.ficha-cabeza { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ficha-nombre { font-size: 22px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.ficha-seccion { margin-top: 18px; }
.ficha-seccion h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--suave); margin: 0 0 6px; }
dl.datos { display: grid; grid-template-columns: minmax(110px, auto) 1fr; margin: 0; background: var(--panel-2); border-radius: 12px; padding: 4px 12px; }
dl.datos dt, dl.datos dd { padding: 8px 0; border-bottom: 1px solid var(--linea); margin: 0; font-size: 14px; }
dl.datos dt { color: var(--suave); padding-right: 12px; }
dl.datos dd { overflow-wrap: anywhere; font-weight: 500; }
dl.datos dt:nth-last-of-type(1), dl.datos dd:last-of-type { border-bottom: none; }
dl.datos code { font-size: 12px; }
.historial { display: grid; gap: 0; background: var(--panel-2); border-radius: 12px; padding: 0 12px; }
.historial .fila { padding: 10px 0; border-bottom: 1px solid var(--linea); font-size: 14px; }
.historial .fila:last-child { border-bottom: none; }

/* ---------- Hoja de QR de práctica ---------- */
.hoja-qr { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.hoja-qr .qr { background: #fff; color: #111; border: 1px solid var(--linea); border-radius: 12px; padding: 14px; text-align: center; break-inside: avoid; }
.hoja-qr .qr svg { width: 100%; height: auto; display: block; }
.hoja-qr .qr b { display: block; margin-top: 6px; }

/* ---------- Impresión ---------- */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; }
  .no-imprimir, .encabezado, .pestanas, .tarjeta.revocado { display: none !important; }
  .pagina { padding: 0; max-width: none; min-height: 0; }
  .hoja-qr { grid-template-columns: repeat(3, 1fr); }
  .hoja-qr .qr { border: 1px solid #ccc; }
  .solo-imprimir { display: block; margin-top: 6px; color: #444; }
  .tarjeta.codigo { background: #fff; color: #111; border: 1px dashed #999; box-shadow: none; break-inside: avoid; margin-bottom: 10px; }
  .tarjeta.codigo .nota { color: #444; }
  .tarjeta.codigo .pin-lista { color: #111; }
}

/* ---------- Quiénes entraron (staff) ---------- */
.lista-entraron { display: grid; margin-top: 10px; border: 1px solid var(--linea); border-radius: 14px; overflow: hidden; }
.lista-entraron .vacio { padding: 16px; margin: 0; }
.renglon-entrada { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: transparent; border: 0; border-bottom: 1px solid var(--linea); color: inherit; font: inherit; text-align: left; }
.renglon-entrada:last-child { border-bottom: 0; }
button.renglon-entrada { cursor: pointer; }
button.renglon-entrada:active { background: var(--linea); }
.renglon-entrada .cuerpo { flex: 1; min-width: 0; }
.renglon-entrada .titulo { overflow-wrap: anywhere; }
.renglon-entrada .cuando { flex: none; text-align: right; display: grid; gap: 2px; }
.renglon-entrada .cuando small { color: var(--suave); font-size: 12px; }
