/* ════════════════════════════════════════════════════════════
   EventSync · Design System v2 — Components
   ════════════════════════════════════════════════════════════ */

/* ─────────── LOGO LOCKUP ─────────── */
.es-logo { display: inline-flex; align-items: center; gap: 10px; line-height: 1; }
.es-logo-mark { display: block; flex-shrink: 0; }
.es-logo-word {
  font-family: var(--font-display);
  font-weight: var(--w-sem);
  letter-spacing: var(--trk-display);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}
.es-logo-word.on-dark { color: var(--paper); }

/* ─────────── BUTTONS ─────────── */
/* button.btn / a.btn beat Tailwind @tailwindcss/forms element resets */
button.btn, a.btn, input.btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-body);
  font-weight: var(--w-sem);
  font-size: 14px;
  letter-spacing: -0.01em;
  padding: 9px 18px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: none;
  transition: background var(--t-quick) var(--ease),
              color var(--t-quick) var(--ease),
              border-color var(--t-quick) var(--ease),
              box-shadow var(--t-quick) var(--ease),
              transform 80ms var(--ease);
}
button.btn:active, a.btn:active, input.btn:active, .btn:active { transform: translateY(1px); }
button.btn:focus-visible, a.btn:focus-visible, input.btn:focus-visible, .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(20 184 196 / .25);
}
button.btn.btn-danger:focus-visible, a.btn.btn-danger:focus-visible, .btn-danger:focus-visible {
  box-shadow: 0 0 0 3px rgb(220 38 38 / .25);
}
button.btn svg, a.btn svg, .btn svg { flex-shrink: 0; }

/* Variants */
button.btn.btn-primary, a.btn.btn-primary, button.btn-primary, a.btn-primary, .btn-primary {
  background: var(--teal);
  color: var(--paper);
}
button.btn.btn-primary:hover, a.btn.btn-primary:hover, button.btn-primary:hover, a.btn-primary:hover, .btn-primary:hover {
  background: var(--t-600);
}

button.btn.btn-ink, a.btn.btn-ink, button.btn-ink, a.btn-ink, .btn-ink {
  background: var(--ink);
  color: var(--paper);
}
button.btn.btn-ink:hover, a.btn.btn-ink:hover, button.btn-ink:hover, a.btn-ink:hover, .btn-ink:hover {
  background: #14213d;
}

button.btn.btn-secondary, a.btn.btn-secondary, button.btn-secondary, a.btn-secondary, .btn-secondary {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--n-200);
}
button.btn.btn-secondary:hover, a.btn.btn-secondary:hover, button.btn-secondary:hover, a.btn-secondary:hover, .btn-secondary:hover {
  background: var(--paper-3);
  border-color: var(--n-300);
}

button.btn.btn-ghost, a.btn.btn-ghost, button.btn-ghost, a.btn-ghost, .btn-ghost {
  background: transparent;
  color: var(--n-700);
}
button.btn.btn-ghost:hover, a.btn.btn-ghost:hover, button.btn-ghost:hover, a.btn-ghost:hover, .btn-ghost:hover {
  background: var(--paper-2);
  color: var(--ink);
}

button.btn.btn-outline, a.btn.btn-outline, button.btn-outline, a.btn-outline, .btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--n-300);
}
button.btn.btn-outline:hover, a.btn.btn-outline:hover, button.btn-outline:hover, a.btn-outline:hover, .btn-outline:hover {
  background: var(--paper-2);
  border-color: var(--n-400);
}

button.btn.btn-outline-teal, a.btn.btn-outline-teal, button.btn-outline-teal, a.btn-outline-teal, .btn-outline-teal {
  background: transparent;
  color: var(--teal-deep);
  border-color: var(--t-500);
}
button.btn.btn-outline-teal:hover, a.btn.btn-outline-teal:hover, button.btn-outline-teal:hover, a.btn-outline-teal:hover, .btn-outline-teal:hover {
  background: var(--teal-tint);
}

button.btn.btn-danger, a.btn.btn-danger, button.btn-danger, a.btn-danger, .btn-danger {
  background: var(--err);
  color: var(--white);
}
button.btn.btn-danger:hover, a.btn.btn-danger:hover, button.btn-danger:hover, a.btn-danger:hover, .btn-danger:hover {
  background: #B91C1C;
}

button.btn.btn-success, a.btn.btn-success, button.btn-success, a.btn-success, .btn-success {
  background: var(--ok);
  color: var(--white);
}
button.btn.btn-success:hover, a.btn.btn-success:hover, button.btn-success:hover, a.btn-success:hover, .btn-success:hover {
  background: #15803D;
}

/* Sizes */
button.btn.btn-xs, a.btn.btn-xs, .btn-xs { padding: 4px 9px;  font-size: 11.5px; border-radius: var(--r-sm); gap: 5px; }
button.btn.btn-sm, a.btn.btn-sm, .btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: var(--r); gap: 6px; }
button.btn.btn-lg, a.btn.btn-lg, .btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--r-md); }
button.btn.btn-xl, a.btn.btn-xl, .btn-xl { padding: 14px 28px; font-size: 16px; border-radius: var(--r-md); }

button.btn.btn-block, a.btn.btn-block, .btn-block { width: 100%; }
button.btn[disabled], a.btn[disabled], button.btn:disabled, a.btn:disabled, .btn[disabled], .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
button.btn.btn-icon, a.btn.btn-icon, .btn-icon { padding: 0; width: 36px; height: 36px; }
button.btn.btn-icon.btn-sm, a.btn.btn-icon.btn-sm, .btn-icon.btn-sm { width: 30px; height: 30px; }
button.btn.btn-icon.btn-lg, a.btn.btn-icon.btn-lg, .btn-icon.btn-lg { width: 44px; height: 44px; }

/* Button group (segmented) */
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; border-color: var(--n-200); }
.btn-group .btn + .btn { border-left: 0; }
.btn-group .btn:first-child { border-top-left-radius: var(--r); border-bottom-left-radius: var(--r); }
.btn-group .btn:last-child  { border-top-right-radius: var(--r); border-bottom-right-radius: var(--r); }

/* ─────────── INPUTS ─────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: var(--font-mono);
  font-size: var(--tx-spec);
  font-weight: var(--w-med);
  letter-spacing: var(--trk-spec);
  text-transform: uppercase;
  color: var(--n-500);
}
.input {
  background: var(--white);
  border: 1px solid var(--n-200);
  border-radius: var(--r);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color var(--t-quick), box-shadow var(--t-quick);
  font-family: var(--font-body);
  width: 100%;
}
.input::placeholder { color: var(--n-400); }
.input:hover { border-color: var(--n-300); }
.input:focus {
  outline: none;
  border-color: var(--t-500);
  box-shadow: 0 0 0 3px rgb(20 184 196 / .18);
}
.input.error  { border-color: var(--err); }
.input.error:focus { box-shadow: 0 0 0 3px rgb(220 38 38 / .15); }
.input[disabled] { background: var(--paper-2); color: var(--n-400); cursor: not-allowed; }

.input-with-icon { position: relative; }
.input-with-icon .input { padding-left: 36px; }
.input-with-icon-r .input { padding-right: 36px; padding-left: 12px; }
.input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--n-400); pointer-events: none;
}
.input-with-icon-r .input-icon { left: auto; right: 12px; }

.help-text { font-size: 12px; color: var(--n-500); }
.help-text.error { color: var(--err); }

textarea.input { min-height: 96px; resize: vertical; padding: 10px 12px; line-height: 1.5; }

.select-wrap { position: relative; }
.select-wrap select.input { appearance: none; padding-right: 36px; cursor: pointer; }
.select-wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 1.5px solid var(--n-500); border-bottom: 1.5px solid var(--n-500);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* Combobox — filterable select for long option lists */
.combobox {
  position: relative;
  width: 100%;
}
.combobox__control {
  position: relative;
  display: flex;
  align-items: center;
}
.combobox__input.input {
  padding-right: 36px;
  cursor: text;
}
.combobox__input[aria-expanded="true"] {
  border-color: var(--t-500);
  box-shadow: 0 0 0 3px rgb(20 184 196 / .18);
}
.combobox__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--n-500);
  pointer-events: none;
  font-size: 16px;
  line-height: 1;
  transition: transform var(--t-quick) var(--ease);
}
.combobox__input[aria-expanded="true"] ~ .combobox__chevron {
  transform: translateY(-50%) rotate(180deg);
}
.combobox__panel {
  position: fixed;
  z-index: 60;
  margin: 0;
  padding: var(--sp-1);
  list-style: none;
  max-height: min(16rem, 50vh);
  overflow-y: auto;
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  scrollbar-gutter: stable;
}
.combobox__panel[hidden] {
  display: none !important;
}
.combobox__panel--portaled {
  position: fixed;
  z-index: 100;
}
.combobox__empty {
  padding: var(--sp-3) var(--sp-4);
  font-size: 13px;
  color: var(--n-500);
  text-align: left;
}
.combobox__panel > li[hidden],
.combobox__option[hidden] {
  display: none !important;
}
.combobox__option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background var(--t-quick) var(--ease);
}
.combobox__option:hover,
.combobox__option.is-active {
  background: var(--paper-2);
}
.combobox__option[aria-selected="true"] {
  background: var(--teal-tint);
  color: var(--teal-deep);
  font-weight: var(--w-med);
}
.combobox__option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(20 184 196 / .35);
}
.combobox--error .combobox__input {
  border-color: var(--err);
}
.combobox--error .combobox__input:focus {
  box-shadow: 0 0 0 3px rgb(220 38 38 / .15);
}
.combobox__input:disabled {
  background: var(--paper-2);
  color: var(--n-400);
  cursor: not-allowed;
}

/* Inline public forms (promoter share / link-share invite) */
.public-action-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.public-action-form .field {
  min-width: 0;
}
.public-action-form .input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.public-action-form input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.public-action-form input[type="number"]::-webkit-outer-spin-button,
.public-action-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.public-action-form__submit {
  align-self: end;
}
@media (min-width: 1024px) {
  .public-action-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
  }
}

/* ─────────── CHECKBOX / RADIO ─────────── */
.check-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box, .radio-dot {
  width: 18px; height: 18px;
  border: 1.5px solid var(--n-300);
  border-radius: var(--r-xs);
  background: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-quick), border-color var(--t-quick), box-shadow var(--t-quick);
  flex-shrink: 0;
}
.radio-dot { border-radius: 50%; }
.check-row input:checked + .check-box {
  background: var(--teal); border-color: var(--teal);
}
.check-row input:checked + .check-box::after {
  content: ''; width: 10px; height: 6px;
  border-left: 2px solid white; border-bottom: 2px solid white;
  transform: rotate(-45deg) translate(1px,-1px);
}
.check-row input:checked + .radio-dot {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: inset 0 0 0 3px var(--white);
}
.check-row input:focus-visible + .check-box,
.check-row input:focus-visible + .radio-dot {
  box-shadow: 0 0 0 3px rgb(20 184 196 / .25);
}
.check-row-compact { padding: 0; gap: 0; }
.check-row-start { align-items: flex-start; }

/* ─────────── TOGGLE ─────────── */
.toggle { position: relative; width: 36px; height: 20px; background: var(--n-300); border-radius: 999px; transition: background var(--t-base) var(--ease); cursor: pointer; flex-shrink: 0; }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: white; border-radius: 50%;
  box-shadow: var(--sh-sm); transition: transform var(--t-base) var(--ease);
}
.toggle.on { background: var(--teal); }
.toggle.on::after { transform: translateX(16px); }

/* ─────────── BADGES / PILLS / TAGS ─────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: var(--w-sem);
  padding: 3px 9px; border-radius: 4px;
  letter-spacing: -0.005em;
  color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--n-200);
}
.badge-teal { background: var(--teal-tint); color: var(--teal-deep); border-color: transparent; }
.badge-ink { background: var(--ink); color: var(--paper); border-color: transparent; }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge-err { background: var(--err-bg); color: var(--err-text); border-color: transparent; }
.badge-purple { background: #EDE9FE; color: #6D28D9; border-color: transparent; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
a.badge,
.badge-link {
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-quick) var(--ease), color var(--t-quick) var(--ease), box-shadow var(--t-quick) var(--ease);
}
a.badge:hover,
.badge-link:hover { text-decoration: none; }
a.badge-warn:hover,
.badge-link.badge-warn:hover {
  background: color-mix(in srgb, var(--warn-bg) 70%, var(--warn-text));
}
a.badge:focus-visible,
.badge-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent);
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: var(--w-med);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
  background: var(--teal-tint); color: var(--teal-deep);
  white-space: nowrap;
}
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-ink { background: var(--ink); color: var(--paper); }
.pill-paper { background: var(--paper-2); color: var(--n-700); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: var(--w-sem);
  padding: 2px 8px; border-radius: 3px;
  background: var(--paper-2); color: var(--n-700);
}
.tag-vip { background: var(--teal-tint); color: var(--teal-deep); }
.tag-paid { background: #EDE9FE; color: #6D28D9; }
.tag-free { background: #DCFCE7; color: var(--ok-text); }
.tag-new { background: #FEF3C7; color: var(--warn-text); }

/* ─────────── CARDS ─────────── */
.card {
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-xs);
}
.card-pad-lg { padding: 28px; }
.card-elevated { box-shadow: var(--sh); border-color: transparent; }
.card-floating { box-shadow: var(--sh-lg); border-color: transparent; }
.card-ink { background: var(--ink); color: var(--paper); border-color: transparent; }
.card-teal { background: var(--teal); color: var(--paper); border-color: transparent; }
.card-paper { background: var(--paper); border-color: var(--n-200); }
.card-flat { box-shadow: none; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: var(--bd);
}
.card-ink .card-head { border-bottom-color: rgba(250,250,247,0.08); }
.card-head-title { font-family: var(--font-display); font-weight: var(--w-sem); letter-spacing: var(--trk-tight); font-size: 15px; color: inherit; }

.category-event-card {
  gap: var(--sp-4);
}

/* Entity row cards (promoters, settings tiles) */
.entity-row-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.entity-row-card__lead {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-width: 0;
  flex: 1;
}
.entity-row-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--teal-tint);
  color: var(--t-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
}
.entity-row-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
  flex: 1;
}
.entity-row-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.entity-row-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: var(--w-sem);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.entity-row-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--n-500);
  font-variant-numeric: tabular-nums;
}
.entity-row-card__lines {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.entity-row-card__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
.entity-row-card__line-label {
  font-size: 13px;
  color: var(--n-600);
}
.entity-row-card__empty {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--n-400);
}
.entity-row-card__actions {
  flex-shrink: 0;
  align-self: flex-start;
}
@media (min-width: 1024px) {
  .entity-row-card {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
  .entity-row-card__actions { align-self: center; }
}

.entity-row-card--compact {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: var(--bd);
  background: var(--white);
  box-shadow: var(--sh-xs);
}
.entity-row-card--compact .entity-row-card__title {
  max-width: 100%;
}

.promoter-category-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 13rem;
  overflow-y: auto;
  padding: var(--sp-1);
  margin: calc(var(--sp-1) * -1);
  scrollbar-gutter: stable;
}
.promoter-category-list__row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.promoter-category-list__row .entity-row-card__line {
  flex: 1;
  min-width: 0;
}

.category-form-extended {
  margin-top: var(--sp-5);
}
.category-form-extended__disclosure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  border-radius: var(--r);
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: var(--w-med);
  color: var(--n-600);
  cursor: pointer;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease);
}
.category-form-extended__disclosure:hover {
  color: var(--ink);
  background: var(--paper-2);
}
.category-form-extended__disclosure:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(20 184 196 / 0.25);
}
.category-form-extended__chevron {
  font-size: 16px;
  line-height: 1;
  transition: transform var(--t-quick) var(--ease);
}
.category-form-extended__disclosure.is-open .category-form-extended__chevron {
  transform: rotate(180deg);
}
.category-form-extended__panel {
  gap: var(--sp-4);
  padding-top: var(--sp-3);
}
.category-form-extended__divider {
  border: 0;
  border-top: var(--bd);
  margin: 0 0 var(--sp-4);
}
.category-form-extended__row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  transition: background var(--t-quick) var(--ease);
}
.category-form-extended__row:hover {
  background: var(--paper-2);
}
.category-form-extended__copy {
  flex: 1;
  min-width: 0;
}
.category-form-extended__title {
  margin: 0 0 var(--sp-1);
  font-size: 14px;
  font-weight: var(--w-sem);
  color: var(--ink);
}
.category-form-extended__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--n-600);
}
.category-form-extended__toggle {
  flex-shrink: 0;
  padding-left: 0;
  margin-top: 2px;
}

/* ─────────── AVATAR ─────────── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal); color: var(--paper);
  font-family: var(--font-body); font-weight: var(--w-sem);
  font-size: 13px; letter-spacing: -0.02em;
  flex-shrink: 0;
}
.avatar-xs { width: 22px; height: 22px; font-size: 9px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }
.avatar-square { border-radius: var(--r); }
.avatar-group { display: inline-flex; }
.avatar-group .avatar { border: 2px solid var(--white); margin-right: -8px; }
.avatar-group .avatar:last-child { margin-right: 0; }
.avatar-purple { background: #7C3AED; }
.avatar-green  { background: #059669; }
.avatar-amber  { background: #D97706; }
.avatar-pink   { background: #BE185D; }
.avatar-slate  { background: var(--n-700); }

/* ─────────── TABLE ─────────── */
.tbl-wrap {
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-family: var(--font-mono);
  font-size: var(--tx-spec);
  font-weight: var(--w-med);
  letter-spacing: var(--trk-spec);
  text-transform: uppercase;
  color: var(--n-500);
  text-align: left;
  padding: 11px 16px;
  border-bottom: var(--bd);
  background: var(--paper);
}
.tbl td {
  padding: 13px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--n-150);
  color: var(--n-800);
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--paper); }
.tbl-num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ─────────── LIST ROW ─────────── */
.list { background: var(--white); border: var(--bd); border-radius: var(--r-lg); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--n-150);
  transition: background var(--t-quick);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--paper); }
.list-row-main { flex: 1; min-width: 0; }
.list-row-title { font-weight: var(--w-med); color: var(--ink); font-size: 14px; }
.list-row-sub { font-size: 12.5px; color: var(--n-500); margin-top: 2px; }
.list-row-meta { font-family: var(--font-mono); font-size: 11px; color: var(--n-500); letter-spacing: 0.04em; }

/* Profile account picker rows (members/accounts) */
.profile-account-row {
  align-items: flex-start;
  gap: var(--sp-3);
}
.profile-account-row__lead {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-width: 0;
  flex: 1 1 auto;
}
.profile-account-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
}
.profile-account-row__meta-item {
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-account-row__meta-sep {
  margin-inline: 6px;
  color: var(--n-400);
}
.profile-account-row__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}
.profile-accounts-toolbar {
  display: flex;
  justify-content: flex-end;
}
@media (min-width: 768px) {
  .profile-account-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }
  .profile-account-row__actions {
    align-self: center;
  }
}

/* ─────────── TABS ─────────── */
.tabs {
  display: inline-flex; gap: 0;
  border-bottom: var(--bd);
  margin-bottom: var(--sp-8);
}
.tab {
  font-size: 13.5px; font-weight: var(--w-med);
  padding: 10px 16px;
  color: var(--n-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  transition: color var(--t-quick), border-color var(--t-quick);
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { color: var(--ink); border-bottom-color: var(--teal); text-decoration: none; }

/* ─────────── SECTION HEADER (title + optional subtitle) ─────────── */
.section-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
}
.section-header .h1,
.section-header .h2,
.section-header .h3,
.section-header .h4 {
  margin-bottom: 0;
}

.segmented,
.segmented-on-paper {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-md);
  gap: 2px;
}
.segmented {
  background: var(--paper-2);
}
/* Use on paper / paper-100 page backgrounds where the default track blends in */
.segmented-on-paper {
  background: var(--paper-3);
  border: 1px solid var(--n-200);
  box-shadow: var(--sh-inner);
}
.segmented-on-paper .seg-item.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--sh-xs);
}
.seg-item {
  font-size: 12.5px; font-weight: var(--w-med);
  padding: 6px 14px;
  color: var(--n-600);
  border-radius: var(--r-sm);
  transition: background var(--t-quick), color var(--t-quick);
}
.seg-item:hover { color: var(--ink); }
.seg-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(20 184 196 / .18);
}
.seg-item.active { background: var(--white); color: var(--ink); box-shadow: var(--sh-xs); }
button.seg-item,
a.seg-item {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
}

/* ─────────── ALERTS / BANNERS ─────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--n-200);
  background: var(--white);
  font-size: 13.5px;
  color: var(--n-700);
}
.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: var(--w-sem); color: var(--ink); margin-bottom: 2px; font-size: 14px; }
.alert-info  { background: var(--info-bg);  color: var(--info-text);  border-color: transparent; }
.alert-info .alert-title { color: var(--info-text); }
.alert-ok    { background: var(--ok-bg);    color: var(--ok-text);    border-color: transparent; }
.alert-ok .alert-title { color: var(--ok-text); }
.alert-warn  { background: var(--warn-bg);  color: var(--warn-text);  border-color: transparent; }
.alert-warn .alert-title { color: var(--warn-text); }
.alert-err   { background: var(--err-bg);   color: var(--err-text);   border-color: transparent; }
.alert-err .alert-title { color: var(--err-text); }
.alert--actions {
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.alert--actions__body {
  flex: 1 1 auto;
  min-width: 0;
}
.alert--actions__actions {
  flex-shrink: 0;
}
.alert-banner {
  border-bottom: var(--bd);
}
.alert-banner--info {
  background: var(--info-bg);
  color: var(--info-text);
}
.alert-banner--warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}
.alert-banner--err {
  background: var(--err-bg);
  color: var(--err-text);
}
.alert-banner--ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}
.alert-banner__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
}
@media (min-width: 768px) {
  .alert-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.alert-banner__content {
  min-width: 0;
}
.alert-banner__title {
  font-weight: var(--w-sem);
  color: inherit;
}
.alert-banner__actions {
  flex-shrink: 0;
}

/* ─────────── PROGRESS ─────────── */
.progress { width: 100%; height: 6px; background: var(--n-150); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--teal); border-radius: 999px; transition: width var(--t-slow) var(--ease); }
.progress-lg { height: 10px; }
.progress-ink .progress-bar { background: var(--ink); }
.progress-ok .progress-bar { background: var(--ok); }

/* ─────────── TOOLTIP / POPOVER (static, doc-only) ─────────── */
.tooltip {
  display: inline-block;
  font-size: 11.5px; font-weight: var(--w-med);
  background: var(--ink); color: var(--paper);
  padding: 5px 10px; border-radius: 4px;
  white-space: nowrap;
  position: relative;
}
.tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--ink);
}

.popover {
  background: var(--white); border: var(--bd); border-radius: var(--r-md);
  box-shadow: var(--sh-md); padding: 12px; font-size: 13px;
  max-width: 260px; line-height: 1.5;
  color: var(--n-700);
}

/* ─────────── DROPDOWN MENU ─────────── */
.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--n-500);
  cursor: pointer;
  transition: background var(--t-quick), color var(--t-quick);
}
.dropdown-trigger:hover { background: var(--paper-2); color: var(--ink); }
.dropdown-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(20 184 196 / .18);
}

/* Navbar account / profile triggers (wider than icon-only .dropdown-trigger) */
.navbar-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--n-500);
  font-size: 13px;
  line-height: 1.25;
  cursor: pointer;
  transition: background var(--t-quick), color var(--t-quick);
}
.navbar-dropdown-trigger--profile { padding: 6px; }
@media (min-width: 768px) {
  .navbar-dropdown-trigger { padding: 6px 12px; gap: var(--sp-3); }
  .navbar-dropdown-trigger--profile { padding: 6px 12px; }
}
.navbar-dropdown-trigger:hover { background: var(--paper-2); color: var(--ink); }
.navbar-dropdown-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(20 184 196 / .18);
}
.navbar-dropdown-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
}
.navbar-dropdown-avatar img { width: 100%; height: 100%; object-fit: cover; }
.navbar-dropdown-avatar--logo img { object-fit: contain; }
.navbar-dropdown-label {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
}
@media (min-width: 768px) {
  .navbar-dropdown-label { display: flex; }
}
.navbar-dropdown-eyebrow {
  font-size: 11px;
  color: var(--n-500);
  line-height: 1.25;
}
@media (max-width: 1023px) {
  .navbar-dropdown-eyebrow { display: none; }
}
.navbar-dropdown-name {
  font-size: 13px;
  font-weight: var(--w-med);
  color: var(--ink);
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 1024px) {
  .navbar-dropdown-name { max-width: 8.75rem; }
}
.navbar-dropdown-chevron {
  font-size: 14px;
  color: var(--n-400);
  flex-shrink: 0;
}

.dropdown-menu-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  margin: -6px -6px 4px;
  border-bottom: 1px solid var(--n-200);
}
.dropdown-menu-header-label {
  font-size: 11px;
  color: var(--n-500);
  line-height: 1.25;
}
.dropdown-menu-header-value {
  font-size: 13px;
  font-weight: var(--w-med);
  color: var(--ink);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropdown-menu-header-meta { margin-top: 6px; }

.dropdown-menu {
  width: max-content;
  min-width: 12rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 6px;
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
}
.dropdown-menu.is-floating {
  position: fixed;
  z-index: 50;
}
.dropdown-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dropdown-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  white-space: nowrap;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--n-700);
  font-size: 13px;
  font-weight: var(--w-med);
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-quick), color var(--t-quick);
}
.dropdown-menu-item:hover,
.dropdown-menu-item:focus-visible {
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
  outline: none;
}
.dropdown-menu-item i { font-size: 15px; color: var(--n-500); flex-shrink: 0; }
.dropdown-menu-item-danger,
.dropdown-menu-item-danger:hover,
.dropdown-menu-item-danger:focus-visible {
  color: var(--err);
}
.dropdown-menu-item-danger i { color: var(--err); }
.dropdown-menu-divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--n-200);
  border: 0;
}
.dropdown-menu-list li form { margin: 0; display: contents; }

/* ─────────── FILTER DROPDOWN ─────────── */
.filter-menu {
  width: 20rem;
  max-width: min(20rem, calc(100vw - 2rem));
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
}
.filter-menu-panel {
  display: flex;
  flex-direction: column;
  padding: var(--sp-1);
  overflow: hidden;
}
.filter-menu.hidden,
.filter-menu-panel.hidden {
  display: none;
}
.filter-trigger { position: relative; }
.filter-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--t-500);
  border-radius: 50%;
  border: 2px solid var(--white);
}
.filter-section {
  padding: var(--sp-2) var(--sp-3);
  min-width: 0;
}
.filter-section + .filter-section {
  border-top: var(--bd);
}
.filter-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.filter-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: var(--w-med);
  color: var(--ink);
}
.filter-section-clear,
.filter-foot-clear {
  font-size: 12px;
  line-height: 1.2;
}
.filter-section-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  max-height: 11rem;
  overflow-y: auto;
  margin: 0 calc(var(--sp-1) * -1);
  padding: 0 var(--sp-1);
}
.filter-option.check-row {
  display: flex;
  width: 100%;
  padding: 5px var(--sp-2);
  border-radius: var(--r-sm);
  transition: background var(--t-quick);
}
.filter-option.check-row:hover { background: var(--paper); }
.filter-option-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--n-700);
}
.filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  border-top: var(--bd);
  margin-top: var(--sp-1);
}

/* ─────────── MODAL (static demo) ─────────── */
.modal-shell {
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  width: 100%;
  max-width: 42rem;
  overflow: hidden;
}
.modal-shell-sm { max-width: 28rem; }
.modal-shell-md { max-width: 36rem; }
.modal-shell-lg { max-width: 48rem; }
.modal-shell-xl { max-width: 64rem; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}
.modal-head-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: var(--w-sem);
  letter-spacing: var(--trk-tight);
  color: var(--ink);
  line-height: 1.3;
}
.modal-head-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--n-500);
}
.modal-body {
  padding: 16px 22px 22px;
  font-size: 14px;
  color: var(--n-600);
  line-height: 1.6;
}
.modal-section-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.ticket-preview {
  text-align: center;
}
.ticket-preview__scan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}
.ticket-preview__qr-card {
  width: fit-content;
  padding: var(--sp-3);
}
.ticket-preview__qr-image {
  display: block;
  width: 250px;
  max-width: 100%;
  height: auto;
}
.ticket-preview__uuid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  max-width: 100%;
}
.ticket-preview__uuid-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--w-med);
  letter-spacing: 0.04em;
  color: var(--ink);
  word-break: break-all;
}
.ticket-preview__details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: var(--bd);
}
.ticket-preview__datetime {
  margin: 0;
  font-size: 14px;
  color: var(--n-600);
}
.ticket-preview__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  margin: 0;
}
.ticket-preview__fact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.ticket-preview__fact-value {
  font-size: 14px;
  font-weight: var(--w-med);
  color: var(--ink);
}
.ticket-preview__price {
  font-size: var(--tx-h4);
  letter-spacing: var(--trk-snug);
  line-height: 1.3;
}
.promoter-category-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
@media (min-width: 1024px) {
  .promoter-category-form {
    flex-direction: row;
    align-items: flex-end;
    gap: var(--sp-3);
  }
}
.promoter-category-form__category {
  flex: 1;
  min-width: 0;
}
.promoter-category-form__quantity {
  width: 100%;
}
@media (min-width: 1024px) {
  .promoter-category-form__quantity {
    width: 10rem;
    flex: 0 0 10rem;
  }
}
.promoter-category-form__actions {
  flex-shrink: 0;
}
@media (max-width: 1023px) {
  .promoter-category-form__actions .btn {
    width: 100%;
  }
}
.modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.modal-form-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: var(--bd);
}
.modal-form-option {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}
.modal-form-option .ti-info-circle {
  margin-top: 2px;
  flex-shrink: 0;
}
.form-actions,
.modal-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-2);
  padding-top: var(--sp-4);
  border-top: var(--bd);
}
.form-actions-plain {
  border-top: none;
  padding-top: 0;
}
.modal-intro { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.modal-foot {
  padding: 16px 22px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  border-top: var(--bd);
  background: var(--paper);
}
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 24px;
  border: 2px dashed var(--n-300);
  border-radius: var(--r-lg);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-quick), background var(--t-quick);
}
.drop-zone:hover,
.drop-zone.is-active {
  border-color: var(--t-500);
  background: var(--t-50);
}
.drop-zone-icon { font-size: 2rem; color: var(--n-400); }
.drop-zone-title { color: var(--n-700); font-size: 14px; font-weight: var(--w-med); }
.drop-zone-hint { color: var(--n-500); font-size: 13px; }
.modal-preview {
  overflow: hidden;
  border: var(--bd);
  border-radius: var(--r-md);
  background: var(--white);
}
.modal-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: var(--bd);
  background: var(--paper-2);
}

/* ─────────── PUBLIC EVENT HEADER (invite / partner pages) ─────────── */
.public-event-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: var(--bd);
}
.public-event-header-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.public-event-header-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--w-sem);
  letter-spacing: var(--trk-tight);
  line-height: 1.25;
  color: var(--ink);
}
.public-event-header-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  color: var(--n-600);
}
.public-event-header-subtitle .field-label {
  margin: 0;
}
.public-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.public-event-meta-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: min(100%, 12rem);
}
.public-event-meta-item i {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1;
  color: var(--t-500);
  flex-shrink: 0;
}
.public-event-meta-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.public-event-meta-value {
  font-size: 14px;
  font-weight: var(--w-med);
  line-height: 1.35;
  color: var(--ink);
}

/* ─────────── PUBLIC BRAND THEME (customer accent on invite / partner pages) ─────────── */
.public-brand-theme {
  --brand-accent: var(--teal);
  --brand-accent-text: var(--paper);
  --brand-page-bg: var(--paper);
  background-color: var(--brand-page-bg);
}
.public-brand-theme .tab.active {
  border-bottom-color: var(--brand-accent);
}
.public-brand-theme .public-event-meta-item i {
  color: var(--brand-accent);
}
.public-brand-theme .seg-item.active i {
  color: var(--brand-accent);
}
.public-brand-theme button.btn.btn-primary,
.public-brand-theme a.btn.btn-primary,
.public-brand-theme button.btn-primary,
.public-brand-theme a.btn-primary,
.public-brand-theme .btn-primary {
  background: var(--brand-accent);
  color: var(--brand-accent-text);
}
.public-brand-theme button.btn.btn-primary:hover,
.public-brand-theme a.btn.btn-primary:hover,
.public-brand-theme button.btn-primary:hover,
.public-brand-theme a.btn-primary:hover,
.public-brand-theme .btn-primary:hover {
  background: color-mix(in srgb, var(--brand-accent) 85%, black);
}
.public-brand-theme button.btn:focus-visible,
.public-brand-theme a.btn:focus-visible,
.public-brand-theme .btn:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 25%, transparent);
}
.public-brand-theme .seg-item:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 18%, transparent);
}

/* ─────────── PUBLIC BRAND THEME · DARK BACKGROUND ───────────
   When a customer picks a dark page background, light text on the default
   light palette becomes invisible. The helper appends `.is-dark`, and we
   redefine the neutral ramp + surface/text aliases here. DS component classes
   (.card, .input, .btn, .badge, .h1, .body, .public-event-* …) all resolve
   colour through these tokens, so they flip automatically. Borders cascade
   too (--bd → var(--n-200)). Surfaces are mixed from the customer's own
   --brand-page-bg so the dark theme stays on-brand. */
.public-brand-theme.is-dark {
  color-scheme: dark;

  /* Inverted neutral ramp: --n-0 (was white) → deepest, --n-900 (ink) → lightest.
     Low end (n-50…n-300) reads as surfaces/borders lifted off the page bg;
     high end (n-400…n-950) reads as muted → primary text. */
  --n-0:   var(--brand-page-bg);
  --n-50:  color-mix(in srgb, var(--brand-page-bg) 90%, #ffffff 10%);
  --n-100: color-mix(in srgb, var(--brand-page-bg) 84%, #ffffff 16%);
  --n-150: color-mix(in srgb, var(--brand-page-bg) 78%, #ffffff 22%);
  --n-200: color-mix(in srgb, var(--brand-page-bg) 66%, #ffffff 34%);
  --n-300: color-mix(in srgb, var(--brand-page-bg) 56%, #ffffff 44%);
  --n-400: #8A93A3;
  --n-500: #A6AEBC;
  --n-600: #C3C9D3;
  --n-700: #D9DDE4;
  --n-800: #ECEEF2;
  --n-900: #F5F5F1;
  --n-950: #FCFCFA;

  /* Surfaces tinted toward the brand bg; cards (--white) sit slightly above
     the page for separation. */
  --white:   color-mix(in srgb, var(--brand-page-bg) 86%, #ffffff 14%);
  --paper:   var(--brand-page-bg);
  --paper-2: color-mix(in srgb, var(--brand-page-bg) 80%, #ffffff 20%);
  --paper-3: color-mix(in srgb, var(--brand-page-bg) 73%, #ffffff 27%);

  --ink:      #F5F5F1;
  --ink-soft: #D9DDE4;

  color: var(--ink);
}

/* Literal-hex Tailwind utilities (config maps paper-*/ink to fixed hex, not
   CSS vars) can't read the tokens above, so map the ones used on public pages
   onto the inverted ramp explicitly. */
.public-brand-theme.is-dark .text-ink { color: var(--ink); }
.public-brand-theme.is-dark .text-paper-700,
.public-brand-theme.is-dark .text-paper-600,
.public-brand-theme.is-dark .text-paper-500 { color: var(--n-600); }
.public-brand-theme.is-dark .text-paper-400 { color: var(--n-500); }
.public-brand-theme.is-dark .bg-paper-50,
.public-brand-theme.is-dark .bg-paper-100 { background-color: var(--paper-2); }
.public-brand-theme.is-dark .hover\:bg-paper-50:hover,
.public-brand-theme.is-dark .hover\:bg-paper-100:hover { background-color: var(--paper-3); }
.public-brand-theme.is-dark .border-paper-200 { border-color: var(--n-200); }

/* Deep-teal links read low-contrast on dark; lift toward a brighter teal. */
.public-brand-theme.is-dark a.link,
.public-brand-theme.is-dark .link,
.public-brand-theme.is-dark .text-teal-600,
.public-brand-theme.is-dark .text-teal-700 { color: var(--t-300); }

/* ─────────── APP SIMPLE FOOTER (public invite / partner pages) ─────────── */
.app-simple-footer {
  margin-top: auto;
  padding-top: 24px;
}
.app-simple-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0 8px;
}
@media (min-width: 640px) {
  .app-simple-footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}
.app-simple-footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.app-simple-footer-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--n-500);
}
.app-simple-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.app-simple-footer-link {
  font-size: 13px;
  font-weight: var(--w-med);
  color: var(--n-500);
  text-decoration: none;
  transition: color var(--t-quick) var(--ease);
}
.app-simple-footer-link:hover {
  color: var(--ink);
  text-decoration: none;
}

/* Event secondary nav action row (e.g. entry QR scan button) */
.event-secondary-nav-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--sp-4);
}

/* ─────────── RESOURCE INDEX (lists / tables) ─────────── */
.attendees-page,
.checkin-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.promoters-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.promoter-row-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
@media (min-width: 768px) {
  .promoter-row-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--sp-4);
    align-items: start;
  }
}
.promoter-row-grid__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.promoter-row-grid__identity,
.promoter-row-grid__categories {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}
.promoter-row-grid__categories {
  justify-content: center;
}
.promoter-row-grid__category-lines {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.promoter-row-grid__edit-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 12px;
  width: fit-content;
}
.promoter-row-grid__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
  font-size: 13px;
}
.promoter-row-grid__actions .link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1);
  text-align: right;
}
.promoter-row-grid__actions form.button_to {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
}
.promoter-row-grid__actions form.button_to .link {
  width: auto;
}
.resource-index-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.resource-index-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
@media (min-width: 1024px) {
  .resource-index-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
  }
}
.resource-index-toolbar-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
}
@media (min-width: 1024px) {
  .resource-index-toolbar-main {
    flex-direction: row;
    align-items: center;
    gap: var(--sp-3);
  }
}
.resource-index-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
}
.resource-index-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  font-weight: var(--w-med);
  color: var(--t-600);
  text-decoration: none;
  transition: color var(--t-quick) var(--ease);
}
.resource-index-link:hover { color: var(--ink); }
.resource-index-meta {
  margin: 0;
  font-size: 13px;
  color: var(--n-500);
}
.resource-index-pagination {
  display: flex;
  justify-content: center;
  padding-top: var(--sp-2);
}
.attendee-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.attendee-list-card-inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.attendee-list-card-head,
.attendee-list-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.attendee-list-card-head {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.attendee-list-email,
.attendee-list-category {
  font-size: 13px;
  color: var(--n-500);
}
.attendee-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}
.attendee-name-text {
  font-weight: var(--w-med);
  color: var(--ink);
}

/* ─────────── ENTRY LIVE STATS ─────────── */
.entry-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}
.entry-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
@media (min-width: 1024px) {
  .entry-stat-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--sp-4);
  }
}
.entry-stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  min-width: 0;
}
.entry-stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: var(--w-sem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.entry-stat-value--ok { color: var(--ok); }
.entry-stat-value--warn { color: var(--warn); }
.entry-stat-value--err { color: var(--err); }
.entry-stat-value--pending { color: #7C3AED; }
.entry-progress {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
}
.entry-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.entry-progress-value {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: var(--w-sem);
  color: var(--ink);
  letter-spacing: -0.02em;
}
.entry-chart-card { padding: var(--sp-4); }
.entry-category-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
}
@media (min-width: 1024px) {
  .entry-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.entry-category-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  height: 100%;
}
.entry-category-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.entry-category-name {
  font-size: 1rem;
  font-weight: var(--w-med);
  color: var(--ink);
}
.entry-category-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.entry-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-top: var(--bd);
}
.entry-stat-row:first-child { border-top: 0; padding-top: 0; }
.entry-stat-row-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--tx-spec);
  font-weight: var(--w-med);
  letter-spacing: var(--trk-spec);
  text-transform: uppercase;
  color: var(--n-500);
}
.entry-stat-row-label--ok { color: var(--ok-text); }
.entry-stat-row-label--warn { color: var(--warn-text); }
.entry-stat-row-label--err { color: var(--err-text); }
.entry-stat-row-value {
  margin: 0;
  font-size: 0.875rem;
  font-weight: var(--w-med);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ─────────── LEGAL CONTENT ─────────── */
.legal-content {
  color: var(--n-700);
  font-size: 14px;
  line-height: 1.65;
}
.legal-content-head { margin-bottom: var(--sp-6); }
.legal-content-subtitle {
  margin: var(--sp-2) 0 0;
  font-size: 14px;
  color: var(--n-500);
  font-style: italic;
}
.legal-content-intro { margin: 0 0 var(--sp-6); }
.legal-content-sections {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}
.legal-content-section + .legal-content-section {
  padding-top: var(--sp-6);
  border-top: var(--bd);
}
.legal-content-section .h2 {
  margin-bottom: var(--sp-3);
}
.legal-content-section p {
  margin: 0 0 var(--sp-3);
}
.legal-content-section p:last-child { margin-bottom: 0; }

/* ─────────── DIVIDERS ─────────── */
.divider { border-top: var(--bd); }
.divider-dashed { border-top: 1px dashed var(--n-300); }
.divider-vert { border-left: var(--bd); align-self: stretch; }

/* ─────────── BREADCRUMB ─────────── */
.app-breadcrumb-bar {
  background: var(--paper-2);
  border-bottom: 1px solid var(--n-150);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.35;
  color: var(--n-500);
}
.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.breadcrumb a,
.breadcrumb-link {
  color: var(--n-600);
  text-decoration: none;
  transition: color var(--t-quick);
  border-radius: var(--r-xs);
}
.breadcrumb a:hover,
.breadcrumb-link:hover {
  color: var(--ink);
}
.breadcrumb a:focus-visible,
.breadcrumb-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent);
}
.breadcrumb-sep {
  color: var(--n-400);
  font-size: 13px;
  font-weight: var(--w-med);
  line-height: 1;
  flex-shrink: 0;
  margin-inline: var(--sp-3);
}
.breadcrumb-current {
  color: var(--ink);
  font-weight: var(--w-med);
  min-width: 0;
  max-width: min(28rem, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────── KEYCAP ─────────── */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: var(--w-med);
  min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--white); border: 1px solid var(--n-300); border-bottom-width: 2px;
  border-radius: 4px; color: var(--n-700);
}

/* ─────────── SWATCH ─────────── */
.swatch {
  display: flex; flex-direction: column; gap: 6px;
}
.swatch-block {
  width: 100%; aspect-ratio: 1.4;
  border-radius: var(--r);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 8px 10px;
  font-family: var(--font-mono); font-size: 10px; font-weight: var(--w-med);
  letter-spacing: 0.04em;
  color: white;
  position: relative; overflow: hidden;
  border: 1px solid transparent;
}
.swatch-block.lite { color: var(--ink); border-color: var(--n-200); }
.swatch-name { font-size: 11px; font-weight: var(--w-sem); color: var(--ink); font-family: var(--font-body); letter-spacing: -0.01em; }
.swatch-meta { font-family: var(--font-mono); font-size: 10px; color: var(--n-500); letter-spacing: 0.04em; }

/* ─────────── FEES EXAMPLE PANELS ─────────── */
.fees-example-panel + .fees-example-panel { margin-top: var(--sp-3); }
.fees-example-total {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--n-200);
}
.fees-example-deduction { color: var(--err); }
.fees-example-payout span:last-child { color: var(--ok); }
.ds-icon-ok { color: var(--ok); }
.ds-icon-err { color: var(--err); }

/* ─────────── APP SHELL ─────────── */
.app-main {
  width: 100%;
  min-width: 0;
}

/* ─────────── MOBILE ADAPTATIONS (< 768px) ─────────── */
@media (max-width: 767px) {
  html,
  body {
    overflow-x: clip;
  }

  .app-main {
    padding: var(--sp-3);
    margin-top: var(--sp-3);
    margin-bottom: var(--sp-3);
  }

  .input,
  .input-white-bg,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px;
  }

  .tbl {
    min-width: 36rem;
  }

  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .secondary-nav {
    margin-top: var(--sp-4);
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-2);
    scrollbar-width: none;
  }
  .secondary-nav::-webkit-scrollbar { display: none; }
  .secondary-nav .navbar-item {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    flex-shrink: 0;
  }

  .navbar .navbar-item {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .dropdown-trigger {
    min-width: 44px;
    min-height: 44px;
  }

  .alert-banner__inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
  }
  .alert-banner__actions {
    width: 100%;
  }
  .alert-banner__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .form-actions,
  .modal-form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .form-actions .btn,
  .modal-form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .modal-foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .modal-foot .btn,
  .modal-foot .button_to {
    width: 100%;
  }
  .modal-foot .btn {
    justify-content: center;
  }

  .modal-shell {
    border-radius: var(--r-lg);
    max-height: calc(100svh - var(--sp-4));
    overflow-y: auto;
  }
  .modal-head,
  .modal-body,
  .modal-foot {
    padding-inline: var(--sp-4);
  }

  .resource-index-toolbar-actions {
    width: 100%;
    justify-content: stretch;
  }
  .resource-index-toolbar-actions > .btn,
  .resource-index-toolbar-actions > a.btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .promoter-row-grid__actions {
    align-items: stretch;
  }
  .promoter-row-grid__actions .link,
  .promoter-row-grid__actions form.button_to {
    justify-content: flex-start;
    width: 100%;
  }

  .entry-stat-grid {
    grid-template-columns: 1fr;
  }

  .tabs .tab {
    min-height: 44px;
    flex-shrink: 0;
  }

  .navbar > .container {
    padding: var(--sp-3);
  }

  .event-secondary-nav-actions {
    justify-content: stretch;
  }
  .event-secondary-nav-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .card {
    min-width: 0;
  }

  .profile-account-row {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-account-row__lead {
    width: 100%;
  }
  .profile-account-row__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .profile-account-row__meta-sep {
    display: none;
  }
  .profile-account-row__actions {
    width: 100%;
    justify-content: stretch;
  }
  .profile-account-row__actions .btn,
  .profile-account-row__actions form.button_to {
    width: 100%;
  }
  .profile-account-row__actions .btn {
    justify-content: center;
    min-height: 44px;
  }
  .profile-account-row__actions .badge {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    min-height: 44px;
    align-items: center;
  }

  .profile-accounts-toolbar .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .rounded-md.flex.flex-row.relative > .absolute.top-0.right-0 {
    padding: var(--sp-4);
  }
}
