/* ═══════════════════════════════════════════════════════════
   RSVP MODULE STYLES — Phase 5
   Scanner UI · Invitation cards · Zone grid · Tables · Badges
   ═══════════════════════════════════════════════════════════ */

/* ── KPI row ───────────────────────────────────────────── */
.rsvp-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.rsvp-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}
.rsvp-kpi-val {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}
.rsvp-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

/* ── Toolbar ───────────────────────────────────────────── */
.rsvp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Badge ─────────────────────────────────────────────── */
.rsvp-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Table ─────────────────────────────────────────────── */
.rsvp-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.rsvp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rsvp-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.rsvp-table td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.rsvp-row:last-child td { border-bottom: none; }
.rsvp-row:hover td { background: var(--surface2); }

/* ── Avatar ────────────────────────────────────────────── */
.rsvp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

/* ── Zone grid ─────────────────────────────────────────── */
.rsvp-zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.rsvp-zone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: box-shadow .15s;
}
.rsvp-zone-card:hover {
  box-shadow: var(--shadow);
}

/* ── Scanner tabs ──────────────────────────────────────── */
.rsvp-tab {
  padding: 10px 18px;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.rsvp-tab:hover { color: var(--ink); }
.rsvp-tab.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

/* ── Zone directive cards ──────────────────────────────── */
.scanner-directive {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1.5px solid;
}
.scanner-directive .directive-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.directive-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}
.directive-desc {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.5;
}
.directive-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* VIP directive */
.vip-directive {
  border-color: var(--gold);
  background: var(--gold-bg);
}
.vip-directive .directive-icon {
  background: var(--gold-bg);
  color: var(--gold);
}
.vip-directive .directive-title { color: var(--ink); }

/* Regular directive */
.regular-directive {
  border-color: rgba(37,99,235,.25);
  background: var(--az-bg);
}
.regular-directive .directive-icon {
  background: var(--az-bg);
  color: var(--azure);
}
.regular-directive .directive-title { color: var(--azure); }

/* Blocked directive */
.blocked-directive {
  border-color: rgba(214,59,59,.25);
  background: var(--ru-bg);
}
.blocked-directive .directive-icon {
  background: var(--ru-bg);
  color: var(--ruby);
}
.blocked-directive .directive-title { color: var(--ruby); }

/* ── QR reader container ───────────────────────────────── */
#qr-reader video {
  border-radius: 10px;
}
#qr-reader__scan_region {
  border-radius: 10px;
  overflow: hidden;
}

/* ── Manual search result items ────────────────────────── */
#manual-search-results > div > div:hover {
  background: var(--surface2);
}

/* ── Responsive scanner: full-width on mobile ──────────── */
@media (max-width: 600px) {
  .rsvp-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .rsvp-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .rsvp-toolbar .form-input,
  .rsvp-toolbar .form-select {
    max-width: 100% !important;
  }
  .rsvp-table-wrap {
    overflow-x: auto;
  }
  .rsvp-zone-grid {
    grid-template-columns: 1fr;
  }
  #invitation-card {
    width: 100% !important;
    min-width: unset !important;
  }
}

/* ── Dark mode overrides ───────────────────────────────── */
body.dark .vip-directive       { border-color: rgba(212,168,67,.4); }
body.dark .regular-directive   { border-color: rgba(37,99,235,.35); }
body.dark .blocked-directive   { border-color: rgba(214,59,59,.35); }
body.dark .rsvp-table th       { background: var(--surface); }
body.dark .rsvp-zone-card      { border-color: var(--border); }

/* ── Live scan feed ─────────────────────────────────────── */
#scanner-live-feed {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
}
#scan-feed-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#scan-feed-list::-webkit-scrollbar { width: 4px; }
#scan-feed-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

@keyframes pulse-green {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(1.3); }
}

/* ── Scanner result card countdown bar ──────────────────── */
#scanner-card-countdown {
  border-radius: 0;
  transition: width 1s linear, background .5s;
}

/* ── Audit log scroll container ─────────────────────────── */
#audit-log-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#audit-log-scroll::-webkit-scrollbar { width: 5px; }
#audit-log-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.audit-summary-row:hover td { background: var(--surface2); }

/* ── Audit expand chevron ───────────────────────────────── */
#audit-log-table tr[id^="audit-group-"] td {
  background: var(--surface2);
}

/* ── Scanner KPI row on mobile ──────────────────────────── */
@media (max-width: 600px) {
  .rsvp-kpi-row { grid-template-columns: repeat(2, 1fr); }
  #scanner-live-feed { margin-top: 16px; padding-top: 16px; }
  #scan-feed-list { max-height: 260px; }
  .scanner-directive { flex-direction: column; gap: 8px; }
  .scanner-directive .directive-icon { width: 32px; height: 32px; font-size: 18px; }
  #scanner-result-card > div { max-width: 100% !important; }

  /* Walk-in grid stacks on small screens */
  #scanner-tab-walkin > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Audit log hides verbose columns on mobile */
  #audit-log-table th:nth-child(5),
  #audit-log-table td:nth-child(5),
  #audit-log-table th:nth-child(6),
  #audit-log-table td:nth-child(6) { display: none; }
}

/* ── Admin scanner view padding ─────────────────────────── */
#view-admin-scanner {
  padding: var(--view-pad, 28px);
}

/* ── Mobile bottom-nav scanner item ─────────────────────── */
#bn-scanner { display: none; } /* shown by JS when zone assigned */
