/* ============================================================
   Smart Check-in — Diseño sobrio, formal, blanco y negro
   ============================================================ */

:root {
  --ink: #111111;
  --ink-soft: #3a3a3a;
  --muted: #767676;
  --line: #e2e2e2;
  --line-strong: #111111;
  --paper: #ffffff;
  --paper-soft: #f6f6f4;
  --paper-alt: #efefec;
  --ok: #1f7a4d;
  --warn: #8a6d1f;
  --danger: #9a2b2b;
  --radius: 3px;
  --radius-sm: 3px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.05);
  --shadow-soft: 0 1px 3px rgba(0,0,0,.06);
  --ctrl-h: 42px;
  --ctrl-h-sm: 34px;
  --ctrl-h-lg: 50px;
  --ctrl-px: 16px;
  --ctrl-transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper-soft);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); }

a { color: var(--ink); }

.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ---------- Plataforma: sidebar + main ---------- */
.platform { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  color: #fff;
  padding: 20px 14px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: width .2s ease, padding .2s ease;
}

.platform { padding-left: var(--sidebar-w); transition: padding-left .2s ease; }
.platform--sidebar-collapsed { padding-left: var(--sidebar-w-collapsed); }
.platform--sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.main--loading { opacity: .55; pointer-events: none; transition: opacity .15s; }

.sidebar__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.16);
}

.sidebar__toggle {
  flex-shrink: 0;
  width: 28px; height: 28px;
  padding: 0 !important;
  line-height: 1;
  display: grid;
  place-items: center;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
  flex: 1;
}
.sidebar__brand-text { min-width: 0; overflow: hidden; transition: opacity .15s, width .2s; }
.sidebar__brand-name { font-family: var(--serif); font-size: 18px; line-height: 1.1; display: block; white-space: nowrap; }
.sidebar__brand-sub { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.55); display: block; white-space: nowrap; }

.sidebar--collapsed .sidebar__brand-text,
.sidebar--collapsed .sidebar__link-label,
.sidebar--collapsed .sidebar__foot-meta,
.sidebar--collapsed .sidebar__user-name { display: none; }
.sidebar--collapsed .sidebar__brand { justify-content: center; }
.sidebar--collapsed .sidebar__link { justify-content: center; padding-left: 10px; padding-right: 10px; }
.sidebar--collapsed .sidebar__user { justify-content: center; }
.sidebar--collapsed .sidebar__user .btn { padding: 8px 10px; font-size: 11px; }
.sidebar__mark {
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,.5);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.sidebar__link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  border-left: 2px solid transparent;
  transition: all .15s;
}
.sidebar__link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar__link.active { color: #fff; background: rgba(255,255,255,.10); border-left-color: #fff; }
.sidebar__link--disabled,
.sidebar__link--disabled:hover {
  opacity: 0.42;
  color: rgba(255,255,255,.55);
  background: transparent;
  cursor: not-allowed;
  pointer-events: none;
}
.sidebar__link .ic { width: 18px; text-align: center; opacity: .9; flex-shrink: 0; }
.sidebar__link-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar__foot { margin-top: auto; font-size: 11px; color: rgba(255,255,255,.4); border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; }
.sidebar__event { color: rgba(255,255,255,.7); font-family: var(--serif); font-size: 14px; margin-bottom: 2px; }
.sidebar__user { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); }
.sidebar__user-name { color: rgba(255,255,255,.8); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user .btn-outline-light {
  font-size: 0.75rem;
  padding: 0.42rem 0.75rem;
}

.main { flex: 1; min-width: 0; padding: 34px 40px 60px; }
.main__wrap { max-width: 1160px; margin: 0 auto; }

.page-head { margin-bottom: 26px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-head__eyebrow { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.page-head h1 { font-size: 30px; margin-top: 4px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Bootstrap: sin overrides en .btn / .form-control — solo layout de dominio */
.search-box { position: relative; }
.search-box .form-control { padding-left: 2.5rem; }
.search-box .ic {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); z-index: 2; pointer-events: none;
}
.access-search { position: relative; }
.access-search .form-control { padding-left: 3.25rem; }
.access-search .ic {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.25rem; color: var(--muted); z-index: 2; pointer-events: none;
}
.pw-field { position: relative; display: block; }
.pw-field .form-control { padding-right: 4.5rem; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  z-index: 3;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); border-color: #adb5bd; }
.pw-toggle--on { color: var(--ink); }

/* Pestañas de subsección (btn-check, estilo carpeta sobrio) */
.sc-segment-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.sc-segment-tabs .sc-segment-tab {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--muted);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-bottom-color: var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: none;
  transition: var(--ctrl-transition);
  --bs-btn-border-color: var(--line);
  --bs-btn-bg: var(--paper-soft);
  --bs-btn-color: var(--muted);
  --bs-btn-hover-bg: var(--paper);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-border-color: #ccc;
  --bs-btn-active-bg: var(--paper-soft);
  --bs-btn-active-color: var(--ink);
  --bs-btn-active-border-color: var(--line);
}
.sc-segment-tabs .sc-segment-tab.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.sc-segment-tabs.sc-tabs .sc-segment-tab { min-width: 108px; }
.sc-segment-tabs .btn-check + .sc-segment-tab { z-index: 0; }

/* Inactivas: se leen como botones / submenús separados */
.sc-segment-tabs .btn-check:not(:checked) + .sc-segment-tab:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: #ccc;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

/* Activa: une con el panel, sin línea extra abajo */
.sc-segment-tabs .btn-check:checked + .sc-segment-tab {
  color: var(--ink);
  font-weight: 600;
  background: var(--paper);
  border-color: var(--line);
  border-bottom: 1px solid var(--paper);
  margin-bottom: -1px;
  z-index: 1;
  transform: none;
  box-shadow: none;
}
.sc-segment-tabs .btn-check:checked + .sc-segment-tab:hover {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  border-bottom-color: var(--paper);
  transform: none;
  box-shadow: none;
}
.sc-segment-tabs .btn-check:checked + .sc-segment-tab:active {
  background: var(--paper);
  border-color: var(--line);
  border-bottom-color: var(--paper);
}

.sc-segment-tabs .btn-check:focus,
.sc-segment-tabs .btn-check:focus-visible {
  outline: none;
  box-shadow: none;
}
.sc-segment-tabs .btn-check:focus + .sc-segment-tab,
.sc-segment-tabs .btn-check:focus-visible + .sc-segment-tab,
.sc-segment-tabs .btn-check:focus:checked + .sc-segment-tab,
.sc-segment-tabs .btn-check:focus-visible:checked + .sc-segment-tab {
  box-shadow: none;
  outline: none;
}

/* Marco de subsección (pestañas + contenido) */
.sc-section {
  background: transparent;
}
.sc-section__head {
  padding: 0;
}
.sc-section__head .sc-segment-tabs {
  margin-bottom: 0;
}
.sc-section__body {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 0;
}

/* Filtros rápidos */
.quick-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 8px; }
.quick-filters--bar { justify-content: flex-start; margin: 0 0 12px; }
.quick-filters .btn { border-radius: 50rem; }
.quick-filters .form-select { border-radius: 50rem; min-width: 9.5rem; max-width: 12rem; }

/* Walk-in: opciones como botones Bootstrap */
.walkin-choices { display: grid; gap: 10px; margin: 0 0 4px; }
.walkin-choice { min-height: 72px; text-align: left; }
.walkin-choice__icon { font-size: 1.75rem; line-height: 1; flex-shrink: 0; width: 36px; text-align: center; }
.walkin-choice__body { min-width: 0; }
.walkin-choice__title { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 2px; }
.walkin-choice__sub { display: block; font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.walkin-host-results { display: grid; gap: 8px; margin-top: 10px; max-height: min(42vh, 280px); overflow-y: auto; }
.walkin-host-opt { text-align: left; padding: 12px 16px; }

.modal-title { font-family: var(--serif); }
label.btn { cursor: pointer; margin-bottom: 0; }
a.btn { text-decoration: none; }

/* ---------- Panel cards (clase propia; no usa .card de Bootstrap) ---------- */
.panel-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: none;
}
.panel-card + .panel-card { margin-top: 18px; }
.panel-card__title { font-size: 17px; margin-bottom: 4px; }
.panel-card__sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.panel-card__head { display:flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-card__head h3 { font-size: 17px; }
/* alias legacy */
.card__title { font-size: 17px; margin-bottom: 4px; }
.card__sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.card__head { display:flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__head h3 { font-size: 17px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px){ .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}
.stat--meter::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--stat-pct, 0%);
  background: var(--stat-fill, rgba(17, 17, 17, .08));
  transition: width .45s ease;
  z-index: 0;
}
.stat--meter .stat__num,
.stat--meter .stat__label,
.stat--meter .stat__pct,
.stat--meter .stat__hint { position: relative; z-index: 1; }
#tab-resumen:not(.dash--editing) .stat__actions,
#tab-resumen:not(.dash--editing) .dash-chart__actions,
#tab-resumen .stat__actions[hidden],
#tab-resumen .dash-chart__actions[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
#tab-resumen.dash--editing .stat__actions:not([hidden]),
#tab-resumen.dash--editing .dash-chart__actions:not([hidden]) {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
#tab-resumen.dash--editing .stat[data-stat-id],
#tab-resumen.dash--editing .dash-chart[data-chart-id] {
  border-style: dashed;
  border-color: var(--muted);
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}
#tab-resumen.dash--editing .stat[data-stat-id]:hover,
#tab-resumen.dash--editing .dash-chart[data-chart-id]:hover {
  border-color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
#tab-resumen.dash--editing .stat--click:hover {
  transform: none;
}
#tab-resumen.dash--editing .panel-card--click .chart-box,
#tab-resumen.dash--editing .panel-card--click .chart-box--sm {
  cursor: grab;
}
.stat__actions,
.dash-chart__actions {
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  bottom: auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: 0;
  padding: 0;
  z-index: 3;
}
.stat__icon-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255,255,255,.92);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.stat__icon-btn:hover { color: var(--ink); background: #fff; }
.stat--add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.stat--add:hover { border-color: var(--ink); color: var(--ink); background: var(--paper); }
.stat--drag { cursor: grab; }
.stat--drag:active { cursor: grabbing; }
.stat--dragging { opacity: .55; }
.stat--drag-over { outline: 2px dashed var(--ink); outline-offset: -2px; }
.stat__pct { font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat--ink { background: var(--ink); border-color: var(--ink); }
.stat--ink .stat__num, .stat--ink .stat__label { color: #fff; }
.stat--ok { background: var(--ok); border-color: var(--ok); }
.stat--ok .stat__num, .stat--ok .stat__label { color: #fff; }
.stat__num { font-family: var(--serif); font-size: 34px; line-height: 1; }
.stat__label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.stat__hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Formularios: dominio + Bootstrap */
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Login (sin Bootstrap) ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper-soft);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px 34px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .10);
}
.login-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: .5px;
  margin: 0 auto 18px;
  font-family: var(--serif);
  font-size: 1.25rem;
}
.login-card h1 {
  font-family: var(--serif);
  font-size: 1.5rem;
  text-align: center;
  margin: 0 0 4px;
}
.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 26px;
}
.login-field {
  margin-bottom: 16px;
}
.login-field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.login-field input {
  display: block;
  width: 100%;
  height: var(--ctrl-h);
  padding: 0 var(--ctrl-px);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: var(--ctrl-transition);
}
.login-field input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .08);
}
.login-field .pw-field input {
  padding-right: 4.5rem;
}
.login-btn {
  display: block;
  width: 100%;
  height: var(--ctrl-h);
  margin-top: 8px;
  padding: 0 var(--ctrl-px);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--ctrl-transition);
}
.login-btn:hover:not(:disabled) {
  background: #000;
  border-color: #000;
}
.login-btn:disabled {
  opacity: .65;
  cursor: wait;
}
.login-card .alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.login-card .alert-danger {
  background: #f8eaea;
  color: var(--danger);
  border-color: #e8c4c4;
}

/* ---------- Login (panel dividido + Bootstrap) ---------- */
.login-body { margin: 0; min-height: 100vh; background: var(--paper); }
.login-page { display: flex; min-height: 100vh; }
.login-brand {
  flex: 0 0 42%; max-width: 520px;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; padding: 48px 56px;
}
.login-brand__inner { max-width: 360px; }
.login-brand__mark {
  width: 52px; height: 52px;
  border: 1px solid rgba(255,255,255,.45);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.35rem; font-weight: 600;
  margin-bottom: 28px;
}
.login-brand__eyebrow {
  margin: 0 0 10px; font-size: 10px; letter-spacing: 3px;
  text-transform: uppercase; color: rgba(255,255,255,.5);
}
.login-brand__title {
  margin: 0 0 16px; font-family: var(--serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 600; line-height: 1.12; color: #fff;
}
.login-brand__text { margin: 0 0 28px; font-size: 15px; line-height: 1.55; color: rgba(255,255,255,.72); }
.login-brand__list { margin: 0; padding: 0; list-style: none; font-size: 13px; color: rgba(255,255,255,.55); }
.login-brand__list li { position: relative; padding-left: 18px; margin-bottom: 10px; }
.login-brand__list li::before {
  content: ''; position: absolute; left: 0; top: .55em;
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35);
}
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--paper-soft); }
.login-main__box {
  width: 100%; max-width: 380px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px 32px 40px; box-shadow: var(--shadow-soft);
}
.login-main__head { margin-bottom: 28px; }
.login-main__title { margin: 0 0 6px; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.login-main__sub { margin: 0; font-size: 14px; color: var(--muted); }
.login-main .form-label {
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
  text-transform: uppercase; color: var(--ink-soft);
}
@media (max-width: 860px) {
  .login-page { flex-direction: column; }
  .login-brand { flex: none; max-width: none; padding: 32px 24px 28px; }
  .login-brand__title br { display: none; }
  .login-brand__list { display: none; }
  .login-main { padding: 24px 16px 40px; }
  .login-main__box { border: none; box-shadow: none; padding: 0; max-width: 420px; }
}

/* Check / option grid */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer; font-size: 14px;
  transition: all .12s; background: var(--paper);
}
.opt:hover { border-color: var(--ink); }
.opt input { width: auto; }
.opt--on { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { display: none; }
.switch__track { width: 46px; height: 26px; border: 1px solid var(--ink); border-radius: 20px; position: relative; transition: background .15s; background: var(--paper); }
.switch__track::after { content:''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: var(--ink); border-radius: 50%; transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--ink); }
.switch input:checked + .switch__track::after { transform: translateX(20px); background: #fff; }
.switch__label { font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink); }

/* ---------- Badges / chips (app; no pisan badge de utilidades Bootstrap bg-*) ---------- */
.platform .badge,
.main .badge,
.invite-card .badge,
.person-card .badge,
.walkin-card .badge,
.scan-result-card .badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line);
}
.badge--present { background: var(--ok); color: #fff; border-color: var(--ok); }
.badge--absent { background: #fff; color: var(--danger); border-color: var(--danger); }
.badge--pending { background: #fff; color: var(--ink); border-color: var(--ink); }
.badge--in-situ { background: var(--paper-alt); color: var(--ink-soft); }
.badge--vip { background: #8a6d1f; color: #fff; border-color: #8a6d1f; }
.chip { display: inline-block; font-size: 11px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink-soft); background: var(--paper); margin: 2px 3px 2px 0; }
.chip--filled { background: var(--paper-alt); }

/* ---------- Tables (Bootstrap .table conserva sus estilos) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table:not(.table) { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap table:not(.table) th,
.table-wrap table:not(.table) td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.table-wrap table:not(.table) th {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); background: var(--paper-soft); font-weight: 700;
}
.table-wrap table:not(.table) tbody tr:last-child td { border-bottom: none; }
.table-wrap table:not(.table) tbody tr:hover td { background: var(--paper-soft); }
.table.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--paper-soft); }
.td-name { font-weight: 600; }
.td-sub { font-size: 12px; color: var(--muted); }

/* ---------- Alerts (Bootstrap) ---------- */

/* ---------- Tabs ---------- */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Modal (Bootstrap) ---------- */

/* ---------- Spinner ---------- */
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; padding: 36px; }

/* ---------- Recent list ---------- */
.timeline { list-style: none; }
.timeline li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: none; }
.timeline .t { color: var(--muted); font-size: 12px; }
.timeline .tag { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 1px 6px; border-radius: 10px; margin-left: 8px; }

.recent-panel--clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.recent-panel--clickable:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.recent-panel__hint { margin: -4px 0 10px; }

/* ============================================================
   Control de acceso (tablet)
   ============================================================ */
.access-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1024px){ .access-grid { grid-template-columns: 1fr; } }

#qr-reader { width: 100%; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; min-height: 240px; background: #0c0c0c; }
#qr-reader video { display: block; width: 100%; object-fit: cover; }
/* Recuadro guía del escáner (html5-qrcode) */
#qr-reader__scan_region { border: 2px solid rgba(255,255,255,.9) !important; }
#qr-reader img[alt="Info icon"] { display: none; }
.scanner-hint { font-size: 13px; color: var(--muted); text-align: center; margin-top: 12px; }

.result { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
@media (hover: hover) {
  .result:hover { border-color: var(--ink); }
}
.result__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.result__name { font-family: var(--serif); font-size: 19px; }
.result__meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Ficha de invitado (control de acceso) */
.person-card { border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.person-card__head { background: var(--ink); color: #fff; padding: 20px 22px; }
.person-card__name { font-family: var(--serif); font-size: 24px; }
.person-card__meta { font-size: 13px; color: rgba(255,255,255,.7); margin-top: 3px; }
.person-card__chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.person-card__chips .chip,
.person-card__chips .badge { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.12); color: #fff; }
.person-card__body { padding: 20px 22px; }
.person-card__banner { margin-bottom: 16px; }
.person-card__block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--paper-soft);
}
.person-card__block--titular { border-left: 4px solid var(--ink); }
.person-card__block--guests { border-left: 4px solid var(--warn, #c47f17); background: #fffdf8; }
.person-card__block-label {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 12px;
}
.person-card__block-count { letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--ink-soft); }
.person-card__block-warn { letter-spacing: 0; text-transform: none; font-weight: 700; color: #b45309; }
.person-card__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.person-card__cta { margin-top: 0; }
.guest-blocks { display: grid; gap: 12px; }
.guest-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
.guest-block--absent { border-left: 4px solid var(--danger); }
.guest-block--present { border-left: 4px solid var(--ok); }
.guest-block__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px;
}
.guest-block__name { font-weight: 700; font-size: 17px; line-height: 1.25; }
.guest-block__meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.guest-block__dni { margin-right: 2px; }
.guest-block__btn { margin-top: 4px; min-height: 48px; font-weight: 700; }
.guest-block__edit { margin-top: 8px; width: 100%; }
.btn-checkin {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .btn-checkin:hover,
  .btn-checkin:focus,
  .btn-checkin:active {
    background: #196640 !important;
    border-color: #196640 !important;
    color: #fff !important;
  }
}

/* Estado presente/ausente bien visible en la ficha */
.person-card--present { border-color: var(--ok); }
.person-card--absent { border-color: var(--danger); }
.person-card__state { font-weight: 800; letter-spacing: .8px; text-transform: uppercase; font-size: 13px; padding: 11px 22px; }
.person-card--present .person-card__state { background: #e7f1ec; color: var(--ok); }
.person-card--absent .person-card__state { background: #f6e7e7; color: var(--danger); }
.badge--lg { font-size: 13px; padding: 8px 16px; }

/* Estado en la lista de resultados */
.access-results .result--present { border-left: 4px solid var(--ok); }
.access-results .result--absent { border-left: 4px solid var(--danger); }
.person-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.person-row:last-child { border-bottom: none; }
.person-row__info { min-width: 0; }
.person-row__name { font-weight: 600; font-size: 15px; }
.person-row__tags { margin-top: 4px; }
.person-section-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 18px 0 4px; }

.big-check { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px; }
.big-check__icon { width: 76px; height: 76px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-size: 34px; margin-bottom: 14px; }
.big-check__icon--ok { background: var(--ok); color: #fff; border-color: var(--ok); }

/* ============================================================
   Dashboard charts
   ============================================================ */
.chart-box { position: relative; height: 240px; }
.chart-box--sm { height: 200px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; display: inline-block; border-radius: 2px; }

/* Email client mockup */
.mail-client { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mail-client__bar { background: var(--paper-soft); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
.mail-client__bar-dots { display: flex; align-items: center; gap: 8px; }
.mail-client__bar .btn { margin-left: auto; flex-shrink: 0; }
.mail-client__dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--muted); }
.mail-client__field { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.mail-client__field .k { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); width: 66px; flex-shrink: 0; }
.mail-preview-frame { width: 100%; height: 520px; border: none; background: #f2f2f2; display: block; }

.inbox-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; background: var(--paper); width: 100%; text-align: left; font-family: var(--sans); }
.inbox-item:hover { border-color: var(--ink); }
.inbox-item__avatar { width: 38px; height: 38px; border: 1px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.inbox-item__to { font-weight: 600; font-size: 14px; }
.inbox-item__subject { font-size: 12px; color: var(--muted); }
.inbox-item__time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ============================================================
   Pantalla del invitado (standalone)
   ============================================================ */
.invite-page {
  min-height: 100vh;
  background: var(--paper-soft);
  display: flex; align-items: center; justify-content: center;
  padding: 28px 16px;
}
.invite-card {
  width: 100%; max-width: 500px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.invite-card__rule { height: 6px; background: var(--ink); }
.invite-card__inner { padding: 40px 40px 36px; }
@media (max-width: 480px){ .invite-card__inner { padding: 30px 24px; } }

.invite-hero { text-align: center; }
.invite-hero__eyebrow { font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); }
.invite-hero__title { font-family: var(--serif); font-size: 34px; margin: 12px 0 6px; }
.invite-hero__divider { width: 54px; height: 1px; background: var(--ink); margin: 18px auto; }
.invite-hero__date { font-size: 15px; color: var(--ink-soft); }
.invite-hero__place { font-size: 13px; color: var(--muted); margin-top: 3px; }

.rsvp-question { text-align: center; margin: 30px 0 20px; font-family: var(--serif); font-size: 20px; }
.rsvp-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px){ .rsvp-choices { grid-template-columns: 1fr; } }

.invite-section-title { font-family: var(--serif); font-size: 20px; margin-bottom: 4px; }
.invite-section-sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.divider { height: 1px; background: var(--line); margin: 24px 0; }

.companion-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 8px; }
.companions-list { display: flex; flex-direction: column; gap: 12px; }
.companions-list .companion-block { margin-top: 0; }
.result-screen { text-align: center; padding: 20px 0; }
.result-screen__icon { width: 72px; height: 72px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font-size: 30px; margin: 0 auto 16px; }
.result-screen__icon--ok { background: var(--ink); color: #fff; }

.qr-holder { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 10px 0; }
#qrcode { padding: 14px; border: 1px solid var(--ink); background: #fff; }
#qrcode img { display: block; }

/* Utilidades de layout propias (prefijo sc- evita pisar Bootstrap) */
.sc-mt-0 { margin-top: 0; } .sc-mt-1 { margin-top: 8px; } .sc-mt-2 { margin-top: 16px; } .sc-mt-3 { margin-top: 24px; }
.sc-mb-0 { margin-bottom: 0; } .sc-mb-2 { margin-bottom: 16px; }
.sc-flex { display: flex; } .sc-between { justify-content: space-between; } .sc-items-center { align-items: center; }
.sc-gap { gap: 10px; } .sc-wrap { flex-wrap: wrap; }
.sc-small, .muted.small { font-size: 12.5px; } .sc-strong { font-weight: 700; }
.sc-right { text-align: right; }
/* Alias layout (no colisionan con utilidades Bootstrap estándar) */
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; } .gap { gap: 10px; } .wrap { flex-wrap: wrap; }
.strong { font-weight: 700; }
.right { text-align: right; }

/* Mobile sidebar -> topbar */
@media (max-width: 820px){
  .platform { flex-direction: column; padding-left: 0; }
  .sidebar { width: 100%; height: auto; position: sticky; left: auto; top: 0; z-index: 50; flex-direction: row; align-items: center; padding: 12px 16px; gap: 10px; overflow-x: auto; }
  .sidebar__top { border: none; padding: 0; margin: 0; flex: 0 0 auto; }
  .sidebar__toggle { display: none; }
  .sidebar__brand { border: none; padding: 0; margin: 0; margin-right: 8px; }
  .sidebar__brand-sub, .sidebar__event { display: none; }
  .sidebar__foot { margin: 0 0 0 auto; padding: 0; border: none; display: flex; align-items: center; gap: 8px; }
  .sidebar__foot-meta { display: none; }
  .sidebar__user { margin: 0; padding: 0; border: none; }
  .sidebar__user-name { display: none; }
  .sidebar__user-name--sim { display: flex; }
  .sidebar__sim-as, .sidebar__sim-real, .sidebar__sim-exit { display: none; }
  .sidebar__sim-tag { font-size: 8px; }
  .sidebar__nav { flex-direction: row; margin: 0; }
  .sidebar__link { padding: 8px 12px; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .sidebar__link.active { border-left: none; border-bottom-color: #fff; }
  .platform--sidebar-collapsed .sidebar { width: 100%; }
  .main { padding: 22px 18px 50px; }
}

/* ============ Stats / gráficos interactivos ============ */
.stat--click { cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.stat--click:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: var(--shadow); }
.stat--click:active { transform: translateY(0); }
.stat--click.stat--active {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
  transform: translateY(-1px);
}
button.stat {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.card--click .chart-box, .card--click .chart-box--sm { cursor: pointer; }
.panel-card--click .chart-box, .panel-card--click .chart-box--sm { cursor: pointer; }
.card__hint { font-size: 11px; color: var(--muted); font-weight: 500; }

.dash-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.dash-chart { min-width: 0; max-width: 100%; }
.dash-chart.panel-card { position: relative; overflow: visible; }
.dash-chart--add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.dash-chart--add:hover { border-color: var(--ink); color: var(--ink); background: var(--paper); }
@media (max-width: 900px) { .dash-charts { grid-template-columns: 1fr; } }
.dash-chart--drag { cursor: grab; }
.dash-chart--drag:active { cursor: grabbing; }
.dash-chart--dragging { opacity: .55; }
.dash-chart--drag-over { outline: 2px dashed var(--ink); outline-offset: -4px; }
.dash-layout-hint { font-size: 12px; color: var(--muted); }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; border-radius: 20px; padding: 6px 8px 6px 14px; font-size: 13px;
}
.filter-chip button {
  width: 22px; height: 22px;
  padding: 0; line-height: 1;
  font-size: 14px; font-weight: 400;
  color: #fff;
  background: rgba(255,255,255,.18);
  border: none; border-radius: 50%;
  cursor: pointer;
  transition: background .15s;
}
.filter-chip button:hover { background: rgba(255,255,255,.32); }

/* ============ Control de Acceso — modo puerta (kiosk) ============ */
.platform:not(.platform--door-kiosk) .door-bar { display: none !important; }

.platform--door-kiosk {
  padding-left: 0 !important;
  flex-direction: column;
  min-height: 100vh;
  background: var(--paper-soft);
}

.door-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: var(--ink);
  color: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.door-bar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}
.door-bar__mark {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.45);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 20px;
  flex-shrink: 0;
}
.door-bar__name {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.15;
  display: block;
}
.door-bar__sub {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  display: block;
}
.door-bar__event-wrap {
  text-align: center;
  min-width: 0;
  flex: 1;
}
.door-bar__event {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.door-bar__date {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  margin-top: 2px;
}
.door-bar__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.door-bar__link {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-pill);
  transition: background .15s, color .15s, border-color .15s;
}
.door-bar__link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.35);
}
.door-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.door-bar__user {
  font-size: 12px;
  color: rgba(255,255,255,.75);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.door-bar__sim {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
}
.door-bar__sim-tag {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffc107;
  font-weight: 700;
}

.access-page .main--access {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 28px 20px 52px;
  width: 100%;
}
.access-shell {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.page-head--access {
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
  gap: 8px;
}
.page-head--access h1 { font-size: clamp(26px, 4vw, 32px); }
.access-updated { margin: 0; }

.stat-grid--door {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat--door {
  text-align: center;
  padding: 20px 14px 16px;
}
.stat--door .stat__num {
  font-size: clamp(34px, 6vw, 46px);
}
.stat--door .stat__label {
  margin-top: 10px;
  color: inherit;
  opacity: .88;
}
.stat--door.stat--ink .stat__label,
.stat--door.stat--ok .stat__label,
.stat--door.stat--warn .stat__label { color: rgba(255,255,255,.88); }
.stat--filter {
  cursor: pointer;
  width: 100%;
  text-align: center;
  font: inherit;
  transition: outline-color .15s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.stat--filter:active { transform: scale(.98); }
.stat--filter-on {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.access-panel {
  padding: 22px 22px 24px;
}
.access-panel .scanner-panel {
  margin: 16px 0 0;
  padding: 16px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  box-shadow: none;
}
.access-panel .access-results-wrap { margin-top: 18px; }

.access-toolbar {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 4px;
}
.access-search { flex: 1; min-width: 0; }
.access-search .form-control {
  min-height: var(--ctrl-h-lg);
  font-size: 16px;
}
.access-cam-btn {
  flex-shrink: 0;
  min-width: 104px;
  min-height: var(--ctrl-h-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 14px;
  font-weight: 600;
}
.access-cam-btn__icon { font-size: 20px; line-height: 1; }
.access-cam-btn__label { font-size: 11px; letter-spacing: .3px; text-transform: uppercase; }
.access-cam-btn--on {
  background: var(--ok) !important;
  border-color: var(--ok) !important;
  color: #fff !important;
}

.access-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.access-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}
.access-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 50rem;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.access-filter-chip:hover {
  background: #f0f0ee;
  border-color: #c8c8c8;
}
.access-filter-chip__x {
  font-size: 15px;
  line-height: 1;
  opacity: .55;
}
.access-filter-add {
  position: relative;
  flex-shrink: 0;
}
.access-filter-add .btn {
  border-radius: 50rem;
  cursor: pointer;
}
.access-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 13rem;
  max-width: min(18rem, 92vw);
  max-height: min(22rem, 60vh);
  overflow: auto;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}
.access-filter-menu__group + .access-filter-menu__group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.access-filter-menu__heading {
  padding: 4px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.access-filter-menu__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.access-filter-menu__item:hover {
  background: var(--paper-soft);
}
.access-filter-menu__empty {
  padding: 8px 10px;
}

.access-filters { margin-top: 12px; margin-bottom: 0; }
.access-filters .form-select { min-height: 34px; }

@keyframes pulse { 0%,100%{ opacity: 1; } 50%{ opacity: .3; } }
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 1.8s ease-in-out infinite;
}

.access-flash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: accessFlashIn .18s ease;
}
.access-flash.hidden { display: none; }
@keyframes accessFlashIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.access-flash--ok { background: rgba(31, 122, 77, .94); color: #fff; }
.access-flash--warn { background: rgba(138, 109, 31, .94); color: #fff; }
.access-flash--err { background: rgba(154, 43, 43, .94); color: #fff; }
.access-flash__inner { text-align: center; padding: 32px 24px; max-width: 90vw; }
.access-flash__icon {
  font-size: clamp(72px, 16vw, 128px);
  line-height: 1;
  margin-bottom: 16px;
  font-weight: 700;
}
.access-flash__title {
  font-family: var(--serif);
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 600;
  line-height: 1.12;
}
.access-flash__sub {
  font-size: clamp(15px, 2.4vw, 20px);
  margin-top: 10px;
  opacity: .92;
  line-height: 1.35;
}

.access-results-wrap { width: 100%; }
.access-results-empty { padding: 6px 2px; }

.result-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--paper);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.result-row--open {
  border-color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.result-row--special { margin-bottom: 14px; }
.result-row .result {
  margin-bottom: 0;
  border: none;
  border-radius: 0;
}
.result-row--open .result--active { box-shadow: none; background: var(--paper-soft); }
.result-detail {
  border-top: 1px solid var(--line);
  background: var(--paper-soft);
}
.access-panel-slot { padding: 0; }
.person-card--inline {
  border: none;
  border-radius: 0;
  overflow: visible;
}
.person-card__body--inline { padding: 16px 18px 18px; }

.access-stage-hint {
  text-align: center;
  padding: 36px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
  color: var(--muted);
}
.access-stage-hint__icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 10px;
  opacity: .5;
}
.access-stage-hint p { margin: 0; font-size: 14px; line-height: 1.45; }

.stage-hint { color: var(--muted); text-align: center; padding: 30px 24px; }
.stage-flash { animation: stageFlash .85s ease; }
@keyframes stageFlash {
  0%, 100% { box-shadow: none; }
  35% { box-shadow: 0 0 0 3px rgba(31, 122, 77, .4); }
}

.scan-result-card { padding: 8px 12px; }
.scan-result-card--err .big-check__icon { border-color: var(--danger); color: var(--danger); }

@media (max-width: 720px) {
  .door-bar { padding: 12px 16px; gap: 10px; }
  .door-bar__event-wrap { order: 3; flex: 1 1 100%; text-align: left; }
  .door-bar__nav { order: 4; flex: 1 1 100%; justify-content: flex-start; }
  .stat-grid--door { grid-template-columns: 1fr; }
  .stat--door { display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 16px 18px; }
  .stat--door .stat__num { font-size: 32px; }
  .stat--door .stat__label { margin-top: 0; }
}

/* Alta en puerta (DNI no registrado) */
.walkin-card { padding: 16px 16px 20px; }
.walkin-alert {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff8e6; border: 1px solid #e8d48a; border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 16px;
}
.walkin-alert__icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 2px solid #c9a227; display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #8a6d1f;
}
.walkin-alert__title { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.25; }
.walkin-alert__sub { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0; line-height: 1.45; }
.walkin-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  background: var(--paper-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 16px; position: sticky; top: 0; z-index: 2;
}
.walkin-banner__dni { font-weight: 700; font-size: 15px; }
.walkin-banner__tag { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.walkin-form { margin-top: 14px; padding-top: 4px; }
.walkin-form__head { font-weight: 700; font-size: 14px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 16px 0 10px; }
.walkin-form__head:first-of-type { margin-top: 0; }
.walkin-host-picked {
  margin-top: 10px; padding: 14px 16px; background: #e7f1ec; border-radius: var(--radius-sm);
  border: 1px solid #b8d4c4; font-size: 15px; line-height: 1.45;
}
.walkin-host-picked--warn { background: #fff8e6; border-color: #e8d48a; }
.walkin-divider { height: 1px; background: var(--line); margin: 18px 0; }
.walkin-comp-block { margin-top: 12px; padding-top: 4px; }
.badge--warn { background: #fff8e6; color: #8a6d1f; border-color: #e8d48a; }
.walkin-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin-top: 20px;
}
.walkin-actions .btn-lg { flex: 1; min-width: 140px; justify-content: center; }
.switch--touch { min-height: 48px; align-items: center; }
.switch--touch .switch__label { font-size: 15px; }
.field-row--mobile { gap: 12px; }

@media (max-width: 1000px){
  .walkin-card { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .walkin-form .diet-grid { grid-template-columns: 1fr 1fr; }
  .walkin-form .opt { min-height: 48px; padding: 12px 10px; font-size: 14px; }
  .walkin-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    margin: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(0,0,0,.08); backdrop-filter: blur(8px);
  }
  .walkin-actions .btn { min-height: 52px; font-size: 16px; }
  .walkin-actions .btn-light { flex: 0 0 auto; min-width: 88px; }
  .person-card__cta { flex-direction: column; align-items: stretch; }
  .person-card__cta .btn-lg { width: 100%; justify-content: center; min-height: 52px; }
  .guest-block__btn.btn-lg { min-height: 52px; font-size: 16px; }
  .guest-block { padding: 16px; }
  .person-card__name { font-size: 21px; }
  .scanner-panel { max-width: 100%; margin-bottom: 8px; }
  .page-head__actions .btn { min-height: 44px; }
}
@media (max-width: 560px){
  .walkin-choice { min-height: 68px; padding: 14px 16px; }
  .walkin-alert__title { font-size: 18px; }
  .field-row--mobile { grid-template-columns: 1fr; }
  .walkin-form .diet-grid { grid-template-columns: 1fr; }
}
.access-results { display: grid; gap: 10px; }
.access-results .result {
  padding: 16px 18px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 56px;
  transition: border-color .12s ease, background-color .12s ease, box-shadow .12s ease;
}
.access-results .result--active {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
  background: var(--paper-soft);
}
.access-results .result__name { font-size: 18px; }
.result--vip { box-shadow: inset 3px 0 0 #8a6d1f; border-color: #d8c48a; }

.results-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.results-bar.hidden { display: none; }

.btn-lg.btn-lg-touch { padding: 18px 30px; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.person-card__cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.person-card__cta .btn,
.guest-block__btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.person-card__next { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.access-btn-new-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 56px;
  padding: 14px 18px;
  line-height: 1.25;
}
.access-btn-new-search__label { font-size: 16px; font-weight: 600; }
.access-btn-new-search__hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.person-card__comp-empty { margin: 0 0 12px; }
.person-card__comp-add { margin-top: 4px; }
.access-btn-add-comp {
  min-height: 48px;
  font-weight: 600;
  margin-top: 8px;
  touch-action: manipulation;
}

.sidebar--door .sidebar__nav { /* puerta: un solo ítem */ }

/* ---------- Usuarios / roles ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }
.text-right { text-align: right; }

.role-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.role-badge--puerta { background: #eef6ff; color: #1a4d8c; }
.role-badge--invitaciones { background: #eef9f0; color: #1a6b3a; }
.role-badge--admin { background: #f3eef9; color: #5c3d7a; }
.role-badge--super { background: #fff8e6; color: #8a6200; }
.role-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.role-check input { margin-top: 3px; flex-shrink: 0; }
.role-check strong { display: block; font-size: 14px; }

.role-legend { display: grid; gap: 14px; }
.role-legend__item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.role-legend__item:last-child { border-bottom: none; padding-bottom: 0; }
.role-legend__item p { margin-top: 8px; }

/* ---------- Modo prueba en sidebar ---------- */
.sidebar__user--sim {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.sidebar__user-name--sim {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  background: rgba(255, 214, 102, .18);
  border: 1px solid rgba(255, 214, 102, .45);
  color: rgba(255, 255, 255, .92);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.sidebar__sim-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6b800;
  color: #3d3000;
}
.sidebar__sim-as { font-size: 12px; }
.sidebar__sim-as strong { color: #fff; font-weight: 600; }
.sidebar__sim-real { font-size: 11px; color: rgba(255, 255, 255, .55); }
.sidebar__sim-exit { margin-top: 4px; font-size: 12px; font-weight: 600; }
.sidebar--collapsed .sidebar__user-name--sim {
  display: flex;
  padding: 8px 6px;
  align-items: center;
}
.sidebar--collapsed .sidebar__sim-as,
.sidebar--collapsed .sidebar__sim-real,
.sidebar--collapsed .sidebar__sim-exit { display: none; }
.sidebar--collapsed .sidebar__sim-tag { align-self: center; font-size: 8px; padding: 3px 6px; }

.scanner-panel { margin-top: 0; margin-bottom: 16px; max-width: 100%; }
.scanner-panel.hidden { display: none; }
.scanner-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.scanner-panel__title { font-weight: 600; font-size: 14px; }

/* Ajustes tablet puerta */
@media (min-width: 721px) and (max-width: 1100px){
  .access-shell { max-width: 840px; }
}

/* ---------- Invitaciones: estado de correos ---------- */
.badge--sent  { background: #fff; color: var(--ok); border-color: var(--ok); }
.badge--seen  { background: #2f6fb0; color: #fff; border-color: #2f6fb0; }
.badge--muted { background: var(--paper-alt); color: var(--muted); border-color: var(--line); }

.stat--info { background: #2f6fb0; border-color: #2f6fb0; }
.stat--info .stat__num, .stat--info .stat__label { color: #fff; }
.stat--warn { background: var(--warn); border-color: var(--warn); }
.stat--warn .stat__num, .stat--warn .stat__label { color: #fff; }
.stat-grid--compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid--send { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px){ .stat-grid--send { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px){ .stat-grid--compact, .stat-grid--send { grid-template-columns: repeat(2, 1fr); } }

/* --- Eventos (lista) --- */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.event-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px 20px;
  align-items: center;
  padding: 18px 20px 18px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: default;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.event-row--clickable {
  cursor: pointer;
}
.event-row--clickable:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.event-row--locked {
  cursor: not-allowed;
  opacity: 0.78;
}
@media (hover: hover) {
  .event-row--locked:hover {
    border-color: var(--line);
    background: var(--paper);
  }
}
.event-row:not(:has(.event-row__actions)) {
  grid-template-columns: auto 1fr;
}
@media (hover: hover) {
  .event-row:hover {
    border-color: #d4d4d4;
    background: var(--paper-soft);
  }
  .event-row--active:hover {
    border-color: var(--ink);
    background: #f7f7f5;
  }
}
.event-row--active {
  border-color: var(--ink);
  background: #fafaf8;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .05);
}
.event-row--active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--ink);
  border-radius: 0 2px 2px 0;
}
.event-row__countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 104px;
  padding: 12px 14px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  line-height: 1.1;
  flex-shrink: 0;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.event-row__countdown-caption,
.event-row__countdown-prefix,
.event-row__countdown-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: lowercase;
  color: var(--muted);
  line-height: 1.2;
}
.event-row__countdown-caption:first-child { margin-bottom: 3px; }
.event-row__countdown-caption:last-child:not(:first-child) { margin-top: 5px; }
.event-row__countdown-num {
  font-family: var(--serif);
  font-size: 2.35rem;
  font-weight: 600;
  line-height: 1;
}
.event-row__countdown-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: lowercase;
  line-height: 1.2;
  text-align: center;
  max-width: 72px;
}
.event-row__countdown--today {
  background: #e7f1ec;
  border-color: #b8dcc8;
  color: var(--ok);
}
.event-row__countdown--today .event-row__countdown-caption { color: var(--ok); opacity: .9; }
.event-row__countdown--soon {
  background: #fff8e6;
  border-color: #e8d48a;
  color: #8a6d1f;
}
.event-row__countdown--soon .event-row__countdown-caption { color: #8a6d1f; opacity: .95; }
.event-row__countdown--future {
  background: var(--paper-soft);
  border-color: var(--line);
  color: var(--ink);
}
.event-row__countdown--past {
  background: var(--paper-alt);
  border-color: var(--line);
  color: var(--muted);
}
.event-row__countdown--past .event-row__countdown-status { color: var(--muted); }
.event-row__countdown--muted {
  background: var(--paper-alt);
  border-style: dashed;
  color: var(--muted);
}
.event-row__countdown--muted .event-row__countdown-num {
  font-size: 1.75rem;
  font-family: var(--sans);
}
.event-row--active .event-row__countdown--future,
.event-row--active .event-row__countdown--soon {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.event-row--active .event-row__countdown--future .event-row__countdown-caption,
.event-row--active .event-row__countdown--soon .event-row__countdown-caption {
  color: rgba(255, 255, 255, .82);
}
.event-row--active .event-row__countdown--today {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.event-row--active .event-row__countdown--today .event-row__countdown-caption {
  color: rgba(255, 255, 255, .9);
}
.event-row__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.event-row__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.event-row__title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.event-row__badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ok);
  background: #f3faf6;
  border: 1px solid #b8dcc8;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
}
.event-row--active .event-row__badge {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.event-row__badge--locked {
  color: var(--muted);
  background: #f5f5f3;
  border-color: var(--line);
}
.event-row__meta {
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.event-row__meta span + span::before {
  content: '·';
  margin: 0 8px;
  color: #ccc;
}
.event-row__meter { margin-top: 4px; }
.event-row__meter-track {
  height: 5px;
  background: var(--paper-alt);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.event-row__meter-fill {
  height: 100%;
  background: var(--ok);
  border-radius: var(--radius-pill);
  transition: width .35s ease;
}
.event-row__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.event-row__stats strong {
  font-weight: 600;
  color: var(--ink);
}
.event-row__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.event-row__actions .btn { cursor: pointer; }
.event-row__del { min-width: 34px; }
@media (max-width: 820px) {
  .event-row {
    grid-template-columns: auto 1fr;
    gap: 14px 16px;
  }
  .event-row__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--line);
    margin-top: 2px;
  }
}

/* legacy event cards (unused) */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.event-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.event-card:hover {
  border-color: #cfcfcf;
  box-shadow: 0 6px 28px rgba(0,0,0,.05);
}
.event-card--active {
  border-color: var(--ink);
}
.event-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.event-card__title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}
.event-card__active {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ok);
  border: 1px solid var(--ok);
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  line-height: 1.4;
}
.event-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.event-card__meta span + span::before {
  content: '·';
  margin: 0 8px;
  color: #ccc;
}
.event-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.event-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink-soft);
}
.event-tag--ok {
  background: #f3faf6;
  border-color: #b8dcc8;
  color: var(--ok);
}
.event-tag--no {
  background: #fdf6f6;
  border-color: #e8c4c4;
  color: var(--danger);
}
.event-tag--pending {
  background: var(--paper);
  border-color: var(--line);
  color: var(--muted);
}
.event-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.event-card__del {
  margin-left: auto;
  min-width: 34px;
}
.events-empty {
  text-align: center;
  padding: 48px 24px;
}
.events-empty__title {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin-bottom: 6px;
}
.ev-import-status {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.ev-import-status--ok {
  background: #f3faf6;
  border-color: #b8dcc8;
  color: var(--ok);
}
.ev-import-status--error {
  background: #fdf6f6;
  border-color: #e8c4c4;
  color: var(--danger);
}

.stat--declined { background: #8b3a3a; border-color: #8b3a3a; }
.stat--declined .stat__num, .stat--declined .stat__label { color: #fff; }
.stat--pending { background: var(--paper-alt); border-color: var(--line); }
.stat--pending .stat__num { color: var(--ink); }
.stat--pending.stat--active { border-color: var(--ink); }

.event-live-counter {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 18px 22px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.event-live-counter:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.event-live-counter__num {
  font-family: var(--serif);
  font-size: clamp(42px, 8vw, 64px);
  line-height: 1;
  min-width: 2ch;
}
.event-live-counter__label {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .88;
}
.event-live-counter__date {
  font-size: 15px;
  margin-top: 4px;
  opacity: .95;
}

.stat--unread { background: var(--paper-alt); border-color: var(--line); }
.stat--unread .stat__num { color: var(--ink); }
.stat--unread.stat--active { border-color: var(--ink); }

.invite-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.invite-send-search__box {
  flex: 1;
  max-width: 420px;
}

.cargo { color: #8a6d1f; font-weight: 600; }
@media (max-width: 720px){ .hide-sm { display: none; } }
tr.row--active > td { background: var(--paper-alt); }

.invite-cols { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.invite-cols #preview-pane { position: sticky; top: 16px; }
@media (max-width: 1000px){
  .invite-cols { grid-template-columns: 1fr; }
  .invite-cols #preview-pane { position: static; }
}

.invite-send-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.invite-send-toolbar {
  flex-direction: column;
  align-items: stretch !important;
  gap: 12px;
}
.invite-send-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.invite-send-preview {
  padding: 24px;
}
.invite-send-preview .preview-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.invite-send-preview .mail-preview-frame {
  display: block;
  width: 100%;
  height: min(520px, 62vh);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.preview-hint { color: var(--muted); text-align: center; padding: 44px 24px; }
.preview-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.preview-card__name { font-family: var(--serif); font-size: 21px; line-height: 1.15; }
.preview-card__cargo { color: #8a6d1f; font-weight: 600; font-size: 13px; margin: 3px 0 2px; }
.preview-card__status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.preview-card .mail-preview-frame { height: 460px; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 6px; }
.invite-send-preview .mail-preview-frame { margin-top: 0; }

.tabs-row { display: flex; flex-wrap: wrap; gap: 8px; }

.mail-tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mail-tag-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}
.mail-tag-chip:hover { border-color: var(--ink); background: #fafafa; }
.mail-tag-chip[draggable="true"] { cursor: grab; }
.mail-tag-chip[draggable="true"]:active { cursor: grabbing; }
.mail-template-editor-wrap .tox-tinymce {
  border-radius: var(--radius);
  border-color: var(--line) !important;
}
.mail-template-editor-wrap .tox .tox-edit-area__iframe {
  background: #f2f2f2;
}
.mail-template-editor-wrap .tox-edit-area {
  min-height: 520px;
}
.mail-template-editor {
  width: 100%;
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.invite-mail-editor .preview-card { margin-top: 0; }

.invite-mail-editor-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 1100px) {
  .invite-mail-editor-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.mail-preview-frame--tall {
  height: min(720px, 75vh);
  min-height: 480px;
}

.mail-snippet-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}
.invite-qr-thumb {
  display: block;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

/* Modal: copiar HTML de botones para correo de invitación */
.invite-snippet-modal { display: flex; flex-direction: column; gap: 12px; }
.snippet-copy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 768px) {
  .snippet-copy-layout { grid-template-columns: 1fr; }
}
.snippet-copy-code,
.snippet-mail-preview {
  min-width: 0;
}
.snippet-copy-code__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.snippet-copy-code__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.snippet-full-mail-edit {
  width: 100%;
}
.snippet-full-mail-edit summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}
.snippet-full-example-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 0 0 8px 8px;
}
.snippet-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.mail-preview-frame--snippet-in-modal {
  width: 100%;
  height: min(400px, 44vh);
  min-height: 260px;
  border: none;
  display: block;
  background: #fff;
}
.mail-snippet-box--copy {
  min-height: 300px;
  max-height: min(440px, 46vh);
}
.snippet-test-send {
  margin-top: 12px;
  font-size: 13px;
}
.snippet-test-send summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
  list-style: none;
}
.snippet-test-send summary::-webkit-details-marker { display: none; }
.snippet-test-send summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform .15s ease;
}
.snippet-test-send[open] summary::before {
  transform: rotate(90deg);
}
.snippet-test-send[open] summary {
  margin-bottom: 10px;
}
.snippet-test-send__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
}
.snippet-test-send__form .form-control {
  flex: 1;
  min-width: 160px;
}
.mail-client__recipient {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mail-client__recipient-name {
  font-weight: 600;
  color: var(--ink);
}
.mail-client__recipient-email {
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
}
.mail-client--snippet-sim {
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.mail-client__field-val--empty {
  display: block;
  min-height: 1.2em;
  color: transparent;
}
.mail-embed-preview-frame--in-client {
  width: 100%;
  height: min(400px, 44vh);
  min-height: 260px;
  border: none;
  display: block;
  background: #fff;
}

.invite-snippet-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 992px) {
  .invite-snippet-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: start;
  }
}
.invite-snippet-preview__label,
.invite-snippet-code__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.invite-snippet-preview .mail-client {
  box-shadow: var(--shadow);
}
.invite-snippet-preview .mail-preview-frame--snippet {
  width: 100%;
  height: min(460px, 52vh);
  min-height: 320px;
  border: none;
  display: block;
  background: #f2f2f2;
}
.mail-embed-preview-frame {
  width: 100%;
  height: 200px;
  border: none;
  display: block;
  background: #f2f2f2;
}
.snippet-code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.snippet-code-panel { display: none; }
.snippet-code-panel.is-active { display: block; }
.snippet-code-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.snippet-code-panel__hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  flex: 1;
}
.snippet-link-list { display: flex; flex-direction: column; gap: 10px; }
.snippet-link-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--paper-soft);
}
.snippet-link-item__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.snippet-link-item__url {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.mail-preview-frame--editable {
  width: 100%;
  height: min(560px, 62vh);
  min-height: 360px;
  border: none;
  display: block;
  background: #f2f2f2;
}
.mail-client--editable {
  box-shadow: var(--shadow);
}
.mail-editor-wrap {
  margin-top: 12px;
}
.mail-editor-wrap__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.mail-editor-wrap__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mail-client__field--from {
  flex-wrap: wrap;
  align-items: center;
}
.mail-client__field-val {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.mail-edit-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mail-client__cfg {
  flex-shrink: 0;
  margin-left: auto;
}
.mail-brand-edit {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.mail-brand-edit__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) {
  .mail-brand-edit__grid { grid-template-columns: 1fr; }
}
.mail-help-doc ul {
  margin: 0 0 12px;
  padding-left: 1.2rem;
}
.mail-help-doc li { margin-bottom: 6px; }
.mail-editor-wrap__head .invite-snippet-preview__label {
  margin-bottom: 0;
}
.mail-client__subject-merged {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}
.mail-preview-frame--qr {
  width: 100%;
  height: 240px;
  min-height: 0;
  border: none;
  display: block;
  background: #f2f2f2;
  overflow: hidden;
}
.browser-client {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.browser-client__bar {
  border-bottom: 1px solid var(--line);
}
.browser-client__urlbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}
.browser-client__lock {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1;
  opacity: 0.55;
}
.browser-client__url {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  user-select: all;
  cursor: text;
}
.browser-client__open-tab {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 12px;
  padding: 6px 10px;
  text-decoration: none;
}
.browser-client__urlbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.browser-client__urlbar-actions .btn {
  white-space: nowrap;
  font-size: 12px;
  padding: 6px 10px;
}
.browser-client__device-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.browser-client__device-toggle .btn {
  padding: 5px 8px;
  font-size: 11px;
  border: none;
  box-shadow: none;
}
.browser-client__preview-stage {
  background: #e8eaed;
  padding: 16px 12px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  overflow-y: visible;
}
.browser-client__preview-stage--desktop {
  background: #fff;
  padding: 0;
}
.browser-client__preview-stage .browser-preview-frame {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-shadow: none;
  border-radius: 0;
}
.browser-client__preview-stage--tablet .browser-preview-frame,
.browser-client__preview-stage--mobile .browser-preview-frame {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
  border-radius: 6px;
}
.browser-client__preview-stage--tablet .browser-preview-frame {
  max-width: 768px;
}
.browser-client__preview-stage--mobile .browser-preview-frame {
  max-width: 390px;
}
.browser-preview-frame {
  width: 100%;
  height: min(520px, 58vh);
  min-height: 320px;
  border: none;
  display: block;
  background: #fff;
}
.rsvp-fullpage-html {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  min-height: 360px;
  resize: vertical;
}
.browser-client__edit {
  padding: 16px;
}
.rsvp-form-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rsvp-form-toolbar .help {
  flex: 1;
  min-width: 220px;
}
.rsvp-form-section {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.rsvp-form-section:last-of-type {
  border-bottom: none;
}
.rsvp-form-section__footer {
  margin-top: 12px;
}
.rsvp-form-section__alert:empty {
  display: none;
}
.rsvp-form-section__alert:not(:empty) {
  margin-bottom: 10px;
}
.rsvp-form-section__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rsvp-form-section .browser-preview-frame {
  height: 120px;
  min-height: 0;
  overflow: hidden;
  vertical-align: top;
}
.rsvp-form-section .browser-client__preview,
.rsvp-form-section .browser-client__preview-stage {
  overflow-x: auto;
  overflow-y: visible;
}
.rsvp-preview-mode,
html.rsvp-preview-mode,
body.rsvp-preview-mode {
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.rsvp-preview-mode .invite-page {
  min-height: 0 !important;
  height: auto !important;
  padding: 20px 16px;
  align-items: flex-start;
}
.rsvp-preview-mode button,
.rsvp-preview-mode input,
.rsvp-preview-mode select,
.rsvp-preview-mode textarea {
  pointer-events: none;
}
.rsvp-preview-mode .invite-card {
  box-shadow: none;
}
.mail-editor-wrap + .mail-editor-wrap {
  margin-top: 28px;
}
.browser-client--live .browser-client__preview--compact .browser-preview-frame {
  height: min(280px, 34vh);
  min-height: 200px;
}
.browser-client__preview .browser-preview-frame {
  transition: height 0.2s ease;
}
.form-edit-tools {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.form-edit-tools__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.form-tag-chip {
  font-size: 12px;
}
.mail-editor-html-fallback summary {
  user-select: none;
}
.mail-editor-wrap .mail-client {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  background: #f2f2f2;
}
.mail-client__subject-edit {
  flex: 1;
  min-width: 0;
  outline: none;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}
.mail-client__subject-edit:focus {
  box-shadow: inset 0 0 0 1px var(--ink);
  border-radius: 2px;
}
.mail-tag {
  display: inline-block;
  background: #eef4ff;
  border: 1px dashed #4a7fc1;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  line-height: 1.5;
  color: #1e4a7a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  vertical-align: baseline;
  white-space: nowrap;
}
.mail-tag--subject {
  font-size: 13px;
  margin: 0 1px;
}
.mail-tag--block {
  display: block;
  text-align: center;
  margin: 12px auto;
  padding: 10px 14px;
}
.mail-tag--qr {
  max-width: 240px;
  padding: 18px 14px 14px;
  border: 1px solid #111 !important;
  background: #fff;
  font-size: 11px;
}
.mail-template-editor-wrap--embedded {
  border-top: 1px solid var(--line);
  background: #fff;
}
.mail-template-editor-wrap--embedded .tox-tinymce {
  border: none !important;
  border-radius: 0 !important;
}
.mail-firma-hint {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
}
.mail-firma-hint__label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.mail-firma-hint__preview {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mail-firma-hint__mark {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.mail-firma-hint__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--serif);
  font-size: 16px;
}

/* ---------- Descargar datos (modal) ---------- */
.data-hub { display: flex; flex-direction: column; gap: 20px; }
.data-hub__block-title {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.data-hub__scope { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .data-hub__scope { grid-template-columns: 1fr; } }
.data-hub__scope-opt { margin: 0; cursor: pointer; }
.data-hub__scope-opt input { position: absolute; opacity: 0; pointer-events: none; }
.data-hub__scope-card {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); transition: border-color .15s, box-shadow .15s, background .15s;
}
.data-hub__scope-card strong { display: block; font-size: 14px; margin-bottom: 4px; }
.data-hub__scope-card small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.data-hub__scope-opt input:checked + .data-hub__scope-card {
  border-color: var(--ink); background: var(--paper-soft); box-shadow: 0 0 0 1px var(--ink);
}
.data-hub__scope-opt--off { cursor: not-allowed; }
.data-hub__scope-opt--off .data-hub__scope-card { opacity: .55; }
.data-hub__scope-opt--off input:disabled + .data-hub__scope-card {
  border-color: var(--line); box-shadow: none; background: var(--paper);
}
.data-hub__formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.data-hub__fmt {
  margin: 0; cursor: pointer; text-align: center;
}
.data-hub__fmt input { position: absolute; opacity: 0; pointer-events: none; }
.data-hub__fmt span {
  display: block; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); transition: border-color .15s, background .15s;
}
.data-hub__fmt span strong, .data-hub__fmt > span { font-size: 14px; font-weight: 600; }
.data-hub__fmt small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.data-hub__fmt--on span, .data-hub__fmt input:checked + span {
  border-color: var(--ink); background: var(--paper-soft); box-shadow: 0 0 0 1px var(--ink);
}
.data-hub__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
@media (max-width: 520px) { .data-hub__cards { grid-template-columns: 1fr; } }
.data-hub__card {
  margin: 0; cursor: pointer; display: block;
}
.data-hub__card input { position: absolute; opacity: 0; pointer-events: none; }
.data-hub__card-body {
  display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); transition: border-color .15s, opacity .15s, background .15s;
}
.data-hub__card-body strong { display: block; font-size: 13px; margin-bottom: 2px; }
.data-hub__card-body small { display: block; font-size: 11px; color: var(--muted); }
.data-hub__card--on .data-hub__card-body {
  border-color: var(--ink); background: var(--paper-soft); box-shadow: inset 0 0 0 1px var(--ink);
}
.data-hub__card--off { opacity: .45; pointer-events: none; }
.data-hub__all { font-size: 13px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 8px; }

/* ---------- Visor PDF ---------- */
body.pdf-viewer-open { overflow: hidden; }
.pdf-viewer {
  position: fixed; inset: 0; z-index: 2000; background: #e5e5e5;
  display: flex; flex-direction: column;
}
.pdf-viewer__toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #111; color: #fff; flex-shrink: 0;
}
.pdf-viewer__title { font-size: 14px; font-weight: 500; }
.pdf-viewer__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pdf-viewer__frame {
  flex: 1; width: 100%; border: none; background: #e5e5e5;
}

/* ---------- Tabla invitados: orden por columna ---------- */
#tbl-guests .th-sort {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0; border: none; background: none;
  font: inherit; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); cursor: pointer; user-select: none;
}
#tbl-guests .th-sort:hover { color: var(--ink); }
#tbl-guests .th-sort--active { color: var(--ink); font-weight: 600; }
#tbl-guests .th-sort__arrow { font-size: 10px; min-width: 10px; }

/* ---------- Modal extra ancho / armador de informe ---------- */
.modal-xl { max-width: min(960px, 96vw); }
.report-builder { margin-top: 4px; }
.report-builder__hint {
  font-size: 12px; color: var(--muted); margin: 0 0 12px;
}
.report-builder__layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 12px; min-height: 320px;
}
@media (max-width: 640px) { .report-builder__layout { grid-template-columns: 1fr; } }
.report-builder__palette {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px; background: var(--cream); border: 1px dashed var(--line); border-radius: 10px;
  max-height: 360px; overflow-y: auto;
}
.report-builder__palette-title {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.rb-palette-item {
  padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  cursor: grab; user-select: none; transition: border-color .15s, box-shadow .15s;
}
.rb-palette-item:hover { border-color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.rb-palette-item:active { cursor: grabbing; }
.rb-palette-item strong { display: block; font-size: 12px; margin-bottom: 2px; }
.rb-palette-item small { display: block; font-size: 10px; color: var(--muted); line-height: 1.3; }
.rb-palette-item--text,
.rb-palette-item--summary,
.rb-palette-item--tables,
.rb-palette-item--charts {
  border-left: 3px solid var(--rb-cat, var(--line));
}
.rs-palette-group { margin-bottom: 10px; }
.rs-palette-group:last-child { margin-bottom: 0; }
.rs-palette-group__head {
  font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--rb-cat, var(--muted)); margin: 0 0 6px; padding-left: 2px;
  border-left: 3px solid var(--rb-cat, var(--line)); padding-left: 8px;
}
.rs-palette-group .rb-palette-item { margin-bottom: 6px; }
.rs-palette-group .rb-palette-item:last-child { margin-bottom: 0; }
.report-builder__palette { gap: 4px; }
.report-builder__main {
  display: flex; flex-direction: column; min-height: 280px;
}
.report-builder__canvas {
  flex: 1; padding: 10px; background: #fff; border: 2px dashed var(--line); border-radius: 10px;
  min-height: 280px; max-height: 360px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.report-builder__canvas.rb-canvas--over { border-color: var(--ink); background: rgba(17,17,17,.02); }
.rb-canvas-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 13px; color: var(--muted); padding: 24px;
}
.rb-canvas-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 8px;
  cursor: grab;
}
.rb-canvas-item--dragging { opacity: .55; }
.rb-canvas-item--over { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.rb-canvas-item__handle { color: var(--muted); font-size: 14px; line-height: 1; padding-top: 2px; flex-shrink: 0; }
.rb-canvas-item__body { flex: 1; min-width: 0; }
.rb-canvas-item__title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.rb-canvas-item__preview { font-size: 11px; color: var(--muted); line-height: 1.4; }
.rb-notes {
  width: 100%; font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  resize: vertical; min-height: 48px; font-family: inherit;
}
.rb-canvas-item__remove {
  border: none; background: none; color: var(--muted); font-size: 18px; line-height: 1;
  padding: 0 4px; cursor: pointer; flex-shrink: 0;
}
.rb-canvas-item__remove:hover { color: var(--red, #9a2b2b); }
.rb-preview-stats span { font-weight: 600; color: var(--ink); }

/* ---------- Modal descarga: acciones PDF ---------- */
.data-hub__pdf-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Módulo report-editor (pantalla completa) ---------- */
.report-studio {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 768px) { .report-studio { grid-template-columns: 1fr; } }
.report-studio__palette { max-height: none; }
.report-studio__doc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  min-height: 65vh;
  box-shadow: 0 4px 28px rgba(0, 0, 0, .06);
}
.report-studio__page { max-width: 720px; margin: 0 auto; }
.rs-canvas-empty {
  text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14px;
  border: 2px dashed var(--line); border-radius: 10px;
}
.rs-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
  background: var(--cream);
  cursor: grab;
  border-left: 4px solid var(--rs-cat, var(--line));
}
.rs-block--cat-text { --rs-cat: #7d6b9a; }
.rs-block--cat-summary { --rs-cat: #1f7a4d; }
.rs-block--cat-tables { --rs-cat: #2f6fb0; }
.rs-block--cat-charts { --rs-cat: #b8860b; }
.rs-block__cat {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rs-cat); flex-shrink: 0;
}
.rs-col-picker {
  margin-bottom: 12px; padding: 10px 12px; background: rgba(255,255,255,.7);
  border: 1px solid var(--line); border-radius: 8px;
}
.rs-col-picker__label {
  display: block; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 8px;
}
.rs-col-picker__opts { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.rs-col-opt {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; cursor: pointer; user-select: none;
}
.rs-col-opt input { margin: 0; accent-color: var(--rs-cat, #2f6fb0); }
.rs-chart-preview { max-width: 100%; overflow: hidden; }
.rs-chart-thumb { display: block; max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.rs-block--dragging { opacity: .55; }
.rs-block--over { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.rs-block__head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.6);
  border-radius: 10px 10px 0 0;
}
.rs-block__handle { color: var(--muted); font-size: 14px; }
.rs-block__title { flex: 1; margin: 0; font-size: 14px; font-weight: 600; }
.rs-block__remove {
  border: none; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.rs-block__remove:hover { color: #9a2b2b; }
.rs-block__body { padding: 14px; }
.rs-mini-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.rs-mini-table td, .rs-mini-table th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.rs-mini-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.rs-row-act { width: 32px; text-align: right; }
.rs-rm-row {
  border: none; background: none; color: var(--muted); font-size: 16px; cursor: pointer; line-height: 1;
}
.rs-rm-row:hover { color: #9a2b2b; }
.rs-divider-preview { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
.rs-notes { width: 100%; font-family: inherit; }
.rs-title-field {
  width: 100%; font-family: var(--serif, Georgia, serif); font-size: 1.35rem; font-weight: 600;
  border: none; border-bottom: 2px solid var(--line); background: transparent; padding: 4px 0;
}
.rs-title-field:focus { outline: none; border-bottom-color: var(--ink); }
.rs-drop-zone {
  min-height: 10px; margin: 2px 0; border-radius: 6px; border: 2px dashed transparent;
  display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s, min-height .15s;
}
.rs-drop-zone__label {
  font-size: 11px; color: transparent; user-select: none; pointer-events: none;
}
.rs-drop-zone--over {
  min-height: 36px; border-color: var(--ink); background: rgba(17, 17, 17, .04);
}
.rs-drop-zone--over .rs-drop-zone__label { color: var(--muted); }
.rs-canvas-empty .rs-drop-zone {
  min-height: 120px; border-color: var(--line); margin-bottom: 12px;
}
.rs-canvas-empty .rs-drop-zone__label { color: var(--muted); }
.rs-canvas-empty .rs-drop-zone--over { border-color: var(--ink); background: rgba(17, 17, 17, .04); }
.rs-charts-hidden {
  position: fixed;
  left: -10000px;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
  width: auto;
  height: auto;
  overflow: visible;
}
