/* ══════════════════════════════════════════════════════════
   NCTE 2026 — Staff Portal
   Brand-coherent with the public site (styles.css / ncte.css):
   cream surfaces, CCCN red + blue, Fraunces display + Raleway sans,
   tricolor strip-flag accent.
   ══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* Brand palette — mirrors styles.css */
  --cccn-blue-900: #041a71;
  --cccn-blue-700: #2d479d;
  --cccn-blue-500: #6269ae;
  --cccn-blue-100: #E8EBF6;
  --cccn-red:      #ee304e;
  --cccn-red-700:  #c20f2f;
  --cccn-red-100:  #FDE3E7;
  --cccn-gray:     #77787b;

  --ink:        #1a1d27;
  --ink-2:      #2a2f3d;
  --muted:      #6b6e78;
  --muted-2:    #95979f;
  --line:       #E6E7EC;
  --line-2:     #C7CAD2;
  --cream:      #F6F4EF;
  --cream-2:    #EBE8DF;
  --surface:    #ffffff;

  --green:      #16a34a;
  --green-bg:   #dcfce7;
  --green-tx:   #166534;
  --orange:     #ea580c;
  --orange-bg:  #fff0e8;
  --orange-tx:  #9a3412;
  --gold-bg:    #fef9c3;
  --gold-tx:    #854d0e;

  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --font-sans:    "Raleway", system-ui, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "Courier New", monospace;

  --r:    12px;
  --r-sm: 8px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(11,19,32,.06), 0 1px 1px rgba(11,19,32,.04);
  --shadow-md: 0 8px 24px -12px rgba(11,19,32,.18), 0 2px 6px rgba(11,19,32,.06);
  --shadow-lg: 0 24px 60px -24px rgba(11,19,32,.30), 0 6px 18px rgba(11,19,32,.08);

  --hdr-h: 64px;
}

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

/* Tricolor accent — matches the public site */
.strip-flag {
  height: 5px; width: 100%;
  background: linear-gradient(to right,
    var(--cccn-red) 0 33.33%,
    var(--cccn-gray) 33.33% 66.66%,
    var(--cccn-blue-700) 66.66% 100%);
}

/* ══ Auth gate ══════════════════════════════════════════ */

.sp-auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 60% at 15% 90%, rgba(4,26,113,.55) 0%, transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 10%, rgba(238,48,78,.40) 0%, transparent 55%),
    linear-gradient(135deg, var(--cccn-red-700) 0%, #8f1234 40%, var(--cccn-blue-900) 100%);
}
/* The class sets display:flex, which would otherwise beat the [hidden]
   attribute — make hiding the gate actually work once authenticated. */
.sp-auth[hidden] { display: none; }

.sp-auth__box {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 430px;
  overflow: hidden;
}
.sp-auth__inner { padding: 34px 34px 30px; }

.sp-auth__brand {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 26px; padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.sp-auth__logo img { height: 46px; width: auto; display: block; }

.sp-auth__eyebrow {
  display: inline-block;
  font-size: 11.5px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cccn-red);
  margin-bottom: 8px;
}
.sp-auth__titles h1 {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 600;
  font-size: 30px; line-height: 1.05; letter-spacing: -.02em;
  color: var(--cccn-blue-900);
}
.sp-auth__titles h1 em { font-style: italic; color: var(--cccn-red); font-weight: 600; }
.sp-auth__titles p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }

.sp-auth__checking {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 20px 0 8px; color: var(--muted); font-size: 13px;
}
.sp-auth__checking p { margin: 0; }

.sp-auth__form { display: flex; flex-direction: column; gap: 16px; }

.sp-auth__error {
  margin: 0; padding: 11px 14px;
  background: var(--cccn-red-100); color: var(--cccn-red-700);
  border: 1px solid #f5c2cb; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
}
.sp-auth__note {
  margin: 16px 0 0; font-size: 12.5px; color: var(--muted); text-align: center;
}

/* ══ Fields ═════════════════════════════════════════════ */

.sp-field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  letter-spacing: .01em;
}
.sp-field input {
  padding: 12px 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 15px; color: var(--ink);
  outline: none; font-family: var(--font-sans);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.sp-field input::placeholder { color: var(--muted-2); letter-spacing: .1em; }
.sp-field input:focus {
  border-color: var(--cccn-red);
  box-shadow: 0 0 0 3px rgba(238,48,78,.15);
}
.sp-field select {
  padding: 12px 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 15px; color: var(--ink);
  outline: none; font-family: var(--font-sans);
  background: var(--surface); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.sp-field select:focus {
  border-color: var(--cccn-red);
  box-shadow: 0 0 0 3px rgba(238,48,78,.15);
}
.sp-field.has-error input,
.sp-field.has-error select { border-color: var(--cccn-red); }
.sp-field-error {
  font-size: 11.5px; font-weight: 700; color: var(--cccn-red); min-height: 1px;
}
.sp-field--narrow { max-width: 260px; }

/* ══ Buttons ════════════════════════════════════════════ */

.sp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .14s, color .14s, border-color .14s, box-shadow .14s, transform .05s;
}
.sp-btn:active:not(:disabled) { transform: translateY(1px); }
.sp-btn:disabled { opacity: .55; cursor: not-allowed; }
.sp-btn--full { width: 100%; }
.sp-btn--sm   { padding: 6px 13px; font-size: 12.5px; }

.sp-btn--primary { background: var(--cccn-red); color: #fff; border-color: var(--cccn-red); box-shadow: var(--shadow-sm); }
.sp-btn--primary:hover:not(:disabled) { background: var(--cccn-red-700); border-color: var(--cccn-red-700); }

.sp-btn--secondary { background: var(--surface); color: var(--cccn-blue-900); border-color: var(--line-2); }
.sp-btn--secondary:hover:not(:disabled) { background: var(--cream); border-color: var(--cccn-red); color: var(--cccn-red); }

.sp-btn--ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.sp-btn--ghost:hover:not(:disabled) { background: rgba(255,255,255,.22); }

.sp-btn--outline { background: transparent; color: var(--cccn-blue-700); border-color: var(--line-2); }
.sp-btn--outline:hover:not(:disabled) { background: var(--cccn-blue-100); border-color: var(--cccn-blue-500); }

.sp-btn--checkin { background: var(--green); color: #fff; border-color: var(--green); padding: 10px 20px; }
.sp-btn--checkin:hover:not(:disabled) { background: #15803d; border-color: #15803d; }

/* ══ Header ═════════════════════════════════════════════ */

.sphdr {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.sphdr__bar {
  height: var(--hdr-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 clamp(14px, 3vw, 28px);
}
.sphdr__brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sphdr__logo img { height: 34px; width: auto; display: block; }
.sphdr__divider { width: 1px; height: 30px; background: var(--line-2); flex-shrink: 0; }
.sphdr__titles { display: flex; flex-direction: column; min-width: 0; }
.sphdr__label {
  font-family: var(--font-display); font-weight: 600;
  color: var(--cccn-blue-900); font-size: 17px; line-height: 1.15; letter-spacing: -.01em;
}
.sphdr__sub { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.sphdr__right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ══ Role badges ════════════════════════════════════════ */

.sp-role-badge {
  display: inline-flex; align-items: center; padding: 3px 11px;
  border-radius: 999px; font-size: 10px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
}
.sp-role-badge--admin { background: var(--gold-bg); color: var(--gold-tx); border: 1px solid #fde68a; }
.sp-role-badge--staff { background: var(--cccn-red-100); color: var(--cccn-red-700); border: 1px solid #f5c2cb; }

.sp-inline-badge {
  display: inline-flex; align-items: center; padding: 1px 7px;
  border-radius: 5px; font-size: 10px; font-weight: 700;
  background: var(--cccn-blue-100); color: var(--cccn-blue-700);
  vertical-align: middle; margin-left: 5px; letter-spacing: .03em;
}
.sp-inline-badge--admin { background: var(--gold-bg); color: var(--gold-tx); }

/* ══ Main wrap ══════════════════════════════════════════ */

.sp-main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 28px); }

/* ══ Stats bar ══════════════════════════════════════════ */

.sp-stats {
  display: flex; align-items: center; gap: 0;
  margin: 18px 0 0; padding: 14px 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.sp-stat {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 0 24px; border-right: 1px solid var(--line);
}
.sp-stat:first-child { padding-left: 0; }
.sp-stat b {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  line-height: 1; color: var(--cccn-blue-900);
}
.sp-stat span {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin-top: 4px;
}
.sp-stat--green b { color: var(--green); }
.sp-stat--blue  b { color: var(--cccn-red); }
.sp-stat--muted b { font-family: var(--font-sans); font-size: 15px; color: var(--muted); }

.sp-realtime-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #d1d5db; margin-left: auto; flex-shrink: 0;
  transition: background .3s, box-shadow .3s;
}
.sp-realtime-dot.is-live { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.sp-realtime-dot.is-err  { background: var(--cccn-red); }

/* ══ Tabs ═══════════════════════════════════════════════ */

.sp-tabs {
  display: flex; align-items: stretch; gap: 4px;
  margin: 16px 0 4px; padding-bottom: 0;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.sp-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 16px; border: none; background: transparent;
  color: var(--muted); font-family: var(--font-sans);
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  border-bottom: 2.5px solid transparent; white-space: nowrap;
  transition: color .14s, border-color .14s;
}
.sp-tab:hover { color: var(--cccn-blue-900); }
.sp-tab--active { color: var(--cccn-red); border-bottom-color: var(--cccn-red); }

/* ══ Panel ══════════════════════════════════════════════ */

.sp-panel { padding: 22px 0 60px; }

/* ══ Scanner layout ═════════════════════════════════════ */

.sp-scanner-layout {
  display: grid; grid-template-columns: 380px 1fr;
  gap: 22px; align-items: start;
}
.sp-camera-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm);
}
.sp-qr-reader { width: 100%; }
#qr-reader { border: none !important; }
#qr-reader video { width: 100% !important; border-radius: 0 !important; display: block; }
#qr-reader img  { width: 100% !important; }
#qr-reader__scan_region { border: none !important; }
#qr-reader__dashboard { padding: 8px !important; background: var(--surface) !important; }
#qr-reader__dashboard_section_csr { display: none !important; }
#qr-reader__status_span { font-size: 11px !important; color: var(--muted) !important; }

.sp-camera-placeholder {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--muted-2); background: var(--cream);
}
.sp-camera-placeholder p { margin: 0; font-size: 13px; }

.sp-camera-bar { padding: 12px; display: flex; gap: 8px; border-top: 1px solid var(--line); }
.sp-camera-bar .sp-btn { flex: 1; }

/* ══ Search ═════════════════════════════════════════════ */

.sp-or-divider {
  text-align: center; color: var(--muted); font-size: 12px;
  position: relative; margin: 16px 0;
}
.sp-or-divider span { background: var(--cream); padding: 0 12px; position: relative; z-index: 1; }
.sp-or-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--line);
}
.sp-search-wrap { position: relative; }
.sp-search-row {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm); padding: 0 13px;
  transition: border-color .15s, box-shadow .15s;
}
.sp-search-row:focus-within {
  border-color: var(--cccn-red); box-shadow: 0 0 0 3px rgba(238,48,78,.12);
}
.sp-search-ico { color: var(--muted); flex-shrink: 0; }
.sp-search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-sans); font-size: 14px; padding: 11px 0; color: var(--ink);
}
.sp-search-input::placeholder { color: var(--muted-2); }

.sp-search-results {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow-md);
  z-index: 200; max-height: 340px; overflow-y: auto;
}
.sp-search-result {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; background: none; border: none;
  border-bottom: 1px solid var(--line); cursor: pointer;
  font-family: var(--font-sans); text-align: left; transition: background .12s;
}
.sp-search-result:last-child { border-bottom: none; }
.sp-search-result:hover { background: var(--cream); }
.sp-search-result__name { font-size: 13.5px; font-weight: 600; color: var(--ink); flex: 1; }
.sp-search-result__meta { font-size: 11.5px; color: var(--muted); }
.sp-search-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* ══ Result panel ═══════════════════════════════════════ */

.sp-result-col {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
  min-height: 320px; overflow: hidden;
}
.sp-result-empty, .sp-result-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 70px 40px; text-align: center; color: var(--muted);
  min-height: 320px;
}
.sp-result-empty svg { opacity: .28; color: var(--cccn-blue-700); }
.sp-result-empty p, .sp-result-error p { margin: 0; font-size: 14px; max-width: 240px; }
.sp-result-icon { font-size: 40px; line-height: 1; color: var(--cccn-red); }

/* ══ Attendee card ══════════════════════════════════════ */

.sp-attendee-card__head {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 22px 18px; border-bottom: 1px solid var(--line);
}
.sp-attendee-card__avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cccn-red), var(--cccn-blue-900));
  color: #fff; font-family: var(--font-display); font-size: 19px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sp-attendee-card__avatar.is-staff { background: linear-gradient(135deg, #d97706, var(--gold-tx)); }
.sp-attendee-card__info h2 {
  margin: 0 0 3px; font-family: var(--font-display); font-weight: 600;
  font-size: 19px; color: var(--cccn-blue-900); line-height: 1.15;
}
.sp-attendee-card__info p { margin: 0 0 7px; font-size: 13px; color: var(--muted); }

.sp-ticket {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  background: var(--cream); padding: 3px 9px; border-radius: 6px;
  color: var(--cccn-blue-900); letter-spacing: .05em;
}
.sp-ticket-sm { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

/* ── Check-in banner ── */
.sp-checkin-banner {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 22px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600;
}
.sp-checkin-banner.is-done    { background: var(--green-bg); color: var(--green-tx); }
.sp-checkin-banner.is-pending { background: var(--orange-bg); color: var(--orange-tx); }
.sp-checkin-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.sp-checkin-banner .sp-btn--checkin { margin-left: auto; }

/* ── Sessions section in card ── */
.sp-sessions-section { padding: 16px 22px; }
.sp-sessions-section h3 {
  margin: 0 0 12px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--cccn-red); font-weight: 800;
}
.sp-session-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line); margin-bottom: 8px;
}
.sp-session-row.is-checked { background: var(--green-bg); border-color: #a7f3d0; }
.sp-session-row__info { flex: 1; min-width: 0; }
.sp-session-row__info b { display: block; font-size: 13px; color: var(--cccn-blue-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-session-row__info small { font-size: 11.5px; color: var(--muted); }
.sp-session-row__status { flex-shrink: 0; }

.sp-result-foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* ══ Badges ═════════════════════════════════════════════ */

.sp-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.sp-badge--green  { background: var(--green-bg); color: var(--green-tx); }
.sp-badge--orange { background: var(--orange-bg); color: var(--orange-tx); }
.sp-badge--grey   { background: #f3f4f6; color: var(--muted); }
.sp-badge--blue   { background: var(--cccn-blue-100); color: var(--cccn-blue-700); }

/* ══ Sessions tab ═══════════════════════════════════════ */

.sp-section-hdr { margin-bottom: 18px; }
.sp-section-hdr h2 {
  margin: 0 0 4px; font-family: var(--font-display); font-weight: 600;
  font-size: 22px; color: var(--cccn-blue-900); letter-spacing: -.01em;
}
.sp-sessions-list { display: flex; flex-direction: column; gap: 22px; }
.sp-session-group__label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--cccn-red); margin: 0 0 10px;
}
.sp-session-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}
.sp-session-card__head { padding: 16px 20px; }
.sp-session-card__meta { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; flex-wrap: wrap; }
.sp-session-card__title {
  margin: 0 0 4px; font-family: var(--font-display); font-weight: 600;
  font-size: 16px; color: var(--cccn-blue-900); line-height: 1.25;
}
.sp-session-card__spk { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.sp-session-card__body { border-top: 1px solid var(--line); padding: 16px 20px; background: var(--cream); }

/* ══ Attendee table ═════════════════════════════════════ */

.sp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sp-table th {
  text-align: left; padding: 8px 11px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
  border-bottom: 1.5px solid var(--line-2);
}
.sp-table td { padding: 10px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sp-table tr:last-child td { border-bottom: none; }
.sp-table tr.is-in td { background: rgba(220,252,231,.45); }
.sp-table small { display: block; font-size: 11px; color: var(--muted); }
.sp-table .sp-cell-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.sp-move-select {
  font-family: var(--font-sans); font-size: 12px; color: var(--ink-2);
  padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; max-width: 150px;
}
.sp-move-select:focus { outline: none; border-color: var(--cccn-red); }

/* Small "undo" link-button next to a green check */
.sp-undo {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 700;
  color: var(--muted); text-decoration: underline;
}
.sp-undo:hover { color: var(--cccn-red); }

/* ══ Attendees tab ══════════════════════════════════════ */

.sp-attendees-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sp-attendees-bar .sp-search-row { flex: 1; }
.sp-count-badge { font-size: 12.5px; font-weight: 700; color: var(--cccn-blue-900); white-space: nowrap; }

.sp-attendees-list { display: flex; flex-direction: column; gap: 7px; }
.sp-attendee-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; transition: border-color .13s, box-shadow .13s;
}
.sp-attendee-row:hover { border-color: var(--cccn-red); box-shadow: 0 0 0 3px rgba(238,48,78,.08); }
.sp-attendee-row.is-in { background: #f0fdf4; border-left: 3px solid var(--green); }
.sp-attendee-row__av {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--cccn-red), var(--cccn-blue-900));
  color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.sp-attendee-row__av.is-staff { background: linear-gradient(135deg, #d97706, var(--gold-tx)); }
.sp-attendee-row__info { flex: 1; min-width: 0; }
.sp-attendee-row__info b { display: block; font-size: 13.5px; font-weight: 700; color: var(--cccn-blue-900); }
.sp-attendee-row__info small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sp-attendee-row__meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ══ Spinner / loading ══════════════════════════════════ */

.sp-spinner {
  width: 24px; height: 24px;
  border: 2.5px solid var(--line); border-top-color: var(--cccn-red);
  border-radius: 50%; animation: sp-spin .6s linear infinite;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }
.sp-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 50px; color: var(--muted); }
.sp-loading p { margin: 0; font-size: 13px; }

/* ══ Toast ══════════════════════════════════════════════ */

.sp-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s;
  pointer-events: none;
}
.sp-toast.is-visible { transform: translateY(0); opacity: 1; }
.sp-toast--success { background: var(--green); }
.sp-toast--error   { background: var(--cccn-red); }
.sp-toast--info    { background: var(--cccn-blue-700); }

/* ══ Utilities ══════════════════════════════════════════ */

.sp-muted { color: var(--muted); }
.sp-p { padding: 10px 0; }
.sp-link {
  background: none; border: none; cursor: pointer;
  color: var(--cccn-blue-700); font-weight: 700; font-size: 13px;
  font-family: var(--font-sans); text-align: left; padding: 0;
}
.sp-link:hover { color: var(--cccn-red); text-decoration: underline; }

/* ══ Profile session-row actions (status + change-session) ══ */
.sp-session-row__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Add-a-session control under the picks list in the Scanner result card */
.sp-add-session-row {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
}
.sp-add-session-row .sp-move-select { flex: 1; max-width: none; }

/* Add-attendee search bar at the top of a session's attendee table */
.sp-add-attendee { margin-bottom: 14px; }
.sp-search-row--sm { padding: 0 11px; }
.sp-search-row--sm .sp-search-input { padding: 8px 0; font-size: 13px; }
.sp-add-results {
  margin-top: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow-sm);
  max-height: 240px; overflow-y: auto;
}
.sp-add-walkin-link {
  display: inline-block; margin-top: 8px; font-size: 12.5px;
}

/* ══ Quick Registration tab ═════════════════════════════ */
.sp-reg-form { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
.sp-reg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.sp-reg-sessions-wrap { display: flex; flex-direction: column; gap: 8px; }
.sp-reg-sessions-label {
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
}
.sp-reg-sessions {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.sp-reg-block { display: flex; flex-direction: column; gap: 6px; }
.sp-reg-block__label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .09em; color: var(--cccn-red);
}
.sp-reg-session-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; cursor: pointer;
}
.sp-reg-session-item input { flex-shrink: 0; width: 17px; height: 17px; accent-color: var(--cccn-red); cursor: pointer; }
.sp-reg-session-item__title { flex: 1; font-size: 13.5px; color: var(--ink); }

/* ══ Horizontal scroll wrapper for wide tables (mobile) ══ */
.sp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-table-wrap .sp-table { min-width: 540px; }

/* ══ Analytics tab ══════════════════════════════════════ */
.sp-analytics { display: flex; flex-direction: column; gap: 16px; }
.sp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.sp-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.sp-kpi b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--cccn-blue-900); line-height: 1; }
.sp-kpi span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.sp-kpi small { display: block; font-size: 11px; color: var(--cccn-red); font-weight: 700; margin-top: 2px; }

.sp-an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sp-an-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  /* Grid items default to min-width:auto (content-based) — without this,
     a card whose content is wide (e.g. many day-columns) spills past its
     own grid track instead of shrinking, forcing the whole page wider. */
  min-width: 0;
}
.sp-an-card h4 { margin: 0 0 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--cccn-red); font-weight: 800; }
.sp-an-card--center { display: flex; flex-direction: column; align-items: center; }

.sp-donut {
  width: 140px; height: 140px; border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), var(--line) 0);
  display: grid; place-items: center; margin: 4px 0;
}
.sp-donut__hole {
  width: 104px; height: 104px; border-radius: 50%; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sp-donut__hole b { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--cccn-blue-900); line-height: 1; }
.sp-donut__hole small { font-size: 11px; color: var(--muted); margin-top: 3px; }

.sp-hi__title { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--cccn-blue-900); line-height: 1.2; }
.sp-hi__sub { font-size: 12px; color: var(--muted); margin: 3px 0 8px; }
.sp-hi__big { font-family: var(--font-display); font-weight: 700; font-size: 30px; color: var(--cccn-red); line-height: 1; margin-bottom: 10px; }
.sp-hi__big small { font-family: var(--font-sans); font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 6px; }

.sp-bars { display: flex; flex-direction: column; gap: 11px; }
.sp-bar__top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 4px; }
.sp-bar__top span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sp-bar__top b { color: var(--cccn-blue-900); flex-shrink: 0; }
.sp-bar__track { height: 8px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.sp-bar__fill { height: 100%; border-radius: 999px; background: linear-gradient(to right, var(--cccn-red), var(--cccn-blue-700)); }

/* Scrolls internally instead of forcing the whole page wider when there
   are many registration days (real data can easily be 15-20+ columns). */
.sp-cols { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-col { flex: 1 0 28px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.sp-col__bar {
  width: 100%; max-width: 40px; min-height: 6px;
  background: linear-gradient(to top, var(--cccn-blue-700), var(--cccn-red));
  border-radius: 6px 6px 0 0; display: flex; justify-content: center;
}
.sp-col__bar span { font-size: 10px; font-weight: 800; color: var(--cccn-blue-900); margin-top: -16px; }
.sp-col small { font-size: 10px; color: var(--muted); }

/* ══ Responsive ═════════════════════════════════════════ */

@media (max-width: 860px) {
  .sp-scanner-layout { grid-template-columns: 1fr; }
  .sp-an-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sp-reg-row { grid-template-columns: 1fr; }
  .sp-field--narrow { max-width: none; }
  .sp-add-session-row { flex-wrap: wrap; }
  .sp-add-session-row .sp-move-select { flex: 1 1 100%; }
}
@media (max-width: 680px) {
  .sphdr__sub { display: none; }
  .sp-stats { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .sp-stat {
    padding: 8px 12px; border-right: none;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    flex-direction: row; align-items: baseline; gap: 7px; flex: 1 1 calc(50% - 5px);
  }
  .sp-stat b { font-size: 19px; }
  .sp-realtime-dot { order: -1; }
  .sp-attendees-bar { flex-direction: column; align-items: stretch; }
  .sp-toast { left: 14px; right: 14px; bottom: 14px; text-align: center; }
}
/* ══ Surveys tab — compact executive cards ═════════════════ */

.sfb-highlights { margin-top: 16px; }

.sfb-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 22px 0 14px;
}
.sfb-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.sfb-chip {
  padding: 7px 15px; border-radius: 999px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink-2);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: all .14s;
}
.sfb-chip:hover { border-color: var(--cccn-red); color: var(--cccn-red); }
.sfb-chip--active { background: var(--cccn-blue-900); border-color: var(--cccn-blue-900); color: #fff; }

.sfb-cards { display: flex; flex-direction: column; gap: 8px; padding-bottom: 60px; }
.sfb-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow-sm);
  padding: 12px 16px;
}
.sfb-card__top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }
.sfb-card__count { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sfb-card__count b { color: var(--cccn-blue-900); font-family: var(--font-display); font-size: 13px; }

.sfb-card__title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: 14.5px; color: var(--cccn-blue-900); line-height: 1.25;
}
.sfb-card__spk { margin: 1px 0 8px; font-size: 11.5px; color: var(--muted); }

.sfb-pill {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em;
}
.sfb-pill--completed { background: #f3f4f6; color: var(--muted); }
.sfb-pill--live      { background: var(--green-bg); color: var(--green-tx); animation: sfb-pulse 1.8s ease-in-out infinite; }
.sfb-pill--upcoming  { background: var(--gold-bg); color: var(--gold-tx); }
@keyframes sfb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* Ratings — always visible, no expand needed */
.sfb-rates { display: flex; gap: 22px; flex-wrap: wrap; }
.sfb-rate { display: flex; flex-direction: column; gap: 3px; min-width: 96px; flex: 1 1 96px; max-width: 160px; }
.sfb-rate__top { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--muted); }
.sfb-rate__top b { font-family: var(--font-display); font-size: 13px; color: var(--cccn-blue-900); }
.sfb-rate__bar { height: 5px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.sfb-rate__bar > div { height: 100%; border-radius: 999px; background: linear-gradient(to right, var(--cccn-red), var(--cccn-blue-700)); }

.sfb-empty { margin: 2px 0 0; font-size: 12.5px; }

/* Comments — compact, collapsed beyond the first two by default */
.sfb-comments { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sfb-comments__label {
  display: block; margin-bottom: 5px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; color: var(--cccn-red);
}
.sfb-comments__list { display: flex; flex-direction: column; gap: 4px; }
.sfb-comment-line:not([hidden]) { display: flex; align-items: baseline; gap: 8px; }
.sfb-comment-line p {
  margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical; flex: 1; min-width: 0;
}
.sfb-comment-line small { flex-shrink: 0; font-size: 10px; color: var(--muted-2); }
.sfb-comments__more {
  margin-top: 5px; background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 700;
  color: var(--cccn-blue-700);
}
.sfb-comments__more:hover { color: var(--cccn-red); }

@media (max-width: 680px) {
  .sfb-card__count { margin-left: 0; width: 100%; }
  .sfb-comment-line { flex-direction: column; gap: 1px; }
}

@media (max-width: 460px) {
  .sp-auth__inner { padding: 26px 20px 24px; }
  .sp-auth__titles h1 { font-size: 25px; }
  .sphdr__divider { display: none; }
  .sphdr__logo img { height: 30px; }
  .sp-attendee-card__head { flex-wrap: wrap; }
  .sp-checkin-banner { flex-wrap: wrap; }
  .sp-checkin-banner .sp-btn--checkin { margin-left: 0; width: 100%; }
  .sp-attendee-row__meta { flex-direction: column; align-items: flex-end; gap: 4px; }
  .sp-session-row { flex-wrap: wrap; }
  .sp-session-row__actions { width: 100%; justify-content: space-between; }
  .sp-session-row__actions .sp-move-select { max-width: none; flex: 1; }
  .sp-kpi b { font-size: 24px; }
}
