/* Activity POS design system ("Ride Boards", calm teal).
   Type scale 12 / 14 / 16 / 20 / 28 / 40 · spacing on an 8 px grid.
   --brand comes from the client's venue settings (layout sets it). */

:root {
  --brand: #22566A;
  --brand-ink: #ffffff;
  --accent: var(--brand);
  --brand-2: color-mix(in srgb, var(--brand) 82%, black);
  --tint: color-mix(in srgb, var(--brand) 9%, white);
  --tint-2: color-mix(in srgb, var(--accent) 18%, white);
  --brand-line: color-mix(in srgb, var(--brand) 32%, white);

  --ink: #172638;
  --ink-2: #44546A;
  --ink-3: #5E6E80;
  --ink-4: #8B97A7;
  --line: #E3E8EF;
  --line-2: #CBD5E0;
  --ground: #F5F7FA;
  --panel: #ffffff;
  --panel-2: #F8FAFC;

  --ok: #23704F;      --ok-tint: #E3F2EA;
  --warn: #7A4E00;    --warn-tint: #FBEFD3;   --warn-line: #E7C979;
  --bad: #A1303E;     --bad-tint: #FBE9EB;    --bad-line: #E9CDD1;
  --info: #22566A;    --info-tint: #EAF2F4;
  --pm-cash: var(--accent); --pm-upi: color-mix(in srgb, var(--accent) 62%, #fff); --pm-card: color-mix(in srgb, var(--accent) 34%, #fff);
  --water-hue: #2F6E94; --thrill-hue: #B8683A; --family-hue: #3F7A4C; --pkg-hue: #5E4E9A; --edge-pct: 0%;
  --water-line: #CFE2EE; --thrill-line: #F0D6C9; --family-line: #D2E7D6; --pkg-line: #DCD4F0;
  --stop-bg: #F1F3F6; --stop-line: #DDE3E9; --stop-tile: #8A96A3; --stop-stripe: #F2C9CF;
  --water-art: #6E9FBC; --thrill-art: #E0A891; --family-art: #7FAE87; --pkg-art: #9A8CC9; --art-op: 1;
  --water: #E8F2F8;   --thrill: #FBEEE7;      --family: #EAF4EC;   --pkg: #F0ECF8;

  --field: #ffffff;
  --rail-bg: var(--panel);
  --rail-ink: var(--ink-2);
  --rail-dim: var(--ink-3);
  --rail-hover: #F3F6FA;
  --rail-current: #EDF2F8;

  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --font: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --disp: Inter, "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--ground); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--disp); font-weight: 700; color: var(--ink); line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: 20px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Shell + collapsible sidebar ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.shell.is-collapsed { grid-template-columns: 88px minmax(0, 1fr); }
.side { background: var(--rail-bg); color: var(--rail-ink); display: flex; flex-direction: column; padding: 20px 14px 14px; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 4px 18px; margin: 0 -14px 14px; padding-left: 18px; padding-right: 14px; border-bottom: 1px solid var(--line); position: relative; }
.side-word b { display: block; font: 700 20px/1.1 var(--disp); color: var(--ink); letter-spacing: -.005em; }
.side-word small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.side .pd-mark { width: 40px; height: 40px; }
.side-mark { flex: none; padding: 2px; margin: -2px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.side-mark:hover { background: var(--rail-hover); }
.side-mark:focus-visible { box-shadow: var(--focus); }
.theme-choice { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; align-self: start; justify-self: start; width: max-content; max-width: 100%; }
.theme-choice button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-right: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font: 600 14px var(--font); cursor: pointer; }
.theme-choice button:last-child { border-right: 0; }
.theme-choice button[aria-pressed="true"] { background: var(--rail-current); color: var(--ink); }
.theme-choice button:focus-visible { box-shadow: inset var(--focus); }
.side .pd-cab rect { stroke: var(--rail-bg); }
.side-venue { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 6px; }
.side-venue-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; flex: none; background: var(--panel); }
.side-venue-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.side-name { color: var(--ink); font: 700 16px/1.25 var(--disp); margin-top: 2px; overflow-wrap: anywhere; }
.side-code { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.side-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 18px 12px 6px; }
.side a.nav { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--rail-ink); font-weight: 600; text-decoration: none; position: relative; }
.side a.nav svg { width: 20px; height: 20px; flex: none; }
.side a.nav:hover { background: var(--rail-hover); color: var(--ink); }
.side a.nav[aria-current="page"] { background: var(--rail-current); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.side a.nav:focus-visible { box-shadow: var(--focus); }
.nav-pill { margin-left: auto; font-size: 12px; font-weight: 600; line-height: 20px; padding: 0 8px; border-radius: 6px; background: var(--ok-tint); color: var(--ok); white-space: nowrap; }
.nav-pill.ok::before, .nav-pill.bad::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.nav-pill.ok::before { background: var(--ok); }
.nav-pill.bad { background: var(--bad-tint); color: var(--bad); }
.nav-pill.bad::before { background: var(--bad); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--tint-2); color: var(--ink); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.who-name { color: var(--ink); font-weight: 600; }
.who-role { font-size: 12px; color: var(--ink-3); }
.side-btn { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--rail-ink); font: 600 14px var(--font); cursor: pointer; width: 100%; }
.side-btn:hover { background: var(--rail-hover); color: var(--ink); }
.side-btn svg { width: 18px; height: 18px; flex: none; }
.side-btn:focus-visible { box-shadow: var(--focus); }
/* Collapsed: icon above a 12px label, never icon-only (touch counters have no hover). */
.is-collapsed .side { padding: 16px 8px; align-items: stretch; }
.is-collapsed .side-brand { flex-direction: column; justify-content: center; gap: 10px; margin: 0 -8px 10px; padding: 0 0 14px; }
.is-collapsed .side-brand .grow, .is-collapsed .who .grow, .is-collapsed .nav-long, .is-collapsed .side-venue .grow { display: none; }
.is-collapsed .side-label { height: 1px; padding: 0; margin: 8px 12px; background: var(--line); font-size: 0; }
.is-collapsed .side a.nav { flex-direction: column; justify-content: center; gap: 4px; min-height: 56px; padding: 6px 2px; font-size: 12px; text-align: center; line-height: 1.15; }
.is-collapsed .nav-pill { position: absolute; top: 4px; right: 8px; margin: 0; width: 10px; height: 10px; padding: 0; font-size: 0; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--rail-bg); }
.is-collapsed .nav-pill::before { display: none; }
.is-collapsed .nav-pill.bad { background: var(--bad); }
.is-collapsed .who { justify-content: center; flex-direction: column; gap: 8px; }
.is-collapsed .side-btn { justify-content: center; padding: 0; font-size: 0; gap: 0; }
.nav-short { display: none; }
.is-collapsed .nav-short { display: inline; }
.side-toggle { margin-left: auto; width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink-3); cursor: pointer; padding: 0; }
.side-toggle:hover { background: var(--rail-hover); color: var(--ink); }
.side-toggle:focus-visible { box-shadow: var(--focus); }
.side-toggle svg { width: 16px; height: 16px; transition: transform .15s ease; }
.is-collapsed .side-toggle svg { transform: rotate(180deg); }
.is-collapsed .side-toggle { margin: 0; }
.side-icon-btn { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 0; }
.side-icon-btn:hover { background: var(--rail-hover); color: var(--ink); }
.side-icon-btn:focus-visible { box-shadow: var(--focus); }
.who form { margin: 0; }

/* Ferris mark (shared with sign-in): draws in once, then turns one notch every 6 s. */
.pd-mark { width: 50px; height: 50px; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.pd-leg, .pd-rim { stroke: #22566A; stroke-width: 2.8; stroke-dasharray: 1; stroke-dashoffset: 1; }
.pd-leg { animation: pd-draw .6s cubic-bezier(.3,.7,.3,1) forwards; }
.pd-rim { animation: pd-draw .9s cubic-bezier(.3,.7,.3,1) .15s forwards; }
.pd-spoke { stroke: #22566A; stroke-width: 1.9; opacity: 0; animation: pd-fade .4s ease .5s forwards; }
.pd-hub { fill: #22566A; }
.pd-cab { opacity: 0; animation: pd-fade .4s ease forwards; }
.pd-cab:nth-of-type(1) { animation-delay: .60s; } .pd-cab:nth-of-type(2) { animation-delay: .68s; }
.pd-cab:nth-of-type(3) { animation-delay: .76s; } .pd-cab:nth-of-type(4) { animation-delay: .84s; }
.pd-cab:nth-of-type(5) { animation-delay: .92s; } .pd-cab:nth-of-type(6) { animation-delay: 1.0s; }
.pd-turn { transform-box: view-box; transform-origin: 22px 19px; animation: pd-notch6 6s ease-in-out 1.6s infinite; }
.pd-w { display: inline-block; opacity: 0; transform: translateY(6px); animation: pd-arrive .7s cubic-bezier(.2,.8,.2,1) .15s forwards; }
.pd-w2 { color: #2F7E93; animation-delay: .27s; }
.pd-by { opacity: 0; animation: pd-fade .6s ease .5s forwards; }
@keyframes pd-draw { to { stroke-dashoffset: 0; } }
@keyframes pd-fade { to { opacity: 1; } }
@keyframes pd-pop { to { transform: scale(1); } }
@keyframes pd-arrive { to { opacity: 1; transform: none; } }
@keyframes pd-notch6 { 0%, 35% { transform: rotate(0); } 75%, 100% { transform: rotate(60deg); } }
@media (prefers-reduced-motion: reduce) {
  .pd-mark *:not(.pd-wheel):not(.pd-cab), .pd-w, .pd-by { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; transform: none !important; }
}
:root[data-theme="dark"] .pd-leg, :root[data-theme="dark"] .pd-rim, :root[data-theme="dark"] .pd-spoke { stroke: #8ECFDC; }
:root[data-theme="dark"] .pd-hub { fill: #8ECFDC; }
:root[data-theme="dark"] .pd-w2 { color: #8ECFDC; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .pd-leg, :root[data-theme="system"] .pd-rim, :root[data-theme="system"] .pd-spoke { stroke: #8ECFDC; }
  :root[data-theme="system"] .pd-hub { fill: #8ECFDC; }
  :root[data-theme="system"] .pd-w2 { color: #8ECFDC; }
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; min-height: 64px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 20px; }
.topbar .crumb { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.topbar .crumb a { color: var(--ink-3); }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.content.narrow { max-width: 920px; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .shell, .shell.is-collapsed { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 30; transform: translateX(-100%); transition: transform .18s ease; }
  .shell.nav-open .side { transform: none; box-shadow: 0 10px 40px rgb(0 0 0 / 30%); }
  .is-collapsed .side a.nav { flex-direction: row; min-height: 40px; font-size: 14px; }
  .menu-toggle { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.platform-bar { background: var(--warn-tint); color: var(--warn); border-bottom: 1px solid var(--warn-line); padding: 8px 24px; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.platform-bar form { margin-left: auto; }

/* Licence and support notices from the shell: one calm line above the top bar, on every screen. */
.shell-notice { display: flex; align-items: center; gap: 8px; padding: 8px 24px; font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--line); background: var(--info-tint); color: var(--info); }
.shell-notice > svg { flex: none; }
.shell-notice > span { min-width: 0; overflow-wrap: anywhere; }
.shell-notice form { margin-left: auto; flex: none; }
.shell-notice.is-warn { background: var(--warn-tint); color: var(--warn); border-color: var(--warn-line); }
.shell-notice.is-bad { background: var(--bad-tint); color: var(--bad); border-color: var(--bad-line); }
.shell-notice.is-support { background: var(--ink); color: var(--panel); border-color: var(--ink); }
@media (max-width: 900px) { .shell-notice { padding: 8px 16px; } }
@media print { .shell-notice { display: none !important; } }

/* ---------- Panels ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head p { color: var(--ink-3); font-size: 12px; margin-top: 2px; font-weight: 600; }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.stat { padding: 16px 20px; }
.stat.has-ic { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 16px; align-items: center; padding: 20px; }
.stat.has-ic > :not(.stat-ic) { grid-column: 2; }
.stat-ic { grid-row: 1 / span 3; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.stat-ic svg { width: 22px; height: 22px; }
.stat-ic.g { background: #E3F2EA; color: #2A6A4C; } .stat-ic.b { background: #E3EEF8; color: #355C7D; }
.stat-ic.v { background: #EEEAF8; color: #5E4E9A; } .stat-ic.r { background: #FBE9EB; color: #A1303E; }
:root[data-theme="dark"] .stat-ic { background: var(--panel-2); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .stat-ic { background: var(--panel-2); } }
.hbar { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 0; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.hbar.pm-cash .track span { background: var(--pm-cash); } .hbar.pm-upi .track span { background: var(--pm-upi); } .hbar.pm-card .track span { background: var(--pm-card); }
.stat-label { color: var(--ink-2); font-weight: 600; }
.stat-value { font: 700 28px/1.15 var(--disp); margin-top: 4px; }
.stat-sub { font-size: 12px; margin-top: 4px; color: var(--ink-3); font-weight: 600; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--bad); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; touch-action: manipulation; user-select: none; }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-green { background: #2A6A4C; border-color: #2A6A4C; color: #fff; } .btn-green:hover { background: #225A40; border-color: #225A40; color: #fff; }

.btn-danger { color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-tint); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--bad) 85%, black); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--line); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 16px; border-radius: 10px; }
.btn-icon { width: 40px; padding: 0; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--ink-3); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--field); color: var(--ink); font: 14px var(--font); }
.textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23566770' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input[type="date"] { padding-right: 8px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.input[aria-invalid="true"], .input-validation-error { border-color: var(--bad); }
.input-sm { height: 32px; font-size: 13px; }
.input-lg { height: 48px; font: 700 20px var(--disp); }
.field-error, .field-validation-error { color: var(--bad); font-size: 12px; font-weight: 600; }
.validation-summary-errors ul, .alert .error-list { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none !important; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; pointer-events: none; }
.input-prefix > .input { padding-left: 28px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; background: var(--field); }
.seg label, .seg a, .seg span { display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 40px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); border-right: 1px solid var(--line); text-decoration: none; }
.seg > :last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked), .seg .on, .seg [aria-current="true"] { background: var(--accent); color: #fff; }
.seg label:has(input:focus-visible) { box-shadow: inset var(--focus); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

/* ---------- Tables ---------- */
/* relative: screen-reader-only labels in cells are absolutely positioned; without it they escape the
   scroll box and make the whole page scroll sideways on a phone. */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--panel-2); }
.table tr.is-muted td { color: var(--ink-4); }
.table a.row-link { color: var(--ink); font-weight: 600; }
.table tfoot td { font: 700 16px var(--disp); background: var(--panel-2); border-top: 1px solid var(--line); }
.edit-table td { padding: 6px 8px; }
/* Wide tables in a narrow column (the tickets on a bill): less side padding so every column shows at 1366. */
.table-tight th, .table-tight td { padding-left: 10px; padding-right: 10px; }
.table-tight th:first-child, .table-tight td:first-child { padding-left: 16px; }
.edit-table th { padding: 8px; }

/* ---------- Status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-bad { background: var(--bad-tint); color: var(--bad); }
.badge-info, .badge-brand { background: var(--tint); color: var(--accent); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); font-weight: 600; border: 1px solid; }
.alert-ok { background: var(--ok-tint); border-color: #BFDECD; color: var(--ok); }
.alert-bad { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); }
.alert-info { background: var(--tint); border-color: var(--tint-2); color: var(--accent); }
.alert-warn { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.alert .close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; font-size: 20px; line-height: 1; padding: 0 4px; }
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 440px; }
.toast-stack .alert { box-shadow: 0 10px 30px rgb(27 43 51 / 18%); }
.empty { text-align: center; padding: 48px 24px; color: var(--ink-3); }
.empty h3 { color: var(--ink-2); margin-bottom: 4px; }

/* ---------- Skeleton loaders ---------- */
.skel { position: relative; overflow: hidden; background: var(--tint); border-radius: 6px; color: transparent !important; user-select: none; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgb(255 255 255 / 55%), transparent); animation: skel 1.3s ease-in-out infinite; }
.skel-line { height: 12px; margin: 8px 0; }
.skel-line.w-60 { width: 60%; } .skel-line.w-80 { width: 80%; } .skel-line.w-40 { width: 40%; }
.skel-block { height: 100%; min-height: 60px; border-radius: 12px; }
@keyframes skel { to { transform: translateX(100%); } }
[aria-busy="true"] > .when-loaded { display: none; }
[aria-busy="false"] > .when-loading { display: none; }

/* ---------- Dialogs ---------- */
dialog.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgb(27 43 51 / 28%); color: var(--ink); }
dialog.modal::backdrop { background: rgb(27 43 51 / 45%); }
.modal-head { padding: 20px 24px 4px; }
.modal-body { padding: 12px 24px 4px; }
.modal-foot { padding: 16px 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }
dialog.modal-wide { width: min(760px, calc(100vw - 32px)); }

/* Refund dialog (Sales > bill): one row per ticket line, a quantity box, the running amount. */
.refund-wrap { border: 1px solid var(--line); border-radius: var(--r-sm); max-height: min(46vh, 420px); overflow: auto; overscroll-behavior: contain; }
.refund-table th, .refund-table td { padding: 6px 12px; }
.refund-table thead th { position: sticky; top: 0; z-index: 1; }
.refund-table tbody tr:hover td { background: transparent; }
.refund-table tr.refund-sale th { font: 600 14px var(--font); color: var(--ink); background: var(--panel); white-space: normal; padding-top: 10px; border-bottom: 0; }
.refund-table tr.refund-sale th .mono { margin: 0 6px; }
.refund-table td:first-child { padding-left: 24px; }
.refund-table .price-sm { display: none; }
@media (max-width: 520px) {
  .refund-table .col-price { display: none; }
  .refund-table .price-sm { display: block; }
  .refund-table td:first-child { padding-left: 16px; }
  dialog.modal-wide .modal-head, dialog.modal-wide .modal-body, dialog.modal-wide .modal-foot { padding-left: 16px; padding-right: 16px; }
}
.refund-qty { width: 72px; height: 32px; text-align: right; padding: 0 8px; }
.refund-total { font-weight: 700; }
.refunded-note { color: var(--warn); font-weight: 600; margin-bottom: 2px; }
.badge-sm { height: 20px; padding: 0 6px; font-size: 11px; margin-left: 6px; }
.table tfoot tr.refund-row td { font: 600 14px var(--font); border-top: 0; padding-top: 4px; }

/* ---------- Misc ---------- */
.icon-tile { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; flex: none; }
.icon-mask { width: 24px; height: 24px; background: #fff; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; display: inline-block; }
.icon-mask.ink { background: var(--accent); }
.ride-ic { width: 18px; height: 18px; background: var(--accent); }
.ride-ic.cat-water { background: var(--water-hue); } .ride-ic.cat-thrill { background: var(--thrill-hue); } .ride-ic.cat-family { background: var(--family-hue); } .ride-ic.cat-pkg { background: var(--pkg-hue); } .ride-ic.cat-stop { background: var(--stop-tile); }
.toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.toolbar .field { min-width: 140px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; }
.progress { height: 8px; background: var(--tint); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.progress.is-high > span { background: #C89A2E; }
.progress.is-full > span { background: var(--bad); }
.kbd { font: 600 12px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--field); color: var(--ink); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ok); }
.status-dot.maintenance { background: #C89A2E; }
.status-dot.closed { background: var(--bad); }
.day { display: inline-flex; margin-right: 2px; cursor: pointer; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day span { display: inline-grid; place-items: center; width: 30px; height: 28px; border-radius: 6px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--field); }
.day input:checked + span { background: var(--tint); border-color: var(--brand-line); color: var(--accent); }
.day input:focus-visible + span { box-shadow: var(--focus); }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 160px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar > span { width: 100%; max-width: 48px; background: #B9D0D8; border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .bar.is-today > span { background: var(--accent); }
.bars .bar small { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.bars.is-dense { gap: 3px; }
.bars.is-dense .bar b { display: none; }
.bars.is-dense .bar small { font-size: 10px; }
.period { display: inline-flex; align-items: center; gap: 8px; }
.period-pick { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--ink-2); cursor: pointer; }
.period-pick:hover { border-color: var(--ink-4); }
.period-pick:focus-within { box-shadow: var(--focus); border-color: var(--accent); }
.period-pick svg { width: 16px; height: 16px; flex: none; }
.period-pick select { appearance: none; border: 0; background: transparent; font: 600 14px var(--font); color: var(--ink); padding-right: 18px; cursor: pointer; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 7px) 55%, calc(100% - 2px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.period-pick select option { color: var(--ink); background: var(--panel); }
/* With the Ferris menu, the button fills the pill and the calendar icon sits inside it. */
.period-pick:has(.fsel) { padding: 0; }
.period-pick:has(.fsel) > svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; pointer-events: none; z-index: 1; }
.period-pick .fsel-btn { height: 34px; padding: 0 32px 0 36px; border: 0; border-radius: 9px; background: transparent; font: 600 14px var(--font); color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23566770' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.period-pick .fsel-btn:focus-visible { outline: none; }
.period-pick .fsel-pop { min-width: 248px; top: calc(100% + 8px); }

/* Ferris dropdown menu (app.js): replaces the browser's list for every <select> on mouse screens. */
.fsel { position: relative; display: inline-block; vertical-align: middle; }
.fsel-field { display: block; width: 100%; }
.fsel-btn { display: flex; align-items: center; width: 100%; text-align: left; cursor: pointer; white-space: nowrap; }
.fsel-btn:disabled { cursor: not-allowed; opacity: .6; }
.fsel-btn.select[aria-expanded="true"] { border-color: var(--accent); box-shadow: var(--focus); }
.fsel-btn.select:hover:not(:disabled) { border-color: var(--ink-4); }
.fsel-value { overflow: hidden; text-overflow: ellipsis; }
.fsel-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; min-width: max(100%, 180px); max-height: min(340px, 60vh); overflow-y: auto; margin: 0; padding: 5px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(15 30 40 / 14%), 0 2px 6px rgb(15 30 40 / 6%); outline: none; }
.fsel-pop[hidden] { display: none; }
.fsel-pop.is-up { top: auto; bottom: calc(100% + 6px); }
.fsel-pop.is-end { left: auto; right: 0; }
.fsel-opt { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; column-gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 8px;
  color: var(--ink-2); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; user-select: none; }
.fsel-opt svg { width: 16px; height: 16px; color: var(--brand); visibility: hidden; }
.fsel-opt small { justify-self: end; margin-left: 20px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fsel-opt.is-active { background: var(--rail-hover); color: var(--ink); }
.fsel-opt[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.fsel-opt[aria-selected="true"] svg { visibility: visible; }
.fsel-opt[aria-disabled="true"] { opacity: .45; cursor: default; }
.fsel-sep { height: 1px; margin: 5px 6px; background: var(--line); }
/* Ferris date picker (app.js): "5 Nov 2026" field plus a Ferris calendar. */
.fdate { position: relative; display: block; }
.fdate-sm { display: inline-block; }
.fdate-btn { display: flex; align-items: center; width: 100%; text-align: left; cursor: pointer; white-space: nowrap; padding-right: 36px;
  font-variant-numeric: tabular-nums;
  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='%23566770' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.fdate-btn.is-empty { color: var(--ink-3); }
.fdate-btn:hover:not(:disabled) { border-color: var(--ink-4); }
.fdate-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: var(--focus); }
.fdate-btn.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.fdate-value { overflow: hidden; text-overflow: ellipsis; }
.fdate-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; width: 292px; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(15 30 40 / 14%), 0 2px 6px rgb(15 30 40 / 6%); }
.fdate-pop[hidden] { display: none; }
.fdate-pop.is-up { top: auto; bottom: calc(100% + 6px); }
.fdate-pop.is-end { left: auto; right: 0; }
.fdate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fdate-title { height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: 600 14px var(--font); color: var(--ink); cursor: pointer; }
.fdate-title:hover { background: var(--rail-hover); }
.fdate-title:focus-visible { outline: none; box-shadow: var(--focus); }
.fdate-nav { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.fdate-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fdate-nav:hover:not(:disabled) { background: var(--rail-hover); color: var(--ink); }
.fdate-nav:disabled { opacity: .35; cursor: default; }
.fdate-grid { display: grid; gap: 2px; }
.fdate-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.fdate-dow span { display: grid; place-items: center; height: 28px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.fdate-day { position: relative; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: 500 13px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; }
.fdate-day:hover:not(:disabled) { background: var(--rail-hover); }
.fdate-day.is-out { color: var(--ink-3); }
.fdate-day.is-today { box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 700; }
.fdate-day[aria-selected="true"] { background: var(--brand); color: #fff; font-weight: 600; box-shadow: none; }
.fdate-day:disabled { color: color-mix(in srgb, var(--ink-4) 55%, var(--panel)); cursor: not-allowed; }
.fdate-day:focus-visible, .fdate-nav:focus-visible, .fdate-link:focus-visible { outline: none; box-shadow: var(--focus); }
.fdate-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.fdate-link { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--brand); font: 600 13px var(--font); cursor: pointer; }
.fdate-link:hover:not(:disabled) { background: var(--rail-hover); }
.fdate-link:disabled { color: var(--ink-4); cursor: default; }
.fdate-error { margin: 4px 0 0; font-size: 12px; font-weight: 500; color: var(--bad); }
.fdate-error[hidden] { display: none; }
.fdate-link[hidden] { display: none; }
:root[data-theme="dark"] .fdate-link { color: #8ECFDC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fdate-link { color: #8ECFDC; } }

/* Today keeps a small dot even when it is also the selected day. */
.fdate-day.is-today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--brand); }
.fdate-day.is-today[aria-selected="true"]::after { background: #fff; }
/* From/To range: tinted between the ends, ends filled. */
.fdate-day.in-range { background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 0; }
.fdate-day.range-start { border-radius: 8px 0 0 8px; }
.fdate-day.range-end { border-radius: 0 8px 8px 0; }
.fdate-day.range-start.range-end { border-radius: 8px; }
.fdate-day.in-range.range-start, .fdate-day.in-range.range-end { background: color-mix(in srgb, var(--brand) 26%, transparent); }
.fdate-day.in-range[aria-selected="true"] { background: var(--brand); color: #fff; }
.fdate-row:not(.fdate-dow) { gap: 2px 0; }
/* Range preview while choosing the other end. */
.fdate-grid.is-previewing .fdate-day.in-range:not(.in-preview) { background: transparent; }
.fdate-day.in-preview:not([aria-selected="true"]) { background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 0; }
/* Calendar shown inside a panel (data-calendar-slot): sits between the fields and the panel's buttons. */
.fdate-pop.is-inline { position: static; width: auto; margin-top: 12px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
/* Month grid for jumping back fast. */
.fdate-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.fdate-months[hidden], .fdate-grid[hidden] { display: none; }
.fdate-month { height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: 500 14px var(--font); cursor: pointer; }
.fdate-month:hover:not(:disabled) { background: var(--rail-hover); }
.fdate-month[aria-current="true"] { background: var(--brand); color: #fff; font-weight: 600; }
.fdate-month:disabled { color: var(--ink-4); opacity: .45; cursor: not-allowed; }
.fdate-month:focus-visible { outline: none; box-shadow: var(--focus); }
/* No flash of the browser's date field before app.js replaces it (phones keep theirs). */
@media (min-width: 768px) { input[type="date"].input:not(._fdate-on):not([data-native]) { visibility: hidden; } }
/* Touch counter PCs: bigger targets. */
@media (pointer: coarse) {
  .fsel-opt { min-height: 44px; }
  .fdate-pop { width: 340px; }
  .fdate-day { height: 44px; font-size: 15px; }
  .fdate-nav, .fdate-title { height: 40px; min-width: 40px; }
  .fdate-link { height: 40px; padding: 0 14px; }
  .fdate-month { height: 52px; }
}
.fsel-pop:focus-visible .fsel-opt.is-active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
.period { position: relative; }
.period-custom { position: absolute; right: 0; top: calc(100% + 8px); z-index: 55; width: 320px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(15 30 40 / 14%), 0 2px 6px rgb(15 30 40 / 6%); }
.period-custom[hidden] { display: none; }
.period-custom-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.period-custom-fields .field { margin: 0; }
.period-custom-fields label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.period-custom-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.dash-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; margin-bottom: -4px; }
.dash-meta b { color: var(--ink); font-weight: 600; }
.dash-updated { display: inline-flex; align-items: center; gap: 6px; }
.dash-updated svg, .dash-refresh svg { width: 14px; height: 14px; }
.dash-refresh { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.dash-refresh:hover { color: var(--accent); text-decoration: none; }
.bars .bar b { font-size: 12px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 560px); background: var(--panel); }
.auth-art { background: var(--accent); color: var(--rail-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art h2 { color: #fff; font-size: 40px; line-height: 1.1; max-width: 520px; }
.auth-art p { color: var(--rail-ink); max-width: 460px; margin-top: 16px; font-size: 16px; }
.auth-boards { display: grid; grid-template-columns: repeat(3, 150px); gap: 12px; }
.auth-boards div { background: rgb(255 255 255 / 9%); border: 1px solid rgb(255 255 255 / 14%); border-radius: 12px; padding: 12px; height: 132px; display: flex; flex-direction: column; }
.auth-boards i { flex: 1; background: rgb(255 255 255 / 30%); -webkit-mask: var(--a) center / auto 100% no-repeat; mask: var(--a) center / auto 100% no-repeat; margin: 6px -12px; }
.auth-boards b { color: #fff; font: 700 14px var(--disp); }
.auth-boards span { font: 700 20px var(--disp); color: #fff; }
.auth-boards small { font-size: 12px; color: var(--rail-dim); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 72px); gap: 24px; }
.auth-form h1 { font-size: 28px; }
.auth-form .input { height: 48px; font-size: 16px; }
.auth-form .btn { height: 48px; font-size: 16px; }
.code-input { text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.brandmark { display: inline-flex; align-items: center; gap: 12px; font: 700 16px var(--disp); color: #fff; }
.brandmark i { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: var(--accent); font-style: normal; font: 700 18px var(--disp); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }


/* ---------- Dark theme (per user: System / Light / Dark) ---------- */
:root[data-theme="dark"] {
  --ink: #E9EEF0; --ink-2: #BFCACF; --ink-3: #98A6AC; --ink-4: #84939A;
  --line: #2A3439; --line-2: #3A464C; --ground: #101518; --panel: #182024; --panel-2: #1D262B; --field: #12181B;
  --accent: color-mix(in srgb, var(--brand), #C9F0F7 66%); --brand-ink: #0E1A1F;
  --brand-2: color-mix(in srgb, var(--brand), #BFE3EC 50%);
  --tint: color-mix(in srgb, var(--accent) 16%, #182024); --tint-2: color-mix(in srgb, var(--accent) 28%, #182024); --brand-line: color-mix(in srgb, var(--accent) 50%, #182024);
  --ok: #86D7AE; --ok-tint: #17302A; --warn: #F0C46E; --warn-tint: #352B16; --warn-line: #5A4722; --bad: #F2949F; --bad-tint: #36202A; --bad-line: #5A2E36;
  --info: #8CCBDB; --info-tint: #182C33;
  --water: #1E272B; --thrill: #1E272B;
  --family: #1E272B; --pkg: #1E272B;
  --water-hue: #6FB9CF; --thrill-hue: #E39A85; --family-hue: #8FC29E; --pkg-hue: #A99BD8; --edge-pct: 100%;
  --water-line: var(--line); --thrill-line: var(--line); --family-line: var(--line); --pkg-line: var(--line);
  --stop-bg: var(--panel-2); --stop-line: var(--line); --stop-tile: var(--ink-4); --stop-stripe: rgb(242 148 159 / 22%);
  --water-art: #6FB9CF; --thrill-art: #E39A85; --family-art: #8FC29E; --pkg-art: #A99BD8; --art-op: .38;
  --rail-bg: #151C20; --rail-ink: var(--ink-2); --rail-dim: var(--ink-3); --rail-hover: #1D262B; --rail-current: #233038;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --ink: #E9EEF0; --ink-2: #BFCACF; --ink-3: #98A6AC; --ink-4: #84939A;
    --line: #2A3439; --line-2: #3A464C; --ground: #101518; --panel: #182024; --panel-2: #1D262B; --field: #12181B;
    --accent: color-mix(in srgb, var(--brand), #C9F0F7 66%); --brand-ink: #0E1A1F;
    --brand-2: color-mix(in srgb, var(--brand), #BFE3EC 50%);
    --tint: color-mix(in srgb, var(--accent) 16%, #182024); --tint-2: color-mix(in srgb, var(--accent) 28%, #182024); --brand-line: color-mix(in srgb, var(--accent) 50%, #182024);
    --ok: #86D7AE; --ok-tint: #17302A; --warn: #F0C46E; --warn-tint: #352B16; --warn-line: #5A4722; --bad: #F2949F; --bad-tint: #36202A; --bad-line: #5A2E36;
    --info: #8CCBDB; --info-tint: #182C33;
    --water: #1E272B; --thrill: #1E272B;
    --family: #1E272B; --pkg: #1E272B;
  --water-hue: #6FB9CF; --thrill-hue: #E39A85; --family-hue: #8FC29E; --pkg-hue: #A99BD8; --edge-pct: 100%;
  --water-line: var(--line); --thrill-line: var(--line); --family-line: var(--line); --pkg-line: var(--line);
  --stop-bg: var(--panel-2); --stop-line: var(--line); --stop-tile: var(--ink-4); --stop-stripe: rgb(242 148 159 / 22%);
  --water-art: #6FB9CF; --thrill-art: #E39A85; --family-art: #8FC29E; --pkg-art: #A99BD8; --art-op: .38;
    --rail-bg: #151C20; --rail-ink: var(--ink-2); --rail-dim: var(--ink-3); --rail-hover: #1D262B; --rail-current: #233038;
    color-scheme: dark;
  }
}

.theme-switch { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.theme-switch button { flex: 1; height: 32px; border: 0; background: transparent; color: var(--rail-dim); font: 600 12px var(--font); cursor: pointer; display: grid; place-items: center; }
.theme-switch button[aria-pressed="true"] { background: var(--rail-current); color: var(--ink); }
.theme-switch button:focus-visible { box-shadow: inset var(--focus); }
.theme-switch svg { width: 16px; height: 16px; }
.is-collapsed .theme-switch { flex-direction: column; }

/* ---------- Printing a report page from a normal printer ---------- */
@media print {
  body { background: #fff; }
  .shell, .shell.is-collapsed { display: block; }
  .side, .topbar .btn, .toolbar, .platform-bar, .toast-stack, .menu-toggle, .no-print { display: none !important; }
  .topbar { position: static; border: 0; padding: 0 0 8mm; }
  .content { padding: 0; max-width: none; }
  .card { break-inside: avoid; border-color: #ccc; }
}

/* Menu button only exists on small screens (beats .btn display). */
.btn.menu-toggle { display: none; }
@media (max-width: 900px) { .btn.menu-toggle { display: inline-flex; } }

/* Flash and toast messages carry a leading status icon. */
.alert > svg { flex: none; margin-top: 1px; }

/* Footer shared with RestroDesk */
.app-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 24px 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; text-align: center; }
.app-foot b { color: var(--ink-2); font-weight: 600; }
.app-foot a { color: var(--ink-2); }
.is-sell .app-foot, .is-scan .app-foot { display: none; }
@media print { .app-foot { display: none; } }

/* Sidebar sized like RestroDesk: roomy rows, small-caps section labels, the venue in a soft card,
   a filled current page (no side bar), and dots/counts instead of pills. */
.side { padding: 18px 14px 14px; gap: 4px; }
.side .pd-mark { width: 40px; height: 40px; }
.side-venue { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; }
.side-venue-mark, .side-venue-logo { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.side-venue-mark { display: none; }
.side-venue-logo { object-fit: contain; background: var(--panel); border: 1px solid var(--line); }
.side-venue-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.side-name { font: 600 15px/1.3 var(--disp); color: var(--ink); margin-top: 2px; }
.side-code { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.side-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 18px 12px 6px; }
.side a.nav { min-height: 44px; gap: 12px; padding: 0 12px; border-radius: 10px; font-weight: 500; font-size: 14.5px; color: var(--ink); }
.side a.nav svg { width: 20px; height: 20px; color: var(--ink-2); }
.side a.nav:hover { background: var(--rail-hover); }
.side a.nav[aria-current="page"] { background: var(--rail-current); color: var(--ink); font-weight: 600; box-shadow: none; }
.side a.nav[aria-current="page"] svg { color: var(--accent); }
.nav-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); flex: none; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font: 600 11.5px/20px var(--font); text-align: center; flex: none; }
.nav-count.bad { background: var(--bad-tint); color: var(--bad); }
.is-collapsed .side-venue { justify-content: center; padding: 8px 0; background: transparent; border: 0; }
.is-collapsed .side-venue-mark { display: grid; place-items: center; background: var(--accent); color: var(--brand-ink); font: 700 14px var(--disp); }
.is-collapsed .nav-dot, .is-collapsed .nav-count { position: absolute; top: 6px; right: 10px; margin: 0; }
.is-collapsed .nav-count { min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; background: var(--bad); }

/* Header bar: page title, live status chips, page actions, account menu. */
.topbar { gap: 12px; }
.top-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.top-chip:hover { border-color: var(--line-2); color: var(--ink); text-decoration: none; }
.top-chip svg { width: 15px; height: 15px; color: var(--ink-3); }
.top-chip b { color: var(--ink); font-weight: 650; }
.top-chip .muted { color: var(--ink-3); }
.top-chip.is-ok svg { color: var(--ok); }
.top-chip.is-bad { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); font-weight: 600; }
.top-chip.is-bad svg { color: var(--bad); }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 3px; border-radius: 999px; cursor: pointer; color: var(--ink-3); }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--rail-hover); }
.user-menu > summary:focus-visible { box-shadow: var(--focus); outline: none; }
.user-menu .avatar { width: 32px; height: 32px; }
.user-menu > summary svg { width: 14px; height: 14px; }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(15 30 40 / 14%), 0 2px 6px rgb(15 30 40 / 6%); z-index: 40; overflow: hidden; }
.user-pop-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.user-pop-head b { color: var(--ink); }
.user-pop-head span { font-size: 12px; color: var(--ink-3); }
.user-pop-sec { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.user-pop-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.user-pop .rd-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.user-pop .rd-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font: 600 12px var(--font); cursor: pointer; }
.user-pop .rd-seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.user-pop .rd-seg svg { width: 14px; height: 14px; }
.user-pop-foot { margin: 0; padding: 6px; }
.user-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: 500 14px var(--font); cursor: pointer; text-align: left; }
.user-pop-item:hover { background: var(--rail-hover); color: var(--ink); }
.user-pop-item svg { width: 16px; height: 16px; }
.empty-action { margin-top: 16px; }
@media (max-width: 1100px) { .top-chip .muted { display: none; } }
@media (max-width: 760px) { .top-status { display: none; } }

/* Sidebar fits 1440×900 without scrolling; live dot on today's takings. */
.side { gap: 2px; }
.side a.nav { min-height: 40px; }
.side-label { padding: 14px 12px 4px; }
.side-venue { padding: 10px 12px; margin-bottom: 4px; }
.side-brand { padding-bottom: 12px; margin-bottom: 10px; }
.nav-count { width: auto; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }

/* After the first page of a session the logo and name are shown finished (no replayed draw-in). */
.no-intro .pd-leg, .no-intro .pd-rim { animation: none; stroke-dashoffset: 0; }
.no-intro .pd-spoke, .no-intro .pd-by { animation: none; opacity: 1; }
.no-intro .pd-cab { animation: none; opacity: 1; }
.no-intro .pd-w { animation: none; opacity: 1; transform: none; }

/* Turning wheel: cabins fade in (their transform belongs to the SMIL rotation), hangers in ink. */
.pd-cab rect { stroke: var(--panel, #fff); stroke-width: 1; }
.pd-hang { stroke: #22566A; stroke-width: 1.2; fill: none; }
.pd-cab.c0 rect { fill: #E0A23A; } .pd-cab.c1 rect { fill: #4FA3B8; } .pd-cab.c2 rect { fill: #D9826A; }
:root[data-theme="dark"] .pd-hang { stroke: #8ECFDC; }

/* Skeleton loader (app.js): placeholder blocks over the content area while the next page arrives. */
.content.is-loading, main.is-loading { position: relative; }
main.is-loading > :not(.skel-page) { visibility: hidden; }
.skel-page { position: absolute; inset: 0; padding: inherit; display: flex; flex-direction: column; gap: 16px; }
:root { --skel: #E8EDF2; --skel-hi: #F5F8FA; }
:root[data-theme="dark"] { --skel: #232D33; --skel-hi: #2C383F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --skel: #232D33; --skel-hi: #2C383F; } }
.skel { background: linear-gradient(90deg, var(--skel) 0%, var(--skel-hi) 40%, var(--skel) 80%); background-size: 300% 100%; border-radius: 8px; animation: skel-sweep 1.2s ease-in-out infinite; }
.skel-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.skel-title { width: min(260px, 50%); height: 24px; }
.skel-pill { width: 120px; height: 34px; border-radius: 10px; }
.skel-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.skel-tile { height: 92px; border-radius: 12px; }
.skel-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.skel-line { height: 14px; }
.skel-line:nth-child(odd) { width: 92%; }
.skel-line:nth-child(even) { width: 78%; }
.skel-line-head { width: 40% !important; height: 18px; }
@keyframes skel-sweep { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (max-width: 760px) { .skel-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* Phones: the page title keeps its own line; page buttons that do not fit beside it wrap below it. */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar > .grow { min-width: max-content; max-width: calc(100% - 52px); }
  .topbar > .grow h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .btn:not(.btn-icon) { height: 36px; padding: 0 10px; font-size: 13px; }
}

/* Phones: the page title keeps its room next to the period picker and account menu. */
@media (max-width: 520px) {
  .topbar { gap: 8px; }
  .topbar h1 { white-space: nowrap; }
  .period-pick { padding: 0 6px 0 10px; }
  .period-pick > svg { display: none; }
  .period-pick select { max-width: 120px; text-overflow: ellipsis; }
  .period-pick .fsel-btn { padding: 0 28px 0 12px; max-width: 136px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-menu > summary svg { display: none; }
}
