/* ticket-catraca design system — the single source of truth for tokens and component classes.
   Tailwind (CDN) is used for layout utilities only; everything with a visual identity lives here.
   Reference: docs/reference/design-system.md. Brand colours are injected by base.html from platform settings. */

/* ---------- 1. Tokens ---------- */
:root {
  --brand-primary: #4f46e5;
  --brand-accent: #0f172a;
  --brand-primary-hover: color-mix(in srgb, var(--brand-primary) 85%, black);
  --brand-primary-soft: color-mix(in srgb, var(--brand-primary) 9%, white);
  --brand-primary-softer: color-mix(in srgb, var(--brand-primary) 5%, white);
  --brand-primary-ring: color-mix(in srgb, var(--brand-primary) 28%, white);
  --brand-primary-text: color-mix(in srgb, var(--brand-primary) 80%, black);
  --brand-accent-soft: color-mix(in srgb, var(--brand-accent) 6%, white);
  --brand-accent-hover: color-mix(in srgb, var(--brand-accent) 88%, white);

  --ink-900: #0f172a; --ink-800: #1e293b; --ink-700: #334155; --ink-600: #475569;
  --ink-500: #64748b; --ink-400: #94a3b8; --ink-300: #cbd5e1;
  --line: #e2e8f0; --line-strong: #cbd5e1; --line-soft: #f1f5f9;
  --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #f1f5f9; --canvas: #f3f5f9;

  --ok: #15803d; --ok-bg: #dcfce7; --ok-line: #bbf7d0; --ok-soft: #f0fdf4;
  --warn: #b45309; --warn-bg: #fef3c7; --warn-line: #fde68a; --warn-soft: #fffbeb;
  --danger: #b91c1c; --danger-bg: #fee2e2; --danger-line: #fecaca; --danger-soft: #fef2f2;
  --info: #1d4ed8; --info-bg: #dbeafe; --info-line: #bfdbfe; --info-soft: #eff6ff;

  --radius-sm: .5rem; --radius: .75rem; --radius-lg: 1rem; --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 12px rgba(15, 23, 42, .08), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .06);
  --focus-ring: #f59e0b;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --control-h: 2.5rem; --control-h-sm: 2rem; --control-h-lg: 3rem;
  --topbar-h: 4rem; --sidebar-w: 16.5rem; --gutter: 1rem;
}
@media (min-width: 640px) { :root { --gutter: 1.5rem; } }

/* ---------- 2. Base ---------- */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 1rem); }
body { font-family: var(--font-sans); background: var(--canvas); color: var(--ink-900); -webkit-font-smoothing: antialiased; line-height: 1.5; overflow-x: hidden; }
body.scroll-lock { overflow: hidden; }
[x-cloak] { display: none !important; }
h1, h2, h3, h4 { letter-spacing: -.01em; overflow-wrap: anywhere; }
p, li, dd { overflow-wrap: anywhere; }
img, svg, video { max-width: 100%; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
::selection { background: var(--brand-primary-ring); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: .75rem; top: -4rem; z-index: 100; background: var(--ink-900); color: #fff; padding: .5rem .875rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .875rem; transition: top .15s; }
.skip-link:focus { top: .75rem; }
.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }
.icon { width: 1.125rem; height: 1.125rem; flex: none; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.container-page { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { width: 100%; max-width: 56rem; margin-inline: auto; padding-inline: var(--gutter); }
.container-tight { width: 100%; max-width: 44rem; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- 3. Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: var(--control-h); padding: .5rem 1rem; border-radius: .625rem; font-weight: 600; font-size: .875rem; line-height: 1.25rem; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; vertical-align: middle; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; -webkit-tap-highlight-color: transparent; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-primary); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover:not(:disabled) { background: var(--brand-primary-hover); }
.btn-secondary { background: var(--surface); color: var(--ink-800); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-400); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink-900); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #991b1b; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); }
.btn-soft { background: var(--brand-primary-soft); color: var(--brand-primary-text); }
.btn-soft:hover:not(:disabled) { background: var(--brand-primary-ring); }
.btn-link { background: transparent; color: var(--brand-primary-text); padding-inline: .25rem; min-height: auto; text-decoration: underline; text-underline-offset: 2px; }
.btn-sm { min-height: var(--control-h-sm); padding: .3rem .75rem; font-size: .8125rem; border-radius: .5rem; }
.btn-lg { min-height: var(--control-h-lg); padding: .75rem 1.375rem; font-size: 1rem; border-radius: .75rem; }
.btn-icon { padding: .5rem; width: var(--control-h); }
.btn-icon.btn-sm { width: var(--control-h-sm); padding: .3rem; }
.btn-block { display: flex; width: 100%; }
.btn .icon { width: 1.125rem; height: 1.125rem; }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
@media (pointer: coarse) { .btn-sm { min-height: 2.25rem; } }

/* ---------- 4. Forms ---------- */
.input, .select, .textarea { display: block; width: 100%; min-height: var(--control-h); border: 1px solid var(--line-strong); border-radius: .625rem; padding: .5rem .75rem; font-size: .9375rem; line-height: 1.375rem; background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-ring); }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] { background: var(--surface-2); color: var(--ink-600); cursor: not-allowed; box-shadow: none; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 5rem; resize: vertical; }
.select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; }
.input-sm, .select-sm, .textarea-sm { min-height: var(--control-h-sm); padding: .3rem .6rem; font-size: .8125rem; line-height: 1.25rem; border-radius: .5rem; }
.select-sm:not([multiple]) { padding-right: 2rem; background-position: right .5rem center; }
.input-auto { width: auto; display: inline-block; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-primary); width: 1rem; height: 1rem; flex: none; }
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"] { min-width: 0; width: 100%; max-width: 100%; display: block; -webkit-appearance: none; appearance: none; }
/* iOS Safari: date/time controls keep an intrinsic width and centre their value unless the appearance is reset; a control under 16px zooms the page on focus */
input[type="date"]::-webkit-date-and-time-value, input[type="datetime-local"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.375rem; }
input::-webkit-datetime-edit { min-width: 0; padding: 0; }
.input, .textarea { -webkit-appearance: none; appearance: none; }
@media (max-width: 639px) { .input, .select, .textarea, .input-sm, .select-sm, .textarea-sm, .stepper input { font-size: 1rem; } }
.label { display: block; font-size: .8125rem; font-weight: 600; color: var(--ink-700); margin-bottom: .3rem; }
.help { font-size: .75rem; color: var(--ink-500); margin-top: .3rem; }
.field-error { font-size: .75rem; color: var(--danger); margin-top: .3rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .875rem; cursor: pointer; }
.check input { margin-top: .2rem; }
.form-grid { display: grid; gap: .875rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.fieldset > legend { padding-inline: .4rem; font-weight: 600; font-size: .875rem; }

/* ---------- 5. Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
a.card, .card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover, .card-link:hover { border-color: var(--ink-300); box-shadow: var(--shadow); }
.card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .875rem 1rem; border-bottom: 1px solid var(--line); }
.card-body { padding: 1rem; }
.card-footer { padding: .875rem 1rem; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card-title { font-weight: 600; font-size: 1rem; color: var(--ink-900); }
.card-muted { background: var(--surface-2); box-shadow: none; }
.card-accent { border-top: 3px solid var(--brand-primary); }
.panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .875rem; }
.panel-brand { background: var(--brand-primary-softer); border: 1px solid var(--brand-primary-ring); border-radius: var(--radius-sm); padding: .875rem; }
.hero { background: linear-gradient(135deg, var(--brand-primary-soft), #fff 60%); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; }
@media (min-width: 640px) { .hero { padding: 2rem 2.25rem; } }
.cover-placeholder { background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent)); }
.stripe { border-left: 4px solid var(--brand-primary); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-500); }
.empty-title { font-weight: 600; color: var(--ink-800); font-size: 1rem; }
.empty-icon { width: 3rem; height: 3rem; margin: 0 auto .75rem; border-radius: var(--radius-full); background: var(--brand-primary-soft); color: var(--brand-primary-text); display: flex; align-items: center; justify-content: center; }

/* ---------- 6. Page structure ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-header > div { min-width: 0; }
.page-title { font-size: 1.375rem; font-weight: 700; line-height: 1.2; color: var(--ink-900); }
@media (min-width: 640px) { .page-title { font-size: 1.625rem; } }
.page-subtitle { font-size: .875rem; color: var(--ink-500); margin-top: .25rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.section-title { font-size: 1.0625rem; font-weight: 600; color: var(--ink-900); }
.eyebrow { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); }
.subtle { color: var(--ink-500); font-size: .875rem; }
.note { font-size: .75rem; color: var(--ink-500); }
.link { color: var(--brand-primary-text); text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--brand-primary-hover); }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .625rem .75rem; }
.toolbar > * { min-width: 0; }
.toolbar .field { flex: 1 1 10rem; }
@media (max-width: 639px) { .toolbar .field { flex-basis: 100%; } .toolbar .btn { flex: 1 1 auto; } }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; }
.stat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .875rem 1rem; min-width: 0; box-shadow: var(--shadow-xs); }
.stat .value { font-size: 1.375rem; font-weight: 700; color: var(--ink-900); line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .title { font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); margin-top: .35rem; font-weight: 600; }
.stat-accent { border-top: 3px solid var(--brand-primary); }
.stat-grid-compact { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); }
.stat-grid-compact .stat { padding: .6rem .5rem; text-align: center; }
.stat-grid-compact .stat .value { font-size: 1.25rem; }
.band-accent { background: var(--brand-accent); color: #fff; }
.band-accent .eyebrow { color: rgba(255, 255, 255, .7); }
.stat-ok .value { color: var(--ok); }
.stat-warn .value { color: var(--warn); }
.stat-danger .value { color: var(--danger); }
.kv { display: grid; grid-template-columns: minmax(6rem, 30%) 1fr; gap: .35rem .75rem; font-size: .875rem; }
.kv dt { color: var(--ink-500); }
.kv dd { color: var(--ink-900); min-width: 0; }

/* ---------- 7. Feedback ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: var(--radius-full); font-size: .72rem; font-weight: 600; line-height: 1.1rem; white-space: nowrap; border: 1px solid transparent; vertical-align: middle; }
.badge-green { background: var(--ok-bg); color: #166534; }
.badge-amber { background: var(--warn-bg); color: #92400e; }
.badge-red { background: var(--danger-bg); color: #991b1b; }
.badge-slate { background: var(--line); color: var(--ink-700); }
.badge-blue { background: var(--info-bg); color: #1e40af; }
.badge-brand { background: var(--brand-primary-soft); color: var(--brand-primary-text); }
.badge-outline { background: transparent; border-color: var(--line-strong); color: var(--ink-600); }
.badge-success { background: var(--ok-bg); color: #166534; }
.badge-warning { background: var(--warn-bg); color: #92400e; }
.badge-danger { background: var(--danger-bg); color: #991b1b; }
.badge-info { background: var(--info-bg); color: #1e40af; }
.badge-muted { background: var(--line); color: var(--ink-700); }
.flash, .alert { display: block; border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .875rem; border: 1px solid; border-left-width: 4px; background: var(--surface-2); border-color: var(--line); color: var(--ink-700); }
.flash-success, .alert-success { background: var(--ok-soft); border-color: var(--ok-line); border-left-color: var(--ok); color: #166534; }
.flash-error, .alert-error, .alert-danger { background: var(--danger-soft); border-color: var(--danger-line); border-left-color: var(--danger); color: #991b1b; }
.flash-warning, .alert-warning { background: var(--warn-soft); border-color: var(--warn-line); border-left-color: var(--warn); color: #92400e; }
.flash-info, .alert-info { background: var(--info-soft); border-color: var(--info-line); border-left-color: var(--info); color: #1e40af; }
.flash a, .alert a { text-decoration: underline; text-underline-offset: 2px; }
.test-banner { background: repeating-linear-gradient(-45deg, #fde68a 0 12px, #fef3c7 12px 24px); color: #78350f; font-size: .75rem; font-weight: 700; text-align: center; padding: .3rem .75rem; letter-spacing: .01em; }
.result-panel { border-radius: var(--radius-lg); padding: 1.25rem; text-align: center; color: #fff; box-shadow: var(--shadow); }
.result-ok { background: #16a34a; } .result-exit { background: #475569; } .result-warn { background: #d97706; } .result-error { background: #dc2626; }

/* ---------- 8. Tables and lists ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.card > .table-wrap:first-child > .table, .card > .table-wrap:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.table { width: 100%; font-size: .875rem; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500); padding: .65rem .875rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: .65rem .875rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td .btn-sm, .table td.mono, .table td .mono, .table td.font-mono, .table td .font-mono, .table td .badge { white-space: nowrap; }
.table-compact th, .table-compact td { padding: .45rem .625rem; }
.table-plain th { background: transparent; }
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--line-soft); }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 0; font-size: .875rem; }
.list-item > * { min-width: 0; }
.qr svg { width: 100%; height: auto; max-width: 280px; }

/* ---------- 9. Navigation ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px); -webkit-backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: .5rem; min-height: var(--topbar-h); }
.topbar-dark { background: var(--brand-accent); border-bottom-color: rgba(255, 255, 255, .08); color: #fff; }
.topbar-dark .btn-ghost { color: rgba(255, 255, 255, .85); }
.topbar-dark .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar-dark .btn-secondary { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .18); box-shadow: none; }
.topbar-dark .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.0625rem; color: var(--brand-accent); text-decoration: none; min-width: 0; }
.brand img { height: 2rem; width: auto; }
.brand-mark { width: 2rem; height: 2rem; border-radius: .6rem; background: var(--brand-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; flex: none; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-dark .brand { color: #fff; }
.nav-top { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: .5rem; font-size: .875rem; font-weight: 500; color: var(--ink-600); text-decoration: none; transition: background .15s, color .15s; }
.nav-top:hover { background: var(--surface-3); color: var(--ink-900); }
.nav-top.active, .nav-top[aria-current="page"] { color: var(--brand-primary-text); background: var(--brand-primary-soft); font-weight: 600; }
.avatar { width: 2rem; height: 2rem; border-radius: var(--radius-full); background: var(--brand-primary-soft); color: var(--brand-primary-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex: none; text-transform: uppercase; }
.topbar-dark .avatar { background: rgba(255, 255, 255, .14); color: #fff; }
.menu { position: absolute; right: 0; top: calc(100% + .375rem); min-width: 14rem; max-width: calc(100vw - 2rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .375rem; z-index: 40; color: var(--ink-900); }
.menu-head { padding: .5rem .75rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .25rem; }
.menu-head strong { display: block; font-size: .875rem; overflow-wrap: anywhere; }
.menu-head span { display: block; font-size: .75rem; color: var(--ink-500); overflow-wrap: anywhere; }
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .75rem; border-radius: .5rem; font-size: .875rem; font-weight: 500; color: var(--ink-700); text-align: left; background: transparent; border: 0; cursor: pointer; text-decoration: none; }
.menu-item:hover { background: var(--surface-3); color: var(--ink-900); }
.menu-item.active, .menu-item[aria-current="page"] { background: var(--brand-primary-soft); color: var(--brand-primary-text); }
.menu-item .icon { color: var(--ink-500); }
.menu-item.active .icon { color: inherit; }
.menu-sep { border: 0; border-top: 1px solid var(--line); margin: .3rem 0; }
.menu-label { padding: .5rem .75rem .2rem; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); }
.mobile-menu { background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow); max-height: calc(100dvh - var(--topbar-h)); overflow-y: auto; }
.mobile-menu .menu-item { padding: .7rem .75rem; font-size: .9375rem; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .625rem .8rem; margin-bottom: -1px; font-size: .875rem; font-weight: 500; color: var(--ink-500); border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; scroll-snap-align: start; transition: color .15s, border-color .15s; }
.tab:hover { color: var(--ink-900); }
.tab.active, .tab[aria-current="page"] { color: var(--brand-primary-text); border-bottom-color: var(--brand-primary); font-weight: 600; }
.tabs-pills { border-bottom: 0; gap: .375rem; }
.tabs-pills .tab { border: 1px solid var(--line-strong); border-radius: var(--radius-full); padding: .35rem .8rem; margin-bottom: 0; background: var(--surface); }
.tabs-pills .tab.active, .tabs-pills .tab[aria-current="page"] { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.segmented { display: inline-flex; padding: .2rem; background: var(--surface-3); border-radius: .625rem; gap: .2rem; max-width: 100%; overflow-x: auto; }
.segmented .btn { min-height: 2rem; padding: .3rem .7rem; font-size: .8125rem; border-radius: .45rem; background: transparent; color: var(--ink-600); }
.segmented .btn.active, .segmented .btn[aria-pressed="true"], .segmented .btn[aria-selected="true"] { background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-xs); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; font-size: .8125rem; color: var(--ink-500); }
.breadcrumb a { color: var(--ink-600); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink-900); text-decoration: underline; }

/* Backoffice shell */
.admin-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { width: var(--sidebar-w); flex: none; background: var(--brand-accent); color: #e2e8f0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar .topbar-inner { min-height: 3.75rem; padding-inline: .75rem; }
@media (min-width: 1024px) { .admin-topbar .topbar-inner { padding-inline: 1.5rem; } }
.admin-heading { font-weight: 600; font-size: 1rem; color: var(--ink-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.admin-content { flex: 1; padding: 1rem var(--gutter) 3rem; width: 100%; max-width: 90rem; }
@media (min-width: 1024px) { .admin-content { padding: 1.5rem 2rem 4rem; } }
.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(20rem, 88vw); background: var(--brand-accent); color: #e2e8f0; display: flex; flex-direction: column; overflow-y: auto; box-shadow: var(--shadow-lg); overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
.drawer-close { position: absolute; top: .75rem; right: .75rem; }
.nav-brand { padding: 1rem 1rem .875rem; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.nav-brand a { font-weight: 700; color: #fff; font-size: 1.0625rem; text-decoration: none; display: block; overflow-wrap: anywhere; }
.nav-brand p { font-size: .75rem; color: var(--ink-400); margin-top: .15rem; }
.nav-groups { padding: .5rem .625rem 1rem; display: flex; flex-direction: column; gap: .125rem; }
.nav-group { padding: .9rem .625rem .3rem; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-400); }
.nav-link { display: flex; align-items: center; gap: .625rem; padding: .5rem .625rem; border-radius: .5rem; font-size: .875rem; color: #cbd5e1; text-decoration: none; transition: background .15s, color .15s; }
.nav-link .icon { width: 1.125rem; height: 1.125rem; opacity: .75; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.active, .nav-link[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-primary); }
.nav-link.active .icon { opacity: 1; }
.nav-link-muted { color: var(--ink-400); }

/* ---------- 10. Utilities and print ---------- */
/* Grid children may shrink below their content (a long unbreakable string never widens the page) and any
   column span collapses to the full row on phones, where every grid is a single column. */
.grid > * { min-width: 0; }
@media (max-width: 639px) { .grid > [class*="col-span-"] { grid-column: 1 / -1; } }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; padding-inline: .35rem; border-radius: var(--radius-full); background: rgba(255, 255, 255, .16); font-size: .6875rem; font-weight: 700; margin-left: auto; }
.legend-swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: .2rem; vertical-align: middle; margin-right: .25rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .drawer, .drawer-backdrop, .test-banner, .skip-link, .no-print, footer { display: none !important; }
  .card { box-shadow: none; }
  .admin-content { padding: 0; }
}

/* ---------- 11. Identity: display type, brand mark, home ---------- */
:root { --font-display: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif; }
.page-title, .section-title, .hero-title, .banner-title, .card-title, .event-title, .empty-title, .brand-name, .home-intro-title { font-family: var(--font-display); }
.brand-mark { width: 2.125rem; height: 2.125rem; border-radius: 0; font-family: var(--font-display); font-size: .95rem;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M5 8a3 3 0 0 1 3-3h16a3 3 0 0 1 3 3v5.1a2.9 2.9 0 0 0 0 5.8V24a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3v-5.1a2.9 2.9 0 0 0 0-5.8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M5 8a3 3 0 0 1 3-3h16a3 3 0 0 1 3 3v5.1a2.9 2.9 0 0 0 0 5.8V24a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3v-5.1a2.9 2.9 0 0 0 0-5.8z'/%3E%3C/svg%3E") center / contain no-repeat; }
.brand-mark .icon { width: 1.05rem; height: 1.05rem; }

/* Home hero: brand gradient or banner carousel, then the search card and category chips */
.home-hero { position: relative; margin-bottom: 1.5rem; }
.hero-brand { position: relative; overflow: hidden; border-radius: var(--radius-lg); color: #fff; padding: 2.75rem 1.5rem 4.75rem;
  background: linear-gradient(118deg, var(--brand-accent) 0%, color-mix(in srgb, var(--brand-accent) 45%, var(--brand-primary)) 58%, var(--brand-primary) 100%); }
.hero-brand::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.6px); background-size: 22px 22px; opacity: .7; pointer-events: none; }
.hero-brand::after { content: ""; position: absolute; right: -12%; top: -55%; width: 58%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 62%); pointer-events: none; }
.hero-brand-inner { position: relative; max-width: 40rem; }
.hero-kicker { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .72); margin-bottom: .75rem; }
.hero-title { font-size: clamp(1.75rem, 4.2vw, 2.875rem); font-weight: 800; line-height: 1.08; letter-spacing: -.025em; }
.hero-subtitle { margin-top: .75rem; font-size: 1.0625rem; color: rgba(255, 255, 255, .84); max-width: 34rem; line-height: 1.5; }
@media (min-width: 640px) { .hero-brand { padding: 4rem 3rem 6rem; } }
.search-card { position: relative; margin: -3rem .75rem 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1rem; }
@media (min-width: 640px) { .search-card { margin: -3.5rem 2rem 0; padding: 1.25rem 1.5rem; } }
.has-banners .search-card { margin-top: 1rem; margin-inline: 0; box-shadow: var(--shadow-sm); }
.home-intro { margin: .25rem 0 1.75rem; max-width: 46rem; }
.home-intro-title { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.home-intro-text { color: var(--ink-500); margin-top: .25rem; font-size: .9375rem; }
.chips { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: .25rem .125rem; margin-top: 1rem; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
@media (max-width: 639px) { .chips { padding-right: 2.5rem; mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); } }
.chip { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .9rem; border-radius: var(--radius-full); border: 1px solid var(--line-strong); background: var(--surface); font-size: .8125rem; font-weight: 500; color: var(--ink-700); text-decoration: none; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.chip:hover { border-color: var(--ink-400); color: var(--ink-900); }
.chip.active { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.home-section { margin-bottom: 2.25rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .875rem; }
.section-head .section-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }

/* Event cards */
.event-card { position: relative; display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
/* the title link is stretched over the whole card: clicking anywhere on it opens the event (the cover link sits above) */
.event-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.event-card .event-cover { position: relative; z-index: 2; }
.event-card .event-link { position: relative; z-index: 2; }
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-300); }
.event-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-3); }
.event-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.event-card:hover .event-cover img { transform: scale(1.03); }
.cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent)); }
.cover-placeholder::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1.5px); background-size: 18px 18px; }
.cover-placeholder::after { content: ""; position: absolute; right: -20%; bottom: -55%; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .2), transparent 62%); }
.cover-placeholder span { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 3.25rem; color: rgba(255, 255, 255, .42); letter-spacing: -.04em; }
.date-chip { position: absolute; top: .75rem; left: .75rem; display: flex; flex-direction: column; align-items: center; min-width: 3rem; padding: .4rem .5rem .35rem; border-radius: .625rem; background: rgba(255, 255, 255, .96); color: var(--ink-900); box-shadow: var(--shadow-sm); line-height: 1; }
.date-chip strong { font-family: var(--font-display); font-size: 1.125rem; font-weight: 800; }
.date-chip span { font-size: .625rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); margin-top: .2rem; font-weight: 700; }
.cover-badge { position: absolute; top: .75rem; right: .75rem; }
.event-body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.event-title { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; letter-spacing: -.01em; }
.event-title a { color: inherit; text-decoration: none; }
.event-title a:hover { color: var(--brand-primary-text); }
.event-meta { display: flex; align-items: flex-start; gap: .4rem; font-size: .875rem; color: var(--ink-600); }
.event-meta .icon { width: 1rem; height: 1rem; color: var(--ink-400); margin-top: .15rem; }
.event-footer { margin-top: auto; padding-top: .625rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; border-top: 1px dashed var(--line-strong); }
.event-price { font-weight: 700; font-size: .9375rem; color: var(--ink-900); }
.event-price small { font-weight: 500; color: var(--ink-500); font-size: .75rem; }
.event-link { display: inline-flex; align-items: center; gap: .25rem; font-size: .8125rem; font-weight: 600; color: var(--brand-primary-text); }

/* Benefits strip and organizer call to action */
.features { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 768px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature { display: flex; gap: .875rem; padding: 1.125rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feature-icon { flex: none; width: 2.5rem; height: 2.5rem; border-radius: .75rem; background: var(--brand-primary-soft); color: var(--brand-primary-text); display: inline-flex; align-items: center; justify-content: center; }
.feature-title { font-weight: 600; font-size: .9375rem; }
.feature-text { font-size: .8125rem; color: var(--ink-500); margin-top: .2rem; line-height: 1.45; }
.organizer-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--brand-primary-softer); border: 1px solid var(--brand-primary-ring); }

/* Site footer */
.site-footer { margin-top: 3rem; background: var(--brand-accent); color: rgba(255, 255, 255, .78); }
.footer-grid { display: grid; gap: 2rem; padding: 2.5rem 0 2rem; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-brand .brand { color: #fff; }
.footer-text { margin-top: .75rem; font-size: .875rem; max-width: 26rem; line-height: 1.55; }
.footer-title { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .55); margin-bottom: .75rem; }
.footer-links { display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom)); font-size: .75rem; color: rgba(255, 255, 255, .55); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

/* ---------- Wallet: credentials that look like tickets (account/wallet.html, account/ticket.html) ---------- */
.wallet-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--brand-accent), color-mix(in srgb, var(--brand-primary) 75%, #0f172a)); color: #fff; box-shadow: var(--shadow); }
.wallet-hero .page-title, .wallet-hero .eyebrow { color: #fff; margin: 0; }
.wallet-hero .eyebrow { opacity: .78; }
.wallet-hero p { color: rgba(255, 255, 255, .8); }
.wallet-stats { display: flex; gap: .5rem; }
.wallet-stat { display: flex; flex-direction: column; align-items: center; min-width: 4.75rem; padding: .55rem .75rem; border-radius: var(--radius); background: rgba(255, 255, 255, .14); backdrop-filter: blur(4px); }
.wallet-stat strong { font-family: var(--font-display, var(--font-sans)); font-size: 1.5rem; line-height: 1; }
.wallet-stat span { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; opacity: .85; margin-top: .25rem; }

.ticket { position: relative; display: grid; grid-template-columns: 1fr; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.ticket:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
a.ticket:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-lg); }
.ticket-cover { position: relative; min-height: 11rem; background: var(--brand-accent) center top / cover no-repeat; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: .2rem; padding: 1rem 1.1rem; }
.ticket-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 23, 42, .06) 0%, rgba(15, 23, 42, .74) 68%, rgba(15, 23, 42, .9) 100%); }
.ticket-cover > * { position: relative; }
.ticket-cover .eyebrow { color: rgba(255, 255, 255, .75); }
.ticket-title { font-family: var(--font-display, var(--font-sans)); font-weight: 700; font-size: 1.2rem; line-height: 1.2; letter-spacing: -.01em; text-shadow: 0 1px 2px rgba(15, 23, 42, .4); }
.ticket-when { display: flex; align-items: center; gap: .4rem; font-size: .8125rem; color: rgba(255, 255, 255, .92); }
.ticket-when .icon { flex: none; opacity: .85; }
.ticket-date { position: absolute; top: .85rem; left: .9rem; display: flex; flex-direction: column; align-items: center; min-width: 3.25rem; padding: .4rem .45rem .35rem; border-radius: .8rem; background: rgba(255, 255, 255, .94); color: var(--ink-900); line-height: 1; box-shadow: var(--shadow-sm); }
.ticket-date strong { font-family: var(--font-display, var(--font-sans)); font-size: 1.45rem; }
.ticket-date span { font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-600); margin-top: .2rem; }
.ticket-soon { position: absolute; top: .95rem; right: .9rem; }
.ticket-stub { position: relative; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; border-top: 2px dashed var(--line-strong); background: var(--surface); }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--canvas); border: 1px solid var(--line); top: -.8rem; }
.ticket-stub::before { left: -.8rem; }
.ticket-stub::after { right: -.8rem; }
.ticket-seat { font-family: var(--font-display, var(--font-sans)); font-weight: 800; font-size: 1.55rem; letter-spacing: -.02em; line-height: 1; overflow-wrap: anywhere; }
.ticket-seat small { display: block; font-family: var(--font-sans); font-weight: 600; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-500); margin-bottom: .35rem; }
.ticket-code { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: var(--ink-500); }
.ticket-cta { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; color: var(--brand-primary-text); font-size: .875rem; margin-top: auto; }
.ticket-past { opacity: .8; filter: saturate(.75); }
.ticket-past .ticket-cover::before { background: linear-gradient(180deg, rgba(15, 23, 42, .4), rgba(15, 23, 42, .86)); }
@media (min-width: 640px) {
  .ticket { grid-template-columns: 1.35fr 1fr; }
  .ticket-cover { min-height: 12.5rem; }
  .ticket-stub { border-top: 0; border-left: 2px dashed var(--line-strong); }
  .ticket-stub::before, .ticket-stub::after { left: -.8rem; right: auto; }
  .ticket-stub::before { top: -.8rem; }
  .ticket-stub::after { top: auto; bottom: -.8rem; }
}

/* the credential page: cover, facts, a tear line and the QR on a white slab */
.pass { max-width: 30rem; margin: 0 auto; border-radius: 1.25rem; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; }
.pass-cover { position: relative; min-height: 13.5rem; background: var(--brand-accent) center top / cover no-repeat; color: #fff; padding: 1.25rem 1.4rem; display: flex; flex-direction: column; justify-content: flex-end; gap: .35rem; }
.pass-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 23, 42, .08) 0%, rgba(15, 23, 42, .78) 62%, rgba(15, 23, 42, .9) 100%); }
.pass-cover > * { position: relative; }
.pass-cover .eyebrow { color: rgba(255, 255, 255, .75); }
.pass-title { font-family: var(--font-display, var(--font-sans)); font-weight: 800; font-size: 1.5rem; line-height: 1.15; letter-spacing: -.02em; text-shadow: 0 1px 2px rgba(15, 23, 42, .4); }
.pass-line { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .875rem; color: rgba(255, 255, 255, .92); }
.pass-line .icon { flex: none; opacity: .85; }
.pass-line a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.pass-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; padding: 1rem 1.4rem .25rem; }
.pass-fact .eyebrow { margin-bottom: .15rem; }
.pass-fact strong { font-weight: 700; overflow-wrap: anywhere; }
.pass-seat { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border-radius: var(--radius); background: var(--brand-primary-softer); border: 1px solid var(--brand-primary-soft); }
.pass-seat .ticket-seat { color: var(--brand-primary-text); }
.pass-tear { position: relative; height: 0; border-top: 2px dashed var(--line-strong); margin: 1rem 0 .25rem; }
.pass-tear::before, .pass-tear::after { content: ""; position: absolute; top: -.85rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--canvas); border: 1px solid var(--line); }
.pass-tear::before { left: -.9rem; }
.pass-tear::after { right: -.9rem; }
.pass-qr { padding: 1rem 1.4rem .5rem; text-align: center; }
.pass-qr .qr { margin: 0 auto; padding: .85rem; background: #fff; border-radius: 1.1rem; border: 1px solid var(--line); width: fit-content; box-shadow: 0 0 0 6px var(--surface-2); }
.pass-qr .qr svg { width: 100%; height: auto; max-width: 240px; display: block; }
.pass-code { font-family: var(--font-mono); font-size: 1.05rem; letter-spacing: .22em; margin-top: .75rem; color: var(--ink-900); }
.pass-hint { font-size: .75rem; color: var(--ink-500); margin-top: .35rem; }
.pass-body { padding: .75rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .9rem; }


/* ---------- 12. Backoffice clarity: sectioned forms, in-page index, choice cards, structure chain, checklists ----------
   Components that explain a screen: one sentence of plain language per section, essentials apart from options, and
   the chain organização → local → evento → sessão → tipo → lote drawn the same way everywhere (docs/work/active/admin-ux-clarity). */
.form-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; scroll-margin-top: calc(var(--topbar-h, 3.5rem) + 1rem); }
@media (min-width: 640px) { .form-section { padding: 1.25rem; } }
.form-section-head { margin-bottom: .9rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line-soft); }
.form-section-title { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: 1.0625rem; font-weight: 600; color: var(--ink-900); }
.form-section-step { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: var(--radius-full); background: var(--brand-primary); color: #fff; font-size: .75rem; font-weight: 700; flex: none; }
.form-section-lead { font-size: .8125rem; color: var(--ink-600); margin-top: .35rem; line-height: 1.55; max-width: 60rem; }
.form-section-lead a, .help a, .help-intro a { text-decoration: underline; text-underline-offset: 2px; }
.help-intro { font-size: .8125rem; color: var(--ink-600); line-height: 1.55; }
.form-optional { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); margin-left: .35rem; white-space: nowrap; }
.page-index { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; }
.page-index::-webkit-scrollbar { display: none; }
.page-index a { flex: none; font-size: .8125rem; color: var(--ink-600); padding: .35rem .7rem; border-radius: var(--radius-full); border: 1px solid transparent; white-space: nowrap; text-decoration: none; }
.page-index a:hover { background: var(--surface-2); color: var(--ink-900); }
.page-index a.active { background: var(--brand-primary-soft); color: var(--brand-primary-text); border-color: var(--brand-primary-soft); font-weight: 600; }
@media (min-width: 1024px) { .page-index-side { flex-direction: column; position: sticky; top: calc(var(--topbar-h, 3.5rem) + 1rem); overflow: visible; }
  .page-index-side a { white-space: normal; border-radius: var(--radius-sm); } }
.check-cards { display: grid; gap: .625rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .check-cards { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); } }
.check-card { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.check-card:hover { border-color: var(--ink-300); }
.check-card:has(input:checked) { border-color: var(--brand-primary); box-shadow: 0 0 0 1px var(--brand-primary); }
.check-card:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.check-card input { margin-top: .2rem; }
.check-card > span { min-width: 0; }
.check-card-title { display: block; font-size: .875rem; font-weight: 600; color: var(--ink-900); }
.check-card-text { display: block; font-size: .75rem; color: var(--ink-500); margin-top: .15rem; line-height: 1.5; }
.chain { display: grid; gap: .5rem; grid-template-columns: 1fr; counter-reset: chain; }
@media (min-width: 640px) { .chain { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); } }
.chain-item { position: relative; padding: .7rem .8rem .7rem 2.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: .8125rem; line-height: 1.45; color: var(--ink-700); }
.chain-item::before { counter-increment: chain; content: counter(chain); position: absolute; left: .7rem; top: .75rem; width: 1.1rem; height: 1.1rem; border-radius: var(--radius-full); background: var(--brand-gold, #b48a4a); color: #fff; font-size: .6875rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chain-item strong { display: block; color: var(--ink-900); font-size: .875rem; }
.chain-item-sub { display: block; margin-top: .25rem; padding-top: .25rem; border-top: 1px dashed var(--line-strong); color: var(--ink-500); font-size: .75rem; }
.checklist { display: flex; flex-direction: column; gap: .4rem; }
.checklist-item { display: flex; gap: .6rem; align-items: flex-start; font-size: .875rem; color: var(--ink-800); }
.checklist-item::before { content: ""; flex: none; width: 1.1rem; height: 1.1rem; margin-top: .1rem; border-radius: var(--radius-full); border: 2px solid var(--warn); background: var(--warn-bg); }
.checklist-item.is-done { color: var(--ink-500); }
.checklist-item.is-done::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E") center / 80% no-repeat; }
.list-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; counter-reset: step; }
.list-steps li { position: relative; padding-left: 2.2rem; font-size: .875rem; line-height: 1.5; color: var(--ink-800); }
.list-steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: .05rem; width: 1.55rem; height: 1.55rem; border-radius: var(--radius-full); background: var(--surface-3); color: var(--ink-700); font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.list-steps li.is-done { color: var(--ink-500); }
.list-steps li.is-done::before { content: "✓"; background: var(--ok); color: #fff; }
.list-steps li.is-current::before { background: var(--brand-primary); color: #fff; }
.list-steps li strong { color: var(--ink-900); }
.state-line { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8125rem; color: var(--ink-500); }
.state-line .badge { vertical-align: middle; }

/* ---------- 13. Backoffice reading aids: timelines, meters, key facts ----------
   A lot timeline (lots in order, the current one lit), a quantity meter (sold · held · free) reused wherever a
   capacity is shown, and a compact facts strip for detail pages. Same warm palette, no new tokens. */
.timeline { display: flex; flex-direction: column; gap: .75rem; position: relative; counter-reset: lot; }
.timeline-item { position: relative; display: grid; gap: .6rem; padding: .9rem 1rem .9rem 3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.timeline-item::before { counter-increment: lot; content: counter(lot); position: absolute; left: .9rem; top: .95rem; width: 1.5rem; height: 1.5rem; border-radius: var(--radius-full); background: var(--surface-3); color: var(--ink-700); font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 1.6rem; top: 2.6rem; bottom: -.85rem; border-left: 2px dashed var(--line-strong); }
.timeline-item.is-current { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); background: var(--ok-soft); }
.timeline-item.is-current::before { background: var(--ok); color: #fff; }
.timeline-item.is-closed, .timeline-item.is-archived { color: var(--ink-500); }
.timeline-item.is-closed::before, .timeline-item.is-archived::before { background: var(--surface-2); color: var(--ink-400); }
.timeline-item.is-upcoming::before { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-line); }
.timeline-item.is-sold_out::before { background: var(--danger-bg); color: var(--danger); }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.timeline-title { font-size: 1rem; font-weight: 600; color: var(--ink-900); }
.timeline-item.is-closed .timeline-title, .timeline-item.is-archived .timeline-title { color: var(--ink-600); text-decoration: line-through; text-decoration-color: var(--ink-300); }
.timeline-meta { font-size: .8125rem; color: var(--ink-600); }
.timeline-prices { display: flex; flex-wrap: wrap; gap: .4rem; }
.price-chip { display: inline-flex; align-items: baseline; gap: .35rem; padding: .25rem .6rem; border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--surface); font-size: .8125rem; color: var(--ink-800); }
.price-chip strong { font-family: var(--font-display); font-weight: 600; font-size: .9375rem; color: var(--ink-900); }
.price-chip s { color: var(--ink-400); font-size: .75rem; }
.price-chip.is-out { opacity: .6; }
.timeline-item.is-example { background: var(--surface-2); border-style: dashed; }
.meter { display: block; height: .5rem; border-radius: var(--radius-full); background: var(--surface-3); overflow: hidden; display: flex; }
.meter-sold { background: var(--brand-primary); height: 100%; }
.meter-held { background: var(--warn); height: 100%; }
.meter-sm { height: .375rem; }
.meter-legend { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .75rem; color: var(--ink-500); margin-top: .35rem; }
.meter-legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: .15rem; margin-right: .3rem; vertical-align: -1px; }
.meter-legend .is-sold i { background: var(--brand-primary); }
.meter-legend .is-held i { background: var(--warn); }
.meter-legend .is-free i { background: var(--surface-3); border: 1px solid var(--line-strong); }
.facts { display: grid; gap: .5rem .75rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.fact { min-width: 0; }
.fact-label { display: block; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.fact-value { display: block; font-size: .9375rem; color: var(--ink-900); overflow-wrap: anywhere; }
