/* styles.css — shared styling, branded for Siinqee Bank
 * Palette:
 *   Siinqee green #6c9448 (primary) + orange #f7911f (accent) — from official logo
 */
:root {
  --brand: #6c9448;            /* Siinqee brand (main) — lighter, easier to read */
  --brand-dark: #4e6e31;       /* darker indigo: headings, button hover, gradients */
  --brand-slate: #4f7a45;
  --brand-mist: #a8d08d;
  --brand-tint: #e6f2e0;       /* very light indigo wash for chips/hovers */
  --accent: #f7911f;           /* Siinqee accent (CTA / accent) */
  --accent-dark: #de7c0e;      /* orange hover */
  --accent-tint: #fdefe0;      /* light orange wash */
  --success: #1a7a4a;          /* semantic green: registered / checked-in OK */
  --success-tint: #d9f2e4;
  --red: #c0392b;
  --amber: #b7791f;
  --amber-tint: #fdf0d5;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e8ebef;
  --bg: #f4f6f8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(63, 90, 40, 0.06), 0 1px 3px rgba(63, 90, 40, 0.05);
  --shadow: 0 4px 12px rgba(63, 90, 40, 0.07), 0 2px 4px rgba(63, 90, 40, 0.05);
  --shadow-lg: 0 12px 30px rgba(63, 90, 40, 0.12);
}

* { box-sizing: border-box; }

/* Inline line-icons inherit text colour and align with the baseline */
.ico { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.container { max-width: 1000px; margin: 0 auto; padding: 20px; }
.container.narrow { max-width: 520px; }

/* ── App shell: left sidebar + main content (mediaplan-style) ──── */
body.app { display: flex; min-height: 100vh; }
body.app .main { flex: 1; min-width: 0; padding: 22px 26px; display: flex; flex-direction: column; }
body.app .main > .site-footer { margin-top: auto; }
body.app.viewer .admin-only { display: none !important; }  /* read-only mode */

.sidebar {
  width: 232px; flex-shrink: 0;
  background: linear-gradient(180deg, #7da55a 0%, #4e6e31 100%);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  margin: 18px 14px 10px;
  padding: 4px 10px; text-align: center;
}
.sidebar-brand img { width: 100%; max-width: 172px; display: block; margin: 0 auto; }
.sidebar-title {
  text-align: center; font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: #fff; margin: 4px 18px 10px;
  padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}
.sidebar nav { flex: 1; padding: 4px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  color: #fff; text-decoration: none;
  padding: 10px 12px; border-radius: 9px; margin-bottom: 3px;
  font-size: 0.92rem; font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(249, 134, 19, 0.35); }
.nav-item.active .nav-icon { color: #fff; }
.nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.92); }
.nav-item:hover .nav-icon { color: #fff; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar-user { margin-bottom: 8px; font-size: 0.85rem; }
.sidebar-user strong { display: block; }
.sidebar-user span { color: var(--brand-mist); font-size: 0.75rem; }
.sidebar-footer button { width: 100%; }

.page-head { margin: 0 0 20px; }
.page-head h1 { margin: 0; font-size: 1.45rem; font-weight: 800; color: var(--brand-dark); letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.page-head .eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brand-slate); margin-bottom: 4px;
}
.page-head #eventMeta { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.88rem; }
.meta-item .ico { color: var(--brand-slate); }

/* Email-in-console-mode warning banner */
.email-warning {
  display: flex; align-items: flex-start; gap: 12px;
  border-color: #f2d48b; background: #fdf9ee; color: #7a5b1a;
}
.email-warning .warn-ico { color: var(--amber); flex-shrink: 0; margin-top: 1px; }
.email-warning a { color: var(--brand); font-weight: 600; }

@media (max-width: 760px) {
  body.app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { display: flex; overflow-x: auto; padding-bottom: 8px; }
  .nav-item { white-space: nowrap; }
  .sidebar-brand { max-width: 220px; margin: 12px auto 4px; }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; }
  .sidebar-footer button { width: auto; }
}

/* Header bar: white with the Siinqee Bank logo, teal accent line */
.topbar {
  background: #fff;
  border-bottom: 3px solid var(--brand);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.topbar img.brand-logo { width: auto; max-width: 320px; max-height: 56px; height: auto; display: block; margin: 0 auto; }
.topbar h1 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--brand); }
.topbar .sub { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.topbar .sub a { color: var(--brand); font-weight: 600; text-decoration: none; }
.topbar .sub a:hover { text-decoration: underline; }
.topbar .spacer { flex: 1; }

/* Site footer (registration page) */
.site-footer {
  margin-top: 40px;
  padding: 22px 20px 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.site-footer .footer-tagline {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.site-footer .footer-tagline a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}
.site-footer .footer-tagline a:hover { text-decoration: underline; }
.site-footer .footer-domain {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-slate);
  text-decoration: none;
}
.site-footer .footer-domain:hover { color: var(--brand); }

/* Cards */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 14px; font-size: 1rem; color: var(--brand-dark); font-weight: 700; }

/* Stat counters row: icon chip + number */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 5px solid var(--accent);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.stat:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand);
}
/* Per-stage accent: coloured top border, icon chip and number for
   maximum contrast and instant read of the funnel stage. */
.stat-icon.added      { background: #e0e2ef; color: #557a37; }
.stat-icon.invited    { background: var(--accent-tint); color: var(--accent); }
.stat-icon.registered { background: var(--brand-tint); color: var(--brand); }
.stat-icon.checked_in { background: #e9edf8; color: #7da55a; }
/* Bold per-card edge, each a distinct brand-guideline colour */
.stat:has(.stat-icon.added)      { border-top-color: #557a37; }  /* deep indigo */
.stat:has(.stat-icon.invited)    { border-top-color: #f7911f; }  /* orange */
.stat:has(.stat-icon.registered) { border-top-color: #6c9448; }  /* indigo */
.stat:has(.stat-icon.checked_in) { border-top-color: #a8d08d; }  /* light blue */
.stat .num { font-size: 2.1rem; font-weight: 800; color: var(--brand); line-height: 1.03; letter-spacing: -0.02em; }
.stat .lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-top: 2px; }

/* Forms */
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  margin-bottom: 10px;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
label { font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 4px; }

/* Modern select: hidden native chevron + custom teal chevron, focus ring */
.select-modern {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding: 10px 40px 10px 14px; margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b628f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
  box-shadow: var(--shadow-sm);
  font-weight: 600; color: var(--brand-dark); cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.select-modern:hover { border-color: var(--brand-mist); background-color: var(--brand-tint); }
.select-modern:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(63, 90, 40, 0.16); }
.field-label { text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em; color: var(--brand-slate); font-weight: 700; margin-bottom: 5px; }

/* Buttons */
button {
  font: inherit;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
button:hover { background: var(--brand-dark); box-shadow: var(--shadow); }
button:active { transform: translateY(1px); }
button.secondary { background: #fff; color: var(--brand-dark); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
button.secondary:hover { background: var(--brand-tint); border-color: var(--brand-mist); }
button.danger { background: #fff; color: var(--red); border: 1px solid var(--line); box-shadow: none; }
button.danger:hover { background: #fdecea; border-color: #f3b0a8; }
button.small { padding: 6px 9px; font-size: 0.8rem; border-radius: 8px; }
button.btn-accent { background: var(--accent); }
button.btn-accent:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Styled file-picker (hides the native "Choose file" control) */
.file-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: #fff; color: var(--brand-dark); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; margin: 0; user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.file-btn:hover { background: var(--brand-tint); border-color: var(--brand-mist); }
.file-btn .ico { color: var(--brand-slate); }
.file-btn input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 0.72rem; color: var(--brand-slate); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }

/* Status badges: coloured dot + label */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px 3px 9px; border-radius: 99px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.added      { background: #eef1f4; color: #52606d; }
.badge.invited    { background: var(--amber-tint); color: var(--amber); }
.badge.registered { background: var(--brand-tint); color: var(--brand); }
.badge.checked_in { background: var(--success-tint); color: var(--success); }

/* Filter pills */
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters button { background: #fff; color: var(--muted); border: 1px solid var(--line); font-weight: 600; box-shadow: none; padding: 7px 13px; border-radius: 99px; font-size: 0.83rem; }
.filters button:hover { background: var(--brand-tint); color: var(--brand-dark); border-color: var(--brand-mist); }
/* Count pill inside each status tab */
.filters button .tab-count {
  display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 2px;
  background: var(--brand-tint); color: var(--brand); border-radius: 99px;
  font-size: 0.72rem; font-weight: 800; text-align: center; vertical-align: 1px;
}
.filters button.active .tab-count { background: rgba(255,255,255,0.25); color: #fff; }
.filters button.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: var(--shadow-sm); }

/* Attention tab (e.g. "Invited, not registered"): amber so the
   follow-up list stands out from the normal funnel tabs */
.filters button.attention {
  background: #fef3c7; color: var(--amber);
  border-color: #f2d48b; font-weight: 700;
}
.filters button.attention:hover { background: #fdeaa8; }
.filters button.attention.active {
  background: var(--amber); color: #fff; border-color: var(--amber);
}

/* VIP category badge + stat subcount */
.badge-vip {
  display: inline-block; background: #e0a92e; color: #3f5a28;
  padding: 1px 8px; border-radius: 5px; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.5px; vertical-align: 1px; margin-left: 2px;
}
.vipsub { font-size: 0.68rem; font-weight: 800; color: #c08a1e; letter-spacing: 0.3px; margin-top: 3px; min-height: 0.8em; }
.chan { font-size: 0.66rem; color: var(--muted); margin-top: 4px; letter-spacing: 0.2px; }

/* Invitee search box */
.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box .search-ico { position: absolute; left: 11px; display: inline-flex; color: var(--brand-slate); pointer-events: none; }
.search-box input {
  width: 240px; max-width: 52vw; margin: 0; padding: 8px 12px 8px 34px;
  border: 1px solid var(--line); border-radius: 99px; font-size: 0.86rem;
  background: #fff; box-shadow: var(--shadow-sm); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,103,159,0.16); }

/* Inline-editable phone cell (admins). Viewers see the plain value. */
.viewer-only { display: none; }
body.app.viewer .viewer-only { display: inline; }
.phone-cell {
  cursor: pointer; color: var(--muted); border-bottom: 1px dashed #cfd6ee;
  padding-bottom: 1px; transition: color 0.12s ease, border-color 0.12s ease;
}
.phone-cell:hover { color: var(--brand); border-bottom-color: var(--brand); }
.phone-add { color: var(--brand-slate); font-size: 0.82rem; font-style: italic; }
.badge-letter {
  display: inline-block; background: var(--brand-tint); color: var(--brand);
  padding: 1px 8px; border-radius: 5px; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.3px; vertical-align: 1px; margin-left: 2px; border: 1px solid #cfd6ee;
}
/* ── Viewer, mobile: slimmed guest list ──────────────────────────
   For VIEWER accounts on a phone, the guest list shows only Name,
   Organization and the print action; the filter tabs/dropdowns are
   hidden so just the counters + search remain. Admins are unaffected. */
@media (max-width: 640px) {
  /* Shrink the "Switch event" dropdown on phones (all users). The
     inline min-width:240px needs !important to be overridden. */
  #eventSelect { min-width: 0 !important; max-width: 210px; }

  /* strip the header: no event title, no date/time/venue meta */
  body.viewer #eventTitle,
  body.viewer #eventMeta { display: none; }

  /* minimized number cards: 2x2, no icon, tighter, smaller figures */
  body.viewer .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
  body.viewer .stat { padding: 8px 10px; gap: 8px; border-top-width: 3px; box-shadow: var(--shadow-sm); }
  body.viewer .stat:hover { transform: none; }
  body.viewer .stat-icon { display: none; }
  body.viewer .stat .num { font-size: 1.35rem; }
  body.viewer .stat .lbl { font-size: 0.62rem; }
  body.viewer .stat .vipsub { display: none; }

  /* hide the filter row (status tabs + source/category selects) */
  body.viewer .filters { display: none; }
  /* keep only Name(3), Organization(7), Actions(9); hide the rest */
  body.viewer #inviteeTable thead th:nth-child(1),
  body.viewer #inviteeTable thead th:nth-child(2),
  body.viewer #inviteeTable thead th:nth-child(4),
  body.viewer #inviteeTable thead th:nth-child(5),
  body.viewer #inviteeTable thead th:nth-child(6),
  body.viewer #inviteeTable thead th:nth-child(8),
  body.viewer #inviteeTable tbody td:nth-child(1),
  body.viewer #inviteeTable tbody td:nth-child(2),
  body.viewer #inviteeTable tbody td:nth-child(4),
  body.viewer #inviteeTable tbody td:nth-child(5),
  body.viewer #inviteeTable tbody td:nth-child(6),
  body.viewer #inviteeTable tbody td:nth-child(8) { display: none; }
}

/* Self-registered via the public link */
.badge-self {
  display: inline-block; background: #e6f4ea; color: #1b7a3d;
  padding: 1px 8px; border-radius: 5px; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.3px; vertical-align: 1px; margin-left: 2px; border: 1px solid #a9d8ba;
}

/* Animated attention hint under the "Remind registered" button */
.er-hint {
  text-align: right;
  margin: 9px 2px 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
  animation: erPulse 1.5s ease-in-out infinite;
}
@keyframes erPulse {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50%      { opacity: 0.5; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) { .er-hint { animation: none; } }

/* ── Button progress spinner ───────────────────────────────────── */
.spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  border-radius: 50%; vertical-align: -2px; margin-right: 6px;
  animation: spin 0.7s linear infinite;
}
button.secondary .spinner {
  border-color: rgba(63, 90, 40,0.25); border-top-color: var(--brand);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal dialogs (replaces native prompt/confirm) ────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 30, 40, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modalFade 0.15s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: #fff; border-radius: 12px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  animation: modalPop 0.18s ease;
  overflow: hidden;
}
@keyframes modalPop { from { transform: translateY(10px) scale(0.98); opacity: 0.6; } to { transform: none; opacity: 1; } }
.modal-box header {
  padding: 14px 20px; border-bottom: 3px solid var(--brand);
  display: flex; align-items: center; gap: 10px;
}
.modal-box header .m-icon { font-size: 1.3rem; }
.modal-box header h3 { margin: 0; font-size: 1rem; color: var(--brand-dark); }
.modal-box .m-body { padding: 18px 20px 6px; }
.modal-box .m-body p { margin: 0 0 12px; color: var(--ink); font-size: 0.92rem; }
.modal-box .m-error { color: var(--red); font-size: 0.82rem; min-height: 1.2em; margin: 2px 0 0; }
.modal-box footer {
  padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 10px;
}
.modal-box button.confirm-danger { background: var(--red); }
.modal-box button.confirm-danger:hover { background: #96271b; }

/* Toast (temporary notification) */
#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--brand-dark); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 0.9rem; opacity: 0; transition: opacity 0.25s; pointer-events: none;
  max-width: 90vw;
}
#toast.show { opacity: 1; }

.muted { color: var(--muted); font-size: 0.85rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  th:nth-child(4), td:nth-child(4) { display: none; } /* hide email col on phones */
  .topbar img.brand-logo { max-width: 240px; }
}

/* Collapsible cards (dashboard "Add invitees") */
.card.collapsible .collapse-head {
  display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; margin-bottom: 14px;
}
.card.collapsible .collapse-hint { font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.card.collapsible .collapse-chev { margin-left: auto; color: var(--muted); transition: transform .2s ease; flex-shrink: 0; }
.card.collapsible:not(.collapsed) .collapse-chev { transform: rotate(180deg); }
.card.collapsible .collapse-head:hover .collapse-chev { color: var(--brand); }
.card.collapsible .collapse-head:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }
.card.collapsible.collapsed { padding-top: 16px; padding-bottom: 16px; }
.card.collapsible.collapsed .collapse-head { margin-bottom: 0; }
.card.collapsible.collapsed > :not(.collapse-head) { display: none; }

/* ── Invitees toolbar (dashboard) ─────────────────────────────── */
.inv-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.inv-title { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; flex: 1; min-width: 260px; }
.inv-title h2 { margin: 0; }
.inv-title .search-box { flex: 1; max-width: 380px; min-width: 200px; }
.inv-actions { display: flex; gap: 10px; }

.act-menu { position: relative; }
.act-trigger {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  background: #fff; color: var(--brand-dark); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-weight: 700; font-size: 0.88rem; cursor: pointer; white-space: nowrap;
}
.act-trigger:hover { border-color: var(--brand-mist); background: var(--brand-tint); }
.act-trigger.primary-ish { background: var(--brand); color: #fff; border-color: var(--brand); }
.act-trigger.primary-ish:hover { background: var(--brand-dark); }
.act-trigger .chev { transition: transform .18s ease; opacity: .8; }
.act-menu.open .act-trigger .chev { transform: rotate(180deg); }
.act-menu.busy .act-trigger { pointer-events: none; opacity: .85; }
.act-menu.busy .act-trigger::after {
  content: ''; width: 14px; height: 14px; border-radius: 50%; margin-left: 2px;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}

.act-list {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 290px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.act-menu.open .act-list { display: block; animation: actIn .14s ease; }
@keyframes actIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.act-list button {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left;
  background: transparent; border: 0; box-shadow: none; padding: 9px 10px; border-radius: 8px;
  color: var(--ink); font-weight: 500; cursor: pointer;
}
.act-list button > [data-icon], .act-list button > svg:first-child { color: var(--brand); margin-top: 2px; flex-shrink: 0; }
.act-list button:hover:not(:disabled) { background: var(--brand-tint); }
.act-list button:disabled { opacity: .45; cursor: not-allowed; }
.act-list .mi { display: flex; flex-direction: column; gap: 1px; }
.act-list .mi b { font-size: 0.88rem; font-weight: 700; color: var(--brand-dark); }
.act-list .mi small { font-size: 0.76rem; color: var(--muted); }
.act-group { font-size: 0.68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.act-group + button { margin-top: 0; }

.inv-filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.inv-filterbar .filters { margin: 0; gap: 4px; }
.inv-filterbar .filters button { border-color: transparent; background: transparent; padding: 6px 11px; }
.inv-filterbar .filters button:hover { background: #fff; border-color: var(--line); }
.inv-filterbar .filters button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.inv-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select-modern.compact { width: auto; padding: 6px 30px 6px 11px; font-size: 0.82rem; background-position: right 9px center; background-size: 15px; margin: 0; }

.date-range {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; padding: 3px 8px; color: var(--muted);
}
.date-range input[type=date] {
  border: 0; padding: 3px 2px; font-size: 0.8rem; color: var(--ink); background: transparent; width: 122px; margin: 0; box-shadow: none;
}
.date-range input[type=date]:focus { outline: none; box-shadow: none; }
.date-range .dash { color: var(--muted); }
.date-range .dr-clear {
  background: transparent; border: 0; box-shadow: none; color: var(--muted); padding: 2px 4px; font-size: 0.8rem; cursor: pointer;
}
.date-range .dr-clear:hover { color: var(--red); }

.sel-bar {
  display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px 12px;
  background: var(--accent-tint); border: 1px solid #f6d3a8; border-radius: 10px; font-size: 0.86rem; color: var(--ink);
}
.sel-bar[hidden] { display: none; }
.sel-bar button { margin-left: auto; background: var(--accent); color: #fff; border: 0; }
.sel-bar button:hover:not(:disabled) { background: var(--accent-dark); }

@media (max-width: 760px) {
  .inv-actions { width: 100%; }
  .inv-actions .act-menu { flex: 1; }
  .inv-actions .act-trigger { width: 100%; justify-content: center; }
  .act-list { left: 0; right: auto; min-width: min(290px, 90vw); }
  .inv-actions .act-menu:last-child .act-list { left: auto; right: 0; }
}

/* ── Stat cards: simple flat light tones, no coloured edge ── */
.stats .stat { border: 1px solid transparent; border-top-width: 1px; box-shadow: none; }
.stats .stat:has(.stat-icon.added)      { background: #dde8cf; border-color: #c7d9b3; }
.stats .stat:has(.stat-icon.invited)    { background: #ffdfb5; border-color: #f7c88a; }
.stats .stat:has(.stat-icon.registered) { background: #cfe4b8; border-color: #b6d398; }
.stats .stat:has(.stat-icon.checked_in) { background: #c4e3d2; border-color: #a6d2ba; }
.stats .stat:hover { box-shadow: var(--shadow-sm); }

.stats .stat-icon { background: #fff !important; }
.stats .stat-icon.added      { color: #557a37; }
.stats .stat-icon.invited    { color: #de7c0e; }
.stats .stat-icon.registered { color: #4e6e31; }
.stats .stat-icon.checked_in { color: #1f6b4b; }

.stats .stat .num { color: #2c4019; }
.stats .stat:has(.stat-icon.invited) .num    { color: #8f4a00; }
.stats .stat:has(.stat-icon.checked_in) .num { color: #15513a; }
.stats .stat .lbl { color: #3d4f2e; }
.stats .stat:has(.stat-icon.invited) .lbl { color: #7a4a10; }
.stats .stat:has(.stat-icon.checked_in) .lbl { color: #1f5a42; }
