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

:root {
  /* Neutrals — muted grey canvas, white cards sit on top and pop */
  --bg: #fbf7f0;
  --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;

  /* Brand — logo gradient (255deg, peach → coral) */
  --brand-1: #edb57b;          /* warm peach / gold */
  --brand-2: #a0263b;          /* coral */
  --brand-gradient: linear-gradient(255deg, #edb57b 8.86%, #a0263b 91.84%);
  --brand-gradient-hover: linear-gradient(255deg, #e5a866 8.86%, #d33f58 91.84%);

  /* Accent — brand coral (the saturated end of the logo gradient) */
  --accent: #a0263b;
  --accent-hover: #d33f58;
  --accent-soft: #fdeef1;
  --accent-text: #b83a52;      /* deeper coral: AA-readable for small text on white/soft */
  --accent-ring: rgba(225, 88, 111, 0.18);

  /* 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;
}

/* Exclusive accordion sections: big header buttons, one open at a time,
   animated expand/collapse via the grid-template-rows 0fr→1fr trick (the
   inner wrapper clips its content while the row track grows). */
.nav-sec { display: flex; flex-direction: column; }
.nav-sec-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  margin-top: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: start;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: background 0.08s ease, color 0.08s ease;
}
.nav-sec-toggle:hover { background: var(--surface-3); color: var(--text); }
.nav-sec-toggle .icon {
  width: 18px; height: 18px;
  display: flex;
  align-items: center;
  color: var(--text-3);
  flex-shrink: 0;
}
.nav-sec.open > .nav-sec-toggle {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.nav-sec.open > .nav-sec-toggle .icon { color: var(--text); }
.nav-sec-toggle .nav-caret { margin-inline-start: auto; }
.nav-sec.open > .nav-sec-toggle .nav-caret { transform: rotate(180deg); }
.nav-sec-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-sec.open > .nav-sec-items { grid-template-rows: 1fr; }
.nav-sec-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-inline-start: 13px;
  padding-inline-start: 6px;
  border-inline-start: 1px solid var(--border);
}
/* The flat top-level links (dashboard) match the section buttons' size */
.nav > .nav-item {
  padding: 9px 8px;
  font-weight: 600;
}
.nav > .nav-item .icon { width: 18px; height: 18px; }

/* Collapsible nav group (parent item + submenu), same animation */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-caret {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  color: var(--text-3);
  border-radius: var(--r-sm);
  transition: transform 0.22s ease;
}
.nav-item .count + .nav-caret { margin-inline-start: 4px; }
.nav-group.open > .nav-item .nav-caret { transform: rotate(180deg); }
.nav-sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-group.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-inline-start: 13px;
  padding-inline-start: 6px;
  border-inline-start: 1px solid var(--border);
}
.nav-sub .nav-item {
  font-size: 12.5px;
  padding-top: 5px;
  padding-bottom: 5px;
}
.nav-sub .nav-item .icon { width: 14px; height: 14px; }

.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: var(--brand-gradient);
  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; }

.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(--brand-2);
  color: #fff;
  border-color: var(--brand-2);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.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); }
/* Guest name doubles as the "open details/edit" trigger (#2). Reset the button
   chrome so it reads as the name, with an affordance on hover/focus. */
.cell-name-link {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  text-align: inherit;
  cursor: pointer;
}
.cell-name-link:hover { color: var(--accent); text-decoration: underline; }
.cell-name-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.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; }

/* /guests status filters as stacked tiles — icon / label / number (3 lines) */
.filters-panel { padding: 12px; border-bottom: 1px solid var(--divider); }
.filter-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1 1 0;
  min-width: 76px;
  padding: 11px 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-2);
  cursor: pointer;
  text-align: center;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.filter-tile:hover { background: var(--surface-2); border-color: var(--border-strong); }
.filter-tile .ft-icon { display: inline-flex; color: var(--text-3); }
.filter-tile .ft-label { font-size: 12px; line-height: 1.2; font-weight: 500; }
.filter-tile .ft-count {
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.filter-tile.active {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
  box-shadow: 0 1px 3px rgba(225, 88, 111, 0.28);
}
.filter-tile.active .ft-icon,
.filter-tile.active .ft-count { color: #fff; }
/* The consolidated "כשל" tile reads as an alert. */
.filter-tile.is-alert .ft-icon,
.filter-tile.is-alert .ft-count { color: var(--red); }
.filter-tile.is-alert.active { background: var(--red); border-color: var(--red); }
.filter-tile.is-alert.active .ft-icon,
.filter-tile.is-alert.active .ft-count { 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.warn .num { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.upload-step.warn .title { color: var(--amber); }
.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; }

/* Two-column settings layout — opt-in via .settings-grid on .section-body.
   Each .field-row becomes a half-width cell (label beside a compact control);
   .fr-stack stacks the label above wide controls (textareas, pickers, lists);
   .fr-span stretches a cell across both columns. Row dividers are dropped in
   grid mode (cells sit side by side, so per-row borders would misalign). */
.section-body.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
  align-items: start;
}
.section-body.settings-grid > .field-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  border-bottom: none;
  padding: 14px 0;
}
.section-body.settings-grid > .field-row.fr-stack { grid-template-columns: minmax(0, 1fr); }
.section-body.settings-grid > .field-row.fr-span,
.section-body.settings-grid > .field-hint { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .section-body.settings-grid { grid-template-columns: minmax(0, 1fr); }
}

.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; }
/* Each row is a transparent slot in the live-preview canvas: the real field
   face shows through, and the editing chrome (name + tools) is a small overlay
   that only appears on hover or when the row is selected. */
.form-builder-row {
  position: relative; cursor: pointer; border-radius: 7px;
  outline: 2px solid transparent; outline-offset: 3px;
  transition: outline-color .12s;
}
.form-builder-row:hover { outline-color: rgba(37, 99, 235, .35); }
.form-builder-row.fb-selected { outline-color: var(--accent, #2563eb); }
.form-builder-row.dragging { opacity: .4; }
.form-builder-row-head {
  position: absolute; top: -11px; inset-inline-end: 4px; z-index: 4;
  display: none; align-items: center; gap: 3px;
  padding: 2px 4px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
}
.form-builder-row:hover .form-builder-row-head,
.form-builder-row.fb-selected .form-builder-row-head { display: flex; }
.form-builder-row .form-builder-label { flex: 0 1 auto; min-width: 0; padding-inline: 4px; }
.form-builder-row .form-builder-label .cell-name { font-size: 11px; font-weight: 600; white-space: nowrap; }
.form-builder-row .form-builder-label .cell-time { display: none; }
.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-option-row.fb-option-simple { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; }
.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 { opacity: 0.6; }
.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 — WPForms-style palette (left) + canvas (right). The
   canvas cards double as the live preview, so the colours chosen lower on the
   page flow into each card face via the --fb-* custom properties. */
/* Preview pinned to the (physical) left at mobile width; the build rail fills
   the rest of the page on the right with a 3-column palette. */
.fb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 26px; margin-bottom: 22px; align-items: start; }
@media (max-width: 980px) { .fb-layout { grid-template-columns: 1fr; } }

.fb-palette { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 28px); overflow-y: auto; padding-inline-end: 2px; }
@media (max-width: 980px) { .fb-palette { position: static; max-height: none; overflow: visible; } }
.fb-palette-head { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--text); }
.fb-palette-hint { font-size: 11.5px; color: var(--text-3); margin: 4px 0 12px; line-height: 1.5; }
.fb-palette-list { display: flex; flex-direction: column; gap: 14px; }
.fb-palette-group-head { font-size: 11.5px; font-weight: 600; text-transform: none; color: var(--text-3); margin-bottom: 6px; }
.fb-palette-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 1180px) { .fb-palette-chips { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px) { .fb-palette-chips { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }

/* Compact general-colour swatches that live at the top of the build rail. */
.fb-rail-colors { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--divider); }
.fb-rail-head { font-weight: 600; font-size: 13px; color: var(--text); }
.fb-rail-sub { font-size: 11px; color: var(--text-3); margin: 3px 0 11px; line-height: 1.5; }
.fb-color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px 12px; }
.fb-color-chip { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); cursor: pointer; }
.fb-color-chip input[type="color"] { width: 26px; height: 26px; padding: 1px; border: 1px solid var(--border); border-radius: 6px; flex: 0 0 auto; cursor: pointer; background: var(--surface); }
.fb-palette-chip {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: grab; font: inherit; color: var(--text);
  font-size: 12.5px; font-weight: 500; text-align: center;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.fb-palette-chip .fb-chip-icon { display: inline-flex; flex: 0 0 auto; color: var(--text-3); }
.fb-palette-chip .fb-chip-icon svg { display: block; width: 16px; height: 16px; }
.fb-palette-chip:hover { border-color: var(--accent, #2563eb); background: var(--surface-2); box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.fb-palette-chip:hover .fb-chip-icon { color: var(--accent, #2563eb); }
.fb-palette-chip:active { cursor: grabbing; }
.fb-palette-chip.is-used { opacity: .4; cursor: not-allowed; }
.fb-chip-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The canvas IS the live preview: a mobile-width card painted with the form's
   own background colour, fields flowing like the real /r/ page. The colours
   come from the --fb-* custom properties that applyFaceColors() sets here. */
.fb-canvas {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 420px; margin: 0 auto; min-height: 180px;
  padding: 20px 18px;
  border: 1px solid var(--border); border-radius: 16px;
  /* --fb-page-bg carries the full theme background (color / gradient / image
     layer); --fb-bg stays the flat-color fallback until the builder JS runs. */
  background: var(--fb-page-bg, var(--fb-bg, #f4f4f5));
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.fb-canvas-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; max-width: 480px; margin-inline: auto; }
.fb-drop-before { box-shadow: 0 -3px 0 -1px var(--accent, #2563eb); }

/* Card chrome (the head row sits above each card's live face). */
.fb-card-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.fb-card-tools { display: inline-flex; gap: 2px; }
.fb-card-tool {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-3); cursor: pointer;
}
.fb-card-tool:hover { background: var(--surface-2); color: var(--text); }
.fb-card-tool-danger:hover { background: #fef2f2; color: #dc2626; }

/* Card face = the live preview of one row, painted with the form's colours.
   pointer-events:none lets a click fall through to the card → open settings. */
.fb-card-face {
  pointer-events: none; padding: 0; color: var(--fb-text, #374151);
  font-family: var(--fb-font-body, inherit);
  background: var(--fb-card-bg, transparent);
}
.form-builder-row[data-hide-landing="1"] .fb-card-face { opacity: .45; }
.fb-card-face:empty { display: none; }
.fb-card-face .field { margin: 0; }
.fb-card-face .field + .field { margin-top: 8px; }
.fb-card-face .input, .fb-card-face .select, .fb-card-face .textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: var(--fb-r-field, 8px);
  background: var(--fb-field, #fff); color: var(--fb-field-text, #374151);
  font-size: 13px; box-sizing: border-box;
}
.fb-card-face .input::placeholder, .fb-card-face .textarea::placeholder { color: var(--fb-field-text, #374151); opacity: .75; }
.fb-card-face .textarea { min-height: 46px; resize: none; }
.fb-card-face h1 { font-size: 16px; margin: 0; text-align: center; color: var(--fb-heading, var(--fb-text)); font-family: var(--fb-font-heading, inherit); }
.fb-card-face .sub { font-size: 12px; text-align: center; opacity: .7; margin: 0; color: var(--fb-text); }
.fb-card-face a, .fb-card-face .public-legal a { color: var(--fb-link, #2563eb); }
.fb-card-face .public-legal-body, .fb-card-face .public-text-block-p, .fb-card-face .public-text-block-span,
.fb-card-face .public-check, .fb-card-face .public-fieldset > legend { color: var(--fb-text); }
.fb-card-face .submit { width: 100%; padding: 9px; border: 1.5px solid var(--fb-submit-border, transparent); border-radius: var(--fb-r-button, 8px); background: var(--fb-submit-bg, #111827); color: var(--fb-submit-text, #fff); font-weight: 600; font-size: 13px; }
.fb-card-face .field-tickets { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-card-face .field-tickets label { font-size: 13px; }
.fb-card-face .simple-stepper { display: inline-flex; align-items: center; gap: 8px; }
.fb-card-face .ticket-stepper-btn,
.fb-card-face .simple-stepper .ticket-stepper-btn {
  width: 34px; height: 34px; border-radius: 9px;
  border: none; background: var(--fb-submit-bg, rgba(127,127,127,.16));
  color: var(--fb-submit-text, var(--fb-text, #374151)); font-size: 17px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.fb-card-face .ticket-stepper-val { min-width: 22px; text-align: center; font-weight: 700; font-size: 16px; }
.fb-card-face .public-logo { text-align: center; line-height: 0; }
.fb-card-face .public-logo img { display: inline-block; width: var(--fb-logo-width, 40%); max-width: 100%; height: auto; }
.fb-card-face .public-element-image img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.fb-card-face .ticket-selector { display: flex; flex-direction: column; gap: 6px; }
.fb-card-face .ticket-selector-row { display: flex; gap: 8px; padding: 8px 10px; border: 1px solid rgba(127,127,127,.35); border-radius: var(--fb-r-field, 8px); background: var(--fb-field, rgba(255,255,255,.6)); color: var(--fb-field-text, var(--fb-text, inherit)); }
.fb-card-face .ticket-selector-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fb-card-face .ticket-selector-name { font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fb-card-face .ticket-selector-desc, .fb-card-face .ticket-selector-meta { font-size: 11.5px; opacity: .8; }
.fb-card-face .ticket-badge { display: inline-flex; padding: 1px 7px; border-radius: 999px; background: rgba(127,127,127,.18); font-size: 11px; font-weight: 600; }
.fb-card-face .ticket-badge-red { background: rgba(220,38,38,.12); color: #b91c1c; }
.fb-card-face .ticket-selector-stepper { display: flex; align-items: center; gap: 6px; align-self: center; }
.fb-card-face .ticket-selector .ticket-stepper-btn { width: 26px; height: 26px; border-radius: 6px; }
.fb-card-face .ticket-stepper-val { min-width: 22px; text-align: center; font-weight: 600; }
.fb-card-face .ticket-selector-total { display: flex; justify-content: space-between; padding: 8px 10px; background: var(--fb-field, rgba(0,0,0,.05)); color: var(--fb-field-text, var(--fb-text, inherit)); border-radius: var(--fb-r-field, 8px); margin-top: 6px; font-weight: 600; }
.fb-face-spacer { background: repeating-linear-gradient(45deg, rgba(0,0,0,.04), rgba(0,0,0,.04) 6px, transparent 6px, transparent 12px); border-radius: 6px; }
.fb-face-placeholder { padding: 14px; text-align: center; font-size: 12.5px; color: var(--text-3); border: 1px dashed var(--border); border-radius: 8px; background: var(--surface); }
.fb-face-muted { color: var(--text-3); }
.fb-video-thumb { position: relative; width: 100%; aspect-ratio: 16/9; background-size: cover; background-position: center; background-color: #000; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.fb-video-play { color: #fff; font-size: 22px; background: rgba(0,0,0,.5); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Field-settings modal */
.fb-settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fb-settings-head h3 { margin: 0; line-height: 1.2; }
.fb-settings-x { background: transparent; border: 0; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.fb-settings-x:hover { background: var(--surface-2); color: var(--text); }
.fb-settings-body { display: flex; flex-direction: column; gap: 14px; max-height: 62vh; overflow: auto; }
.fb-settings-body .form-builder-row-body { display: flex; flex-direction: column; gap: 10px; }
.fb-editor-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-editor-grid2 input[type="color"] { width: 100%; height: 34px; padding: 2px; }

/* Rich-text (WYSIWYG) element editor */
.fb-rte { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.fb-rte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.fb-rte-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; line-height: 1; }
.fb-rte-btn:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.fb-rte-btn svg { width: 15px; height: 15px; }
.fb-rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }
.fb-rte-color { position: relative; overflow: hidden; font-weight: 700; }
.fb-rte-color input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.fb-rte-area { min-height: 90px; max-height: 240px; overflow-y: auto; padding: 10px 12px; font-size: 14px; line-height: 1.6; outline: none; background: var(--surface); color: var(--text); }
.fb-rte-area:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.fb-rte-area ul, .fb-rte-area ol { padding-inline-start: 22px; margin: 6px 0; }
.fb-rte-area a { color: var(--accent); }
.fb-card-face .public-richtext { line-height: 1.55; }
.fb-card-face .public-richtext ul, .fb-card-face .public-richtext ol { padding-inline-start: 22px; margin: 4px 0; }
.fb-card-face .public-richtext a { color: var(--fb-link, #2563eb); }
.fb-settings-section { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--divider); }
.fb-settings-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.fb-settings-toggle input { width: auto; flex: 0 0 auto; }
.fb-settings-vis { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.fb-settings-vis-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.fb-settings-empty { font-size: 13px; color: var(--text-3); }
.fb-settings-actions { margin-top: 16px; }
.fb-readonly-options { margin: 4px 0 0; padding-inline-start: 18px; color: var(--text-2); font-size: 13px; }
/* Public register form: checkbox group + legal block */
.public-fieldset {
  border: 0; border-radius: 0;
  padding: 0; 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; }
}
