/* shared dashboard / event / login styles. depends on landing.css for tokens */
:root { --danger:#B91C1C; --good:#15803D; --warn:#A16207; }

.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 9px; min-height: 36px; }
.btn.block { width: 100%; }
.btn.danger { background: white; color: var(--danger); border: 1px solid #FCA5A5; }
.btn.danger:hover { background: #FEF2F2; }
/* keep buttons easy to tap on phone */
.btn { min-height: 44px; }
.btn.small { min-height: 36px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.full { grid-column: 1 / -1; }

/* ---- auth pages ---- */
.auth-body { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-shell { width: 100%; max-width: 420px; display: grid; place-items: center; }
.auth-card {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.3px; }
.auth-form { display: grid; gap: 10px; margin-top: 14px; }
.auth-form label { font-size: 13px; color: var(--muted); font-weight: 600; }
.auth-form input {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px;
  font-size: 16px; background: white;
}
.auth-form input:focus { outline: 2px solid var(--sky-300); outline-offset: 1px; }
.auth-form .terms-consent {
  display: flex; align-items: flex-start; gap: 9px; color: var(--ink);
  font-weight: 500; line-height: 1.4; cursor: pointer; margin-top: 3px;
}
.auth-form .terms-consent input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px; padding: 0; margin: 0;
  accent-color: var(--sky-600);
}
.auth-form .terms-consent a, .auth-form .privacy-note a { color: var(--sky-700); }
.auth-form .privacy-note { margin: -3px 0 0 27px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.auth-form .msg { min-height: 1em; font-size: 13px; color: var(--good); margin: 0; }
.auth-form .msg.error { color: var(--danger); }

.google-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line); background: white; border-radius: 10px;
  font-weight: 600; color: #1F2937; font-size: 14px;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.google-btn:hover { border-color: var(--sky-400); background: var(--sky-50); }

.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- auth tabs (Sign in / Create account) ---- */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  background: var(--sky-50);
  border-radius: 12px;
}
.auth-tab {
  border: 0; background: transparent;
  padding: 10px 12px;
  border-radius: 9px;
  font-weight: 600; font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab[aria-selected="true"] {
  background: white;
  color: var(--sky-800);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.auth-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 22px !important;
  letter-spacing: 10px !important;
  text-align: center;
  padding: 14px 12px !important;
}
.auth-code-hint {
  font-size: 13px; color: var(--muted); margin: 2px 0 0;
}
.auth-code-hint strong { color: var(--ink); word-break: break-all; }
.auth-form .link-btn {
  background: transparent; border: 0; color: var(--sky-700);
  font-weight: 600; font-size: 13px; padding: 0; cursor: pointer;
  text-decoration: underline;
}
.auth-form .link-btn:hover { color: var(--sky-900); }

/* ---- main page wrap ---- */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px 28px; }
@media (min-width: 720px) { .page-wrap { padding: 24px; } }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.5px; }
@media (min-width: 720px) { .page-head h1 { font-size: 26px; } }

/* ---- panels ---- */
.panel {
  background: white; border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 18px 16px;
  box-shadow: 0 8px 22px -18px rgba(2,132,199,.4);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: -2px 0 12px;
}
.panel-head h2 { margin: 0; font-size: 15px; letter-spacing: .2px; color: var(--sky-700); text-transform: uppercase; font-weight: 800; }

/* ---- forms ---- */
.grid-form { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.grid-form .field { display: grid; gap: 6px; }
.grid-form .field.full { grid-column: 1 / -1; }
.grid-form .field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.grid-form input, .grid-form select, .grid-form textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  font-size: 16px; /* prevents iOS auto-zoom */
  background: white; font-family: inherit;
  min-height: 44px; /* tap target */
}
.grid-form input[type=date], .grid-form input[type=time] {
  appearance: none; -webkit-appearance: none;
  background-color: white;
  /* date/time pickers expose icon on right; keep readable on iOS */
}
.grid-form textarea { min-height: 80px; }
.grid-form input:focus, .grid-form textarea:focus { outline: 2px solid var(--sky-300); outline-offset: 1px; }
.grid-form .row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Save toolbar repeated at the top and bottom of the combined Manage-Invite
   form so the host doesn't have to scroll to save after a small change. */
.grid-form .save-row {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.grid-form .save-row-top { margin-bottom: 4px; }
.grid-form .save-row-bottom { margin-top: 4px; }
@media (max-width: 640px) { .grid-form { grid-template-columns: 1fr; } }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input[type=text], .inline-form input:not([type=file]) {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 16px;
  flex: 1; min-width: 140px; background: white; min-height: 40px;
}
.inline-form input[type=file] {
  font-size: 13px; flex: 1 1 100%;
}
@media (min-width: 600px) { .inline-form input[type=file] { flex: 1 1 220px; } }

.msg { font-size: 13px; color: var(--good); }
.msg.error { color: var(--danger); }

/* ---- segmented control ---- */
.seg.horizontal {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--sky-50); padding: 5px; border-radius: 10px;
}
.seg.horizontal input {
  /* visually-hidden but focusable */
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.seg.horizontal label {
  text-align: center; padding: 11px 8px; border-radius: 7px;
  cursor: pointer; user-select: none; font-weight: 600; font-size: 13px; color: var(--sky-700);
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg.horizontal input:checked + label { background: white; box-shadow: 0 2px 6px rgba(2,132,199,.2); color: var(--sky-900); }
.seg.horizontal input:focus-visible + label { outline: 2px solid var(--sky-400); outline-offset: 2px; }

/* ---- events grid (dashboard) ---- */
.events-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.event-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  display: grid; gap: 8px;
  text-decoration: none; color: var(--ink);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.event-card:hover { border-color: var(--sky-300); transform: translateY(-1px); box-shadow: 0 12px 26px -18px rgba(2,132,199,.4); }
.event-card h3 { margin: 0; font-size: 17px; }
.event-card .meta { color: var(--muted); font-size: 13px; }
.event-card .stats-row { display: flex; gap: 12px; margin-top: 4px; font-size: 13px; }
.event-card .stats-row span { background: var(--sky-50); padding: 4px 10px; border-radius: 999px; color: var(--sky-700); font-weight: 600; }

.empty-state {
  background: white; border: 1px dashed var(--sky-300);
  border-radius: 16px; padding: 36px 24px; text-align: center;
}
.empty-state p { margin: 0 0 14px; color: var(--muted); }

/* ---- modal ---- */
.modal {
  position: fixed; inset: 0; background: rgba(12, 74, 110, .42);
  display: grid; place-items: center; z-index: 50; padding: 16px;
  animation: modal-fade .15s ease-out;
}
.modal[hidden] { display: none; }     /* override .modal{display:grid} when hidden */
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  background: white; border-radius: 16px; padding: 24px 22px 20px;
  width: 100%; max-width: 520px;
  max-height: calc(100dvh - 32px); overflow: auto;
  box-shadow: 0 25px 60px -20px rgba(2,132,199,.45);
}
.modal-card h2 { margin: 0 0 16px; font-size: 20px; padding-right: 28px; }
.modal-close {
  position: absolute; top: 8px; right: 10px;
  width: 36px; height: 36px;
  background: transparent; border: 0; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--muted);
  border-radius: 8px;
}
.modal-close:hover { background: var(--sky-50); color: var(--ink); }

/* Info-style modals (single OK button, used for "feature pending" notices) */
.info-modal h2 {
  display: flex; align-items: center; gap: 10px;
  color: var(--sky-700);
}
.info-modal-body { font-size: 15px; line-height: 1.55; color: #334155; }
.info-modal-body p { margin: 0 0 12px; }
.info-modal-body p:last-child { margin-bottom: 0; }
.info-modal-body strong { color: var(--ink); }
.info-modal-body .eta {
  display: inline-block;
  background: #fef3c7; color: #92400e;
  padding: 2px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  margin-left: 4px;
}
.info-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px;
}
.info-modal-actions .btn { padding: 10px 18px; }

/* ---- event editor ---- */
.event-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.event-head h1 { margin: 0; font-size: 22px; letter-spacing: -.4px; min-width: 0; word-break: break-word; }
@media (min-width: 720px) { .event-head h1 { font-size: 24px; } }

/* ---- tabs ---- */
.tabs {
  display: flex; gap: 6px; padding: 5px;
  background: #f1f5f9; border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 14px;
}
.tab {
  flex: 1;
  appearance: none; border: none; cursor: pointer;
  padding: 12px 14px; border-radius: 10px;
  background: transparent; color: #475569;
  font: inherit; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s, box-shadow .15s, transform .1s;
  min-height: 44px;
}
.tab:hover { color: var(--sky-700); background: rgba(14,165,233,.08); }
.tab:active { transform: scale(.98); }
.tab[aria-selected="true"] {
  background: var(--sky-500);
  color: white;
  box-shadow: 0 4px 12px -2px rgba(2,132,199,.45), inset 0 -2px 0 rgba(0,0,0,.08);
}
.tab[aria-selected="true"]:hover {
  background: var(--sky-600);
  color: white;
}
.tab[aria-selected="true"] .tab-icon { filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
.tab-icon { font-size: 16px; line-height: 1; }
.pane[hidden] { display: none; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- send-mode cards ---- */
.seg-cards {
  display: grid; gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.seg-cards.seg-cards-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .seg-cards.seg-cards-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .seg-cards, .seg-cards.seg-cards-3 { grid-template-columns: 1fr; } }
.seg-card.seg-card-disabled { opacity: .55; cursor: not-allowed; pointer-events: auto; }
.seg-card.seg-card-disabled:hover { border-color: transparent; }
.seg-card.seg-card-pending { opacity: .7; cursor: help; }
.seg-card.seg-card-pending:hover { border-color: var(--sky-200); background: #f8fafc; }
.coming-soon {
  display: inline-block;
  background: #FEF3C7; color: #A16207;
  font: 700 10px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px;
  margin-left: 6px; vertical-align: middle;
}
.seg-card {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 14px 14px 14px;
  background: var(--sky-50);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.seg-card:hover { border-color: var(--sky-300); }
.seg-card input[type=radio] {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.seg-card-body { flex: 1; }
.seg-card-title {
  font-weight: 700; color: var(--ink); margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.seg-card-title::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--sky-300); background: white;
  flex-shrink: 0;
}
.seg-card input:checked ~ .seg-card-body .seg-card-title::before {
  border-color: var(--sky-500); background: var(--sky-500);
  box-shadow: inset 0 0 0 3px white;
}
.seg-card input:checked ~ .seg-card-body { color: var(--ink); }
.seg-card:has(input:checked) {
  border-color: var(--sky-500);
  background: white;
  box-shadow: 0 6px 18px -10px rgba(2,132,199,.45);
}
.seg-card-desc { color: var(--muted); font-size: 13px; line-height: 1.4; }
.seg-card input:focus-visible ~ .seg-card-body .seg-card-title::before {
  outline: 2px solid var(--sky-400); outline-offset: 2px;
}

/* ---- draggable chip tray ---- */
.chip-tray {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px;
  background: var(--sky-50); border-radius: 10px;
  margin-bottom: 8px;
}
.chip {
  appearance: none; cursor: grab;
  background: white;
  color: var(--sky-700);
  border: 1px solid var(--sky-200);
  border-radius: 999px;
  padding: 6px 12px;
  font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transition: background .15s, transform .1s, box-shadow .15s;
  user-select: none;
  -webkit-user-select: none;
}
.chip:hover { background: var(--sky-50); border-color: var(--sky-400); }
.chip:active { cursor: grabbing; transform: scale(.96); }
.chip.dragging { opacity: .5; }
#sms-template {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
#sms-template.drop-target {
  border-color: var(--sky-500);
  background: #EBF7FF;
  box-shadow: 0 0 0 3px rgba(14,165,233,.18);
}
.starter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.sms-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff8e6;
  border: 1px solid #f5d78a;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #4a3a10;
  cursor: pointer;
}
.sms-consent input[type=checkbox] { margin-top: 3px; flex: 0 0 auto; }
.sms-consent span { flex: 1 1 auto; }

/* ---- footer ---- */
.app-footer {
  margin-top: 32px;
  padding: 18px 24px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}
.app-footer a { color: var(--sky-700); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.app-footer .sep { color: var(--line); }

.event-grid {
  display: grid; gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}
@media (max-width: 900px) { .event-grid { grid-template-columns: 1fr; } }

/* Invite sub-tabs (Upload / Templates) */
.invite-tabs {
  display: flex; gap: 4px;
  background: var(--sky-50);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.invite-tab {
  flex: 1;
  appearance: none; border: 0; cursor: pointer;
  padding: 9px 12px; border-radius: 7px;
  background: transparent; color: var(--muted);
  font: inherit; font-weight: 600; font-size: 13px;
  min-height: 38px;
}
.invite-tab[aria-selected="true"] {
  background: white;
  color: var(--sky-700);
  box-shadow: 0 1px 4px rgba(2,132,199,.15);
}
.invite-pane[hidden] { display: none; }

/* Template grid */
.template-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.template-card {
  position: relative;
  cursor: pointer;
  background: white;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s, transform .1s;
}
.template-card:hover { border-color: var(--sky-300); transform: translateY(-2px); }
.template-card.selected {
  border-color: var(--sky-500);
  box-shadow: 0 6px 18px -8px rgba(2,132,199,.5);
}
.template-card .thumb {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  background: #f0f0f0;
}
.template-card .meta {
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 1px;
}
.template-card .name { font-weight: 600; font-size: 13px; color: var(--ink); }
.template-card .cat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.template-card.selected::after {
  content: '✓';
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px;
  background: var(--sky-500); color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(2,132,199,.4);
}

.image-zone {
  display: block;
  border: 2px dashed var(--sky-300);
  border-radius: 14px;
  background: var(--sky-50);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  outline: none;
}
.image-zone:hover, .image-zone:focus-visible { border-color: var(--sky-500); background: #EBF7FF; }
.image-zone.drag { border-color: var(--sky-600); background: #DBEFFB; transform: scale(1.005); }
.image-preview {
  width: 100%;
  min-height: 180px;
  display: grid; place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  pointer-events: none;
}
.image-preview img { width: 100%; height: 100%; max-height: 360px; object-fit: contain; }
.image-placeholder { color: var(--muted); font-size: 14px; line-height: 1.5; }
.image-placeholder strong { color: var(--sky-700); }
.image-zone #image-msg { display: block; margin-top: 8px; }
.image-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Place Autocomplete (new) mount — appears under the Location input */
.location-ac-mount { margin-top: 6px; }
.location-ac-mount gmp-place-autocomplete { width: 100%; display: block; }
.location-ac-mount::before {
  content: "Search Google for an address";
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.host-messages-list { display: flex; flex-direction: column; gap: 10px; }
.host-msg {
  background: #fafaf6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.host-msg-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; align-items: baseline; }
.host-msg-body { font-size: 14px; color: #333; line-height: 1.45; white-space: pre-wrap; }

/* Stats tiles → clickable filter buttons */
.stat.clickable {
  appearance: none; border: 1px solid transparent;
  cursor: pointer; text-align: left; padding: 8px 10px;
  font: inherit; color: inherit;
  transition: transform .1s, box-shadow .15s, border-color .15s, background .15s;
}
.stat.clickable:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -4px rgba(2,132,199,.25); }
.stat.clickable.active {
  border-color: var(--sky-500);
  background: var(--sky-50);
  box-shadow: 0 0 0 2px rgba(14,165,233,.18);
}
.stat.clickable.active .label { color: var(--sky-700); font-weight: 600; }
.stat.clickable .label { transition: color .15s; }

/* Per-column filter dropdowns in the contacts table header */
.col-filter {
  display: inline-block;
  margin-left: 6px;
  font: inherit; font-size: 12px; font-weight: 500;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 4px;
  color: #475569;
  cursor: pointer;
}
.col-filter:focus { outline: 2px solid var(--sky-400); outline-offset: 1px; }

/* Super-admin detail modal — wider than the default info modal, scrollable */
.modal-card.detail-card {
  max-width: 980px;
  padding: 22px 22px 20px;
}
.detail-body { font-size: 14px; line-height: 1.5; color: #1f2937; }
.detail-section { margin-top: 18px; }
.detail-section:first-child { margin-top: 0; }
.detail-section h3 {
  margin: 0 0 8px; font-size: 14px; font-weight: 700;
  color: var(--sky-700); text-transform: uppercase; letter-spacing: .8px;
  display: flex; align-items: center; gap: 8px;
}
.detail-section h3 .count {
  background: var(--sky-100); color: var(--sky-700);
  font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px;
  text-transform: none; letter-spacing: 0;
}
.detail-kv {
  display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px;
  font-size: 13px;
}
.detail-kv dt { color: #6b7280; font-weight: 500; }
.detail-kv dd { margin: 0; word-break: break-word; }
.detail-kv code { font-size: 12px; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th { text-align: left; font-weight: 600; color: #6b7280; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.detail-table td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.detail-table tr:hover { background: #fafaf6; }
.detail-empty { color: #9ca3af; font-size: 13px; padding: 8px 0; }
.detail-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: #e5e7eb; color: #374151;
}
.detail-pill.ok { background: #DCFCE7; color: #166534; }
.detail-pill.err { background: #FEE2E2; color: #991b1b; }
.detail-pill.warn { background: #FEF3C7; color: #92400e; }
.detail-pill.info { background: var(--sky-100); color: var(--sky-700); }
.row-link {
  cursor: pointer;
  color: var(--sky-700);
  text-decoration: none;
}
.row-link:hover { text-decoration: underline; }
.row-clickable { cursor: pointer; }
.row-clickable:hover { background: #f0f9ff; }

/* Contact-book picker rows */
.book-list {
  max-height: 50vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px; background: white;
  padding: 4px;
}
.book-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background .1s;
}
.book-row:hover { background: #f8fafc; }
.book-row.selected { background: var(--sky-50); }
.book-row .book-check { margin-top: 3px; flex-shrink: 0; }
.book-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.book-row-name { font-weight: 600; color: var(--ink); }
.book-row-meta { font-size: 12px; }

/* Contact-book management page — inline-edit feedback */
.row-edit {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 14px;
  background: transparent;
  font-family: inherit;
}
.row-edit:hover { border-color: var(--line); background: #fafaf6; }
.row-edit:focus { border-color: var(--sky-400); background: white; outline: none; }
.row-edit.saved { background: #DCFCE7; transition: background .6s ease; }

/* RSVP link in the guests table — actual clickable anchor + spinning Refresh */
.link-cell a.rsvp-link {
  display: inline-block;
  max-width: 100%;
  font-size: 12px;
  color: var(--sky-700);
  text-decoration: none;
  border-bottom: 1px dotted var(--sky-300);
  word-break: break-all;
  line-height: 1.3;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f8fafc;
}
.link-cell a.rsvp-link:hover {
  color: var(--sky-900);
  background: var(--sky-50);
  border-bottom-style: solid;
}
.link-cell a.rsvp-link::after { content: " ↗"; opacity: .65; }

/* General/public invite link panel — shown in both Manage Invite + Manage Guests */
.bulk-result {
  margin: 10px 0 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
  background: #f4faf3;
  color: #1d4720;
}
.bulk-result.ok { background: #f4faf3; color: #1d4720; border-color: #cfe5cc; }
.bulk-result.err { background: #fff5f5; color: #7a1f1f; border-color: #efc8c8; }
.bulk-result.warn { background: #fff8e6; color: #7a5a12; border-color: #f5d78a; }
.bulk-result .bulk-result-fails { margin-top: 6px; font-size: 13px; }
.bulk-result .bulk-result-fails li { margin-left: 18px; }

.general-link-panel { background: linear-gradient(180deg, #fffdf6 0%, #fff 100%); }
.general-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.general-link-input {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: white;
  color: var(--ink);
}
.general-link-input:focus { outline: 2px solid var(--sky-300); outline-offset: 1px; }
[data-general-link-msg] { display: inline-block; margin-top: 6px; color: var(--sky-700); }
[data-general-link-msg].error { color: #b03a3a; }

@keyframes spin-icon { to { transform: rotate(360deg); } }
#refresh-btn.spinning {
  pointer-events: none; opacity: .65;
}
#refresh-btn.spinning::before {
  content: "↻";
  display: inline-block;
  animation: spin-icon .9s linear infinite;
}
#refresh-btn.spinning { color: transparent !important; position: relative; }
#refresh-btn.spinning::before {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  color: var(--sky-700); font-size: 16px; text-align: center;
}

/* Happy-picture gallery in the event editor */
.happy-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.happy-tile {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  background: var(--sky-50);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.happy-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.happy-del {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}
.happy-del:hover { background: rgba(180,30,40,.9); }
.happy-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.add-row { margin-top: 4px; }

/* ---- stats ---- */
.stats {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin-bottom: 14px;
}
.stat { background: var(--sky-50); border-radius: 10px; padding: 10px 12px; }
.stat .label { font-size: 11px; color: var(--sky-700); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.stat .value { font-size: 20px; font-weight: 700; margin-top: 2px; color: var(--ink); }
.stat.yes .value { color: var(--good); }
.stat.no .value { color: var(--danger); }
.stat.pending .value { color: var(--warn); }

/* ---- contacts table ---- */
.table-wrap { overflow-x: auto; }
.contacts { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.contacts th, .contacts td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.contacts thead th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.contacts tbody tr:hover { background: var(--sky-50); }
.contacts .name { font-weight: 600; }
.contacts .meta { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.yes { background: #DCFCE7; color: var(--good); }
.pill.no  { background: #FEE2E2; color: var(--danger); }
.pill.pending { background: #FEF3C7; color: var(--warn); }
.pill.sent { background: var(--sky-100); color: var(--sky-700); }
.pill.viewed { background: #E0E7FF; color: #3730A3; }
.pill.error { background: #FEE2E2; color: var(--danger); }

.link-cell { display: flex; align-items: center; gap: 4px; }
.link-cell input { flex: 1; min-width: 0; max-width: 220px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; font-size: 11px; background: var(--sky-50); color: var(--ink); }
.send-block { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.send-block .send-btn { white-space: nowrap; }
.send-caption { font-size: 11px; line-height: 1.2; }

@media (max-width: 720px) {
  .contacts thead { display: none; }
  .contacts, .contacts tbody, .contacts tr, .contacts td { display: block; width: 100%; }
  .contacts tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
  .contacts td { border: none; padding: 5px 4px; }
  .contacts td::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 600; font-size: 11px; }
}

/* ---- V2: dashboard card badges (co-host / quick page) ---- */
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
.card-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase;
}
.card-badge.cohost { background: #EEF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.card-badge.page   { background: #F3F0FF; color: #6D28D9; border: 1px solid #DDD6FE; }
