/* ==========================================================================
 * Festival Studio - tickets view
 *
 * Rules for this screen only (st-tickets-* classes); the shared kit is in
 * /studio/studio.css. Cards, tables, badges, buttons and dialogs come from
 * the kit. This file adds: the ticket-type badge colours the app uses (gold
 * VIP, sky ride, violet for the rest), the column widths of the registrations
 * table, the action lists of the row panel and the downloads dialog, the
 * import wizard and the waiver signature placement.
 * ========================================================================== */

/* ---------- page ---------- */
.st-tickets-notice { margin-bottom: 16px; }
.st-tickets-notice:empty { display: none; }
.st-tickets-panel { display: flex; flex-direction: column; gap: 16px; padding-top: 18px; }
/* The two set-up tabs are read, not scanned: keep their cards to a text width. */
.st-tickets-panel--setup > .st-card { max-width: 920px; }
.st-tickets-foot { font-size: 12.5px; line-height: 1.5; color: var(--st-text-muted); }

/* "Works here" / "Needs AKTVO" lists in the notice shown when the ticket page
   sells another festival. */
.st-tickets-gate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; max-width: 820px; margin-top: 4px; }
.st-tickets-gate__head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--st-text); }
.st-tickets-gate__head .st-icon { color: var(--st-text-muted); }
.st-tickets-bullets { margin-top: 4px; padding-left: 20px; list-style: disc; font-size: 13px; line-height: 1.6; color: var(--st-text-dim); }
.st-tickets-bullets li::marker { color: var(--st-text-muted); }

/* ---------- ticket type badges ---------- */
/* Upper case with an icon, like the app's FestivalTicketBadge, so a ticket
   type never reads as a status chip. */
.st-tickets-ticket { gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.st-tickets-ticket--vip { color: #f5b301; background: rgba(245, 179, 1, 0.12); border-color: rgba(245, 179, 1, 0.45); }
.st-tickets-ticket--ride { color: #38bdf8; background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.42); }
.st-tickets-ticket--other { color: #c9c1ff; background: rgba(109, 92, 255, 0.18); border-color: rgba(124, 92, 255, 0.42); }
.st-tickets-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; max-width: 100%; }
/* A long ticket name stays inside its column (it overlapped Status at 1440 px). */
.st-tickets-ticket { flex: 0 1 auto; max-width: 100%; min-width: 0; }
.st-tickets-ticket .st-icon { flex: 0 0 auto; }
.st-tickets-ticket__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- counters ---------- */
.st-tickets-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.st-tickets-bytype {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px 16px;
  border: 1px solid var(--st-border); border-radius: var(--st-r-12); background: var(--st-bg-card); font-size: 13px;
}
.st-tickets-bytype__label { font-size: 12.5px; font-weight: 500; color: var(--st-text-dim); }
.st-tickets-bytype__items { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.st-tickets-bytype__item { display: inline-flex; align-items: center; gap: 8px; }
.st-tickets-bytype__note { margin-left: auto; font-size: 12.5px; color: var(--st-text-muted); }

/* ---------- toolbar ---------- */
.st-tickets-toolbar .st-search { flex: 1 1 240px; max-width: 340px; }
.st-tickets-filter { width: auto; flex: 0 1 auto; min-width: 0; max-width: 230px; }
/* Stays on the right, also when the filters wrap onto a second line. */
.st-tickets-toolbar__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.st-tickets-updated { font-size: 12.5px; color: var(--st-text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- registrations table ---------- */
/* Fixed layout. Email takes what the other columns leave, and the breakpoints
   below keep that at about 285px or more down to a 1100px window: room for a
   34-character address. A longer name or address is clipped with an ellipsis
   (the whole value is in its tooltip and in the row panel) instead of pushing
   the status columns off screen.
   Status is sized to its widest pair of badges on one line:
   "Not in the app" + "Checked in 12:00 AM". */
.st-tickets-table .st-table__table { table-layout: fixed; min-width: 720px; }
.st-tickets-table col:nth-child(1) { width: 18%; }
.st-tickets-table col:nth-child(3) { width: 188px; }
.st-tickets-table col:nth-child(4) { width: 296px; }
.st-tickets-table col:nth-child(5) { width: 104px; }
.st-tickets-table col:nth-child(6) { width: 126px; }
.st-tickets-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.st-tickets-name__main { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tickets-name__main.st-muted { font-weight: 400; }
.st-tickets-name__sub { font-size: 12px; color: var(--st-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tickets-clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The least important columns give way before Email is squeezed. In order:
   Source goes (it has its own filter), Status drops to "In the app" + the
   check-in on one line, the date goes, and last Status drops to one badge
   with the check-in on a second line. Source and the date are in the row
   panel. Each step is where Email would otherwise fall under 285px; the page
   is the window less 306px, and stops growing at 1528px. */
@media (max-width: 1527px) {
  .st-tickets-table col:nth-child(5), .st-tickets-table th:nth-child(5), .st-tickets-table td:nth-child(5) { display: none; }
}
@media (max-width: 1400px) {
  .st-tickets-table col:nth-child(3) { width: 176px; }
  .st-tickets-table col:nth-child(4) { width: 274px; }
}
@media (max-width: 1355px) {
  .st-tickets-table col:nth-child(6), .st-tickets-table th:nth-child(6), .st-tickets-table td:nth-child(6) { display: none; }
}
@media (max-width: 1200px) {
  .st-tickets-table col:nth-child(4) { width: 188px; }
}
@media (max-width: 900px) {
  .st-tickets-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-tickets-bytype__note { margin-left: 0; }
}

/* ---------- small tables (ticket types, import preview) ---------- */
.st-tickets-mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.st-tickets-mini th {
  padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--st-border);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--st-text-muted);
}
.st-tickets-mini td { padding: 9px 12px; border-bottom: 1px solid var(--st-border); overflow-wrap: anywhere; }
.st-tickets-mini tbody tr:last-child td { border-bottom: 0; }
.st-tickets-mini th.st-ta-right { text-align: right; }
.st-tickets-types th:first-child, .st-tickets-types td:first-child { padding-left: 0; }
.st-tickets-types th:last-child, .st-tickets-types td:last-child { padding-right: 0; }

/* ---------- action lists (row panel, downloads) ---------- */
.st-tickets-status { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; color: var(--st-text-dim); }
.st-tickets-status .st-icon { margin-top: 2px; color: var(--st-text-muted); }
.st-tickets-status.is-ok .st-icon { color: var(--st-green); }
.st-tickets-actions { display: flex; flex-direction: column; border: 1px solid var(--st-border); border-radius: var(--st-r-12); overflow: hidden; }
.st-tickets-actions__head { padding: 10px 14px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--st-text-muted); }
.st-tickets-action {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 9px 14px; text-align: left;
  border-top: 1px solid var(--st-border); transition: background var(--st-ease);
}
.st-tickets-action:first-child { border-top: 0; }
.st-tickets-action:hover:not(:disabled) { background: var(--st-bg-hover); }
.st-tickets-action:focus-visible { outline-offset: -2px; }
.st-tickets-action:disabled { cursor: not-allowed; }
.st-tickets-action:disabled .st-tickets-action__icon, .st-tickets-action:disabled .st-tickets-action__label { opacity: 0.45; }
.st-tickets-action.is-busy { cursor: progress; }
.st-tickets-action__icon {
  flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--st-r-8);
  background: rgba(109, 92, 255, 0.14); color: var(--st-lavender);
}
.st-tickets-action__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.st-tickets-action__label { font-size: 13.5px; font-weight: 600; }
.st-tickets-action__sub { font-size: 12.5px; color: var(--st-text-muted); overflow-wrap: anywhere; }

/* ---------- import / give VIP wizard ---------- */
.st-tickets-wizard { --st-modal-w: 940px; }
.st-tickets-steps { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--st-text-muted); }
.st-tickets-step { display: flex; align-items: center; gap: 8px; }
.st-tickets-step + .st-tickets-step::before { content: ""; width: 32px; height: 1px; margin-right: 2px; background: var(--st-border-strong); }
.st-tickets-step__n {
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--st-border-strong);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.st-tickets-step.is-active { color: var(--st-text); font-weight: 600; }
.st-tickets-step.is-active .st-tickets-step__n { background: var(--st-violet); border-color: var(--st-violet); color: #fff; }
.st-tickets-step.is-done .st-tickets-step__n { background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.4); color: #6ee7b7; }

.st-tickets-compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.st-tickets-paste { min-height: 210px; font-family: var(--st-mono); font-size: 12.5px; line-height: 1.55; white-space: pre; overflow: auto; }
.st-tickets-preview {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 14px;
  border: 1px solid var(--st-border); border-radius: var(--st-r-12); background: var(--st-bg-elev);
}
.st-tickets-preview > .st-empty { margin: auto 0; }

.st-tickets-tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.st-tickets-tally--wide { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.st-tickets-tally__item {
  display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 9px 12px;
  border: 1px solid var(--st-border); border-radius: var(--st-r-10); background: rgba(255, 255, 255, 0.02);
}
.st-tickets-tally__n { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.st-tickets-tally__label { font-size: 12px; line-height: 1.35; color: var(--st-text-muted); }
.st-tickets-tally__item.is-ok .st-tickets-tally__n { color: #6ee7b7; }
.st-tickets-tally__item.is-warn .st-tickets-tally__n { color: #fcd34d; }
.st-tickets-tally__item.is-bad .st-tickets-tally__n { color: var(--st-red-text); }

.st-tickets-box { border: 1px solid var(--st-border); border-radius: var(--st-r-10); background: var(--st-bg-card); overflow: hidden; }
.st-tickets-box .st-tickets-mini { font-size: 13px; }
.st-tickets-box .st-tickets-mini td { padding-top: 6px; padding-bottom: 6px; }
.st-tickets-box__more { padding: 7px 12px; border-top: 1px solid var(--st-border); font-size: 12.5px; color: var(--st-text-muted); }
.st-tickets-invalid__head { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: #fcd34d; }
.st-tickets-invalid__head .st-icon { margin-top: 1px; }
/* Lines exactly as pasted. They are text nodes: nothing in them is markup. */
.st-tickets-invalid__list {
  margin-top: 6px; max-height: 128px; overflow: auto; padding: 6px 10px;
  border: 1px solid var(--st-border); border-radius: var(--st-r-8); background: var(--st-bg-card);
  font-family: var(--st-mono); font-size: 12px; line-height: 1.5; color: var(--st-text-dim);
}
.st-tickets-invalid__list li { white-space: pre-wrap; overflow-wrap: anywhere; }
.st-tickets-invalid .st-tickets-box__more { padding: 6px 0 0; border-top: 0; }

.st-tickets-run { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 44px 24px 36px; text-align: center; }
.st-tickets-run__title { font-size: 15px; font-weight: 600; }
.st-tickets-run .st-progress { width: 100%; max-width: 440px; }
.st-tickets-run__why { max-width: 460px; }
/* After an attempt to close the window while batches are out. */
.st-tickets-run__why.is-nudged { color: #fcd34d; }

.st-tickets-done { display: flex; align-items: center; gap: 12px; }
.st-tickets-done.is-ok > .st-icon { color: var(--st-green); }
.st-tickets-done.is-warn > .st-icon { color: var(--st-amber); }
.st-tickets-done__title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.st-tickets-results .st-table__table { table-layout: fixed; }
.st-tickets-warn { color: #fcd34d; }
.st-tickets-results .st-table__table td { height: 40px; }

/* ---------- waiver: signature placement ---------- */
.st-tickets-place { --st-modal-w: 900px; }
.st-tickets-place__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 32px; }
.st-tickets-place__hint { font-size: 13.5px; color: var(--st-text-dim); }
.st-tickets-place__nav { display: flex; align-items: center; gap: 6px; }
.st-tickets-place__page { width: auto; }
/* The page keeps its paper colour; the stage scrolls when it is taller than
   the dialog. */
.st-tickets-place__stage {
  margin-top: 12px !important; min-height: 220px; max-height: calc(100dvh - 276px); overflow: auto; padding: 12px;
  border: 1px solid var(--st-border); border-radius: var(--st-r-10); background: #090c15;
}
.st-tickets-place__sheet { position: relative; margin: 0 auto; background: #fff; cursor: crosshair; line-height: 0; }
.st-tickets-place__sheet:focus-visible { outline-offset: 3px; }
.st-tickets-place__canvas { width: 100%; height: auto; }
/* Same footprint as the stamped signature: 30% of the page width, centred on
   the chosen point (MARK_WIDTH / MARK_RATIO in views/tickets.js). */
.st-tickets-mark {
  position: absolute; width: 30%; aspect-ratio: 100 / 27; transform: translate(-50%, -50%); pointer-events: none;
  border: 2px solid var(--st-violet); border-radius: 0 6px 6px 6px; background: rgba(109, 92, 255, 0.14);
}
/* The label sits on top of the box, so it never covers the signature line. */
.st-tickets-mark__tag {
  position: absolute; left: -2px; bottom: 100%; display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px;
  border-radius: 5px 5px 0 0; background: var(--st-violet); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
}

@media (max-width: 860px) {
  .st-tickets-compose { grid-template-columns: minmax(0, 1fr); }
  .st-tickets-gate { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- ticket types editor (views/tickets-editor.js) ---------- */
/* Two columns: the cards on the left, the Setup card on the right, staying
   in view under the top bar while the page scrolls (.st-content scrolls, so
   top is measured from just under the bar). The Setup card comes first in
   the page, so on a narrow screen it simply sits above the cards. */
.st-tickets-editor {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 34%, 390px); gap: 16px;
  align-items: start; max-width: 1320px;
}
.st-tickets-editor__main { grid-column: 1; grid-row: 1; gap: 16px; min-width: 0; }
.st-tickets-editor__side { grid-column: 2; grid-row: 1; position: sticky; top: 16px; min-width: 0; }
.st-tickets-setup .st-overview-check__detail { overflow-wrap: anywhere; }
@media (max-width: 1100px), (max-height: 640px) {
  .st-tickets-editor { grid-template-columns: minmax(0, 1fr); max-width: 920px; }
  .st-tickets-editor__main, .st-tickets-editor__side { grid-column: 1; grid-row: auto; }
  .st-tickets-editor__side { position: static; }
}

/* Where a Setup row points: a ring for a moment around the field, the
   switch or the card (it fades; with reduced motion it just goes away). */
.st-tickets-spot { outline: 2px solid var(--st-lavender); outline-offset: 6px; border-radius: var(--st-r-8); animation: st-tickets-spot 1.8s ease-out both; }
.st-card.st-tickets-spot { outline-offset: 3px; border-radius: var(--st-r-14); }
@keyframes st-tickets-spot {
  0%, 55% { outline-color: var(--st-lavender); }
  100% { outline-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .st-tickets-spot { animation: none; }
}
.st-tickets-editor .st-card__body > .st-toggle { margin-bottom: 4px; }
.st-tickets-editor__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.st-tickets-editor__save { justify-content: flex-end; gap: 8px; }

.st-tickets-share { display: flex; align-items: center; gap: 20px; }
.st-tickets-share__qr {
  position: relative; flex: 0 0 auto; width: 132px; height: 132px; display: grid; place-items: center; padding: 6px;
  border-radius: var(--st-r-10); background: #fff; overflow: hidden;
}
.st-tickets-share__qr-image { display: grid; place-items: center; }
/* Sales off: the QR is covered with "Turn sales on first" (as the schedule's card). */
.st-tickets-share__qr-cover {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center;
  font-size: 13px; font-weight: 600; line-height: 1.3; color: #1f2937; background: rgba(255, 255, 255, 0.72);
}
.st-tickets-share-card.is-off .st-tickets-share__qr-image { opacity: 0.18; filter: blur(2px); pointer-events: none; user-select: none; }
.st-tickets-share__hint { margin: 0; color: var(--st-amber); }
.st-tickets-share__qr canvas { width: 120px; height: 120px; image-rendering: pixelated; }
.st-tickets-share__qr .st-link { padding: 6px; font-size: 12px; color: #4b3df5; text-align: center; }
.st-tickets-share__url { font-size: 15px; font-weight: 600; word-break: break-all; }

.st-tickets-types-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.st-tickets-type {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 20px;
  padding: 12px 14px; border: 1px solid var(--st-border); border-radius: var(--st-r-12); background: var(--st-bg-elev);
}
.st-tickets-type__main { min-width: 0; }
.st-tickets-type__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.st-tickets-type__label { font-size: 14.5px; font-weight: 650; color: var(--st-text); overflow-wrap: anywhere; }
.st-tickets-type.is-off .st-tickets-type__label { color: var(--st-text-dim); }
.st-tickets-type__sub { margin-top: 2px; font-size: 13px; color: var(--st-text-dim); overflow-wrap: anywhere; }
.st-tickets-type__facts { margin-top: 4px; font-size: 12.5px; color: var(--st-text-muted); }
.st-tickets-type__numbers {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 96px;
  font-size: 12.5px; color: var(--st-text-dim); font-variant-numeric: tabular-nums;
}
.st-tickets-type__numbers .st-strong { color: var(--st-text); font-size: 14px; }
.st-tickets-type__actions { display: flex; align-items: center; gap: 4px; }

@media (max-width: 720px) {
  .st-tickets-editor__grid { grid-template-columns: minmax(0, 1fr); }
  .st-tickets-type { grid-template-columns: minmax(0, 1fr) auto; }
  .st-tickets-type__numbers { grid-column: 1; flex-direction: row; gap: 14px; align-items: baseline; }
  .st-tickets-share { flex-direction: column; align-items: flex-start; }
}

/* The event's time zone, shown (picked in Details). */
.st-tickets-editor__zone { margin: 0; min-height: 38px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; font-size: 13.5px; color: var(--st-text-dim); }

/* ---------- gate tab (views/tickets-gate.js) ---------- */
/* Settings first, read like the set-up tabs (a text width); the counters and
   the log below take the full width. Prefix st-admit: st-gate is the shell's
   full-page notice (studio.css). */
.st-tickets-panel--gate > .st-admit { gap: 16px; }
.st-admit-source:empty, .st-admit-latest:empty { display: none; }
.st-admit-source { margin-bottom: 14px; }
.st-admit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.st-admit-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.st-admit-choice {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 10px 12px; border: 1px solid var(--st-border); border-radius: var(--st-r-10);
  background: rgba(255, 255, 255, 0.02); cursor: pointer;
  transition: border-color var(--st-ease), background-color var(--st-ease);
}
.st-admit-choice:hover { border-color: var(--st-border-strong); }
.st-admit-choice.is-active { border-color: rgba(124, 92, 255, 0.7); background: rgba(109, 92, 255, 0.1); }
.st-admit-choice:has(:focus-visible) { outline: 2px solid var(--st-focus); outline-offset: 2px; }
.st-admit-choice.is-disabled { cursor: default; opacity: 0.55; }
.st-admit-choice.is-disabled:hover { border-color: var(--st-border); }
.st-admit-choice__input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--st-violet-2); }
.st-admit-choice__input:focus-visible { outline: none; }
.st-admit-choice__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-admit-choice__label { font-size: 13.5px; font-weight: 600; }
.st-admit-choice__help { font-size: 12.5px; line-height: 1.45; color: var(--st-text-muted); }
.st-admit-setting.is-idle .st-field__hint { color: var(--st-text-dim); }
.st-admit-latest { margin-top: 4px; }
.st-admit-save { justify-content: flex-end; gap: 8px; margin-top: 14px; }
.st-admit-save__note { order: -1; margin-right: auto; font-size: 12.5px; color: var(--st-text-muted); }

.st-admit-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.st-admit-statsnote { margin-top: 12px; }
.st-admit-statsnote:empty { display: none; }
.st-admit-live:empty { display: none; }

.st-admit-toolbar { flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.st-admit-toolbar .st-search { flex: 1 1 220px; max-width: 320px; margin-left: auto; }
.st-admit-logstate:empty { display: none; }
/* Fixed widths for everything but Name, which keeps at least 160px: below
   that the table scrolls sideways instead of losing the name. */
.st-admit-table .st-table__table { table-layout: fixed; min-width: 1000px; }
.st-admit-table tr.is-flagged td:first-child { box-shadow: inset 3px 0 0 var(--st-amber); }
.st-admit-dir { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.st-admit-sub { font-size: 12px; color: var(--st-text-muted); white-space: nowrap; }
/* A long flag wraps inside its pill instead of being squeezed. */
.st-admit-flag.st-badge { height: auto; min-height: 22px; max-width: 100%; padding: 3px 10px; border-radius: 11px; line-height: 1.3; white-space: normal; text-align: left; }
.st-admit-flag .st-icon { flex: 0 0 auto; }

@media (max-width: 1100px) {
  .st-admit-grid { grid-template-columns: minmax(0, 1fr); }
  .st-admit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .st-admit-choices { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .st-admit-choice { transition: none; }
}

/* ---------- paid tickets, refunds, money (Milestone D) ---------- */
/* Ticket types: the price next to the name, the money line above the list. */
.st-tickets-type__price { font-size: 13.5px; font-weight: 600; color: var(--st-text); font-variant-numeric: tabular-nums; }
.st-tickets-type__price.is-free { font-weight: 500; color: var(--st-text-dim); }
.st-tickets-paidnote {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--st-border); border-radius: var(--st-r-12); background: var(--st-bg-elev);
  font-size: 13px; line-height: 1.5; color: var(--st-text-dim);
}
.st-tickets-paidnote > .st-icon { flex: 0 0 auto; margin-top: 2px; color: var(--st-lavender); }
.st-tickets-paidnote > p { flex: 1 1 auto; margin: 0; }

/* The type form: the price with its live preview beside it. */
.st-tickets-pricebox { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 4px 16px; align-items: start; }
.st-tickets-fee {
  display: flex; flex-direction: column; gap: 2px; margin-top: 26px; padding: 9px 12px;
  border: 1px dashed var(--st-border-strong); border-radius: var(--st-r-10); background: rgba(109, 92, 255, 0.06);
}
.st-tickets-fee__line { margin: 0; font-size: 13px; line-height: 1.45; color: var(--st-text-dim); font-variant-numeric: tabular-nums; }
.st-tickets-fee__line.st-strong { color: var(--st-text); }
.st-tickets-fee__note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--st-text-muted); }
.st-tickets-warn { color: var(--st-amber); }

/* The refund policy: a choice, and the days when it is automatic. */
.st-tickets-policy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.st-tickets-policy .st-select { width: auto; min-width: 200px; }
.st-tickets-policy__until { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--st-text-dim); }
.st-tickets-policy__days { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }

/* Registrations: the refund requests inbox. */
.st-refund-reqs { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.st-refund-req {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) auto; align-items: center; gap: 8px 18px;
  padding: 10px 14px; border: 1px solid rgba(251, 191, 36, 0.28); border-radius: var(--st-r-12); background: rgba(251, 191, 36, 0.05);
}
.st-refund-req.is-decided { border-color: var(--st-border); background: var(--st-bg-elev); }
.st-refund-req__who, .st-refund-req__ask { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-refund-req__who > span, .st-refund-req__ask > span { overflow-wrap: anywhere; }
.st-refund-req__reason { font-size: 13px; color: var(--st-text-dim); quotes: '"' '"'; overflow-wrap: anywhere; }
.st-refund-req__actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.st-refund-reqs__more { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.st-refund-reqs__more > .st-refund-reqs { align-self: stretch; }

/* The Refund dialog. */
.st-refund-dialog .st-chips { flex-wrap: wrap; }
.st-refund-dialog__what { margin-top: 2px; }

/* Ticket types: discount codes (views/tickets-coupons.js). */
.st-coupon {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 20px;
  padding: 10px 14px; border: 1px solid var(--st-border); border-radius: var(--st-r-12); background: var(--st-bg-elev);
}
.st-coupon__main { min-width: 0; }
.st-coupon__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.st-coupon__code { font-family: var(--st-mono); font-size: 14px; font-weight: 650; letter-spacing: 0.04em; color: var(--st-text); }
.st-coupon.is-off .st-coupon__code { color: var(--st-text-dim); }
.st-coupon__off { font-size: 13.5px; font-weight: 600; color: var(--st-lavender); font-variant-numeric: tabular-nums; }
.st-coupon__facts { margin-top: 3px; font-size: 12.5px; color: var(--st-text-muted); overflow-wrap: anywhere; }
.st-coupon__codeinput { font-family: var(--st-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.st-coupon__preview:empty { display: none; }

/* Tickets > Money. */
.st-tickets-panel--money { max-width: 1240px; }
.st-money-tab__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.st-money-tab__lead { flex: 1 1 360px; color: var(--st-text-dim); }
.st-money-tab__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.st-money-tab__stats { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.st-money-tab__stats .st-stat__value { font-variant-numeric: tabular-nums; font-size: 19px; }
.st-money-tab__totals { margin-top: 8px; font-variant-numeric: tabular-nums; }
/* With spot payments or vendor fees: what is taken off on a row of its own, over what is left (three tiles). */
.st-money-tab__balance { display: flex; flex-direction: column; gap: 12px; }
/* (Two classes: the narrower layouts further down set the plain row's columns, not these.) */
.st-money-tab__balance .st-money-tab__stats--parts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.st-money-tab__balance .st-money-tab__stats--result { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.st-money-tab__sum { margin: 0; font-variant-numeric: tabular-nums; }
/* A refunded amount with the team's reason under it; a status with its small print. */
.st-money-refunded { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; max-width: 100%; }
.st-money-refunded__why { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--st-text-muted); }
.st-money-state__sub { flex: 1 0 100%; color: var(--st-text-muted); line-height: 1.35; }
.st-money-fees { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.35; }
.st-money-fee--returned { color: var(--st-text-muted); }
.st-money-fee--returned s { text-decoration-color: currentColor; }
/* Tickets, spots, vendor fees (views/tickets-money.js): the tag on a row, and what each kind brought in. */
/* The label goes under its tag when the column is narrow, so a spot or a vendor fee never widens the table. */
.st-money-for { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; min-width: 0; max-width: 100%; }
.st-money-for__label { min-width: 0; overflow-wrap: anywhere; color: var(--st-text-dim); }
.st-money-for > .st-badge { flex: 0 0 auto; }
.st-money-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.st-money-kind { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; max-width: 280px; min-width: 0; padding: 9px 12px; border-radius: var(--st-r-10); background: var(--st-bg-elev); border: 1px solid var(--st-border); }
.st-money-kind dt { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--st-text-muted); }
.st-money-kind dd { display: flex; flex-direction: column; gap: 1px; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--st-text-muted); }
.st-money-kind dd strong { font-size: 16px; font-weight: 600; color: var(--st-text); }

@media (max-width: 1280px) {
  .st-money-tab__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .st-refund-req { grid-template-columns: minmax(0, 1fr); }
  .st-refund-req__actions { justify-content: flex-start; }
  .st-tickets-pricebox { grid-template-columns: minmax(0, 1fr); }
  .st-tickets-fee { margin-top: 0; }
}
@media (max-width: 640px) {
  .st-money-tab__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- AKTVO admin box (Ticket types, admins only) and the free-only line ---------- */
.st-tickets-admin { margin-bottom: 16px; border-color: rgba(251, 191, 36, 0.35); }
.st-tickets-admin .st-card__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.st-tickets-admin__line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; }
.st-tickets-freeonly { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.st-tickets-freeonly > .st-icon { flex: 0 0 auto; margin-top: 2px; color: var(--st-lavender); }
