/* ==========================================================================
   Pilgrimas design system
   One shared look for every organisation (BR-07). Desktop and mobile are
   designed separately: see the "Mobile" blocks under each component.
   ========================================================================== */

:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* Neutrals: warm stone */
  --bg: #f6f5f1;
  --surface: #ffffff;
  --sunken: #fafaf7;
  --hover: #f4f3ee;
  --border: #e9e6df;
  --border-strong: #d8d4ca;
  --text: #1b1915;
  --text-2: #55514a;
  --text-3: #78736a;

  /* Brand: Pilgrimas forest green (logo #013F21) */
  --brand-50: #edf7f0;
  --brand-100: #d3ecdb;
  --brand-200: #a5d7b6;
  --brand-500: #148a4d;
  --brand-600: #0d7040;
  --brand-700: #0a5a33;
  --brand-900: #013f21;

  /* Accent: Pilgrimas gold (logo #FDC403), used for milestones */
  --gold-50: #fff8df;
  --gold-200: #f8de86;
  --gold-500: #f0b400;
  --gold-700: #855f00;

  --good: #137a47; --good-bg: #ecf8f1; --good-border: #c3e7d2;
  --warn: #a35a04; --warn-bg: #fff5e6; --warn-border: #f5d9ad;
  --bad: #b3261e; --bad-bg: #fdefed; --bad-border: #f5cbc6;
  --info: #2c5ccf; --info-bg: #eef3ff; --info-border: #d1ddfa;

  /* Neutrals used by components (overridden in dark mode) */
  --text-4: #a39d92;
  --muted-bg: #f3f2ed;
  --track: #ecebe5;
  --row-hover: #fbfaf7;
  --sidebar-bg: #f1f0eb;
  --border-hover: #c6c1b5;
  --mark-border: #cfcabe;
  --glass-bg: rgba(246, 245, 241, .84);
  --glass-surface: rgba(255, 255, 255, .92);
  --on-inverse: #ffffff;
  --brand-ink: #013f21;
  --brand-press: #0a5a33;
  --gold-ink: #5c3d09;
  --bad-ink: #7a1912;
  --wordmark-gold: #e0a500;
  color-scheme: light;

  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --sh-xs: 0 1px 2px rgba(27, 25, 21, .05);
  --sh-sm: 0 1px 2px rgba(27, 25, 21, .04), 0 2px 6px rgba(27, 25, 21, .05);
  --sh-md: 0 1px 3px rgba(27, 25, 21, .05), 0 10px 24px -6px rgba(27, 25, 21, .12);
  --sh-lg: 0 4px 8px -4px rgba(27, 25, 21, .08), 0 22px 48px -12px rgba(27, 25, 21, .24);
  --ring: 0 0 0 3px rgba(20, 138, 77, .22);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 64px;
  --sidebar-w: 252px;
}

/* --------------------------------------------------------------------------
   Dark mode: follows the device unless the person picks Light or Dark
   (stored in localStorage, applied as <html data-theme> before paint).
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  --bg: #111a16;
  --surface: #18241e;
  --sunken: #142019;
  --hover: #20302a;
  --border: #27382f;
  --border-strong: #33483d;
  --text: #eaf2ec;
  --text-2: #b6c6bc;
  --text-3: #8aa093;
  --text-4: #66796d;

  --brand-50: #143423;
  --brand-100: #1b4730;
  --brand-200: #276242;
  --brand-500: #34b872;
  --brand-600: #22a25e;
  --brand-700: #5ccf90;
  --brand-ink: #b9ebcd;
  --brand-press: #1a8a4f;

  --gold-50: #2b2a12;
  --gold-200: #5c4813;
  --gold-500: #f0b400;
  --gold-700: #f4cd57;
  --gold-ink: #f6dc94;

  --good: #4cc488; --good-bg: #11271b; --good-border: #1f4b32;
  --warn: #f2a94e; --warn-bg: #2b1e0c; --warn-border: #5b3d13;
  --bad: #ff7d70; --bad-bg: #2d1413; --bad-border: #5e2521;
  --bad-ink: #ffc0b8;
  --info: #93b3ff; --info-bg: #131c33; --info-border: #273b68;

  --muted-bg: #20302a;
  --track: #2a3d33;
  --row-hover: #1c2b24;
  --sidebar-bg: #131e19;
  --border-hover: #45604f;
  --mark-border: #45604f;
  --glass-bg: rgba(17, 26, 22, .84);
  --glass-surface: rgba(24, 36, 30, .92);
  --on-inverse: #111a16;
  --wordmark-gold: #f0b400;

  --sh-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .3);
  --sh-md: 0 1px 3px rgba(0, 0, 0, .35), 0 10px 24px -6px rgba(0, 0, 0, .55);
  --sh-lg: 0 4px 8px -4px rgba(0, 0, 0, .4), 0 22px 48px -12px rgba(0, 0, 0, .7);
  --ring: 0 0 0 3px rgba(52, 184, 114, .32);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111a16;
    --surface: #18241e;
    --sunken: #142019;
    --hover: #20302a;
    --border: #27382f;
    --border-strong: #33483d;
    --text: #eaf2ec;
    --text-2: #b6c6bc;
    --text-3: #8aa093;
    --text-4: #66796d;

    --brand-50: #143423;
    --brand-100: #1b4730;
    --brand-200: #276242;
    --brand-500: #34b872;
    --brand-600: #22a25e;
    --brand-700: #5ccf90;
    --brand-ink: #b9ebcd;
    --brand-press: #1a8a4f;

    --gold-50: #2b2a12;
    --gold-200: #5c4813;
    --gold-500: #f0b400;
    --gold-700: #f4cd57;
    --gold-ink: #f6dc94;

    --good: #4cc488; --good-bg: #11271b; --good-border: #1f4b32;
    --warn: #f2a94e; --warn-bg: #2b1e0c; --warn-border: #5b3d13;
    --bad: #ff7d70; --bad-bg: #2d1413; --bad-border: #5e2521;
    --bad-ink: #ffc0b8;
    --info: #93b3ff; --info-bg: #131c33; --info-border: #273b68;

    --muted-bg: #20302a;
    --track: #2a3d33;
    --row-hover: #1c2b24;
    --sidebar-bg: #131e19;
    --border-hover: #45604f;
    --mark-border: #45604f;
    --glass-bg: rgba(17, 26, 22, .84);
    --glass-surface: rgba(24, 36, 30, .92);
    --on-inverse: #111a16;
    --wordmark-gold: #f0b400;

    --sh-xs: 0 1px 2px rgba(0, 0, 0, .35);
    --sh-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .3);
    --sh-md: 0 1px 3px rgba(0, 0, 0, .35), 0 10px 24px -6px rgba(0, 0, 0, .55);
    --sh-lg: 0 4px 8px -4px rgba(0, 0, 0, .4), 0 22px 48px -12px rgba(0, 0, 0, .7);
    --ring: 0 0 0 3px rgba(52, 184, 114, .32);
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { margin: 0; color: var(--text); letter-spacing: -.02em; line-height: 1.2; font-weight: 650; }
p { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand-100); }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 6px; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hide { display: none !important; }

/* Layout helpers */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-xs { display: flex; flex-direction: column; gap: 4px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.stack-xl { display: flex; flex-direction: column; gap: 40px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .grid-3-lg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.with-aside { display: grid; gap: 24px; align-items: start; }
.with-aside > * { min-width: 0; }
@media (min-width: 1024px) {
  .with-aside { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; }
  .sticky { position: sticky; top: calc(var(--header-h) + 24px); }
  .staff .sticky { top: 32px; }
}

/* --------------------------------------------------------------------------
   Logo
   -------------------------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 680; font-size: 15.5px; letter-spacing: -.015em; }
.logo:hover { color: var(--text); }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; box-shadow: 0 1px 2px rgba(1,63,33,.3), 0 0 0 1px rgba(1,63,33,.08); }
.wordmark { font-size: 18px; font-weight: 760; letter-spacing: -.025em; color: var(--text); }
.wordmark b { font-weight: 800; color: var(--wordmark-gold); }
.sidebar .wordmark { font-size: 17px; }
.auth-logo { display: block; width: 210px; height: auto; margin-left: -6px; }
.band-logo { display: block; width: 190px; height: auto; margin: -8px 0 18px -6px; }
.pass-mark { width: 18px; height: 18px; border-radius: 5px; }

/* --------------------------------------------------------------------------
   Pilgrim + public header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass-bg);
  backdrop-filter: saturate(170%) blur(14px);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  border-bottom: 1px solid rgba(233, 230, 223, .9);
}
.site-header-inner { max-width: 1180px; margin: 0 auto; height: var(--header-h); padding: 0 28px; display: flex; align-items: center; gap: 20px; }
.org-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 9px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; font-weight: 560; color: var(--text-2); white-space: nowrap; box-shadow: var(--sh-xs);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.org-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); flex-shrink: 0; }
.header-org { display: none; }
.topnav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.topnav a {
  position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 9px;
  color: var(--text-2); font-size: 14.5px; font-weight: 540; transition: color .15s, background .15s;
}
.topnav a:hover { color: var(--text); background: rgba(27,25,21,.04); }
.topnav a[aria-current] { color: var(--text); font-weight: 600; }
.topnav a[aria-current]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -14px; height: 2px; border-radius: 2px; background: var(--brand-600); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  color: var(--text-2); background: transparent; border: 0; cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(27,25,21,.05); color: var(--text); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 2px var(--bg); }

.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(150deg, var(--brand-100), var(--brand-200)); color: var(--brand-ink);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.avatar-lg { width: 44px; height: 44px; font-size: 14.5px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }
.avatar.female { background: linear-gradient(150deg, var(--gold-50), var(--gold-200)); color: var(--gold-700); }

/* Dropdown menu (details/summary) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-lg);
  animation: pop .14s var(--ease);
}
.menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-name { font-weight: 600; font-size: 14px; }
.menu-sub { font-size: 12.5px; color: var(--text-3); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; font-weight: 520; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--hover); color: var(--text); }
.menu-item .icon { width: 16px; height: 16px; }

/* Main container */
.container { max-width: 1180px; margin: 0 auto; padding: 36px 28px 80px; }
.container-narrow { max-width: 760px; }

/* Bottom tab bar (pilgrim, mobile only) */
.tabbar { display: none; }

/* --------------------------------------------------------------------------
   Page header
   -------------------------------------------------------------------------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-title { font-size: 30px; line-height: 1.15; font-weight: 680; letter-spacing: -.028em; }
.page-subtitle { margin-top: 6px; color: var(--text-2); font-size: 15.5px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--brand-600); }
.crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-3); font-weight: 520; }
.crumbs a:hover { color: var(--text); }
.crumbs .icon { width: 14px; height: 14px; }
.section-title { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head p { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-xs); }
.card.flush { overflow: hidden; }
.card-body { padding: 22px 24px; }
.card-body.tight { padding: 16px 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 640; letter-spacing: -.01em; }
.card-desc { margin-top: 2px; font-size: 13px; color: var(--text-3); }
.card-footer { padding: 14px 24px; border-top: 1px solid var(--border); background: var(--sunken); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-raised { box-shadow: var(--sh-md); border-color: transparent; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* Stats / KPI tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; position: relative; }
.stat-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 540; color: var(--text-3); }
.stat-label .icon { width: 15px; height: 15px; }
.stat-value { margin-top: 8px; font-size: 26px; font-weight: 660; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-meta { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.stat.highlight { background: linear-gradient(180deg, var(--gold-50), var(--surface) 70%); border-color: var(--gold-200); }
.stat.highlight .stat-value { color: var(--gold-700); }
a.stat { color: inherit; transition: box-shadow .2s var(--ease), border-color .2s; }
a.stat:hover { box-shadow: var(--sh-md); border-color: var(--border-strong); color: inherit; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 580; line-height: 1; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background .15s var(--ease), border-color .15s, box-shadow .15s, color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(1,63,33,.3); }
.btn-primary:hover { background: var(--brand-press); color: #fff; }
.btn-dark { background: var(--text); color: var(--on-inverse); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 2px rgba(0,0,0,.3); }
.btn-dark:hover { background: var(--text-2); color: var(--on-inverse); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-xs); }
.btn-secondary:hover { background: var(--sunken); color: var(--text); border-color: var(--border-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(27,25,21,.05); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad-border); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-good { background: var(--good); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.2); }
.btn-good:hover { background: #0f6a3c; color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-600); font-weight: 560; cursor: pointer; }
.link-btn:hover { color: var(--brand-700); }
form.inline { display: inline; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; gap: 18px; }
@media (min-width: 768px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
  .form-grid .span-2 { grid-column: 1 / -1; }
}
.form-section { padding: 24px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }
.form-section-head { margin-bottom: 18px; }
.form-section-head h3 { font-size: 15px; font-weight: 640; }
.form-section-head p { margin-top: 3px; font-size: 13.5px; color: var(--text-3); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--sunken); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { font-size: 13.5px; font-weight: 580; color: var(--text); }
.optional { font-weight: 450; color: var(--text-3); margin-left: 4px; font-size: 12.5px; }
.help { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.error-text { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 520; color: var(--bad); }
.error-text .icon { width: 14px; height: 14px; }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=datetime-local], input[type=month], input[type=search], input[type=url], select, textarea {
  width: 100%; height: 40px; padding: 0 12px;
  font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--sh-xs); transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select {
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23918b80' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
input::placeholder, textarea::placeholder { color: var(--text-4); }
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.has-error input:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, .16); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-600); cursor: pointer; flex-shrink: 0; }
input[type=file] { font-size: 13.5px; color: var(--text-3); padding: 10px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--sunken); width: 100%; cursor: pointer; }
input[type=file]::file-selector-button {
  margin-right: 12px; height: 34px; padding: 0 14px; font: inherit; font-size: 13.5px; font-weight: 580; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: var(--sh-xs); cursor: pointer;
}
input[type=file]:hover { border-color: var(--brand-200); }
.check { display: flex; gap: 11px; align-items: flex-start; font-size: 14.5px; cursor: pointer; line-height: 1.4; }
.check input { margin-top: 1px; }
.check .help { display: block; margin-top: 2px; }

.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-icon input { padding-left: 36px; }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; font-weight: 600; color: var(--text-3); pointer-events: none; }
.input-affix input { padding-left: 48px; font-variant-numeric: tabular-nums; }
.price-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Choice cards (radio/checkbox styled as cards) */
.choices { display: grid; gap: 10px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.choice:hover { border-color: var(--brand-200); }
.choice:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); box-shadow: var(--ring); }
.choice-title { font-weight: 600; font-size: 14.5px; }
.choice-sub { font-size: 12.5px; color: var(--text-3); }
.choice-end { text-align: right; white-space: nowrap; flex: none; }
.choice.is-full { opacity: .55; cursor: not-allowed; }
@media (max-width: 640px) {
  .pickup-choices .choice { flex-wrap: wrap; row-gap: 6px; }
  .pickup-choices .choice-sub { display: block; line-height: 1.45; }
  .pickup-choices .choice-end { flex-basis: 100%; display: flex; align-items: baseline; gap: 6px; padding-left: 30px; text-align: left; }
  .pickup-choices .choice-end > span:last-child { display: inline !important; margin-left: auto; }
}
.bad-text { color: var(--bad); }

/* Segmented control (radio) */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--muted-bg); border-radius: 10px; }
.segmented label { position: relative; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 560; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.segmented label:has(input:focus-visible) { box-shadow: var(--ring); }
.seg-link { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 560; color: var(--text-2); white-space: nowrap; text-decoration: none; }
.seg-link:hover { color: var(--text); }
.seg-link.is-on { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }

/* Filter pills */
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; white-space: nowrap;
  font-size: 13.5px; font-weight: 560; color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}
.pill:hover { color: var(--text); border-color: var(--border-strong); }
.pill[aria-current] { background: var(--text); color: var(--on-inverse); border-color: var(--text); }
.pill .count { font-size: 11.5px; opacity: .7; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .input-icon { flex: 1 1 260px; max-width: 360px; }
.toolbar select { width: auto; min-width: 170px; }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid; line-height: 1;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-neutral { color: var(--text-2); background: var(--muted-bg); border-color: var(--border); }
.badge-good { color: var(--good); background: var(--good-bg); border-color: var(--good-border); }
.badge-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.badge-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); }
.badge-info { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.badge-brand { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100); }
.badge-gold { color: var(--gold-700); background: var(--gold-50); border-color: var(--gold-200); }

/* --------------------------------------------------------------------------
   Tables (desktop) → stacked cards (mobile)
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
  padding: 10px 16px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .01em;
  background: var(--sunken); border-bottom: 1px solid var(--border);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--row-hover); }
.table tr[data-href] { cursor: pointer; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 580; color: var(--text); }
a.cell-title:hover { color: var(--brand-700); }
.cell-sub { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.cell-person { display: flex; align-items: center; gap: 12px; }
.table-empty td { padding: 0 !important; }

/* Bar (progress inside tables) */
.minibar { width: 100%; min-width: 80px; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; }
.minibar > span { display: block; height: 100%; border-radius: 999px; background: var(--brand-500); }
.minibar.gold > span { background: var(--gold-500); }
.meter-cell { width: 100%; }
@media (max-width: 767px) { .meter-cell { width: 58%; } }
.minibar.good > span { background: var(--good); }

/* List rows */
.list { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 16px 24px; color: inherit;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.list > li:last-child > .list-row, .list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--row-hover); color: inherit; }
.list-row .chev { color: var(--text-4); width: 18px; height: 18px; }
.list-title { font-weight: 600; font-size: 14.5px; }
.list-sub { font-size: 13px; color: var(--text-3); margin-top: 1px; }

/* Description list */
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; font-weight: 520; }

/* Facts tiles */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.fact { background: var(--surface); padding: 16px 18px; }
.fact-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); font-weight: 540; }
.fact-label .icon { width: 14px; height: 14px; }
.fact-value { margin-top: 5px; font-size: 15px; font-weight: 620; letter-spacing: -.01em; }
.fact-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* --------------------------------------------------------------------------
   Payment milestone bar (80% room, 100% ticket)
   -------------------------------------------------------------------------- */
.milestone { position: relative; }
.milestone-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: 12px; font-weight: 560; color: var(--text-3); }
.milestone-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.milestone-legend i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--mark-border); background: var(--surface); }
.milestone-legend .reached { color: var(--gold-700); }
.milestone-legend .reached i { background: var(--gold-500); border-color: var(--gold-500); }
.milestone-track { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; box-shadow: inset 0 1px 1px rgba(0,0,0,.04); }
.milestone-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1d9a58, var(--brand-600)); transition: width .8s var(--ease); }
.milestone-fill.done { background: linear-gradient(90deg, #22a463, var(--good)); }
.milestone-mark { position: absolute; top: -3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--mark-border); display: grid; place-items: center; }
.milestone-mark.reached { background: var(--gold-500); border-color: var(--gold-500); color: #fff; }
.milestone-mark.reached svg { width: 10px; height: 10px; }
.milestone-mark.end { margin-left: -16px; }
.milestone-label { position: absolute; top: 20px; font-size: 12px; font-weight: 560; color: var(--text-3); white-space: nowrap; transform: translateX(-50%); }
.milestone-label.end { transform: translateX(-100%); }
.milestone-label.reached { color: var(--gold-700); }

/* Steps (Booked → 80% → 100%) */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { position: relative; display: flex; gap: 10px; align-items: flex-start; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--surface); border: 1.5px solid var(--border-strong); }
.step-dot svg { width: 14px; height: 14px; }
.step.done .step-dot { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.step.current .step-dot { border-color: var(--brand-500); color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-50); }
.step-title { font-size: 13.5px; font-weight: 620; line-height: 1.3; }
.step-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* --------------------------------------------------------------------------
   Callouts, toasts, empty states
   -------------------------------------------------------------------------- */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid; font-size: 14px; line-height: 1.5; }
.callout .icon { margin-top: 1px; }
.callout strong { font-weight: 620; }
.callout-brand { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-ink); }
.callout-brand .icon { color: var(--brand-600); }
.callout-gold { background: var(--gold-50); border-color: var(--gold-200); color: var(--gold-ink); }
.callout-gold .icon { color: var(--gold-500); }
.callout-bad { background: var(--bad-bg); border-color: var(--bad-border); color: var(--bad-ink); }
.callout-neutral { background: var(--sunken); border-color: var(--border); color: var(--text-2); }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; padding: 13px 12px 13px 15px;
  background: #1f1d19; color: #f4f2ec; border-radius: 13px; box-shadow: var(--sh-lg); font-size: 14px; line-height: 1.45;
  animation: toast-in .35s var(--ease);
}
.toast .icon { width: 18px; height: 18px; margin-top: 1px; }
.toast-success .icon { color: #4ade97; }
.toast-error .icon { color: #ff8a7a; }
.toast-warning .icon { color: #f5c46b; }
.toast-info .icon { color: #8fb4ff; }
.toast-close { margin-left: auto; background: none; border: 0; color: #9c978c; cursor: pointer; padding: 2px; border-radius: 6px; }
.toast-close:hover { color: #fff; }
.toast-close .icon { width: 16px; height: 16px; margin: 0; color: inherit; }
.toast.leaving { animation: toast-out .25s var(--ease) forwards; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 52px 24px; }
.empty-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; background: var(--brand-50); color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand-100); }
.empty-icon .icon { width: 22px; height: 22px; }
.empty-title { font-size: 15.5px; font-weight: 640; }
.empty-text { max-width: 380px; font-size: 14px; color: var(--text-3); }
.empty .btn { margin-top: 12px; }

/* --------------------------------------------------------------------------
   Trip cards
   -------------------------------------------------------------------------- */
.trip-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.trip-card {
  display: flex; flex-direction: column; overflow: hidden; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-xs);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s;
}
.trip-card:hover { color: inherit; transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--border-strong); }
.cover { position: relative; height: 132px; overflow: hidden; color: #fff; isolation: isolate; }
.cover::before { /* soft light sweep */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(140% 120% at 85% -10%, rgba(255,255,255,.28), transparent 45%),
              repeating-linear-gradient(135deg, rgba(255,255,255,.045) 0 2px, transparent 2px 14px);
}
.cover-place { position: absolute; right: 18px; bottom: 14px; text-align: right; }
.cover-place-name { font-size: 20px; font-weight: 700; letter-spacing: -.02em; text-shadow: 0 1px 12px rgba(0,0,0,.2); }
.cover-place-country { font-size: 11.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; opacity: .86; }
.cover .date-tile { position: absolute; left: 18px; bottom: 14px; }
.cover-RW { background: radial-gradient(90% 120% at 0% 100%, #d3a23f 0%, transparent 60%), linear-gradient(135deg, #013f21, #0d7040 60%, #1f9a5a); }
.cover-UG { background: radial-gradient(90% 120% at 100% 0%, #c4362a 0%, transparent 60%), linear-gradient(135deg, #2b2620, #8a5d12 55%, #c58b29); }
.cover-KE { background: radial-gradient(90% 120% at 100% 100%, #a3261f 0%, transparent 55%), linear-gradient(135deg, #10291c, #146c3e 60%, #1f8a50); }
.cover-TZ { background: radial-gradient(90% 120% at 0% 0%, #1f9e5a 0%, transparent 55%), linear-gradient(135deg, #0f2c44, #175f8f 55%, #2185b8); }
.cover-default { background: linear-gradient(135deg, var(--brand-900), var(--brand-600)); }

.date-tile { width: 52px; overflow: hidden; text-align: center; border-radius: 11px; background: var(--surface); color: var(--text); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.date-tile-month { padding: 4px 0 3px; font-size: 10.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--bad); }
.date-tile-day { padding: 2px 0 5px; font-size: 21px; font-weight: 720; letter-spacing: -.03em; }
.date-tile.plain { box-shadow: var(--sh-xs); border: 1px solid var(--border); }

.trip-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 20px; }
.trip-card-title { font-size: 17px; font-weight: 660; letter-spacing: -.02em; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-3); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .icon { width: 14px; height: 14px; }
.trip-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.from { font-size: 12px; color: var(--text-3); font-weight: 520; }
.price { font-size: 18px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price small { font-size: 12.5px; font-weight: 560; color: var(--text-3); letter-spacing: 0; }
.places { font-size: 12.5px; color: var(--text-3); text-align: right; }
.places strong { color: var(--text); font-weight: 650; }

/* Trip hero (detail page) */
.trip-hero { position: relative; border-radius: var(--r-xl); padding: 28px 32px; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; overflow: hidden; isolation: isolate; box-shadow: var(--sh-md); margin-bottom: 28px; }
.trip-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 100% at 90% -20%, rgba(255,255,255,.25), transparent 45%), repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, transparent 2px 16px); }
.trip-hero .crumbs, .trip-hero .crumbs a { color: rgba(255,255,255,.78); }
.trip-hero .crumbs a:hover { color: #fff; }
.trip-hero-title { font-size: 36px; font-weight: 720; letter-spacing: -.03em; line-height: 1.1; color: #fff; }
.trip-hero .meta { color: rgba(255,255,255,.88); font-size: 14px; margin-top: 10px; }
.trip-hero .badge { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.25); backdrop-filter: blur(6px); }

/* Package cards */
.package { position: relative; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.package-price { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.package-price small { font-size: 13px; font-weight: 520; color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.package-incl { font-size: 13.5px; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 540; color: var(--text-2); background: var(--sunken); border: 1px solid var(--border); }
.chip .icon { width: 14px; height: 14px; }
.chip-off { color: var(--text-4); background: transparent; border-style: dashed; text-decoration: line-through; text-decoration-color: var(--text-4); }

/* Booking traveller picker */
.pick { border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s, background .15s; }
.pick + .pick { margin-top: 10px; }
.pick-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.pick-head input[type=checkbox] { width: 20px; height: 20px; }
.pick-options { display: none; padding: 0 16px 16px 48px; gap: 14px; }
.pick:has(.pick-head input:checked) { border-color: var(--brand-500); box-shadow: var(--ring); }
.pick:has(.pick-head input:checked) .pick-options { display: grid; }
@media (min-width: 768px) { .pick-options { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }

/* Summary (quote) */
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.summary-row + .summary-row { border-top: 1px solid var(--border); }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; margin-top: 6px; border-top: 1px solid var(--border-strong); }
.summary-total .price { font-size: 24px; }

/* Booking hero */
.pickup-strip { display: flex; align-items: center; gap: 14px; }
.pickup-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); flex: none; }
.pickup-icon .icon { width: 18px; height: 18px; }
.lead-card { color: inherit; transition: box-shadow .15s; }
.lead-card:hover { box-shadow: var(--sh-md, var(--sh-sm)); }
.lead-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.lead-callout { color: inherit; align-items: center; }
.price-list .summary-row { padding: 6px 0; font-size: 13.5px; }
.booking-hero { padding: 24px 26px 22px; }
.amount-pair { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.amount-big { font-size: 32px; font-weight: 720; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.amount-of { font-size: 14px; color: var(--text-3); font-weight: 520; margin-top: 6px; }

.next-aside { display: flex; flex-direction: column; justify-content: center; gap: 14px; height: 100%; padding: 24px; background: var(--sunken); border-top: 1px solid var(--border); }
@media (min-width: 1024px) { .next-aside { border-top: 0; border-left: 1px solid var(--border); } }

/* --------------------------------------------------------------------------
   Boarding pass ticket
   -------------------------------------------------------------------------- */
.pass { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 248px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--sh-md); overflow: hidden; }
.pass::before { content: ""; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--brand-500), #1d9a58 45%, var(--gold-500)); }
.pass-main { padding: 28px 30px 26px; }
.pass-org { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-600); }
.pass-title { margin-top: 8px; font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.route { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.route-point .code { font-size: 20px; font-weight: 720; letter-spacing: -.02em; }
.route-point .name { font-size: 12px; color: var(--text-3); }
.route-line { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.route-line::before, .route-line::after { content: ""; flex: 1; border-top: 1.5px dashed var(--border-strong); }
.route-line .icon { width: 18px; height: 18px; color: var(--brand-600); }
.pass-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.pass-label { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.pass-value { margin-top: 3px; font-size: 14.5px; font-weight: 620; }
.pass-stub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 26px 22px; background: var(--sunken); border-left: 2px dashed var(--border-strong); }
.pass-stub::before, .pass-stub::after { content: ""; position: absolute; left: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
.pass-stub::before { top: -13px; }
.pass-stub::after { bottom: -13px; }
.pass-qr { padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--sh-sm); border: 1px solid var(--border); }
.pass-qr svg { width: 172px; height: 172px; }
.pass-number { font-family: var(--mono); font-size: 13.5px; font-weight: 650; letter-spacing: .02em; }

/* --------------------------------------------------------------------------
   Public pages (landing, auth)
   -------------------------------------------------------------------------- */
.public-bg { background:
  radial-gradient(1200px 600px at 85% -10%, rgba(240,180,0,.12), transparent 60%),
  radial-gradient(900px 520px at -10% 10%, rgba(20,138,77,.12), transparent 60%),
  var(--bg); }
.hero { display: grid; gap: 48px; align-items: center; padding: 72px 0 56px; }
@media (min-width: 1024px) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); padding: 96px 0 80px; } }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-xs); font-size: 13px; font-weight: 560; color: var(--text-2); }
.hero-kicker .tag { height: 20px; padding: 0 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; }
.hero-title { margin-top: 22px; font-size: 56px; line-height: 1.03; font-weight: 740; letter-spacing: -.045em; }
.hero-title em { font-style: normal; background: linear-gradient(100deg, var(--brand-600), #1d9a58 50%, var(--gold-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { margin-top: 20px; max-width: 520px; font-size: 18px; line-height: 1.55; color: var(--text-2); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 18px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-3); }
.hero-note span { display: inline-flex; gap: 6px; align-items: center; }
.hero-note .icon { width: 16px; height: 16px; color: var(--brand-600); }

.showcase { position: relative; min-height: 420px; }
.showcase .float { position: absolute; }
.showcase .float-a { left: 0; right: 40px; top: 10px; transform: rotate(-2.5deg); }
.showcase .float-b { right: 0; width: 300px; bottom: 0; transform: rotate(2deg); }
.showcase .pass { grid-template-columns: minmax(0, 1fr) 150px; }
.showcase .pass-qr svg { width: 104px; height: 104px; }
.showcase .pass-main { padding: 22px 24px; }

.feature-strip { display: grid; gap: 16px; padding: 8px 0 72px; }
@media (min-width: 900px) { .feature-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature { padding: 26px; }
.feature-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--brand-700); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-100); margin-bottom: 16px; }
.feature h3 { font-size: 17px; }
.feature p { margin-top: 8px; color: var(--text-2); font-size: 14.5px; }

.org-band { display: grid; gap: 32px; padding: 44px; border-radius: 24px; color: #e9f4f0; background: radial-gradient(800px 400px at 100% 0%, rgba(240,180,0,.22), transparent 60%), linear-gradient(140deg, var(--brand-900), #02502b); box-shadow: var(--sh-lg); margin-bottom: 72px; }
@media (min-width: 900px) { .org-band { grid-template-columns: 1fr 1fr; align-items: center; padding: 56px; } }
.org-band h2 { color: #fff; font-size: 30px; letter-spacing: -.03em; }
.org-band p { color: rgba(233,244,240,.8); margin-top: 12px; font-size: 16px; }
.org-list { display: grid; gap: 14px; }
.org-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.org-list .icon { color: #f8de86; margin-top: 2px; }
.public-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }

.auth { min-height: 100vh; display: grid; }
@media (min-width: 1024px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.auth-panel { display: none; }
@media (min-width: 1024px) {
  .auth-panel {
    position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px; overflow: hidden; isolation: isolate;
    color: #e9f4f0; background: radial-gradient(700px 420px at 110% 0%, rgba(240,180,0,.26), transparent 60%), linear-gradient(150deg, #02502b, var(--brand-900) 70%);
  }
  .auth-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 18px); }
}
.auth-panel .logo { color: #fff; }
.auth-quote { max-width: 440px; }
.auth-quote h2 { color: #fff; font-size: 34px; line-height: 1.12; letter-spacing: -.035em; }
.auth-quote p { margin-top: 14px; color: rgba(233,244,240,.8); font-size: 16px; }
.auth-points { display: grid; gap: 12px; margin-top: 28px; }
.auth-point { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.auth-point .n { min-width: 40px; padding: 0 6px; height: 28px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; background: rgba(240,180,0,.2); color: #f8de86; font-weight: 700; font-size: 13px; }
.auth-main { display: flex; flex-direction: column; padding: 28px; }
.auth-form { width: 100%; max-width: 420px; margin: auto; padding: 40px 0; }
.auth-title { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.auth-sub { margin-top: 8px; color: var(--text-2); }
.auth-alt { margin-top: 22px; text-align: center; font-size: 14px; color: var(--text-3); }

/* --------------------------------------------------------------------------
   Staff app shell
   -------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 14px; background: var(--sidebar-bg); border-right: 1px solid var(--border); overflow-y: auto; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 18px; }
.workspace { display: flex; align-items: center; gap: 10px; padding: 10px 10px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-xs); }
.workspace-mark { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(150deg, var(--gold-200), var(--gold-500)); color: #3b2706; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.workspace-name { font-size: 13.5px; font-weight: 640; line-height: 1.25; }
.workspace-sub { font-size: 12px; color: var(--text-3); }
.side-section { padding: 16px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-4); }
.side-link { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; margin-bottom: 2px; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 540; transition: background .12s, color .12s; }
.side-link .icon { width: 18px; height: 18px; color: var(--text-3); }
.side-link:hover { background: rgba(27,25,21,.05); color: var(--text); }
.side-link[aria-current] { background: var(--surface); color: var(--text); font-weight: 620; box-shadow: var(--sh-sm); }
.side-link[aria-current] .icon { color: var(--brand-600); }
.side-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--gold-700); background: var(--gold-50); border: 1px solid var(--gold-200); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; }
.me-name { font-size: 13.5px; font-weight: 620; line-height: 1.25; }
.me-role { font-size: 12px; color: var(--text-3); }
.app-main { min-width: 0; }
.app-topbar { display: none; }
.app-content { max-width: 1240px; margin: 0 auto; padding: 36px 44px 72px; }
.scrim { display: none; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin: -8px 0 26px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-3); font-size: 14px; font-weight: 560; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-current] { color: var(--text); border-bottom-color: var(--brand-600); font-weight: 620; }
.tab .icon { width: 16px; height: 16px; }

/* Bar list */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 13.5px; }
.bar-row .minibar { grid-column: 1 / -1; }

/* Check-in */
.scan-box input { height: 56px; font-size: 18px; border-radius: 14px; padding-left: 48px; }
.scan-box .input-icon > .icon { left: 16px; width: 22px; height: 22px; }
.scan-box.input-icon > .icon { left: 16px; width: 22px; height: 22px; }
.scan-box input { padding-right: 120px; }
.scan-cam {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--brand-50); color: var(--brand-ink);
  font: inherit; font-size: 14px; font-weight: 620; cursor: pointer;
}
.scan-cam:hover { background: var(--brand-100); }
.scan-cam .icon { width: 18px; height: 18px; }
.scanner { display: grid; gap: 10px; }
.scanner[hidden] { display: none; }
.scanner-view { position: relative; overflow: hidden; border-radius: 16px; background: #0b0f0d; aspect-ratio: 4 / 3; max-height: 60vh; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-frame { position: absolute; inset: 0; margin: auto; width: min(62%, 260px); aspect-ratio: 1; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.38); outline: 3px solid var(--gold-500); outline-offset: -3px; }
.scanner-msg { color: var(--text-2); }

/* Modal dialog (e.g. reverse a payment) */
.modal {
  width: min(440px, calc(100vw - 32px)); margin: auto; padding: 22px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: var(--sh-lg); text-align: left; white-space: normal; font-size: 14.5px;
}
.modal[open] { animation: pop .14s var(--ease); }
.modal::backdrop { background: rgba(20,18,15,.45); backdrop-filter: blur(2px); }
.modal-title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.modal-text { margin-top: 6px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.modal-actions { justify-content: flex-end; }
.scan-result { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: 18px; color: #fff; box-shadow: var(--sh-md); animation: pop .25s var(--ease); }
.scan-result .scan-icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.scan-result .scan-icon .icon { width: 26px; height: 26px; }
.scan-result h2 { color: #fff; font-size: 22px; }
.scan-result p { color: rgba(255,255,255,.92); margin-top: 4px; }
.scan-accepted { background: linear-gradient(140deg, #1a9a5b, #0f6b3d); }
.scan-duplicate { background: linear-gradient(140deg, #d38a1d, #a35a04); }
.scan-invalid { background: linear-gradient(140deg, #d2453a, #a11d16); }
.scan-photo { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; border: 2px solid rgba(255,255,255,.5); }
.counter { font-size: 40px; font-weight: 740; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.counter small { font-size: 18px; color: var(--text-3); font-weight: 600; letter-spacing: -.01em; }

/* Disclosure */
details.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 580; font-size: 14px; color: var(--brand-600); }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon { width: 16px; height: 16px; transition: transform .2s var(--ease); }
details.disclosure[open] > summary .icon { transform: rotate(90deg); }

/* Mobile CTA bar */
.mobile-cta { display: none; }

/* Animations */
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
.htmx-request .summary-total .price { opacity: .5; transition: opacity .15s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Tablet tweaks
   ========================================================================== */
@media (max-width: 1100px) and (min-width: 768px) {
  .topnav a { padding: 0 9px; }
  .org-chip { display: none; }
  .app-content { padding: 32px 28px 64px; }
}

/* ==========================================================================
   Mobile (< 768px): thumb-first layouts
   ========================================================================== */
@media (max-width: 767px) {
  :root { --header-h: 56px; }
  body { font-size: 16px; }
  .hide-mobile { display: none !important; }

  /* Header becomes compact; nav moves to the bottom tab bar */
  .site-header-inner { padding: 0 12px 0 16px; gap: 10px; }
  .logo-word { display: none; }
  .header-org { display: block; min-width: 0; font-size: 15px; font-weight: 650; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .org-chip, .topnav { display: none; }
  .pilgrim .menu { display: none; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--glass-surface); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--border);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; border-radius: 12px; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .01em; }
  .tabbar a .icon { width: 22px; height: 22px; transition: transform .2s var(--ease); }
  .tabbar a[aria-current] { color: var(--brand-600); }
  .tabbar a[aria-current] .tab-icon { background: var(--brand-50); }
  .tabbar .tab-icon { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 999px; transition: background .2s; }
  .tabbar a:active .icon { transform: scale(.92); }
  body.pilgrim { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  .container { padding: 20px 16px 40px; }
  .page-header { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 20px; }
  .page-title { font-size: 25px; }
  .page-subtitle { font-size: 15px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }

  .card { border-radius: 16px; }
  .card-body { padding: 18px; }
  .card-header { padding: 14px 18px; }
  .card-footer { padding: 14px 18px; }
  .form-section { padding: 18px; }
  .form-actions { padding: 14px 18px; flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 21px; }

  .btn { height: 44px; padding: 0 16px; font-size: 15px; }
  .btn-sm { height: 36px; font-size: 13.5px; }
  .btn-lg { height: 52px; font-size: 16px; }
  input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
  input[type=datetime-local], input[type=month], input[type=search], input[type=url], select { height: 48px; font-size: 16px; border-radius: 12px; }
  textarea { font-size: 16px; border-radius: 12px; }
  .label { font-size: 14.5px; }
  .toolbar .input-icon, .toolbar select { flex: 1 1 100%; max-width: none; }

  /* Tables turn into stacked cards */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 14px 18px; border-bottom: 1px solid var(--border); }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 5px 0 !important; border: 0; text-align: right; font-size: 14.5px; }
  .table.responsive td::before { content: attr(data-label); flex-shrink: 0; text-align: left; font-size: 13px; color: var(--text-3); font-weight: 520; }
  .table.responsive td.cell-main { display: block; text-align: left; padding: 0 0 8px !important; }
  .table.responsive td.cell-main::before, .table.responsive td[data-label=""]::before { display: none; }
  .table.responsive td.actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 10px !important; }
  .table.responsive .minibar { max-width: 140px; }
  .list-row { padding: 15px 18px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 10px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { padding: 14px 16px; }

  .steps { gap: 6px; }
  .step { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .step-sub { display: none; }
  .step-title { font-size: 12.5px; }

  .trip-grid { grid-template-columns: 1fr; gap: 14px; }
  .trip-card { border-radius: 18px; }
  .trip-card:hover { transform: none; }
  .cover { height: 116px; }
  .trip-hero { margin: -20px -16px 20px; border-radius: 0 0 24px 24px; padding: 20px 18px 22px; min-height: 200px; box-shadow: none; }
  .trip-hero-title { font-size: 28px; }

  .booking-hero { padding: 20px 18px; }
  .amount-big { font-size: 28px; }

  .pick-options { padding: 0 16px 16px; }

  /* Ticket: QR first for check-in */
  .pass { grid-template-columns: 1fr; border-radius: 22px; }
  .pass-stub { order: -1; border-left: 0; border-bottom: 2px dashed var(--border-strong); padding: 28px 20px 24px; }
  .pass-stub::before, .pass-stub::after { top: auto; bottom: -13px; }
  .pass-stub::before { left: -13px; }
  .pass-stub::after { left: auto; right: -13px; }
  .pass-qr svg { width: 220px; height: 220px; }
  .pass-main { padding: 22px 20px 24px; }
  .pass-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Sticky action bar above the home indicator */
  .mobile-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--glass-surface); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -12px rgba(27,25,21,.18);
  }
  .mobile-cta .btn { height: 48px; flex-shrink: 0; padding: 0 22px; }
  .mobile-cta-label { font-size: 12px; color: var(--text-3); font-weight: 560; }
  .mobile-cta-value { font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
  body.has-cta .tabbar { display: none; }
  body.has-cta { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .hide-on-mobile-cta { display: none; }

  .toasts { top: auto; bottom: calc(88px + env(safe-area-inset-bottom)); left: 12px; right: 12px; width: auto; }

  /* Public */
  .hero { padding: 36px 0 28px; gap: 36px; }
  .hero-title { font-size: 38px; letter-spacing: -.04em; }
  .hero-lead { font-size: 16.5px; }
  .hero-ctas .btn { flex: 1; }
  /* Landing ticket: stacked, not floating, so nothing overlaps on a phone */
  .showcase { min-height: 0; padding: 4px 6px 8px; }
  .showcase .float { position: relative; }
  .showcase .float-a { left: auto; right: auto; top: auto; transform: rotate(-1.5deg); }
  .showcase .float-b { width: 84%; margin: 14px 0 0 auto; transform: rotate(1.5deg); }
  .showcase .pass { grid-template-columns: minmax(0, 1fr) 108px; }
  .showcase .pass-main { padding: 20px 16px 18px; }
  .showcase .pass-org { font-size: 10px; letter-spacing: .1em; }
  .showcase .pass-title { font-size: 18px; }
  .showcase .route { margin-top: 12px; gap: 8px; }
  .showcase .route-point .code { font-size: 17px; }
  .showcase .pass-grid { gap: 10px 12px; margin-top: 14px; padding-top: 14px; }
  .showcase .pass-value { font-size: 13px; }
  .showcase .pass-stub { order: 0; padding: 16px 8px; gap: 8px; border-bottom: 0; border-left: 2px dashed var(--border-strong); }
  .showcase .pass-stub::before, .showcase .pass-stub::after { left: -13px; right: auto; }
  .showcase .pass-stub::before { top: -13px; bottom: auto; }
  .showcase .pass-stub::after { top: auto; bottom: -13px; }
  .showcase .pass-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .showcase .pass-qr { padding: 6px; border-radius: 10px; }
  .showcase .pass-qr svg { width: 76px; height: 76px; }
  .showcase .pass-number { font-size: 10.5px; }
  .scan-cam span { display: none; }
  .scan-box input { padding-right: 64px; }
  .org-band { padding: 28px 22px; border-radius: 20px; margin-bottom: 40px; }
  .org-band h2 { font-size: 24px; }
  .auth-main { padding: 18px; }
  .auth-form { padding: 24px 0; margin-top: 12px; }

  /* Staff: off-canvas sidebar */
  .app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 80; width: 286px; height: 100%; transform: translateX(-104%); transition: transform .28s var(--ease); box-shadow: var(--sh-lg); }
  body.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 75; background: rgba(20,18,15,.4); opacity: 0; pointer-events: none; transition: opacity .28s var(--ease); backdrop-filter: blur(2px); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .app-topbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 10px 0 6px;
    background: var(--glass-bg); backdrop-filter: saturate(170%) blur(14px); -webkit-backdrop-filter: saturate(170%) blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .app-topbar-title { flex: 1; min-width: 0; font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-content { padding: 20px 16px 48px; }
  .tabs { margin: -4px -16px 20px; padding: 0 12px; }
  .counter { font-size: 34px; }
}

@media (min-width: 768px) {
  .show-mobile { display: none !important; }
}

/* ==========================================================================
   Print (tickets, lists)
   ========================================================================== */
@media print {
  .site-header, .tabbar, .sidebar, .app-topbar, .no-print, .mobile-cta, .toasts { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .app { display: block; }
  .container, .app-content { padding: 0; max-width: none; }
  .container > *, .app-content > * { animation: none; }
  .card, .pass { box-shadow: none; }
  .pass { break-inside: avoid; margin-bottom: 18px; }
  .pass-stub::before, .pass-stub::after { display: none; }
}

/* Theme toggle */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}
.side-theme { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
.side-theme .icon-moon { display: none; }
:root[data-theme="dark"] .side-theme .icon-sun { display: none; }
:root[data-theme="dark"] .side-theme .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .side-theme .icon-sun { display: none; }
  :root:not([data-theme="light"]) .side-theme .icon-moon { display: block; }
}
.auth-main { position: relative; }
.auth-theme { position: absolute; top: 16px; right: 16px; }

/* Printing always uses the light palette, whatever the screen shows. */
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #ffffff; --surface: #ffffff; --sunken: #fafaf7; --hover: #f4f3ee;
    --border: #e9e6df; --border-strong: #d8d4ca;
    --text: #1b1915; --text-2: #55514a; --text-3: #78736a; --text-4: #a39d92;
    --muted-bg: #f3f2ed; --track: #ecebe5; --row-hover: #fbfaf7;
    --brand-50: #edf7f0; --brand-100: #d3ecdb; --brand-600: #0d7040; --brand-700: #0a5a33; --brand-ink: #013f21;
    --gold-50: #fff8df; --gold-200: #f8de86; --gold-700: #855f00; --gold-ink: #5c3d09;
    --good: #137a47; --good-bg: #ecf8f1; --good-border: #c3e7d2;
    --bad: #b3261e; --bad-bg: #fdefed; --bad-border: #f5cbc6; --bad-ink: #7a1912;
    color-scheme: light;
  }
}
