/* =========================================================
   La Roka Club — Sistema de Control de Acceso
   Rediseño · LIGHT THEME · navegación superior compartida
   D'Agostini Sistemas · sin recursos externos · fuente del sistema
   ========================================================= */

:root {
  /* ---- Superficies (claras, limpias) ---- */
  --bg:            #f4f6f8;   /* fondo de página */
  --bg-2:          #eef1f4;
  --surface:       #ffffff;   /* tarjetas */
  --surface-2:     #f5f7f9;   /* inputs / zonas suaves */
  --surface-3:     #eef1f4;   /* hover suave */
  --surface-4:     #e6eaef;

  /* ---- Bordes ---- */
  --border:        #e4e8ee;
  --border-strong: #d3d9e2;

  /* ---- Texto ---- */
  --text:          #1a1f27;
  --text-2:        #48505b;
  --muted:         #858e9b;

  /* ---- Marca (carmesí La Roka) ---- */
  --accent:        #c1121f;
  --accent-2:      #d61f2c;
  --accent-3:      #a10f1a;
  --accent-ink:    #9a0d17;   /* texto carmesí legible sobre claro */
  --accent-weak:   rgba(193,18,31,.08);
  --accent-soft:   rgba(193,18,31,.14);
  --accent-glow:   rgba(193,18,31,.30);

  /* ---- Semánticos ---- */
  --ok:            #16a34a;
  --ok-ink:        #15803d;
  --ok-weak:       rgba(22,163,74,.12);
  --warn:          #d97706;
  --warn-ink:      #b45309;
  --warn-weak:     rgba(217,119,6,.12);

  /* ---- Forma ---- */
  --radius:        14px;
  --radius-lg:     18px;
  --radius-sm:     10px;
  --radius-pill:   999px;

  /* ---- Sombras (suaves, tema claro) ---- */
  --shadow-sm:     0 1px 2px rgba(16,24,40,.06);
  --shadow:        0 8px 24px -12px rgba(16,24,40,.18);
  --shadow-lg:     0 24px 60px -22px rgba(16,24,40,.30);
  --ring:          0 0 0 3px var(--accent-soft);

  /* ---- Tipografía ---- */
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --num:  "Segoe UI", ui-sans-serif, system-ui, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* overflow-x: clip evita el scroll lateral SIN romper position:sticky
   (hidden crea un contenedor de scroll y anula el sticky del buscador). */
html, body { margin: 0; min-height: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
  overflow-x: clip;
}

/* Halo de marca muy sutil detrás de todo (claro) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(820px 460px at 88% -10%, rgba(193,18,31,.06), transparent 60%),
    radial-gradient(680px 420px at 4% 2%, rgba(193,18,31,.045), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

a { color: inherit; text-decoration: none; }
b, strong { font-weight: 650; }
svg { display: block; }
.tnum { font-variant-numeric: tabular-nums; }

/* =========================================================
   Marca / Logo
   ========================================================= */
.brand { display: flex; align-items: center; gap: 12px; }

.monogram {
  position: relative;
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  overflow: hidden;
  font-weight: 800; font-size: 16px; letter-spacing: .5px;
  color: #f2ece2;
  background: #0b0a0a;
  border: 1px solid rgba(0,0,0,.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 6px 16px -8px rgba(0,0,0,.55);
}
/* Logo real: se recorta el aire negro del archivo con un zoom centrado */
.monogram img {
  position: absolute; top: 50%; left: 50%;
  width: 185%; height: 185%;
  transform: translate(-50%, -50%);
  object-fit: cover;
}
.monogram.lg { width: 60px; height: 60px; border-radius: 16px; font-size: 22px; }

.wordmark { line-height: 1.14; }
.wordmark b {
  display: block; font-size: 14px; font-weight: 750; color: var(--text);
  letter-spacing: .14em; text-transform: uppercase;
}
.wordmark span {
  display: block; font-size: 11px; color: var(--muted);
  letter-spacing: .06em; margin-top: 2px;
}

/* =========================================================
   TOP-NAV compartida (admin + puerta)
   ========================================================= */
.topnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  min-height: 66px;
  padding: 10px 22px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.topnav-brand { flex: 0 0 auto; }

/* Segmento de navegación central (Eventos / Puerta) */
.topnav-links {
  display: inline-flex; gap: 4px;
  margin: 0 auto;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.nav-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px; border-radius: var(--radius-pill);
  color: var(--text-2); font-size: 14px; font-weight: 600;
  white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.nav-link svg { width: 17px; height: 17px; opacity: .9; }
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active {
  color: var(--accent-ink); background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent-soft);
}
.nav-link.active svg { color: var(--accent); opacity: 1; }

.topnav-user { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }

/* Chip de usuario / estado */
.userchip {
  display: inline-flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 6px 0 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.userchip > span:last-child { padding-right: 8px; }
.userchip .avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff;
  background: linear-gradient(150deg, var(--accent-2), var(--accent));
}
.userchip .dot {
  width: 8px; height: 8px; border-radius: 50%; margin-left: 6px;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-weak);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--ok-weak); }
  50%      { box-shadow: 0 0 0 5px rgba(22,163,74,.05); }
}

/* Top-nav responsive: nav pasa a fila propia, sin drawers */
@media (max-width: 720px) {
  .topnav { flex-wrap: wrap; gap: 10px; padding: 10px 14px; min-height: 0; }
  .topnav-brand { order: 1; }
  .topnav-user { order: 2; margin-left: auto; }
  .topnav-links { order: 3; flex-basis: 100%; margin: 2px 0 0; justify-content: stretch; }
  .nav-link { flex: 1; padding: 0 10px; }
  .wordmark span { display: none; }
}
@media (max-width: 420px) {
  .topnav-brand .wordmark { display: none; }
  .userchip #whoami { display: none; }
}

/* =========================================================
   Layout
   ========================================================= */
.container { max-width: 1120px; margin: 0 auto; padding: 30px 22px 90px; }
.center { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }

/* Vistas (mini-SPA con ruteo por hash) */
.view { animation: viewIn .28s var(--ease) both; }
.view[hidden] { display: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Encabezado de página */
.page-head { margin-bottom: 8px; }
.page-head.spread { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 720; letter-spacing: -.02em; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }

/* Breadcrumb / volver a la lista */
.crumb {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px 0 8px; border-radius: var(--radius-pill);
  color: var(--text-2); font-size: 13px; font-weight: 620;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.crumb:hover { color: var(--accent-ink); background: var(--surface); border-color: var(--accent-soft); }
.crumb svg { width: 16px; height: 16px; }

/* Acciones de la cabecera del evento */
.ev-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 620px) {
  .page-head.spread { flex-direction: column; }
  .page-head.spread > button { width: 100%; }
  .ev-head-actions { width: 100%; justify-content: space-between; }
}

.section { margin-top: 30px; animation: rise .4s var(--ease) both; }
.section:first-child { margin-top: 0; }

.section-head { margin-bottom: 16px; }
.section-head.spread { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-head h2 { margin: 0; font-size: 19px; font-weight: 680; letter-spacing: -.01em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 10px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* =========================================================
   Card
   ========================================================= */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card.pad-lg { padding: 30px; }

/* =========================================================
   Formularios
   ========================================================= */
.field { display: flex; flex-direction: column; gap: 8px; }
label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}

input, select {
  width: 100%; height: 46px; padding: 0 15px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input::placeholder { color: #a9b0ba; }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
/* Input con ícono a la izquierda */
.input-icon { position: relative; }
.input-icon > svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
  transition: color .16s var(--ease);
}
.input-icon input { padding-left: 42px; }
.input-icon:focus-within > svg { color: var(--accent); }

select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23858e9b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}

/* =========================================================
   Botones
   ========================================================= */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 20px; cursor: pointer;
  font-size: 14px; font-weight: 640; font-family: inherit; letter-spacing: .01em;
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 8px 18px -10px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .12s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease), background .16s var(--ease);
}
button:hover, .btn:hover { filter: brightness(1.04); box-shadow: 0 12px 24px -10px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.22); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); filter: brightness(.97); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ring), 0 8px 18px -10px var(--accent-glow); }

button svg, .btn svg { width: 17px; height: 17px; }

/* Secundario (claro con borde) */
button.sec, .btn.sec {
  background: var(--surface); color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
button.sec:hover, .btn.sec:hover { background: var(--surface-2); border-color: var(--muted); filter: none; }

/* Ghost (texto) */
button.ghost, .btn.ghost {
  background: transparent; color: var(--text-2);
  border-color: transparent; box-shadow: none;
}
button.ghost:hover, .btn.ghost:hover { color: var(--text); background: var(--surface-3); filter: none; transform: none; }

button.danger { background: linear-gradient(180deg, #e23b48, var(--accent-3)); }

button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

button.sm, .btn.sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--radius-sm); }
button.block, .btn.block { width: 100%; }

/* =========================================================
   Grillas
   ========================================================= */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 720px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

/* =========================================================
   KPIs
   ========================================================= */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s var(--ease), transform .16s var(--ease);
}
.kpi:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border-strong);
}
.kpi.good::before { background: var(--ok); }
.kpi.warn::before { background: var(--warn); }
.kpi b {
  display: block; font-family: var(--num);
  font-size: 32px; font-weight: 740; line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--text);
}
.kpi span {
  display: block; margin-top: 6px;
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); font-weight: 650;
}
.kpi.good b { color: var(--ok-ink); }
.kpi.warn b { color: var(--warn-ink); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr 1fr; } }

/* =========================================================
   Tablas
   ========================================================= */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 14px 18px; white-space: nowrap; }
th {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
tbody tr { border-top: 1px solid var(--border); transition: background .12s var(--ease); }
tbody tr:first-child { border-top: 0; }
tbody tr:hover { background: var(--surface-2); }
td b { font-weight: 620; }
td .cell-type {
  text-transform: uppercase; font-size: 11px; letter-spacing: .05em;
  color: var(--text-2); font-weight: 700;
}

/* =========================================================
   Pills / estados
   ========================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 680; letter-spacing: .02em;
  text-transform: capitalize;
  padding: 5px 12px; border-radius: var(--radius-pill);
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.valida, .pill.activo { background: var(--ok-weak); color: var(--ok-ink); border-color: rgba(22,163,74,.22); }
.pill.usada, .pill.cerrado { background: var(--warn-weak); color: var(--warn-ink); border-color: rgba(217,119,6,.22); }
.pill.anulada, .pill.invalida { background: var(--accent-weak); color: var(--accent-ink); border-color: var(--accent-soft); }

/* =========================================================
   Mensajes inline
   ========================================================= */
.msg {
  margin-top: 14px; padding: 12px 15px;
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent;
  display: flex; align-items: center; gap: 9px;
  animation: rise .25s var(--ease) both;
}
.msg:empty { display: none; }
.msg.err { background: var(--accent-weak); color: var(--accent-ink); border-color: var(--accent-soft); }
.msg.ok  { background: var(--ok-weak); color: var(--ok-ink); border-color: rgba(22,163,74,.22); }

/* =========================================================
   Estado vacío
   ========================================================= */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: 34px 18px; color: var(--muted);
}
.empty svg { width: 34px; height: 34px; color: var(--border-strong); margin-bottom: 6px; }
.empty b { color: var(--text-2); font-size: 14px; font-weight: 650; }
.empty span { font-size: 13px; }

/* =========================================================
   Footer / divisores
   ========================================================= */
.footer {
  text-align: center; color: var(--muted); font-size: 12px;
  margin-top: 40px; letter-spacing: .02em;
}
.footer b { color: var(--text-2); font-weight: 650; }

.divider { height: 1px; background: var(--border); margin: 22px 0; border: 0; }

/* =========================================================
   LOGIN — split screen con foto (adaptado a tema claro)
   ========================================================= */
.auth-split {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  max-width: 100%;
  background: var(--bg);
}

/* ---- Lado imagen ---- */
.auth-hero {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 42px 46px;
  overflow: hidden;
  background: #12141a;
}
.auth-hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background-image: url('/assets/club.jpg');
  background-size: cover; background-position: center;
  transform: scale(1.04);
}
.auth-hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(12,14,20,.35) 0%, rgba(12,14,20,.30) 40%, rgba(12,14,20,.85) 100%),
    radial-gradient(120% 80% at 25% 15%, rgba(193,18,31,.34), transparent 60%);
}
.auth-hero > * { position: relative; z-index: 2; }
.auth-hero .monogram { border: 1px solid rgba(255,255,255,.22); }
.auth-hero .wordmark b { color: #fff; }
.auth-hero .wordmark span { color: rgba(255,255,255,.72); }

.auth-hero-bottom { max-width: 460px; }
.auth-title {
  margin: 0; color: #fff;
  font-size: clamp(30px, 3.4vw, 46px); font-weight: 760; line-height: 1.06;
  letter-spacing: -.02em;
  text-shadow: 0 4px 30px rgba(0,0,0,.5);
}
.auth-lead {
  margin: 16px 0 22px; color: rgba(255,255,255,.86);
  font-size: 16px; line-height: 1.5; max-width: 420px;
}
.auth-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.auth-features li {
  display: flex; align-items: center; gap: 11px;
  color: rgba(255,255,255,.92); font-size: 14.5px;
}
.auth-features .tick {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800;
  box-shadow: 0 6px 16px -6px var(--accent-glow);
}
.auth-hero-credit { color: rgba(255,255,255,.62); font-size: 12px; letter-spacing: .03em; }
.auth-hero-credit b { color: rgba(255,255,255,.85); }

/* ---- Lado formulario ---- */
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
  background:
    radial-gradient(700px 420px at 85% -10%, var(--accent-weak), transparent 60%),
    var(--surface);
}
.auth-form { width: 100%; max-width: 380px; animation: rise .45s var(--ease) both; }
.auth-brand-mobile { display: none; margin-bottom: 26px; }
.auth-credit-mobile { display: none; }

.section-head h2 + p, .auth-form .section-head p { color: var(--muted); font-size: 13.5px; }

@media (max-width: 900px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { min-height: 280px; padding: 30px 28px; }
  .auth-hero-bottom { max-width: none; }
  .auth-panel { padding: 34px 22px 48px; }
  .auth-hero-credit { display: none; }
  .auth-credit-mobile { display: block; margin-top: 30px; }
}
/* ---- Login MÓVIL: pantalla completa con foto + tarjeta flotante ---- */
@media (max-width: 560px) {
  .auth-hero { display: none; }              /* el hero desktop se reemplaza por el fondo */

  .auth-panel {
    position: relative;
    min-height: 100dvh;
    display: flex; align-items: stretch; justify-content: center;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
    background: #0d0f14;
    overflow: hidden;
  }
  /* Foto del club de fondo, a pantalla completa */
  .auth-panel::before {
    content: "";
    position: absolute; inset: 0;
    background-image: url('/assets/club.jpg');
    background-size: cover; background-position: center;
    transform: scale(1.05);
  }
  /* Velo oscuro + glow carmesí de marca para que todo se lea */
  .auth-panel::after {
    content: "";
    position: absolute; inset: 0;
    background:
      linear-gradient(180deg, rgba(10,11,16,.60) 0%, rgba(10,11,16,.38) 34%, rgba(10,11,16,.90) 82%),
      radial-gradient(130% 70% at 18% 0%, rgba(193,18,31,.36), transparent 62%);
  }

  /* Formulario ARRIBA: cuando el teclado sube desde abajo, el form queda visible */
  .auth-form {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; justify-content: flex-start;
    width: 100%; max-width: 400px;
  }

  /* Marca arriba, centrada y en blanco sobre la foto */
  .auth-brand-mobile {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 10px;
    margin: 1.5vh auto 0;
    padding-bottom: 20px;
  }
  .auth-brand-mobile .monogram.lg {
    width: 64px; height: 64px; border-radius: 18px;
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: 0 18px 44px -14px rgba(0,0,0,.7);
  }
  .auth-brand-mobile .wordmark b { color: #fff; font-size: 16px; }
  .auth-brand-mobile .wordmark span { color: rgba(255,255,255,.72); }

  /* El formulario/menú como tarjeta de VIDRIO: la foto se ve a través */
  #login, #menu {
    background: rgba(15,13,19,.55);
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 22px;
    padding: 22px 18px 20px;
    box-shadow: 0 26px 60px -20px rgba(0,0,0,.6);
  }

  /* Texto y controles en claro sobre el vidrio */
  .auth-form .eyebrow { color: #ff97a0; }
  .auth-form .eyebrow::before { background: linear-gradient(90deg, #ff97a0, transparent); }
  .auth-form .section-head h2 { color: #fff; }
  .auth-form .section-head p { color: rgba(255,255,255,.68); }
  .auth-form label { color: rgba(255,255,255,.62); }
  .auth-form input {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.22);
    color: #fff;
  }
  .auth-form input::placeholder { color: rgba(255,255,255,.42); }
  .auth-form .input-icon > svg { color: rgba(255,255,255,.55); }
  .auth-form .input-icon:focus-within > svg { color: #ff97a0; }
  .auth-form input:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(224,49,63,.28);
    background: rgba(255,255,255,.14);
  }
  .auth-form .msg.err {
    background: rgba(224,49,63,.2);
    color: #ffb1b8;
    border-color: rgba(224,49,63,.4);
  }
  /* Menú post-login sobre vidrio */
  .auth-form .btn.sec {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.24);
    box-shadow: none;
  }
  .auth-form button.ghost { color: rgba(255,255,255,.78); }

  /* Marca de agua justo debajo de la tarjeta del login */
  .auth-credit-mobile {
    margin-top: 20px;
    color: rgba(255,255,255,.55);
    font-size: 11.5px;
    letter-spacing: .04em;
  }
  .auth-credit-mobile b { color: rgba(255,255,255,.85); }
}

/* =========================================================
   PUERTA — escáner
   ========================================================= */
.scanner { max-width: 540px; margin: 0 auto; }

.reader-shell {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0c0d10;   /* el área de video se mantiene oscura */
  aspect-ratio: 1 / 1;
}
#reader { width: 100%; height: 100%; }
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
#reader img[alt="Info icon"], #reader__dashboard_section_csr span { filter: grayscale(1); }

/* Marco de puntería con esquinas + línea de barrido */
.reader-frame { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.reader-frame .corner {
  position: absolute; width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,.92);
  filter: drop-shadow(0 0 6px rgba(0,0,0,.5));
}
.reader-frame .tl { top: 16%; left: 16%; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.reader-frame .tr { top: 16%; right: 16%; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.reader-frame .bl { bottom: 16%; left: 16%; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.reader-frame .br { bottom: 16%; right: 16%; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.reader-frame .laser {
  position: absolute; left: 16%; right: 16%; top: 16%;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ff5765, transparent);
  box-shadow: 0 0 14px 2px var(--accent-glow);
  animation: sweep 2.6s var(--ease) infinite;
}
@keyframes sweep {
  0%, 100% { transform: translateY(0); opacity: .35; }
  50%      { transform: translateY(calc(68vw - 8px)); opacity: 1; }
}
@media (min-width: 560px) {
  @keyframes sweep {
    0%, 100% { transform: translateY(0); opacity: .35; }
    50%      { transform: translateY(340px); opacity: 1; }
  }
}

.scan-hint {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  text-align: center; color: var(--text-2); font-size: 13.5px;
  margin-top: 18px; letter-spacing: .02em;
}
.scan-hint::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak);
  animation: pulse 1.8s var(--ease) infinite;
}

/* Acción de regreso al panel bajo el escáner */
.scan-back { margin-top: 16px; }

/* =========================================================
   PUERTA — resultado a pantalla completa (verde/rojo)
   ========================================================= */
.resultado {
  position: fixed; inset: 0; z-index: 50;
  display: none; place-items: center; text-align: center; padding: 32px;
  color: #fff;
  animation: fade .16s var(--ease);
}
@keyframes fade { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }
.resultado.show { display: grid; }
.resultado.ok {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(180deg, #16a34a, #0a6b32);
}
.resultado.no {
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(180deg, #d61f2c, #8a0c16);
}
.resultado .icono {
  width: 134px; height: 134px; margin: 0 auto 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 78px; line-height: 1; color: #fff;
  background: rgba(255,255,255,.16);
  border: 2px solid rgba(255,255,255,.4);
  box-shadow: 0 0 0 14px rgba(255,255,255,.06), 0 20px 50px -12px rgba(0,0,0,.5);
  animation: pop .32s var(--ease) both;
}
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
.resultado h2 { font-size: clamp(34px, 9vw, 50px); margin: 0 0 8px; letter-spacing: .01em; font-weight: 780; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.resultado p { font-size: clamp(16px, 4.5vw, 21px); margin: 4px 0; opacity: .96; font-weight: 550; }
.resultado #r-extra { opacity: .82; font-weight: 450; }

/* =========================================================
   Modal QR
   ========================================================= */
.modal {
  position: fixed; inset: 0; z-index: 40; display: none; place-items: center;
  padding: 24px;
  background: rgba(16,24,40,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade .16s var(--ease);
}
.modal.show { display: grid; }
.modal .card { animation: rise .22s var(--ease) both; box-shadow: var(--shadow-lg); }

/* Card del modal Crear evento */
.modal-card { width: 100%; max-width: 520px; text-align: left; max-height: calc(100dvh - 48px); overflow-y: auto; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.modal-head .eyebrow { margin-bottom: 8px; }
button.ghost.icon { width: 36px; padding: 0; flex: 0 0 auto; }
button.ghost.icon svg { width: 18px; height: 18px; }
.qr-frame {
  background: #fff; border-radius: 14px; padding: 16px;
  display: inline-block; line-height: 0;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(16,24,40,.04);
}
.qr-frame img { width: 260px; height: 260px; border-radius: 4px; }

/* =========================================================
   Lista de eventos (tarjetas con imagen de portada)
   ========================================================= */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.ev-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.ev-card:hover, .ev-card:focus-visible {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.ev-card:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow); }

/* Portada: foto + degradado para que el texto siempre se lea */
.ev-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #12141a;
  overflow: hidden;
}
.ev-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .45s var(--ease);
}
.ev-card:hover .ev-cover img { transform: scale(1.05); }
.ev-cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,11,16,.10) 0%, rgba(10,11,16,.06) 40%, rgba(10,11,16,.82) 100%);
}
.ev-cover .pill.on-img { position: absolute; top: 12px; right: 12px; z-index: 2; }

.ev-cover-txt {
  position: absolute; left: 16px; right: 16px; bottom: 13px; z-index: 2;
  color: #fff;
}
.ev-cover-txt h3 {
  margin: 5px 0 0; font-size: 18px; font-weight: 720; letter-spacing: -.01em;
  line-height: 1.2; color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,.55);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ev-cover-date {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.88);
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.ev-cover-date svg { width: 13px; height: 13px; opacity: .85; }

/* Pills sobre imagen: vidrio esmerilado, siempre legibles */
.pill.on-img {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(12,14,20,.55);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: none;
}
.pill.on-img.activo::before { background: #4ade80; }
.pill.on-img.cerrado::before { background: #fbbf24; }

/* Cuerpo de la tarjeta */
.ev-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; }
.ev-go {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13.5px; font-weight: 650; color: var(--accent-ink);
  padding-top: 12px; border-top: 1px solid var(--border);
}
.ev-go svg { width: 16px; height: 16px; transition: transform .18s var(--ease); }
.ev-card:hover .ev-go svg { transform: translateX(4px); }

.progress .bar { height: 8px; border-radius: 99px; background: var(--surface-4); overflow: hidden; }
.progress .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s var(--ease); }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.progress-meta b { color: var(--text); font-variant-numeric: tabular-nums; }

/* =========================================================
   Detalle de evento — banner con imagen (hero)
   ========================================================= */
.ev-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #12141a;
  box-shadow: var(--shadow);
}
.ev-hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ev-hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,11,16,.38) 0%, rgba(10,11,16,.42) 45%, rgba(10,11,16,.88) 100%),
    radial-gradient(120% 90% at 12% 0%, rgba(193,18,31,.30), transparent 58%);
}
.ev-hero-inner {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: space-between; gap: 34px;
  min-height: 250px;
  padding: 20px 24px 22px;
}
.ev-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ev-hero-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.ev-hero-info { min-width: 0; }
.ev-hero-info h1 {
  margin: 0; color: #fff;
  font-size: clamp(24px, 3.4vw, 34px); font-weight: 760; letter-spacing: -.02em; line-height: 1.12;
  text-shadow: 0 3px 24px rgba(0,0,0,.55);
}
.ev-hero .eyebrow { color: #ff97a0; margin-bottom: 8px; }
.ev-hero .eyebrow::before { background: linear-gradient(90deg, #ff97a0, transparent); }
.ev-hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.date-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 13px; border-radius: var(--radius-pill);
  background: rgba(12,14,20,.5); color: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
}
.date-chip svg { width: 14px; height: 14px; opacity: .8; }

/* Controles sobre el hero: estilo "vidrio" */
.ev-hero .crumb {
  background: rgba(12,14,20,.5); color: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ev-hero .crumb:hover { background: rgba(12,14,20,.72); color: #fff; border-color: rgba(255,255,255,.4); }
.ev-hero .live {
  background: rgba(12,60,34,.55); color: #6ee7a0;
  border-color: rgba(110,231,160,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ev-hero .live-dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.ev-hero button.sec {
  background: rgba(12,14,20,.5); color: #fff;
  border-color: rgba(255,255,255,.24);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: none;
}
.ev-hero button.sec:hover { background: rgba(12,14,20,.75); border-color: rgba(255,255,255,.45); }
.ev-hero .pill.activo {
  background: rgba(12,60,34,.55); color: #6ee7a0; border-color: rgba(110,231,160,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ev-hero .pill.cerrado {
  background: rgba(72,50,6,.55); color: #fcd34d; border-color: rgba(252,211,77,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* =========================================================
   Selector de imagen de portada (modal Crear evento)
   ========================================================= */
.img-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.img-opt {
  position: relative;
  display: block; height: auto; padding: 0;
  border-radius: var(--radius-sm); overflow: hidden;
  background: #12141a; border: 2px solid var(--border);
  box-shadow: none; cursor: pointer;
  transition: border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.img-opt:hover { filter: none; transform: translateY(-1px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.img-opt img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.img-opt:hover img { transform: scale(1.05); }
.img-opt::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,11,16,.72) 100%);
}
.img-opt-name {
  position: absolute; left: 9px; bottom: 7px; z-index: 2;
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .03em;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.img-opt-check {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px -4px var(--accent-glow);
  opacity: 0; transform: scale(.6);
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.img-opt-check svg { width: 12px; height: 12px; }
.img-opt.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.img-opt.active .img-opt-check { opacity: 1; transform: scale(1); }
.img-opt:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* Opción "Personalizada": subir una foto propia desde el dispositivo.
   Sin foto elegida muestra un placeholder (ícono + texto); con foto,
   muestra la previsualización igual que las sugeridas. */
.img-opt-custom img { display: none; }
.img-opt-custom.has-img img { display: block; }
.img-opt-custom.has-img .img-opt-upload { display: none; }
.img-opt-custom:not(.has-img)::after { display: none; }
.img-opt-custom:not(.has-img) .img-opt-name { display: none; }
.img-opt-upload {
  display: grid; place-items: center; gap: 6px;
  width: 100%; aspect-ratio: 4 / 3; padding: 6px;
  background: #12141a; color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-align: center;
}
.img-opt-upload svg { width: 22px; height: 22px; }
.img-opt-custom:hover .img-opt-upload { color: var(--text); }

/* =========================================================
   Responsive general
   ========================================================= */
@media (max-width: 820px) {
  .container { padding: 24px 18px 84px; }
  .section { margin-top: 26px; }
  .section-head.spread { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 620px) {
  .container { padding: 20px 14px 76px; }
  .card { padding: 18px; }
  .card.pad-lg { padding: 22px; }
  th, td { padding: 12px 14px; }
  .page-head h1 { font-size: 21px; }
  .section-head h2 { font-size: 18px; }
  .row.actions-mobile { flex-direction: column; align-items: stretch; }
  .row.actions-mobile > button, .row.actions-mobile > .btn { width: 100%; }
}

@media (max-width: 430px) {
  .qr-frame img { width: min(260px, 62vw); height: auto; }
  .resultado .icono { width: 108px; height: 108px; font-size: 62px; }
  .auth-form { max-width: 100%; }
}

/* Alto reducido en horizontal (puerta) */
@media (max-height: 520px) and (orientation: landscape) {
  .scanner .card { padding: 14px; }
  .reader-shell { aspect-ratio: auto; height: 62vh; }
}

/* =========================================================
   DETALLE DE EVENTO — mobile-first
   (indicador en vivo · agregar invitado · buscador · filtros ·
    lista de participantes · toast)
   ========================================================= */

/* ---- Indicador "en vivo" (SSE activo) ---- */
.live {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: var(--radius-pill);
  background: var(--ok-weak); color: var(--ok-ink);
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  border: 1px solid rgba(22,163,74,.22);
}
.live[hidden] { display: none; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-weak);
  animation: pulse 1.8s var(--ease) infinite;
}

/* ---- Barra "Agregar invitado" (flujo rápido con el pulgar) ---- */
.add-card { padding: 16px; }
.add-bar { display: flex; gap: 10px; align-items: stretch; }
.add-bar .input-icon { flex: 1 1 auto; min-width: 0; }
.add-bar input { height: 50px; }
.add-bar > button { height: 50px; flex: 0 0 auto; padding: 0 20px; }

/* Toggle del modo secundario "Generar por cantidad" */
.toggle-gen {
  margin-top: 12px; height: auto; padding: 8px 6px;
  background: none; color: var(--text-2);
  border: 0; box-shadow: none; font-size: 13px; font-weight: 640; gap: 6px;
}
.toggle-gen:hover { background: none; color: var(--accent-ink); filter: none; transform: none; box-shadow: none; }
.toggle-gen:focus-visible { box-shadow: var(--ring); }
.toggle-gen .chev { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.toggle-gen.open .chev { transform: rotate(180deg); }
.gen-panel { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--border); }
.gen-panel[hidden] { display: none; }
.gen-panel .actions-mobile { margin-top: 16px; }

/* ---- Controles de la lista: buscador + filtros ---- */
.list-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.list-controls .search { flex: 1 1 220px; min-width: 0; }
.list-controls .search input { height: 46px; }

.filters {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.chip {
  height: 38px; padding: 0 16px; border-radius: var(--radius-pill);
  background: none; color: var(--text-2); border: 0; box-shadow: none;
  font-size: 13px; font-weight: 640; white-space: nowrap;
}
.chip:hover { background: var(--surface); color: var(--text); filter: none; transform: none; box-shadow: none; }
.chip.active { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent-soft); }
.chip:focus-visible { box-shadow: var(--ring); }

/* ---- Lista de participantes ---- */
.part-list { display: flex; flex-direction: column; gap: 8px; }

/* Renglón FINO tipo lista (móvil): nombre + meta a la izquierda, acciones como íconos a la derecha */
.part-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 12px; box-shadow: var(--shadow-sm);
  transition: border-color .16s var(--ease);
}
.part-item:hover { border-color: var(--border-strong); }
.part-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.part-name { font-size: 15px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part-meta { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.part-meta .cell-type { text-transform: capitalize; white-space: nowrap; }
.part-meta .pill { padding: 2px 9px; font-size: 11px; }
.part-hora { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.part-hora b { color: var(--text-2); font-weight: 650; }
.part-meta .cell-code { font-family: "Consolas", ui-monospace, monospace; font-size: 11.5px; letter-spacing: .5px; color: var(--muted); opacity: .75; white-space: nowrap; }

.part-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* Estado "generando" en un botón de acción: spinner centrado */
.part-actions > button { position: relative; }
.part-actions > button.loading { pointer-events: none; opacity: .8; }
.part-actions > button.loading > * { visibility: hidden; }
.part-actions > button.loading::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
/* Móvil: acciones como ÍCONOS cuadrados al costado (sin texto) */
.part-actions > button {
  width: 42px; height: 42px; padding: 0; min-width: 0; font-size: 0;
  border-radius: 11px;
}
.part-actions > button .lbl { display: none; }
.part-actions > button svg { width: 19px; height: 19px; }

/* Marcar ingreso (check-in): oscuro = ACCIÓN (el verde queda para el ESTADO "Ingresó") */
button.btn-in {
  background: linear-gradient(180deg, #2b323f, #171b23);
  color: #fff; border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 8px 18px -12px rgba(16,24,40,.55), inset 0 1px 0 rgba(255,255,255,.08);
  white-space: nowrap;
}
button.btn-in:hover { filter: brightness(1.12); }
button.btn-in svg { color: #34d17a; }

/* Enviar (compartir por WhatsApp): ícono destacado en carmesí */
button.btn-share svg { color: var(--accent); }

/* Anular: ícono sutil carmesí */
button.btn-anular { color: var(--accent-ink); }
button.btn-anular:hover { background: var(--accent-weak); color: var(--accent-ink); }

/* Pills de estado en la lista */
.pill.in   { background: var(--ok-weak); color: var(--ok-ink); border-color: rgba(22,163,74,.22); }
.pill.pend { background: var(--surface-3); color: var(--text-2); border-color: var(--border-strong); }

/* Desktop: acciones CON texto (botones anchos) y filas un poco más aireadas */
@media (min-width: 640px) {
  .part-item { padding: 12px 16px; }
  .part-main { gap: 6px; }
  .part-name { white-space: normal; font-size: 15.5px; }
  .part-actions { gap: 8px; }
  .part-actions > button { width: auto; height: 40px; padding: 0 14px; min-width: 92px; font-size: 13px; border-radius: var(--radius-sm); }
  .part-actions > button .lbl { display: inline; }
  .part-actions > button svg { width: 16px; height: 16px; }
}

/* Móvil chico: filtros a lo ancho y barra de agregar cómoda */
@media (max-width: 520px) {
  .filters { width: 100%; }
  .chip { flex: 1; padding: 0 8px; }
  .add-bar > button { padding: 0 16px; }
}

/* ---- Toast (aviso flotante) ---- */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 60; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: var(--radius-pill);
  background: var(--text); color: #fff;
  font-size: 13.5px; font-weight: 600; text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--accent-3); }
.toast.ok  { background: var(--ok-ink); }

/* Confirmación flotante animada (alta rápida): tarjeta con tilde/cruz dibujados */
.confirm-fx {
  position: fixed; left: 50%; bottom: 84px;
  transform: translate(-50%, 14px) scale(.96);
  z-index: 61; display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  max-width: calc(100% - 32px);
}
.confirm-fx.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.cfx-icon { width: 38px; height: 38px; flex: none; }
.cfx-circle { stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; }
.cfx-check, .cfx-cross {
  stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60; display: none;
}
.confirm-fx.show .cfx-circle { animation: cfx-trazo .45s var(--ease) forwards; }
.confirm-fx.ok .cfx-circle, .confirm-fx.ok .cfx-check { stroke: var(--ok); }
.confirm-fx.ok .cfx-check { display: block; animation: cfx-trazo .3s .22s var(--ease) forwards; }
.confirm-fx.err .cfx-circle, .confirm-fx.err .cfx-cross { stroke: var(--accent-2); }
.confirm-fx.err .cfx-cross { display: block; animation: cfx-trazo .3s .22s var(--ease) forwards; }
.cfx-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cfx-text b { font-size: 14.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfx-text span { font-size: 12.5px; color: var(--muted); }
@keyframes cfx-trazo { to { stroke-dashoffset: 0; } }

/* Mantener apretada una fila abre la vista previa de la entrada:
   sin selección de texto ni callout del navegador durante el gesto. */
.part-item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Quién creó cada entrada (auditoría en la lista) */
.cell-by { color: var(--muted); font-size: 12px; }

/* Gestión de usuarios (modal solo admin) */
.usuarios-card { width: min(500px, 94vw); max-height: 86vh; overflow-y: auto; }
.usr-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.usr-form .type-chips { grid-column: 1 / -1; margin: 0; }
.usr-form button[type=submit] { grid-column: 1 / -1; }
.usr-hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 14px; }
.usr-lista { display: flex; flex-direction: column; gap: 8px; }
.usr-item {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2);
}
.usr-item b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.usr-rol {
  flex: none; font-size: 11.5px; font-weight: 700; padding: 3px 9px;
  border-radius: var(--radius-pill); background: var(--surface-4); color: var(--text-2);
}
.usr-rol.admin { background: var(--ok-weak); color: var(--ok-ink); }
.usr-acts { margin-left: auto; display: flex; gap: 6px; flex: none; }
@media (max-width: 640px) {
  .usr-form { grid-template-columns: 1fr; }
  .usr-acts { width: 100%; margin-left: 0; }
  .usr-acts button { flex: 1; }
}
.confirm-fx { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* =========================================================
   Vista de evento: enfoque en la LISTA en móvil
   ========================================================= */
.ev-secondary { display: flex; gap: 10px; }

/* Resumen compacto (una línea) — visible solo en móvil */
.ev-compact {
  display: flex; align-items: stretch; justify-content: space-between; gap: 8px;
  margin-top: 14px; padding: 12px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.ev-compact > span { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; }
.ev-compact b { font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; }
.ev-compact > span > span { margin-top: 4px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ev-compact .c-in b { color: var(--ok-ink); }
.ev-compact .c-pend b { color: var(--warn-ink); }
.ev-compact .c-div { flex: 0 0 1px; background: var(--border); }

/* Utilidades de visibilidad por dispositivo */
@media (min-width: 641px) { .only-mobile { display: none !important; } }
@media (max-width: 640px) {
  .only-desktop { display: none !important; }

  /* Hero del evento compacto en móvil */
  .ev-hero-inner { min-height: 200px; padding: 14px 16px 18px; gap: 22px; }
  .ev-hero-main { flex-direction: column; align-items: stretch; }
  .ev-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .ev-head-actions > .only-mobile { margin-left: auto; }   /* "Opciones" a la derecha */

  /* PDF + Cerrar ocultos hasta tocar "Opciones" */
  .ev-secondary { display: none; flex-basis: 100%; flex-direction: column; gap: 8px; }
  .ev-secondary.show { display: flex; }
  .ev-secondary > button { width: 100%; }
}

/* =========================================================
   Chips de tipo de invitado (alta rápida) — práctico, táctil
   ========================================================= */
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tchip {
  height: 38px; padding: 0 16px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  box-shadow: none;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.tchip:hover { filter: none; transform: none; color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.tchip.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 16px -8px var(--accent-glow);
}
.tchip.active:hover { color: #fff; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
/* VIP en dorado cuando está elegido (combina con el badge de la entrada) */
.tchip[data-tipo="vip"].active,
.tchip[data-tipo="vip"].active:hover {
  color: #3a2a00; background: linear-gradient(180deg, #f6d365, #c8992f);
  box-shadow: 0 6px 16px -8px rgba(200,153,47,.55);
}

/* =========================================================
   Pulido MOBILE — práctico para usar con una mano en la puerta
   ========================================================= */

/* Contadores en los filtros (Todos / Entraron / Pendientes) */
.chip .n { margin-left: 3px; font-size: 11.5px; opacity: .6; font-variant-numeric: tabular-nums; }
.chip .n:empty { display: none; }

/* Tarjeta del modal de entrada (antes era estilo inline) */
.qr-card { width: 100%; max-width: 400px; text-align: center; }

/* Aviso flotante por encima de la zona de gestos del iPhone */
.toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

@media (max-width: 640px) {
  /* iOS hace zoom al enfocar inputs con fuente menor a 16px */
  input, select { font-size: 16px; }

  /* La barra superior deja de ser fija: más pantalla útil al scrollear */
  .topnav { position: static; }

  /* Hero del evento más compacto: la lista es la protagonista */
  .ev-hero-inner { min-height: 148px; padding: 12px 14px 14px; gap: 14px; }
  .ev-hero-info h1 { font-size: 22px; }
  .ev-hero .eyebrow { display: none; }
  .ev-hero-meta { margin-top: 8px; }
  .date-chip, .ev-hero .crumb { height: 30px; font-size: 11.5px; }

  /* Portadas menos altas: más eventos a la vista sin scrollear */
  .ev-cover { aspect-ratio: 2 / 1; }

  /* Buscador + filtros SIEMPRE a mano mientras se recorre la lista */
  .list-controls {
    position: sticky; top: 0; z-index: 25;
    background: var(--bg);
    padding: 8px 0 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
  }

  /* Escáner de puerta: aprovechar el ancho completo */
  .scanner { max-width: none; }
  .scanner .card { padding: 14px; }
  .container { padding-top: 16px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* Modales como hoja inferior (bottom sheet) en pantallas chicas */
@media (max-width: 560px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal .card {
    width: 100%; max-width: none;
    border-radius: 20px 20px 0 0;
    max-height: 92dvh; overflow-y: auto;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
    animation: sheetUp .26s var(--ease) both;
  }
  /* Manija de arrastre, como las apps nativas */
  .modal .card::before {
    content: ""; display: block;
    width: 40px; height: 4px; border-radius: 99px;
    background: var(--border-strong);
    margin: -6px auto 14px;
  }
  @keyframes sheetUp { from { transform: translateY(48px); } to { transform: none; } }
}

/* Pantallas muy angostas: acciones un toque más compactas */
@media (max-width: 380px) {
  .part-actions { gap: 4px; }
  .part-actions > button { width: 38px; height: 38px; border-radius: 10px; }
  .part-item { padding: 8px 10px; }
}

/* Chips de tipo de invitado: una sola fila deslizable con el pulgar */
@media (max-width: 640px) {
  .type-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -16px 14px;
    padding: 0 16px 2px;
  }
  .type-chips::-webkit-scrollbar { display: none; }
  .tchip { flex: 0 0 auto; }
}

/* Modal de la tarjeta: botones a lo ancho, cómodos con el pulgar */
@media (max-width: 560px) {
  .qr-card .row { flex-direction: column; }
  .qr-card .row > button { width: 100%; }
}
