@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Brand colors */
  --color-primary: #0053cf;
  --color-primary-hover: #3378e0;
  --color-navy: #1f3063;
  --color-text: #001534;
  --color-text-muted: #6b7694;
  --color-text-dim: #9aa3b8;
  --color-border: #e4e8f1;
  --color-border-light: #edf0f7;
  --color-bg-page: #fafafa;
  --color-bg-neutral: #f4f6fb;
  --color-red: #eb0000;
  --color-orange: #fc560e;
  --color-orange-hover: #d44a0c;
  --color-green: #059669;
  --color-green-hover: #047857;
  --color-linkedin: #0a66c2;
  --color-linkedin-hover: #004182;
  /* Font */
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg-page);
  line-height: 1.5;
  font-size: 14px;
}

/* ── Global dark mode: override CSS variables ─────────────────────── */

body.dark-mode {
  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-navy: #1e293b;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;
  --color-border: #2d3348;
  --color-border-light: #1e2130;
  --color-bg-page: #0f1117;
  --color-bg-neutral: #1a1d27;
  --color-red: #f87171;
  --color-orange: #fb923c;
  --color-orange-hover: #f97316;
  --color-green: #34d399;
  --color-green-hover: #10b981;
  --color-linkedin: #60a5fa;
  --color-linkedin-hover: #3b82f6;
}

body.dark-mode .data-table,
body.dark-mode .sp-card,
body.dark-mode .sp-detail,
body.dark-mode .cache-stat-card,
body.dark-mode .cache-actions,
body.dark-mode .modal-box,
body.dark-mode .sponsors-add-form,
body.dark-mode .users-add-form,
body.dark-mode .queue-item,
body.dark-mode .queue-empty {
  background: #1a1d27;
}

body.dark-mode .sp-row-badge {
  background: #252838;
}

body.dark-mode #sponsors-list:not(:empty) {
  background: #1a1d27;
  border-color: #2d3348;
}

body.dark-mode .data-table thead th {
  background: #151822;
}

body.dark-mode .data-table tbody tr:hover {
  background: #1e2130;
}

body.dark-mode .data-table .cell-primary,
body.dark-mode .data-table .cell-primary a {
  color: #f1f5f9;
}

body.dark-mode .row-past td { color: #4b5563; }
body.dark-mode .row-past .cell-primary,
body.dark-mode .row-past .cell-primary a,
body.dark-mode .row-past td a:not(.checkin-link) { color: #4b5563; }

body.dark-mode .modal-box {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.dark-mode .modal-cancel-btn {
  background: #1e2130;
  color: #e2e8f0;
}

body.dark-mode .modal-cancel-btn:hover {
  background: #252838;
}

body.dark-mode .modal-close { color: #64748b; }
body.dark-mode .modal-close:hover { color: #e2e8f0; }

body.dark-mode .modal-input,
body.dark-mode .sp-input,
body.dark-mode .sp-blurb,
body.dark-mode .users-hs-select,
body.dark-mode .users-role-select {
  background: #1e2130;
  color: #e2e8f0;
}

body.dark-mode .sp-card-header,
body.dark-mode .sp-rep,
body.dark-mode .sp-event-row,
body.dark-mode .preview-note-header,
body.dark-mode .preview-meta {
  background: #151822;
}

body.dark-mode .sp-card-header .sp-name { color: #f1f5f9; }

body.dark-mode .cache-stat-count { color: #f1f5f9; }

body.dark-mode .cache-btn {
  background: #1e2130;
  color: #94a3b8;
}

body.dark-mode .cache-btn:hover {
  background: #252838;
  color: #e2e8f0;
}

body.dark-mode .cache-btn-all {
  background: #2a1215;
  color: #f87171;
  border-color: #7f1d1d;
}

body.dark-mode .log-panel {
  background: #0f1117;
}

body.dark-mode .report-bar {
  background: #0f2419;
  border-color: #166534;
}

body.dark-mode .report-bar a { color: #34d399; }

body.dark-mode h1 { color: #f1f5f9; }

body.dark-mode .top-nav {
  background: #0f1117;
  border-bottom: 1px solid #2d3348;
}

body.dark-mode .sponsors-add-form,
body.dark-mode .users-add-form {
  border-color: #2d3348;
}

body.dark-mode .queue-option:hover {
  background: #1e2130;
}

body.dark-mode .cog-menu {
  background: #1a1d27;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .cog-link {
  color: #e2e8f0;
}

body.dark-mode .cog-link:hover {
  background: #1e2130;
}

body.dark-mode .preview-note-body { color: #94a3b8; }
body.dark-mode .preview-summary { color: #e2e8f0; }

body.dark-mode .save-result-ok { background: #0f2419; }
body.dark-mode .save-result-err { background: #2a1215; }
body.dark-mode .save-result-skip { background: #1e2130; }
body.dark-mode .save-result-name { color: #f1f5f9; }

body.dark-mode .section-title { color: #f1f5f9; }

body.dark-mode .preview-meta-title { color: #f1f5f9; }
body.dark-mode .preview-meta-table td:last-child { color: #e2e8f0; }

body.dark-mode .loading-msg { color: #64748b; }
body.dark-mode .spinner {
  border-color: #2d3348;
  border-top-color: #3b82f6;
}

body.dark-mode .perm-label { color: #e2e8f0; }

/* Email preview: always white email canvas regardless of dark mode */
body.dark-mode #preview-body {
  background: #fff !important;
  border-color: #d1d5db !important;
  color: #001534 !important;
}

body.dark-mode #li-post-text {
  background: #1e2130 !important;
  border-color: #2d3348 !important;
  color: #e2e8f0 !important;
}

body.dark-mode #li-post-loading,
body.dark-mode #thankyou-loading,
body.dark-mode #preevent-loading {
  color: #64748b !important;
}

body.dark-mode #thankyou-subject,
body.dark-mode #preevent-subject {
  background: #151822 !important;
  border-color: #2d3348 !important;
  color: #f1f5f9 !important;
}

body.dark-mode #thankyou-html,
body.dark-mode #preevent-html {
  border-color: #2d3348 !important;
  color: #e2e8f0 !important;
}

body.dark-mode #cards-log {
  background: #0f1117 !important;
  color: #94a3b8 !important;
  border-bottom-color: #2d3348 !important;
}

body.dark-mode .modal-body label[style] {
  color: #94a3b8 !important;
}

body.dark-mode #preview-subject {
  background: #fff;
  color: #001534;
  border-color: #d1d5db;
}

/* Settings page */
body.dark-mode #briefing {
  background: #1e2130 !important;
  border-color: #2d3348 !important;
  color: #e2e8f0 !important;
}

/* Detail row */
body.dark-mode .detail-row .detail-cell {
  background: #151822;
}

body.dark-mode .sponsors-btn {
  background: #8b5cf6;
}

body.dark-mode .sponsors-btn:hover {
  background: #a78bfa;
}

body.dark-mode .sponsor-pick-card.checked {
  border-color: #8b5cf6;
  background: #1e1533;
}

body.dark-mode .sponsor-pick-name {
  color: #f1f5f9;
}

/* Mobile event cards */
body.dark-mode .mobile-event-card {
  background: #1a1d27;
  border-color: #2d3348;
}

body.dark-mode .mobile-card-city {
  color: #f1f5f9;
}

body.dark-mode .mobile-card-meta {
  color: #94a3b8;
}

body.dark-mode .mobile-card-past {
  opacity: 0.5;
}

/* Weather link */
body.dark-mode .weather-link {
  color: #94a3b8;
}

/* Refresh icon */
body.dark-mode #eb-refresh {
  color: #94a3b8;
}

/* Home page recipient list */
body.dark-mode .modal-recipient {
  color: #e2e8f0;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

/* ── Data tables (events, reports) ──────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 32px;
  font-size: 13px;
}

.data-table thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--color-bg-neutral);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background 0.1s;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--color-bg-neutral);
}

.data-table td {
  padding: 10px 12px;
  white-space: nowrap;
  color: var(--color-text-muted);
}

.data-table .cell-primary {
  font-weight: 600;
  color: var(--color-text);
  white-space: normal;
}

.run-btn {
  display: inline-block;
  padding: 3px 12px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.data-row:hover .run-btn {
  background: var(--color-primary-hover);
}

.open-link {
  font-size: 12px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.open-link:hover { text-decoration: underline; }

.row-past td {
  color: #999;
}

.row-past .cell-primary,
.row-past .cell-primary a,
.row-past td a:not(.checkin-link) {
  color: #999;
}

.weather-cell {
  font-size: 12px;
  white-space: nowrap;
}

.weather-link {
  text-decoration: none;
  color: inherit;
}

.weather-link:hover .weather-temps {
  text-decoration: underline;
}

.weather-temps {
  font-size: 11px;
  color: var(--color-text-muted);
}


/* ── Section headers ────────────────────────────────────────────────────── */

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-navy);
}

/* ── Run page: split layout ─────────────────────────────────────────────── */

.run-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  min-height: calc(100vh - 120px);
}

@media (max-width: 800px) {
  .run-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Progress log panel ─────────────────────────────────────────────────── */

.log-panel {
  background: var(--color-navy);
  border-radius: 8px;
  padding: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}

.log-panel .log-step {
  color: #60a5fa;
  font-weight: 600;
  margin-top: 12px;
}

.log-panel .log-step:first-child {
  margin-top: 0;
}

.log-panel .log-msg {
  white-space: pre-wrap;
  word-break: break-word;
}

.log-panel .log-error {
  color: #f87171;
}

.log-panel .log-done {
  color: #4ade80;
  font-weight: 600;
}

/* ── Review queue panel ─────────────────────────────────────────────────── */

.queue-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.queue-empty {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}

.queue-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
  animation: slideIn 0.2s ease;
}

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

.queue-item.resolved {
  opacity: 0.5;
  pointer-events: none;
}

.queue-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.queue-type.hubspot { color: var(--color-orange); }
.queue-type.linkedin { color: #0a66c2; }

.queue-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.queue-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
  font-size: 12px;
}

.queue-option:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-neutral);
}

.queue-option-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-bg-neutral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.queue-option-details {
  flex: 1;
  min-width: 0;
}

.queue-option-name { font-weight: 500; }

.queue-option-meta {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-li-link {
  color: #0a66c2;
  text-decoration: none;
}

.queue-li-link:hover {
  text-decoration: underline;
}

.queue-option-strong {
  border-color: #86efac;
  background: #f0fdf4;
}

.match-score {
  margin-left: 4px;
}

.match-tag {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 600;
  background: #dbeafe;
  color: var(--color-navy);
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.queue-manual-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 2px;
}

.queue-manual-input {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.queue-manual-input:focus {
  border-color: #0a66c2;
}

.queue-manual-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  background: #0a66c2;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.queue-manual-btn:hover {
  background: #004182;
}

.queue-skip {
  margin-top: 4px;
  padding: 6px 10px;
  border: 1px dashed #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #999;
  text-align: center;
  transition: color 0.1s, border-color 0.1s;
}

.queue-skip:hover {
  color: #666;
  border-color: #bbb;
}

/* ── Report link bar ─────────────────────────────────────────────────────── */

.report-bar {
  margin-top: 12px;
  padding: 12px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  display: none;
  align-items: center;
  gap: 8px;
}

.report-bar.visible { display: flex; }

.report-bar a {
  color: #065f46;
  font-weight: 600;
  text-decoration: none;
}

.report-bar a:hover { text-decoration: underline; }

/* ── Cache controls ────────────────────────────────────────────────────── */

.cache-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  background: var(--color-bg-neutral);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.cache-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.cache-btn-all {
  background: #fef2f2;
  color: var(--color-red);
  border-color: #fecaca;
}

.cache-btn-all:hover {
  background: #fee2e2;
  color: #7f1d1d;
}

/* ── EventBrite refresh throbber ────────────────────────────────────────── */

#eb-refresh-row {
  text-align: right;
  margin-bottom: 4px;
  line-height: 1;
}
#eb-refresh {
  display: inline-block;
  font-size: 16px;
  color: #6b7694;
  cursor: pointer;
  user-select: none;
}
#eb-refresh:hover {
  color: var(--color-primary);
}
#eb-refresh.spinning {
  animation: spin 0.6s linear infinite;
  pointer-events: none;
  color: var(--color-primary);
}

/* ── Loading spinner ─────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-msg {
  text-align: center;
  padding: 40px;
  color: #888;
}

/* ── Back link ────────────────────────────────────────────────────────────── */

/* ── Home header ──────────────────────────────────────────────────────────── */

.home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.sync-all-btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  margin-top: 4px;
}

.sync-all-btn:hover {
  background: var(--color-primary-hover);
}

.regen-btn {
  background: var(--color-navy);
}

.regen-btn:hover {
  background: #162448;
}

/* ── Sync badge ──────────────────────────────────────────────────────────── */

.sync-badge {
  display: inline-block;
  min-width: 22px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: #f59e0b;
  color: #fff;
  text-align: center;
  vertical-align: middle;
  margin-right: 4px;
}

/* ── Back link ────────────────────────────────────────────────────────────── */

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: none;
}

.back-link:hover { text-decoration: underline; }

/* ── Send button (in report cell) ────────────────────────────────────── */

.send-btn {
  display: inline-block;
  padding: 2px 8px;
  background: #059669;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  transition: background 0.1s;
}

.send-btn:hover {
  background: #047857;
}

.li-post-btn {
  display: inline-block;
  padding: 2px 8px;
  background: #0a66c2;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 2px;
  vertical-align: middle;
  transition: background 0.1s;
}

.li-post-btn:hover {
  background: #004182;
}

.thankyou-btn {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-orange);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 2px;
  vertical-align: middle;
  transition: background 0.1s;
}

.thankyou-btn:hover {
  background: var(--color-orange-hover);
}

.preevent-btn {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 2px;
  vertical-align: middle;
  transition: background 0.1s;
}

.preevent-btn:hover {
  background: var(--color-primary-hover);
}

#thankyou-html p { margin: 0 0 10px 0; }
#thankyou-html a { color: var(--color-primary); text-decoration: underline; }
#thankyou-html strong { color: var(--color-text); }
#thankyou-html img { vertical-align: middle; }

#preevent-html p { margin: 0 0 10px 0; }
#preevent-html a { color: var(--color-primary); text-decoration: underline; }
#preevent-html strong { color: var(--color-text); }

.sponsor-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 600;
  background: #d1fae5;
  color: #065f46;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Email modal ─────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #fff;
  border-radius: 10px;
  width: 480px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  animation: modalIn 0.15s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  font-size: 22px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-recipient {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
}

.modal-recipient:last-child {
  border-bottom: none;
}

.modal-remove {
  margin-left: auto;
  cursor: pointer;
  color: #ccc;
  font-size: 16px;
  line-height: 1;
}

.modal-remove:hover {
  color: var(--color-red);
}

.modal-add-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.modal-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  outline: none;
}

.modal-input-name {
  flex: 0.7;
}

.modal-input:focus {
  border-color: var(--color-primary);
}

.modal-add-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-bg-neutral);
  color: #334155;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.modal-add-btn:hover {
  background: #e2e8f0;
}

.recip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.recip-input {
  flex: 1;
  min-width: 0;
}

.recip-input-email {
  flex: 1.5;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
}

#modal-status {
  flex: 1;
  font-size: 12px;
  color: var(--color-text-muted);
}

.modal-cancel-btn {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-bg-neutral);
  color: #334155;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.modal-cancel-btn:hover {
  background: #e2e8f0;
}

.modal-send-btn {
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 600;
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.modal-send-btn:hover {
  background: #047857;
}

.modal-send-btn:disabled {
  background: var(--color-text-dim);
  cursor: not-allowed;
}

/* ── Check-in page ─────────────────────────────────────────────────────── */

.checkin-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
}

.checkin-header {
  position: sticky;
  top: 48px;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 12px 16px 0;
}

.checkin-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.checkin-back {
  font-size: 14px;
  color: var(--color-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.checkin-back:hover { text-decoration: underline; }

.checkin-header-info {
  flex: 1;
  min-width: 0;
}

.checkin-event-name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkin-event-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.checkin-stats {
  font-size: 13px;
  font-weight: 600;
  color: #059669;
  white-space: nowrap;
  flex-shrink: 0;
}

.checkin-search-bar {
  padding: 8px 0 12px;
}

.checkin-search {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  outline: none;
  background: var(--color-bg-neutral);
}

.checkin-search:focus {
  border-color: var(--color-primary);
  background: #fff;
}

/* ── Attendee list ─────────────────────────────────────────────────────── */

.checkin-list {
  flex: 1;
  padding: 8px 16px;
  padding-bottom: 180px; /* space for bottom bar */
  overflow-y: auto;
}

.checkin-empty {
  text-align: center;
  color: #999;
  padding: 32px;
  font-size: 14px;
}

/* ── Attendee card ─────────────────────────────────────────────────────── */

.checkin-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.checkin-card.checked-in {
  border-color: #86efac;
  background: #f0fdf4;
}

.checkin-card.expanded {
  border-color: #93c5fd;
}

.checkin-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
}

.checkin-checkbox {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.checkin-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.checkin-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 600;
}

.checkin-card-info {
  flex: 1;
  min-width: 0;
}

.checkin-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.checkin-card-detail {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkin-card-notes-preview {
  font-size: 11px;
  color: var(--color-text-dim);
  margin-top: 2px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkin-card-expand {
  flex-shrink: 0;
  color: #ccc;
  font-size: 10px;
}

/* ── Expanded card ─────────────────────────────────────────────────────── */

.checkin-card-expanded {
  padding: 0 14px 14px;
  border-top: 1px solid var(--color-border-light);
}

.checkin-detail-row {
  font-size: 13px;
  padding: 4px 0;
  color: #555;
}

.checkin-detail-row a {
  color: var(--color-primary);
  text-decoration: none;
}

.checkin-detail-row a:hover {
  text-decoration: underline;
}

.checkin-detail-label {
  font-weight: 600;
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.checkin-notes-section {
  margin-top: 8px;
}

.checkin-notes-textarea {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  margin-top: 4px;
}

.checkin-notes-textarea:focus {
  border-color: var(--color-primary);
}

/* ── Bottom bar ────────────────────────────────────────────────────────── */

.checkin-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid var(--color-border);
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.checkin-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.checkin-mic-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-neutral);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.15s;
}

.checkin-mic-btn:hover {
  background: #e2e8f0;
  color: #334155;
}

.checkin-mic-btn.recording {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.checkin-notes-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
}

.checkin-notes-input:focus {
  border-color: var(--color-primary);
}

.checkin-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.checkin-action-spacer {
  flex: 1;
}

.checkin-parse-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--color-bg-neutral);
  color: #334155;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  min-height: 44px;
}

.checkin-parse-btn:hover {
  background: #e2e8f0;
}

.checkin-parse-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkin-save-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  min-height: 44px;
}

.checkin-save-btn:hover {
  background: var(--color-primary-hover);
}

/* ── Parse modal cards ─────────────────────────────────────────────────── */

.parse-match-card {
  background: var(--color-bg-neutral);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.parse-match-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.parse-match-notes {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}

.parse-match-notes:focus {
  border-color: var(--color-primary);
}

.parse-unmatched {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #92400e;
}

/* ── Check-in button on home page ──────────────────────────────────────── */

.checkin-link {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-navy);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  vertical-align: middle;
  transition: background 0.1s;
}

.checkin-link:hover {
  background: #162448;
}

.cards-btn {
  display: inline-block;
  padding: 2px 8px;
  background: #1a1a2e;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 2px;
  text-decoration: none;
  vertical-align: middle;
  transition: background 0.1s;
}

.cards-btn:hover {
  background: #16213e;
}

.sponsors-btn {
  display: inline-block;
  padding: 2px 8px;
  background: #7c3aed;
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 2px;
  text-decoration: none;
  vertical-align: middle;
  transition: background 0.1s;
}

.sponsors-btn:hover {
  background: #6d28d9;
}

/* ── Sponsors picker modal ─────────────────────────────────────────── */

.sponsor-pick-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 6px;
}

.sponsor-pick-card:hover {
  border-color: var(--color-primary);
}

.sponsor-pick-card.checked {
  border-color: #7c3aed;
  background: #f5f3ff;
}

.sponsor-pick-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.sponsor-pick-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  background: #111;
  padding: 4px 6px;
  border-radius: 6px;
}

.sponsor-pick-info {
  flex: 1;
  min-width: 0;
}

.sponsor-pick-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.sponsor-pick-domain {
  font-size: 12px;
  color: var(--color-text-muted);
}

.sponsor-pick-reps {
  padding: 6px 0 2px 26px;
}

.sponsor-pick-rep-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 0;
}

.sponsor-pick-rep-label input {
  margin: 0;
}

/* ── Save preview ──────────────────────────────────────────────────────── */

.preview-warning {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--color-red);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.preview-meta {
  background: var(--color-bg-neutral);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.preview-meta-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 8px;
}

.preview-meta-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.preview-meta-table td {
  padding: 3px 0;
  vertical-align: top;
}

.preview-meta-table td:first-child {
  color: var(--color-text-muted);
  font-weight: 500;
  width: 100px;
  white-space: nowrap;
  padding-right: 12px;
}

.preview-meta-table td:last-child {
  color: #334155;
}

.preview-summary {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 10px;
}

.preview-note-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.preview-note-card.has-notes {
  border-color: #86efac;
}

.preview-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-bg-neutral);
  font-size: 13px;
  border-bottom: 1px solid var(--color-border-light);
}

.preview-outcome-attended {
  font-size: 11px;
  font-weight: 600;
  color: #059669;
}

.preview-outcome-noshow {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-red);
}

.preview-note-email {
  color: var(--color-text-dim);
  font-size: 11px;
  margin-left: auto;
}

.preview-note-body {
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #555;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin: 0;
  max-height: 120px;
  overflow-y: auto;
}

.preview-skipped-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-dim);
  margin-top: 12px;
  margin-bottom: 4px;
}

.preview-skipped {
  font-size: 12px;
  color: var(--color-text-dim);
  padding: 2px 0;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

/* ── Save results ─────────────────────────────────────────────────────── */

.save-results-list {
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.save-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--color-border-light);
}

.save-result-row:last-child {
  border-bottom: none;
}

.save-result-name {
  font-weight: 500;
  color: var(--color-navy);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-result-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.save-result-link:hover {
  text-decoration: underline;
}

.save-result-ok {
  background: #f0fdf4;
}

.save-result-err {
  background: #fef2f2;
}

.save-result-skip {
  background: var(--color-bg-neutral);
}

/* ── Create/Update action badges ──────────────────────────────────────── */

.preview-action-create {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #dbeafe;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.preview-action-update {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Recovery banner ──────────────────────────────────────────────────── */

.preview-recovery {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.recover-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.recover-btn:hover {
  background: #d97706;
}

/* ── Sponsors page ────────────────────────────────────────────────────── */

.sponsors-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 120px;
}

.sponsors-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.sponsors-header h1 {
  margin-top: 4px;
}

.sponsors-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

#status-msg {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.sponsors-add-form {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding: 16px;
  background: #fff;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
}

.sponsors-add-form .modal-input {
  flex: 1;
}

/* ── Sponsor card ─────────────────────────────────────────────────────── */

.sp-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.sp-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--color-bg-neutral);
  border-bottom: 1px solid var(--color-border);
}

.sp-card-header .sp-name {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
}

.sp-card-header .sp-domain {
  flex: 0 0 180px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.sp-delete-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #ccc;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.sp-delete-btn:hover {
  color: var(--color-red);
}

/* ── Sponsor list rows (accordion) ────────────────────────────────────── */

.sp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.1s;
}

.sp-row:hover { background: var(--color-bg-neutral); }
.sp-row.expanded { background: var(--color-bg-neutral); border-bottom-color: var(--color-border); }

.sp-row-name { font-weight: 600; font-size: 14px; }
.sp-row-domain { font-size: 12px; color: var(--color-text-muted); }
.sp-row-badges { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }

.sp-row-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--color-bg-neutral);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.sp-row-badge-logo {
  color: var(--color-green);
}

#sponsors-list:not(:empty) {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.sp-row:last-child:not(.expanded) { border-bottom: none; }

.sp-detail {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  animation: detailIn 0.15s ease;
}

.sp-detail:last-child { border-bottom: none; }

@keyframes detailIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Sections inside card ─────────────────────────────────────────────── */

.sp-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.sp-section:last-child {
  border-bottom: none;
}

.sp-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sp-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.sp-word-count {
  font-size: 11px;
  color: var(--color-text-dim);
  margin-left: auto;
}

.sp-word-count.over {
  color: var(--color-red);
  font-weight: 600;
}

/* ── Print logo area ──────────────────────────────────────────────────── */

.sp-logo-area {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sp-logo-preview {
  width: 160px;
  height: 80px;
  background: #0a0a14;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sp-logo-preview img {
  max-width: 140px;
  max-height: 68px;
  object-fit: contain;
}

.sp-logo-preview .sp-logo-empty {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

.sp-logo-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-logo-btn-row {
  display: flex;
  gap: 6px;
}

.sp-logo-quality {
  font-size: 11px;
  line-height: 1.4;
}

.sp-logo-quality.good {
  color: var(--color-green);
}

.sp-logo-quality.warn {
  color: #d97706;
}

.sp-logo-quality.bad {
  color: var(--color-red);
}

/* ── Shared input style ───────────────────────────────────────────────── */

.sp-input {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.sp-input:focus {
  border-color: var(--color-primary);
}

.sp-blurb {
  width: 100%;
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
}

.sp-small-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--color-bg-neutral);
  color: #334155;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.sp-small-btn:hover {
  background: #e2e8f0;
}

/* ── Rep card ─────────────────────────────────────────────────────────── */

.sp-rep {
  background: var(--color-bg-neutral);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.sp-rep-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sp-rep-line:last-child {
  margin-bottom: 0;
}

.sp-rep-label-inline {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: pointer;
  white-space: nowrap;
}

.sp-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sp-field-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sp-field .sp-input {
  width: 100%;
}

.sp-remove-rep {
  background: none;
  border: none;
  font-size: 18px;
  color: #ccc;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.sp-remove-rep:hover {
  color: var(--color-red);
}

/* ── Rep photo ───────────────────────────────────────────────────────── */

.sp-rep-photo-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.sp-rep-photo-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sp-rep-photo-preview img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.sp-rep-photo-empty {
  font-size: 9px;
  color: var(--color-text-dim);
  text-align: center;
  line-height: 1.2;
}

.sp-rep-photo-controls {
  display: flex;
  gap: 6px;
}

/* ── Event assignments ────────────────────────────────────────────────── */

.sp-event-select {
  flex: 1;
  min-width: 0;
  margin-left: auto;
}

.sp-event-empty {
  font-size: 12px;
  color: var(--color-text-dim);
  font-style: italic;
}

.sp-event-row {
  background: var(--color-bg-neutral);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
}

.sp-event-row-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}

.sp-event-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-remove-event {
  background: none;
  border: none;
  font-size: 16px;
  color: #ccc;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.sp-remove-event:hover {
  color: var(--color-red);
}

.sp-event-reps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 0 12px 8px;
}

.sp-event-rep-label {
  font-size: 12px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.sp-event-no-reps {
  font-size: 11px;
  color: var(--color-text-dim);
  font-style: italic;
}

/* ── Navigation bar ─────────────────────────────────────────────────────── */

.top-nav {
  background: var(--color-navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 48px;
  gap: 32px;
}

.nav-brand {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.nav-label-short { display: none; }

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.1s, background 0.1s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.nav-cog {
  position: relative;
}

.cog-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s, background 0.1s;
}

.cog-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.cog-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  min-width: 180px;
  padding: 6px 0;
  z-index: 1001;
}

.cog-menu.open {
  display: block;
}

.cog-link {
  display: block;
  padding: 8px 16px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.1s;
}

.cog-link:hover {
  background: var(--color-bg);
}

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

.cog-user {
  padding: 6px 16px;
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ── View-only role: hide action elements ───────────────────────────────── */

[data-role="view-only"] .run-btn,
[data-role="view-only"] .send-btn,
[data-role="view-only"] .li-post-btn,
[data-role="view-only"] .thankyou-btn,
[data-role="view-only"] .preevent-btn,
[data-role="view-only"] .sponsors-btn,
[data-role="view-only"] .checkin-link,
[data-role="view-only"] .action-btn,
[data-role="view-only"] .sync-all-btn,
[data-role="view-only"] .regen-btn {
  display: none;
}

/* ── Cache management page ──────────────────────────────────────────────── */

.cache-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.cache-stat-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
}

.cache-stat-count {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.2;
}

.cache-stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 4px;
}

.cache-actions {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 24px;
}

.cache-section {
  margin-bottom: 20px;
}

.cache-section:last-child {
  margin-bottom: 0;
}

.cache-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}

.cache-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.cache-status-msg {
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  min-height: 20px;
}

/* ── Users management page ──────────────────────────────────────────────── */

.users-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding: 16px;
  background: #fff;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  align-items: center;
}

.users-add-form .modal-input {
  flex: 1;
}

.users-hs-select {
  flex: 1 1 250px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
  outline: none;
  cursor: pointer;
  min-width: 0;
}

.users-hs-select:focus {
  border-color: var(--color-primary);
}

.users-perm-checkboxes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.users-add-actions {
  display: flex;
  gap: 6px;
}

.users-invite-btn {
  background: var(--color-primary) !important;
  color: #fff !important;
}

.perm-cell {
  white-space: nowrap;
}

.perm-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.perm-label input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.perm-label.perm-disabled {
  opacity: 0.5;
  cursor: default;
}

.perm-label.perm-disabled input[type="checkbox"] {
  cursor: default;
}

.users-actions {
  white-space: nowrap;
  display: flex;
  gap: 8px;
  align-items: center;
}

.users-invite {
  cursor: pointer;
  color: #9aa3b8;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}

.users-invite:hover {
  color: var(--color-primary);
}

.users-remove {
  cursor: pointer;
  color: #ccc;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.users-remove:hover {
  color: var(--color-red);
}

.role-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 600;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.role-you {
  background: #dbeafe;
  color: var(--color-navy);
}

/* ── Detail row (expandable actions) ───────────────────────────────── */

.detail-row > td {
  padding: 0;
  background: var(--color-bg-neutral);
  border-bottom: 1px solid var(--color-border);
}

.detail-cell {
  padding: 10px 16px 10px 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-action-btn {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 500;
}

.chevron {
  display: inline-block;
  font-size: 10px;
  color: var(--color-text-dim);
  width: 12px;
  text-align: center;
  transition: transform 0.15s;
}

.row-expanded {
  background: var(--color-bg-neutral);
}

/* ── Mobile event cards ────────────────────────────────────────────── */

.mobile-events {
  display: none;
}

.mobile-event-card {
  display: block;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s;
}

.mobile-event-card:active {
  border-color: var(--color-primary);
}

.mobile-card-city {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.mobile-card-meta {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.mobile-card-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-light);
}

.mobile-card-past {
  opacity: 0.6;
}

.mobile-card-past .mobile-card-city {
  color: #999;
}

/* ── Dark mode toggle ──────────────────────────────────────────────── */

.checkin-dark-toggle {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.1s, background 0.1s;
  padding: 6px;
}

.checkin-dark-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Transcribing state ───────────────────────────────────────────── */

.checkin-mic-btn.transcribing {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #3b82f6;
  pointer-events: none;
}

.checkin-mic-btn.transcribing svg {
  animation: spin 0.8s linear infinite;
}

/* ── Check-in dark mode ────────────────────────────────────────────── */

.checkin-page.dark-mode { color: #e2e8f0; }

.checkin-page.dark-mode .checkin-header {
  background: #1a1d27;
  border-color: #2d3348;
}

.checkin-page.dark-mode .checkin-event-name { color: #f1f5f9; }
.checkin-page.dark-mode .checkin-event-meta { color: #94a3b8; }

.checkin-page.dark-mode .checkin-search {
  background: #1e2130;
  border-color: #2d3348;
  color: #e2e8f0;
}

.checkin-page.dark-mode .checkin-search:focus {
  background: #252838;
  border-color: #3b82f6;
}

.checkin-page.dark-mode .checkin-search::placeholder { color: #64748b; }

.checkin-page.dark-mode .checkin-card {
  background: #1a1d27;
  border-color: #2d3348;
}

.checkin-page.dark-mode .checkin-card.checked-in {
  border-color: #166534;
  background: #0f2419;
}

.checkin-page.dark-mode .checkin-card.expanded {
  border-color: #1e40af;
}

.checkin-page.dark-mode .checkin-card-name { color: #f1f5f9; }
.checkin-page.dark-mode .checkin-card-detail { color: #94a3b8; }
.checkin-page.dark-mode .checkin-card-notes-preview { color: #64748b; }
.checkin-page.dark-mode .checkin-card-expand { color: #64748b; }

.checkin-page.dark-mode .checkin-checkbox svg[fill="none"] { stroke: #4b5563; }

.checkin-page.dark-mode .checkin-avatar-placeholder {
  background: #2d3348;
  color: #94a3b8;
}

.checkin-page.dark-mode .checkin-card-expanded {
  border-color: #2d3348;
}

.checkin-page.dark-mode .checkin-detail-row { color: #94a3b8; }
.checkin-page.dark-mode .checkin-detail-row a { color: #60a5fa; }
.checkin-page.dark-mode .checkin-detail-label { color: #64748b; }

.checkin-page.dark-mode .checkin-notes-textarea {
  background: #1e2130;
  border-color: #2d3348;
  color: #e2e8f0;
}

.checkin-page.dark-mode .checkin-notes-textarea:focus {
  border-color: #3b82f6;
}

.checkin-page.dark-mode .checkin-bottom-bar {
  background: #1a1d27;
  border-color: #2d3348;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.checkin-page.dark-mode .checkin-notes-input {
  background: #1e2130;
  border-color: #2d3348;
  color: #e2e8f0;
}

.checkin-page.dark-mode .checkin-notes-input:focus {
  border-color: #3b82f6;
}

.checkin-page.dark-mode .checkin-notes-input::placeholder { color: #64748b; }

.checkin-page.dark-mode .checkin-mic-btn {
  background: #1e2130;
  border-color: #2d3348;
  color: #94a3b8;
}

.checkin-page.dark-mode .checkin-mic-btn:hover {
  background: #252838;
  color: #e2e8f0;
}

.checkin-page.dark-mode .checkin-mic-btn.recording {
  background: #2a1215;
  border-color: #ef4444;
  color: #ef4444;
}

.checkin-page.dark-mode .checkin-mic-btn.transcribing {
  background: #1e2130;
  border-color: #3b82f6;
  color: #3b82f6;
}

.checkin-page.dark-mode .checkin-parse-btn {
  background: #1e2130;
  border-color: #2d3348;
  color: #e2e8f0;
}

.checkin-page.dark-mode .checkin-parse-btn:hover {
  background: #252838;
}

.checkin-page.dark-mode .checkin-empty { color: #64748b; }
.checkin-page.dark-mode .loading-msg { color: #64748b; }

.checkin-page.dark-mode .checkin-dark-toggle {
  background: #1e2130;
  border-color: #2d3348;
  color: #94a3b8;
}

.checkin-page.dark-mode .checkin-dark-toggle:hover {
  background: #252838;
  color: #e2e8f0;
}

/* Modals inside dark check-in page */
.checkin-page.dark-mode .modal-box {
  background: #1a1d27;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.checkin-page.dark-mode .modal-header {
  border-color: #2d3348;
}

.checkin-page.dark-mode .modal-header h3 { color: #f1f5f9; }

.checkin-page.dark-mode .modal-footer {
  border-color: #2d3348;
}

.checkin-page.dark-mode .modal-cancel-btn {
  background: #1e2130;
  border-color: #2d3348;
  color: #e2e8f0;
}

.checkin-page.dark-mode .modal-cancel-btn:hover {
  background: #252838;
}

.checkin-page.dark-mode .modal-close { color: #64748b; }
.checkin-page.dark-mode .modal-close:hover { color: #e2e8f0; }

.checkin-page.dark-mode .parse-match-card {
  background: #1e2130;
  border-color: #2d3348;
}

.checkin-page.dark-mode .parse-match-name { color: #f1f5f9; }

.checkin-page.dark-mode .parse-match-notes {
  background: #151822;
  border-color: #2d3348;
  color: #e2e8f0;
}

.checkin-page.dark-mode .parse-match-notes:focus {
  border-color: #3b82f6;
}

.checkin-page.dark-mode .parse-unmatched {
  background: #2a2008;
  border-color: #854d0e;
  color: #fbbf24;
}

/* Save preview dark mode */
.checkin-page.dark-mode .preview-meta {
  background: #1e2130;
  border-color: #2d3348;
}

.checkin-page.dark-mode .preview-meta-title { color: #f1f5f9; }
.checkin-page.dark-mode .preview-meta-table td:last-child { color: #e2e8f0; }
.checkin-page.dark-mode .preview-meta-table td:first-child { color: #94a3b8; }

.checkin-page.dark-mode .preview-summary { color: #e2e8f0; }

.checkin-page.dark-mode .preview-note-card {
  border-color: #2d3348;
}

.checkin-page.dark-mode .preview-note-card.has-notes {
  border-color: #166534;
}

.checkin-page.dark-mode .preview-note-header {
  background: #1e2130;
  border-color: #2d3348;
  color: #e2e8f0;
}

.checkin-page.dark-mode .preview-note-body {
  color: #94a3b8;
}

.checkin-page.dark-mode .preview-skipped-header { color: #64748b; }
.checkin-page.dark-mode .preview-skipped { color: #64748b; }

.checkin-page.dark-mode .preview-actions {
  border-color: #2d3348;
}

.checkin-page.dark-mode .preview-recovery {
  background: #2a2008;
  border-color: #854d0e;
}

.checkin-page.dark-mode .preview-warning {
  background: #2a1215;
  border-color: #7f1d1d;
  color: #fca5a5;
}

.checkin-page.dark-mode .save-results-list {
  border-color: #2d3348;
}

.checkin-page.dark-mode .save-result-row {
  border-color: #2d3348;
}

.checkin-page.dark-mode .save-result-ok { background: #0f2419; }
.checkin-page.dark-mode .save-result-err { background: #2a1215; }
.checkin-page.dark-mode .save-result-skip { background: #1e2130; }
.checkin-page.dark-mode .save-result-name { color: #f1f5f9; }

.checkin-page.dark-mode .spinner {
  border-color: #2d3348;
  border-top-color: #3b82f6;
}

/* Dark mode body background (applied via JS on <body>) */
body.checkin-dark { background: #0f1117; }

/* ── Site footer ──────────────────────────────────────────────────── */

.site-footer {
  text-align: center;
  padding: 16px 20px 12px;
  font-size: 11px;
  color: var(--color-text-dim);
}

/* ── Responsive: mobile layout ─────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-brand { display: none; }
  .nav-inner { gap: 8px; padding: 0 12px; }
  .nav-link { padding: 6px 10px; font-size: 12px; }
  .nav-label-full { display: none; }
  .nav-label-short { display: inline; }

  .desktop-table {
    display: none;
  }

  .mobile-events {
    display: block;
  }

  .home-header {
    flex-direction: column;
    gap: 8px;
  }

  .action-btn {
    display: none;
  }

  .container {
    padding: 16px 12px;
  }
}
