/* ============================================================
   irua.app — Minimal dashboard (Linear/Notion vibe, RTL)
   ============================================================ */

:root {
  /* Neutrals — paper-white surface, cool greys */
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f6f6f5;
  --surface-3: #efeeec;
  --border: #e8e7e3;
  --border-strong: #d8d6d1;
  --divider: #f0efec;

  /* Text */
  --text: #1a1a17;
  --text-2: #565651;
  --text-3: #8a8a82;
  --text-4: #b4b3ab;

  /* Accent — quiet indigo */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #3730a3;

  /* Status */
  --green: #15803d;
  --green-soft: #ecfdf5;
  --green-border: #bbf7d0;

  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --red: #b91c1c;
  --red-soft: #fef2f2;
  --red-border: #fecaca;

  --blue: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;

  /* Type */
  --font-sans: "Heebo", "Assistant", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 15, 14, 0.04);
  --shadow-md: 0 1px 2px rgba(15, 15, 14, 0.04), 0 4px 12px rgba(15, 15, 14, 0.04);
  --shadow-lg: 0 1px 2px rgba(15, 15, 14, 0.04), 0 10px 30px rgba(15, 15, 14, 0.08);
  --shadow-pop: 0 1px 2px rgba(15, 15, 14, 0.06), 0 12px 32px rgba(15, 15, 14, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; }

/* ============================================================
   App shell
   ============================================================ */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-middle {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}
.main-column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Sidebar ---------- */

.sidebar {
  flex: 0 0 240px;
  width: 240px;
  background: var(--surface-2);
  border-inline-start: 1px solid var(--border);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 48px;
  align-self: flex-start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { width: 0; height: 0; }

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 8px 6px;
  width: 100%;
  text-align: center;
}
/* Activated mark — always present, smaller "powered by" sized. */
.brand-mark {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  display: block;
  opacity: 0.9;
}
/* Tenant logo — the prominent brand when present. */
.brand-logo {
  max-height: 64px;
  max-width: 80%;
  width: auto;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}
/* Fallback when the tenant has no logo: show the tenant name instead. */
.brand-name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.event-card .label {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.event-card .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.event-card .meta {
  font-size: 11.5px;
  color: var(--text-3);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-section {
  font-size: 10.5px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: start;
  width: 100%;
  transition: background 0.08s ease;
}
.nav-item:hover { background: var(--surface-3); }
.nav-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.nav-item .icon {
  width: 16px; height: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}
.nav-item.active .icon { color: var(--text); }
.nav-item .count {
  margin-inline-start: auto;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 600;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-info .name { font-size: 12.5px; font-weight: 600; }
.user-info .role { font-size: 11px; color: var(--text-3); }

/* ---------- Main ---------- */

.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar {
  height: 48px;
  border-bottom: 1px solid oklch(20% 0.006 286.033);
  background: linear-gradient(90deg,
    oklch(27.4% 0.006 286.033) 0%,
    oklch(32% 0.008 286.033) 100%);
  color: #f5f5f4;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}

/* Mobile brand bar — visible only at ≤900px, scrolls away naturally so the
   sticky .topbar reclaims the full visible row. Hidden on desktop because the
   brand already lives inline inside the topbar there. */
.topbar-brand-bar { display: none; }
.topbar-brand-large {
  display: inline-flex;
  align-items: center;
  height: 28px;
  text-decoration: none;
  opacity: 0.95;
  transition: opacity 0.12s ease;
}
.topbar-brand-large:hover { opacity: 1; }
.topbar-brand-large img { height: 100%; width: auto; display: block; }

/* Mobile-only clickable registration-status indicator inside the topbar.
   Click → opens #registration-modal-topbar. Hidden on desktop (the desktop
   topbar has the full pill + form via .topbar-status). */
.topbar-status-btn { display: none; }
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: rgba(245, 245, 244, 0.65);
}
.crumbs .sep { color: rgba(245, 245, 244, 0.35); }
.crumbs .current { color: #fff; font-weight: 500; }

.topbar-status {
  margin-inline-start: auto;
  display: flex; align-items: center; gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-pill.amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.status-pill.red { background: var(--red-soft); color: var(--red); border-color: var(--red-border); }
.status-pill.gray { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }

/* ---------- Topbar dark-mode adaptations ----------
   The topbar uses a dark gradient, so children that default to light
   surfaces or dark text need to be re-skinned within the .topbar scope. */
.topbar .topbar-event-name { color: #fff; }
.topbar .topbar-event-date { color: rgba(245, 245, 244, 0.55); }

.topbar .hamburger {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
.topbar .hamburger:hover { background: rgba(255, 255, 255, 0.14); }
.topbar .hamburger span { background: #f5f5f4; }

.topbar-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 24px;
  text-decoration: none;
  opacity: 0.95;
  transition: opacity 0.12s ease;
}
.topbar-brand:hover { opacity: 1; }
.topbar-brand img { height: 100%; width: auto; display: block; }

.topbar .status-pill {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  border-color: rgba(187, 247, 208, 0.30);
}
.topbar .status-pill.red {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border-color: rgba(254, 202, 202, 0.30);
}
.topbar .status-pill.amber {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.30);
}
.topbar .status-pill.gray {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 245, 244, 0.75);
  border-color: rgba(255, 255, 255, 0.18);
}

.topbar .btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5f5f4;
}
.topbar .btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}
.topbar .btn-ghost {
  background: transparent;
  border-color: transparent;
  color: rgba(245, 245, 244, 0.75);
}
.topbar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ---------- Site footer ---------- */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  border-top: 1px solid oklch(20% 0.006 286.033);
  background: linear-gradient(90deg,
    oklch(27.4% 0.006 286.033) 0%,
    oklch(32% 0.008 286.033) 100%);
  color: rgba(245, 245, 244, 0.75);
  font-size: 12.5px;
}
.site-footer-contact {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.site-footer-contact a {
  color: rgba(245, 245, 244, 0.85);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.12s ease;
}
.site-footer-contact a:hover { color: #fff; }
.site-footer-contact .sep { color: rgba(245, 245, 244, 0.35); }
.site-footer-credit {
  justify-self: center;
  color: rgba(245, 245, 244, 0.55);
  white-space: nowrap;
}
.site-footer-brand {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  height: 15px;
  opacity: 0.95;
  transition: opacity 0.12s ease;
}
.site-footer-brand:hover { opacity: 1; }
.site-footer-brand img { height: 100%; width: auto; display: block; }
@media (max-width: 760px) {
  .site-footer {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 10px;
    padding: 16px 18px;
  }
  .site-footer-contact,
  .site-footer-credit,
  .site-footer-brand { justify-self: center; }
  .site-footer-credit { white-space: normal; }
}

.page {
  padding: 28px 32px 64px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.page-sub {
  font-size: 13.5px;
  color: var(--text-3);
  margin: 0;
}
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.08s ease, border-color 0.08s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn .icon { width: 14px; height: 14px; }

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.btn-primary:hover { background: #2a2a26; border-color: #2a2a26; }

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger {
  color: var(--red);
}
.btn-danger:hover { background: var(--red-soft); border-color: var(--red-border); }

.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-icon { padding: 5px; }

/* ---------- Cards / Stats ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.stat .label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat .label .icon { width: 13px; height: 13px; }
.stat .value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat .value .unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  margin-inline-start: 2px;
}
.stat .delta {
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat .delta.up { color: var(--green); }
.stat .delta.down { color: var(--red); }
.stat.highlight { border-color: var(--text); }

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  gap: 12px;
}
.section-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.section-header .sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.section-body { padding: 16px; }

/* ---------- Capacity bar ---------- */

.capacity {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.capacity-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
}
.capacity-row .num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 18px;
}
.capacity-row .num .total { color: var(--text-3); font-weight: 500; font-size: 14px; }
.capacity-bar {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.capacity-fill {
  height: 100%;
  background: var(--text);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.capacity-fill.amber { background: #d97706; }
.capacity-fill.red { background: var(--red); }

.capacity-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}
.capacity-legend .item { display: inline-flex; align-items: center; gap: 6px; }
.capacity-legend .swatch {
  width: 8px; height: 8px; border-radius: 2px; background: var(--text);
}
.capacity-legend .swatch.empty { background: var(--surface-3); border: 1px solid var(--border); }

/* ---------- Funnel / breakdown ---------- */

.funnel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
}
.funnel-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text);
}
.funnel-row.green .dot { background: var(--green); }
.funnel-row.amber .dot { background: var(--amber); }
.funnel-row.red .dot { background: var(--red); }
.funnel-row.blue .dot { background: var(--blue); }
.funnel-row.gray .dot { background: var(--text-4); }

.funnel-row .track {
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.funnel-row .fill {
  height: 100%;
  background: var(--text);
  border-radius: 999px;
}
.funnel-row.green .fill { background: var(--green); }
.funnel-row.amber .fill { background: #d97706; }
.funnel-row.red .fill { background: var(--red); }
.funnel-row.blue .fill { background: var(--blue); }
.funnel-row.gray .fill { background: var(--text-4); }

.funnel-row .label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.funnel-row .label .sub { color: var(--text-3); font-weight: 400; font-size: 12px; }
.funnel-row .num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
}
.funnel-meta {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  margin-top: -6px;
}
.funnel-meta .pct {
  grid-column: 3;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* Two-column row */
.row-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.row-2-equal { grid-template-columns: 1fr 1fr; }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead th {
  text-align: start;
  font-weight: 500;
  color: var(--text-3);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }

.cell-phone {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  text-align: end;
  font-variant-numeric: tabular-nums;
}
/* Generic LTR wrapper for phone numbers anywhere in the RTL UI.
   `isolate` keeps the digits from reordering against neighbouring Hebrew. */
.phone-ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.cell-name { font-weight: 500; color: var(--text); }
.cell-time {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.badge.red { background: var(--red-soft); color: var(--red); border-color: var(--red-border); }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-border); }

/* Compact status stack — used in the guests table to fold 4 separate status
   columns into a single cell. Each row is a small icon + label that lights up
   green when the action has completed (V), and stays muted otherwise. */
.status-stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.status-row {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; line-height: 1.35;
  color: var(--text-3);
  white-space: nowrap;
}
.status-row .icon { flex-shrink: 0; }
.status-row.ok   { color: var(--green); font-weight: 500; }
.status-row.warn { color: var(--amber); }
.status-row.bad  { color: var(--red); }
.status-row.muted { opacity: .65; }
.status-row .label { letter-spacing: 0; }

/* Two-line cell for date+time: bigger date on top, muted time underneath. */
.cell-stack { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.cell-stack .cell-date { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.cell-stack .cell-time { font-size: 11.5px; }

.row-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.table tbody tr:hover .row-actions { opacity: 1; }

/* Filters bar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
}
.search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  flex: 1;
  max-width: 320px;
}
.search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  flex: 1;
  font-family: inherit;
  color: var(--text);
}
.search .icon { width: 14px; height: 14px; color: var(--text-3); }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
}
.filter-chip:hover { background: var(--surface-2); }
.filter-chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.filter-chip .count {
  font-size: 11px;
  background: rgba(0,0,0,0.06);
  padding: 0 5px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.filter-chip.active .count { background: rgba(255,255,255,0.18); color: #fff; }

/* Selection bar (when rows selected) */
.selection-bar {
  background: var(--text);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.selection-bar .btn {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.selection-bar .btn:hover { background: rgba(255,255,255,0.18); }

/* Checkbox */
.cb {
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.cb.checked {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.cb svg { width: 10px; height: 10px; }

/* ---------- Upload ---------- */

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: background 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.dropzone .icon-lg {
  width: 36px; height: 36px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px;
}
.dropzone .title { font-size: 14px; font-weight: 600; color: var(--text); }
.dropzone .sub { font-size: 12.5px; color: var(--text-3); }

.upload-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}
.upload-step + .upload-step { border-top: 1px solid var(--divider); }
.upload-step .num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.upload-step.done .num { background: var(--green); color: #fff; }
.upload-step.active .num { background: var(--text); color: #fff; }
.upload-step .body { flex: 1; }
.upload-step .title { font-size: 13.5px; font-weight: 600; }
.upload-step .desc { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- Settings ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
  align-items: flex-start;
}
.field-row:last-child { border-bottom: none; }
.field-row .label-col .label { font-size: 13.5px; font-weight: 600; }
.field-row .label-col .desc { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 13px;
  background: var(--surface);
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.08s ease, box-shadow 0.08s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input.mono { font-family: var(--font-mono); }
.textarea { resize: vertical; min-height: 70px; font-family: var(--font-mono); }
.input::placeholder, .textarea::placeholder { font-family: var(--font-sans); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.toggle-track {
  width: 32px; height: 18px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background 0.15s ease;
}
.toggle-thumb {
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  transition: inset-inline-end 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle.on .toggle-track { background: var(--text); }
.toggle.on .toggle-thumb { inset-inline-end: 16px; }

.schedule-list { display: flex; flex-direction: column; gap: 8px; }
.schedule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.schedule-item .time {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.schedule-item .label { font-size: 12.5px; color: var(--text-3); flex: 1; }

/* ---------- Guest preview screens ---------- */

.guest-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.phone-frame {
  background: #1a1a17;
  border-radius: 28px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.phone-screen {
  background: #ffffff;
  border-radius: 22px;
  aspect-ratio: 9 / 17;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.phone-screen .notch {
  height: 22px;
  background: #1a1a17;
  border-radius: 0 0 14px 14px;
  width: 90px;
  margin: 0 auto;
}
.phone-content {
  flex: 1;
  padding: 24px 18px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 14px;
}
.phone-content .event-meta {
  position: absolute;
  top: 30px;
  right: 0; left: 0;
  text-align: center;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
.phone-content .icon-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: grid; place-items: center;
  border: 1px solid var(--green-border);
}
.phone-content .icon-circle.red { background: var(--red-soft); color: var(--red); border-color: var(--red-border); }
.phone-content .icon-circle.amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.phone-content .icon-circle svg { width: 26px; height: 26px; }
.phone-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text);
}
.phone-content p {
  font-size: 12.5px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.5;
  max-width: 220px;
}
.phone-content .small {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}
.phone-tag {
  position: absolute;
  top: -10px;
  inset-inline-start: 16px;
  background: var(--text);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  z-index: 2;
}

/* Activity log */
.activity {
  display: flex;
  flex-direction: column;
}
.activity-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  align-items: center;
  border-bottom: 1px solid var(--divider);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  display: grid; place-items: center;
}
.activity-icon svg { width: 12px; height: 12px; }
.activity-icon.green { background: var(--green-soft); color: var(--green); }
.activity-icon.red { background: var(--red-soft); color: var(--red); }
.activity-icon.amber { background: var(--amber-soft); color: var(--amber); }
.activity-icon.blue { background: var(--blue-soft); color: var(--blue); }

.activity-text { font-size: 13px; color: var(--text); }
.activity-text .b { font-weight: 600; }
.activity-text .sub { font-size: 12px; color: var(--text-3); margin-top: 1px; display: block; }
.activity-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Spark/inline mini bar */
.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
  margin-top: 6px;
}
.mini-bars .bar {
  flex: 1;
  background: var(--surface-3);
  border-radius: 2px;
  min-height: 4px;
}
.mini-bars .bar.fill { background: var(--text); }
.mini-bars .bar.green { background: var(--green); }
.mini-bars .bar.red { background: var(--red); }
.mini-bars .bar.amber { background: #d97706; }

/* Empty / placeholder helpers */
.empty {
  text-align: center;
  padding: 32px;
  color: var(--text-3);
  font-size: 13px;
}

/* Kbd */
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-2);
}

/* Settings: per-event form-builder */
.form-builder-list { display: flex; flex-direction: column; gap: 6px; }
.form-builder-row {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: default;
}
.form-builder-row.dragging { opacity: .45; }
.form-builder-row-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
}
.form-builder-row-template .form-builder-row-head { border-bottom: 1px solid var(--divider); }
.form-builder-row-template .form-builder-row-body {
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface-2);
}
.form-builder-editor-field { display: flex; flex-direction: column; gap: 4px; }
.form-builder-editor-label { font-size: 12px; color: var(--text-2); }
.form-builder-editor-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 2px;
}
.form-builder-editor-toolbar .btn { padding: 2px 8px; font-size: 12px; }
.form-builder-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.form-builder-option-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto auto;
  gap: 6px; align-items: center;
}
.form-builder-opt-required { white-space: nowrap; }
.form-builder-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; cursor: grab; color: var(--text-3);
}
.form-builder-handle:active { cursor: grabbing; }
.form-builder-label { flex: 1; min-width: 0; }
.form-builder-required {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none;
}
.form-builder-row-system .form-builder-row-head { background: var(--surface-2); }
.form-builder-row-hidden .form-builder-row-head { opacity: 0.55; }
.form-builder-row-hidden .form-builder-row-body { display: none; }
.form-builder-system-badge {
  display: inline-block; margin-inline-start: 6px;
  padding: 1px 6px; border-radius: 99px;
  background: var(--surface-3, #e5e7eb); color: var(--text-3);
  font-size: 10.5px; font-weight: 500; vertical-align: middle;
}
.form-builder-hidden-badge { background: #fef3c7; color: #92400e; }

/* Forms builder page — 2-column layout with sticky preview on the side.
   align-items defaults to stretch so the preview column matches the main
   column's height; that lets `position: sticky` keep the mockup visible for
   the full scroll, not just until the column itself scrolls off-screen. */
.forms-layout { display: flex; gap: 24px; }
.forms-main    { flex: 1 1 auto; min-width: 0; }
.forms-preview-col { flex: 0 0 422px; }
.forms-preview-sticky {
  position: sticky; top: 16px;
  display: flex; flex-direction: column; align-items: center;
  /* Cap height so a 874px-tall phone doesn't overflow short viewports — the
     iframe handles its own scroll, with the scrollbar hidden inside. */
  max-height: calc(100vh - 32px);
}
@media (max-width: 1280px) {
  .forms-layout { flex-direction: column; }
  .forms-preview-col { flex: 1 1 auto; width: 100%; }
  .forms-preview-sticky { position: static; max-height: none; }
}

.form-preview-toggle {
  display: flex; gap: 2px; margin-bottom: 12px; width: 402px; max-width: 100%;
  background: var(--surface-2); border-radius: 8px; padding: 3px;
  border: 1px solid var(--border);
}
.form-preview-toggle button {
  flex: 1; background: transparent; border: 0;
  padding: 7px 10px; font-size: 12.5px;
  border-radius: 6px; cursor: pointer; font: inherit;
  color: var(--text-2);
}
.form-preview-toggle button.active {
  background: var(--surface); color: var(--text-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.phone-mockup {
  width: 402px; height: 874px;
  max-height: calc(100vh - 100px);
  border: 10px solid #1f2937;
  border-top-width: 28px;
  border-radius: 44px;
  background: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}
.phone-mockup::before {
  content: ''; position: absolute; top: -22px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 18px;
  background: #1f2937;
  border-radius: 0 0 14px 14px; z-index: 2;
}
.phone-mockup iframe { width: 100%; height: 100%; border: 0; display: block; background: #f4f4f5; }
/* Public register form: checkbox group + legal block */
.public-fieldset {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px;
}
.public-fieldset > legend { padding: 0 4px; font-size: 13px; color: var(--text-2); }
.public-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.public-check input { width: auto; }
.public-check-req { color: #dc2626; font-weight: 600; margin-inline-start: 2px; }
.public-legal {
  padding: 6px 0; font-size: 13px; line-height: 1.55;
}
.public-legal-body { color: var(--text-2); }
.public-legal > .public-legal-body { margin-bottom: 8px; }
.public-legal a { color: var(--brand); text-decoration: underline; }
.public-legal .public-check:last-child { margin-bottom: 0; }
.public-legal-accept {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
}
.public-legal-accept > input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; width: auto; }
.public-legal-accept .public-legal-body { margin: 0; }
.public-text-block { margin: 4px 0; }
.public-text-block-h2,
.public-text-block-h3,
.public-text-block-h4 { text-align: center; }
.public-text-block-h2 { font-size: 20px; font-weight: 700; }
.public-text-block-h3 { font-size: 17px; font-weight: 600; }
.public-text-block-h4 { font-size: 15px; font-weight: 600; }
.public-text-block-p  { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.public-text-block-span { display: inline; font-size: 13px; line-height: 1.55; color: var(--text-2); }
/* Guests admin modal: same controls reused in the inline create/edit forms */
.extra-checkboxes { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.extra-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.extra-check input { width: auto; }
.extra-legal {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; font-size: 12.5px; line-height: 1.55;
}
.extra-legal-body { color: var(--text-2); }
.extra-legal a { color: var(--brand); text-decoration: underline; }
.extra-legal-accept {
  display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
}
.extra-legal-accept > input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; width: auto; }
.extra-legal-accept .extra-legal-body { margin: 0; }
.form-builder-picker {
  display: flex; flex-direction: column; gap: 16px;
  max-height: 60vh; overflow: auto; margin-top: 12px;
}
.form-builder-picker-group {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.form-builder-picker-group-head {
  grid-column: 1 / -1;
  padding: 6px 2px 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.form-builder-picker-group-head .cell-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.form-builder-picker-group-head .cell-time { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.45; }
.form-builder-picker-item {
  text-align: right; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); cursor: pointer;
  font: inherit; color: inherit;
}
.form-builder-picker-item:hover { border-color: var(--text-3); background: var(--surface-2); }
.field-hint {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
}
.field-hint code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 4px;
  background: var(--surface-2);
  border-radius: 4px;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .form-builder-picker-group { grid-template-columns: 1fr; }
  .form-builder-row-head { gap: 8px; padding: 8px 10px; }
  .form-builder-row .form-builder-handle { width: 18px; height: 18px; }
  .form-builder-option-row { grid-template-columns: 1fr; }
  .form-builder-opt-required { justify-self: start; }
}

/* Resp */
@media (max-width: 1180px) {
  .sms-templates-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .row-2 { grid-template-columns: 1fr; }
  .guest-preview-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .guest-preview-grid { grid-template-columns: 1fr; }
  .sms-templates-grid { grid-template-columns: 1fr !important; }
}
