/* ── Guest List Container ── */
.sz-guests-wrap { padding: 24px; }

/* ── Stats Cards ── */
.sz-guests-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.sz-guests-stat {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; text-align: center;
}
/* Stat: texto informativo grande — tinta dorada AA (issue #92); --gold mide
   2,52:1 sobre la tarjeta y ni siquiera aprueba el 3:1 de texto grande. */
.sz-guests-stat__value { font-size: 28px; font-weight: 700; color: var(--gold-deep); }
.sz-guests-stat__label { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }

/* ── Toolbar ── */
.sz-guests-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.sz-guests-search {
  flex: 1; min-width: 200px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px;
}
.sz-guests-filter {
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; background: var(--bg-surface);
}

/* ── Table Container ── */
.sz-guests-table-wrap {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: 8px;
}

/* ── Table ── */
.sz-guests-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  min-width: 640px;
}
.sz-guests-table th {
  background: var(--bg-surface); border-bottom: 2px solid var(--border);
  padding: 10px 12px; text-align: left; font-weight: 600;
  position: sticky; top: 0; z-index: 5;
}
.sz-guests-table td {
  border-bottom: 1px solid var(--border); padding: 8px 12px;
  transition: background 0.15s;
}

/* ── Clickable Row ── */
.sz-guest-row { cursor: pointer; }
.sz-guest-row:hover td { background: var(--paper-deep); }

/* ── Row States ── */
.sz-guests-table tr.is-selected td { background: rgba(180, 154, 110, 0.08); }

/* ── RSVP Badges ── */
/* Mapped to the Serenza status palette (sage/gold/terracotta tints) — never
   Material/Tailwind status colors. Text labels carry the meaning (WCAG 1.4.1). */
.sz-rsvp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 500;
  letter-spacing: .02em; line-height: 1;
}
.sz-rsvp-badge--confirmed { background: rgba(94,107,90,.14); color: var(--sage-deep); }
.sz-rsvp-badge--pending { background: rgba(180,154,110,.18); color: var(--sand-deep); }
.sz-rsvp-badge--declined { background: rgba(156,75,63,.14); color: var(--status-urgent); }

/* ── Bulk Actions Bar ── */
.sz-guests-bulk {
  display: none; position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%;
  transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 12px 24px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  z-index: 100; gap: 12px; align-items: center;
}
.sz-guests-bulk.is-visible { display: flex; }
/* En móvil flota por encima de la barra inferior fija */
@media (max-width: 768px) {
  .sz-guests-bulk { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
.sz-guests-bulk__count { font-weight: 500; }
.sz-guests-bulk__btn {
  background: transparent; border: 1px solid rgba(243,238,231,.30);
  color: var(--paper); padding: 6px 12px; border-radius: var(--radius); cursor: pointer;
  font-size: 13px;
}
.sz-guests-bulk__btn:hover { background: rgba(243,238,231,.12); }
.sz-guests-bulk__btn--danger { border-color: var(--status-urgent); color: var(--status-urgent); }

/* ── Import Modal ── */
.sz-import-preview {
  max-height: 400px; overflow-y: auto; margin: 16px 0;
}
.sz-import-preview table { width: 100%; font-size: 13px; }
.sz-import-preview tr.is-duplicate { background: rgba(180,154,110,.18); }
.sz-import-preview tr.is-error { background: rgba(156,75,63,.10); }

/* ── Actions row ── */
.sz-guests-actions { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; }
.sz-guests-actions .sz-btn { flex: 1; justify-content: center; }

/* ── Modal Actions ── */
.sz-guest-modal-actions {
  display: flex; gap: 8px;
  margin-top: 16px;
}
.sz-btn--full { flex: 1; justify-content: center; }

/* ── Tablet (iPad) ── */
/* Oculta solo Comida (7) y Acompañantes (8); la columna de acciones (9) debe
   seguir visible para poder eliminar invitados desde la tabla en iPad. */
@media (max-width: 1024px) {
  .sz-guests-table th:nth-child(7),
  .sz-guests-table td:nth-child(7),
  .sz-guests-table th:nth-child(8),
  .sz-guests-table td:nth-child(8) { display: none; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .sz-guests-wrap { padding: 16px; }
  .sz-guests-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sz-guests-toolbar { flex-direction: column; }
  .sz-guests-search { min-width: 100%; }
  .sz-guests-filter { width: 100%; }
  .sz-guests-table-wrap { border: none; border-radius: 0; }
  .sz-guests-table { font-size: 13px; min-width: 0; }
  /* Oculta checkbox(1), email(3), teléfono(4), comida(7), acompañantes(8).
     Quedan visibles Nombre(2), Grupo(5), RSVP(6) y Acciones(9).
     :not([colspan]) excluye el td único del estado vacío y de 'sin
     coincidencias': es nth-child(1) pero ocupa la fila entera (#100). */
  .sz-guests-table th:nth-child(1),
  .sz-guests-table td:nth-child(1):not([colspan]),
  .sz-guests-table th:nth-child(3),
  .sz-guests-table td:nth-child(3):not([colspan]),
  .sz-guests-table th:nth-child(4),
  .sz-guests-table td:nth-child(4):not([colspan]),
  .sz-guests-table th:nth-child(7),
  .sz-guests-table td:nth-child(7):not([colspan]),
  .sz-guests-table th:nth-child(8),
  .sz-guests-table td:nth-child(8):not([colspan]) { display: none; }
  .sz-guests-actions { flex-direction: column; }
  .sz-guests-actions .sz-btn { width: 100%; justify-content: center; }
}

/* ── Small mobile ── */
@media (max-width: 480px) {
  .sz-guests-stats { grid-template-columns: 1fr 1fr; gap: 6px; }
  .sz-guests-stat { padding: 12px 8px; }
  .sz-guests-stat__value { font-size: 22px; }
}

/* ── Companions editor (guest form) ── */
.sz-companions__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.sz-companions__row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.sz-companions__row .sz-input {
  margin: 0;
}
.sz-companions__remove {
  color: var(--fg-muted);
}
.sz-companions__remove:hover {
  color: var(--status-urgent);
}

/* ── RSVP (kronos 06): panel, builder, secciones de modal y enlaces ── */
.sz-rsvp-panel-wrap {
  margin-bottom: 16px;
}
.sz-rsvp-panel {
  border: 1px solid var(--border, #e3ded4);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--surface, #fff);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sz-rsvp-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.sz-rsvp-panel__title {
  font-size: 1rem;
  margin: 0;
}
.sz-rsvp-panel__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sz-rsvp-panel__counts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.sz-rsvp-count strong {
  font-size: 1.1rem;
}
.sz-rsvp-panel__table h4 {
  margin: 6px 0 4px;
}
.sz-rsvp-builder summary {
  cursor: pointer;
  font-weight: 600;
}
.sz-rsvp-builder__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}
.sz-rsvp-builder__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border, #e3ded4);
  border-radius: 10px;
  padding: 8px 10px;
}
.sz-rsvp-builder__options {
  color: var(--fg-muted, #6b7a70);
  font-size: 0.82rem;
}
.sz-rsvp-builder__row-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.sz-rsvp-badge {
  display: inline-block;
  font-size: 0.7rem;
  border-radius: 999px;
  background: #f0ece2;
  color: #6b5a3e;
  padding: 1px 8px;
  margin-left: 6px;
}
.sz-rsvp-options__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.sz-rsvp-modal-section {
  border: 1px solid var(--border, #e3ded4);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.sz-rsvp-modal-section legend {
  font-weight: 600;
  padding: 0 4px;
}
.sz-rsvp-modal-question {
  margin-bottom: 10px;
}
.sz-rsvp-link-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sz-rsvp-portal-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sz-rsvp-submission {
  border: 1px solid var(--border, #e3ded4);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.sz-rsvp-submission__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sz-rsvp-submission__dup {
  color: #8a6d1f;
  background: #fdf6e3;
  border: 1px solid #efe3b3;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.82rem;
  margin-top: 6px;
}
.sz-rsvp-submission__meta {
  color: var(--fg-muted, #6b7a70);
  font-size: 0.82rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.sz-rsvp-submission__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.sz-companions__tags {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 640px) {
  .sz-companions__tags {
    grid-template-columns: 1fr;
  }
}
.sz-btn--hidden {
  display: none;
}

/* ── RSVP linkbox (kronos 06): URL siempre visible, seleccionable con un
   clic; el botón de copiar es comodidad, nunca el único camino ── */
.sz-rsvp-linkbox {
  border: 1px dashed var(--border, #d8d2c4);
  border-radius: 10px;
  padding: 10px 12px;
}
.sz-rsvp-linkbox .sz-label {
  display: block;
  margin-bottom: 6px;
}
.sz-rsvp-linkbox__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
}
.sz-rsvp-linkbox__row [data-rsvp-url-input] {
  font-family: var(--mono, monospace);
  font-size: 0.82rem;
  color: var(--fg-muted, #55605a);
  min-width: 0;
  cursor: text;
}
@media (max-width: 640px) {
  .sz-rsvp-linkbox__row {
    grid-template-columns: 1fr;
  }
}


/* ── RSVP: foto de los novios en el panel del planner (kronos 06) ── */
.sz-rsvp-photobox {
  border: 1px dashed var(--border, #d8d2c4);
  border-radius: 10px;
  padding: 10px 12px;
}
.sz-rsvp-photobox .sz-label {
  display: block;
  margin-bottom: 8px;
}
.sz-rsvp-photobox__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Preview discreta: la foto vive en la invitación, aquí solo se identifica */
.sz-rsvp-photobox__preview {
  width: 34px;
  height: 40px;
  object-fit: cover;
  border-radius: 999px 999px 0 0;
  border: 1px solid var(--border, #d8d2c4);
}
.sz-rsvp-photobox__form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sz-rsvp-photobox__form input[type="file"] {
  font-family: inherit;
  font-size: 13px;
  color: var(--fg-muted, #6b7a70);
  max-width: 260px;
}
.sz-rsvp-photobox__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.sz-rsvp-photobox__filename {
  font-size: 13px;
  color: var(--fg-muted, #6b7a70);
}
