/* =====================================================================
   MASTER BOOKING — design system
   ---------------------------------------------------------------------
   Visual language borrowed from the objects of Kenyan intercity travel:
   the slatted destination board above a coach windscreen, the amber
   livery stripe down its flank, and the perforated ticket stub.
   ===================================================================== */

:root {
  /* Surfaces — cool paper, not cream */
  --paper:      #F3F5F2;
  --card:       #FFFFFF;
  --card-2:     #FAFBF9;
  --line:       #DFE4E0;
  --line-soft:  #ECEFEB;

  /* The board — deep slate with a green cast, like enamel at dusk */
  --ink:        #0B1F24;
  --slate:      #143039;
  --slate-2:    #1D414B;

  /* Interactive */
  --rift:       #0F6E7A;
  --rift-dark:  #0A545E;
  --rift-tint:  #E4F1F2;

  /* Signature accent — the livery stripe */
  --signal:     #F4A81D;
  --signal-dark:#D18C08;
  --signal-tint:#FDF2DC;

  /* Semantic */
  --ok:         #17795E;
  --ok-tint:    #E2F2EC;
  --warn:       #B87503;
  --warn-tint:  #FDF2DC;
  --bad:        #A3273A;
  --bad-tint:   #F9E7EA;
  --info:       #1F6091;
  --info-tint:  #E5EFF7;

  /* Text */
  --text:       #0B1F24;
  --text-2:     #4A5A5F;
  --text-3:     #7A8A8F;
  --on-dark:    #E8EFEF;
  --on-dark-2:  #9DB3B7;

  /* Type */
  --display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --body:    'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Space & shape */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(11,31,36,.06), 0 1px 3px rgba(11,31,36,.04);
  --shadow:    0 2px 4px rgba(11,31,36,.05), 0 8px 20px rgba(11,31,36,.07);
  --shadow-lg: 0 12px 40px rgba(11,31,36,.14);

  --sidebar-w: 246px;
}

/* ---------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--rift); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Visible keyboard focus everywhere — clerks work by keyboard */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------
   Type scale
   ------------------------------------------------------------------ */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }

.eyebrow {
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.num  { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.muted    { color: var(--text-2); }
.dim      { color: var(--text-3); }
.small    { font-size: .82rem; }
.tiny     { font-size: .72rem; }
.strong   { font-weight: 600; }
.upper    { text-transform: uppercase; letter-spacing: .06em; }
.right    { text-align: right; }
.center   { text-align: center; }
.nowrap   { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================================
   SIGNATURE 1 — THE DESTINATION BOARD
   The slatted panel above a coach windscreen. Used on the public hero,
   every trip card, the printed ticket and the manifest.
   ================================================================== */
.board {
  position: relative;
  background:
    repeating-linear-gradient(
      180deg,
      var(--slate) 0px, var(--slate) 7px,
      rgba(0,0,0,.16) 7px, rgba(0,0,0,.16) 8px
    );
  color: var(--on-dark);
  border-radius: var(--r);
  padding: 18px 20px 20px;
  overflow: hidden;
}

.board::after {                       /* the amber livery stripe */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg,
      var(--signal) 0%, var(--signal) 38%,
      var(--rift) 38%, var(--rift) 62%,
      var(--signal) 62%, var(--signal) 100%);
}

.board__route {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  letter-spacing: .04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: .6em;
  flex-wrap: wrap;
}

.board__arrow { color: var(--signal); font-weight: 400; }

.board__meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--on-dark-2);
}

.board__meta b { color: var(--on-dark); font-weight: 500; }

/* Compact variant used inside lists */
.board--sm { padding: 12px 14px 14px; border-radius: var(--r-sm); }
.board--sm .board__route { font-size: 1rem; }
.board--sm .board__meta { margin-top: 6px; font-size: .72rem; }

/* =====================================================================
   SIGNATURE 2 — THE TICKET STUB
   Perforated edge with punched notches. Tickets, waybills, receipts.
   ================================================================== */
.stub {
  position: relative;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stub__tear {
  position: relative;
  border-top: 2px dashed var(--line);
  margin: 0;
}

.stub__tear::before,
.stub__tear::after {                  /* the punched notches */
  content: '';
  position: absolute;
  top: -11px;
  width: 20px; height: 20px;
  background: var(--paper);
  border-radius: 50%;
}
.stub__tear::before { left: -11px; }
.stub__tear::after  { right: -11px; }

.stub__body { padding: 24px; }
.stub__foot { padding: 18px 24px 24px; }

/* =====================================================================
   LAYOUT — admin shell
   ================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--ink);
  color: var(--on-dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar__brand {
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar__brand a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 11px; }

.brandmark {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: var(--signal);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: .95rem;
  color: var(--ink);
  letter-spacing: -.03em;
}

.sidebar__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: .01em;
  line-height: 1.15;
}
.sidebar__sub { font-size: .68rem; color: var(--on-dark-2); letter-spacing: .04em; }

.nav { padding: 14px 10px 24px; flex: 1; }

.nav__group {
  font-family: var(--display);
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #6E858A;
  padding: 16px 12px 7px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: #C3D2D5;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .13s ease, color .13s ease;
}

.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }

.nav a.is-active {
  background: var(--rift);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--signal);
}

.nav a svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.nav a.is-active svg { opacity: 1; }

.nav__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .68rem;
  background: rgba(255,255,255,.12);
  padding: 1px 6px;
  border-radius: 20px;
}

.sidebar__user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
}

.avatar {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--rift);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: .78rem;
}

/* Main column ------------------------------------------------------ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 13px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar h1 { font-size: 1.18rem; }
.topbar__spacer { flex: 1; }

.content { padding: 24px 26px 56px; flex: 1; }
.content--wide { max-width: none; }

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head__text { flex: 1; min-width: 220px; }
.page-head p { color: var(--text-2); font-size: .9rem; margin-top: 3px; }

/* =====================================================================
   CARDS, GRIDS
   ================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.card__head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card__head h3 { flex: 1; min-width: 140px; }
.card__body { padding: 18px; }
.card__foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--card-2);
  border-radius: 0 0 var(--r) var(--r);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.stack   { display: flex; flex-direction: column; gap: 14px; }
.row     { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--tight { gap: 7px; }
.spacer  { flex: 1; }

/* Stat tiles ------------------------------------------------------- */
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--rift);
}
.stat--signal::before { background: var(--signal); }
.stat--ok::before     { background: var(--ok); }
.stat--bad::before    { background: var(--bad); }

.stat__label {
  font-family: var(--display);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-3);
}
.stat__value {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -.02em;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.stat__note { font-size: .78rem; color: var(--text-2); margin-top: 3px; }

/* =====================================================================
   BUTTONS
   ================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--rift);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .14s ease, transform .06s ease, box-shadow .14s ease;
}
.btn:hover { background: var(--rift-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

.btn--signal { background: var(--signal); color: var(--ink); }
.btn--signal:hover { background: var(--signal-dark); color: var(--ink); }

.btn--ghost {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--card-2); border-color: #C9D2CD; color: var(--text); }

.btn--danger { background: var(--bad); }
.btn--danger:hover { background: #8A1F30; }

.btn--dark { background: var(--ink); }
.btn--dark:hover { background: var(--slate); }

.btn--sm  { padding: 5px 11px; font-size: .79rem; border-radius: 5px; }
.btn--lg  { padding: 13px 26px; font-size: .98rem; }
.btn--block { width: 100%; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* =====================================================================
   FORMS
   ================================================================== */
.field { margin-bottom: 15px; }

.field > label,
.label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.label .req { color: var(--bad); font-weight: 400; }

.hint { font-size: .76rem; color: var(--text-3); margin-top: 4px; }
.err  { font-size: .78rem; color: var(--bad); margin-top: 4px; font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  font-size: .9rem;
  transition: border-color .13s ease, box-shadow .13s ease;
}

.input:hover, .select:hover, .textarea:hover { border-color: #C4CFCA; }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--rift);
  box-shadow: 0 0 0 3px var(--rift-tint);
}

.input[readonly] { background: var(--card-2); color: var(--text-2); }
.input.is-error, .select.is-error { border-color: var(--bad); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234A5A5F' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.textarea { min-height: 84px; resize: vertical; }

.input--mono { font-family: var(--mono); letter-spacing: .04em; }

.input-group { display: flex; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .btn   { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  font-family: var(--mono);
  font-size: .84rem;
  color: var(--text-2);
}
.prefix + .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: .87rem;
  cursor: pointer;
  padding: 3px 0;
}
.check input { margin-top: 3px; accent-color: var(--rift); width: 15px; height: 15px; flex: 0 0 15px; }

.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }

fieldset { border: 0; padding: 0; }

.fieldset-title {
  font-family: var(--display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--rift);
  padding-bottom: 7px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

/* Segmented control ------------------------------------------------ */
.segmented { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
  display: block;
  padding: 6px 14px;
  border-radius: 5px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.segmented input:checked + span { background: var(--card); color: var(--rift); box-shadow: var(--shadow-sm); }

/* =====================================================================
   TABLES
   ================================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .865rem;
}

.table thead th {
  text-align: left;
  font-family: var(--display);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tbody tr:hover { background: var(--card-2); }
.table tbody tr:last-child td { border-bottom: 0; }

.table .num, .table .right { text-align: right; font-variant-numeric: tabular-nums; }

.table tfoot td {
  padding: 12px 14px;
  border-top: 2px solid var(--line);
  font-weight: 700;
  background: var(--card-2);
  font-family: var(--mono);
}

.table--compact tbody td { padding: 7px 12px; }

.cell-main  { font-weight: 600; }
.cell-sub   { font-size: .76rem; color: var(--text-3); }

/* =====================================================================
   BADGES, PILLS, ALERTS
   ================================================================== */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  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  { background: var(--info-tint);  color: var(--info); }
.badge--muted { background: #EDF0EE;           color: var(--text-2); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
}
.pill:hover { border-color: var(--rift); color: var(--rift); text-decoration: none; }
.pill.is-active { background: var(--rift); border-color: var(--rift); color: #fff; }

.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border-left: 3px solid;
  font-size: .875rem;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert strong { font-weight: 700; }
.alert--ok    { background: var(--ok-tint);    border-color: var(--ok);    color: #0E5843; }
.alert--warn  { background: var(--warn-tint);  border-color: var(--signal);color: #7A4E02; }
.alert--bad   { background: var(--bad-tint);   border-color: var(--bad);   color: #7A1C2B; }
.alert--info  { background: var(--info-tint);  border-color: var(--info);  color: #174865; }

/* Toasts ----------------------------------------------------------- */
.toasts {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 380px;
}
.toast {
  background: var(--ink);
  color: var(--on-dark);
  padding: 12px 16px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  font-size: .86rem;
  border-left: 3px solid var(--signal);
  animation: toast-in .22s ease-out;
}
.toast--ok  { border-left-color: #35C08F; }
.toast--bad { border-left-color: #E4576D; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Empty state ------------------------------------------------------ */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-2);
}
.empty svg { width: 42px; height: 42px; margin: 0 auto 14px; color: var(--text-3); opacity: .5; }
.empty h3 { font-size: 1.02rem; margin-bottom: 5px; color: var(--text); }
.empty p { font-size: .875rem; margin-bottom: 16px; }

/* =====================================================================
   SEAT MAP
   ================================================================== */
.deck {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  max-width: 400px;
}

.deck__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 2px dashed var(--line);
  font-family: var(--display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.deck__rows { display: flex; flex-direction: column; gap: 8px; }
.deck__row  { display: flex; gap: 8px; justify-content: center; }

.seat {
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px 7px 4px 4px;
  background: var(--card);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .12s ease;
  position: relative;
  padding: 0;
}

.seat:hover:not(:disabled) {
  border-color: var(--rift);
  background: var(--rift-tint);
  color: var(--rift);
  transform: translateY(-1px);
}

.seat.is-selected {
  background: var(--rift);
  border-color: var(--rift);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15,110,122,.35);
}

.seat.is-taken {
  background: #E6EAE7;
  border-color: #DAE0DB;
  color: #A9B5AF;
  cursor: not-allowed;
  text-decoration: line-through;
}

.seat.is-ladies { border-color: #C86FA0; }

.seat--aisle { width: 20px; border: 0; background: none; cursor: default; pointer-events: none; }

.deck__legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .75rem;
  color: var(--text-2);
}
.deck__legend span { display: flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); }
.swatch--free  { background: var(--card); }
.swatch--taken { background: #E6EAE7; border-color: #DAE0DB; }
.swatch--mine  { background: var(--rift); border-color: var(--rift); }

/* =====================================================================
   PUBLIC SITE
   ================================================================== */
.site-header {
  background: var(--ink);
  color: var(--on-dark);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; }
.site-header a { color: var(--on-dark); text-decoration: none; }
.site-nav { display: flex; gap: 20px; margin-left: auto; font-size: .875rem; font-weight: 500; }
.site-nav a:hover { color: var(--signal); text-decoration: none; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 760px; }
.wrap--slim   { max-width: 520px; }

.hero {
  background:
    linear-gradient(180deg, rgba(11,31,36,.93), rgba(11,31,36,.97)),
    repeating-linear-gradient(180deg, #143039 0px, #143039 7px, rgba(0,0,0,.2) 7px, rgba(0,0,0,.2) 8px);
  color: var(--on-dark);
  padding: 52px 0 64px;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, var(--signal) 0 33%, var(--rift) 33% 66%, var(--signal) 66% 100%);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  letter-spacing: -.02em;
  line-height: 1.05;
  max-width: 15ch;
}
.hero p { color: var(--on-dark-2); font-size: 1.02rem; margin-top: 12px; max-width: 48ch; }

.searchbar {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  margin-top: 30px;
  color: var(--text);
}

.searchbar__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tabs a, .tabs button {
  padding: 9px 16px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
  border: 0;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none;
}
.tabs a:hover, .tabs button:hover { color: var(--rift); text-decoration: none; }
.tabs .is-active { color: var(--rift); border-bottom-color: var(--rift); }

/* Trip result card ------------------------------------------------- */
.trip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: box-shadow .16s ease, border-color .16s ease;
}
.trip:hover { box-shadow: var(--shadow); border-color: #C9D2CD; }

.trip__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 18px;
  align-items: center;
}

.trip__times {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
}
.trip__time { font-size: 1.28rem; font-weight: 500; }
.trip__dash {
  flex: 1;
  min-width: 40px;
  height: 1px;
  background: var(--line);
  position: relative;
}
.trip__dash::after {
  content: '';
  position: absolute; right: -1px; top: -3px;
  border-left: 7px solid var(--signal);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}

.trip__price {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  text-align: right;
}

.trip__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}

/* Tracking timeline ------------------------------------------------ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line);
}
.timeline__item { position: relative; padding-bottom: 20px; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: -25px; top: 5px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line);
}
.timeline__item.is-done::before { background: var(--ok); border-color: var(--ok); }
.timeline__item.is-current::before {
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-tint);
}
.timeline__title { font-weight: 600; font-size: .9rem; }
.timeline__meta  { font-size: .78rem; color: var(--text-3); font-family: var(--mono); }

/* =====================================================================
   PAYMENT WAITING STATE
   ================================================================== */
.paywait { text-align: center; padding: 34px 24px; }
.paywait__phone {
  width: 62px; height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--signal-tint);
  display: grid;
  place-items: center;
  color: var(--warn);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,168,29,.4); }
  50%      { box-shadow: 0 0 0 14px rgba(244,168,29,0); }
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   MISC
   ================================================================== */
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 18px; font-size: .875rem; }
.kv dt { color: var(--text-3); font-size: .78rem; }
.kv dd { font-weight: 500; }

.copy-btn { cursor: pointer; background: none; border: 0; color: var(--text-3); padding: 2px; }
.copy-btn:hover { color: var(--rift); }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 18px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .82rem;
  text-align: center;
  color: var(--text-2);
  text-decoration: none;
  background: var(--card);
}
.pager a:hover { border-color: var(--rift); color: var(--rift); text-decoration: none; }
.pager .is-current { background: var(--rift); border-color: var(--rift); color: #fff; font-weight: 600; }
.pager .is-disabled { opacity: .4; pointer-events: none; }

.mobile-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 6px; color: var(--text); }

/* =====================================================================
   RESPONSIVE
   ================================================================== */
@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .mobile-toggle { display: block; }
  .content { padding: 18px 16px 48px; }
  .topbar { padding: 11px 16px; }
  .scrim {
    position: fixed; inset: 0;
    background: rgba(11,31,36,.5);
    z-index: 99;
  }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .trip__grid { grid-template-columns: 1fr; gap: 12px; }
  .trip__price { text-align: left; }
  .hero { padding: 34px 0 44px; }
  .card__body, .stub__body { padding: 16px; }
  .table thead { display: none; }
  .table--stack tbody td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 14px;
    border: 0;
  }
  .table--stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
  }
  .table--stack tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    margin-bottom: 10px;
    padding: 6px 0;
  }
  .seat { width: 38px; height: 38px; }
}

/* =====================================================================
   PRINT — tickets, waybills, manifests
   ================================================================== */
@media print {
  @page { margin: 12mm; }

  body { background: #fff; font-size: 11.5pt; }

  .sidebar, .topbar, .no-print, .toasts, .btn, .pager, .tabs { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }

  .card, .stub {
    box-shadow: none !important;
    border: 1px solid #000 !important;
    break-inside: avoid;
  }

  .board {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000;
  }
  .board::after { background: #000 !important; height: 2px; }
  .board__meta, .board__meta b { color: #000 !important; }

  .stub__tear::before, .stub__tear::after { background: #fff; }

  .table thead th { background: #EEE !important; color: #000 !important; }
  .badge { border: 1px solid #666; }

  a[href]::after { content: ''; }

  .print-only { display: block !important; }
}

.print-only { display: none; }

/* =====================================================================
 |  PART 12 — ADDITIONS
 |  Bits added as the admin, document and installer screens were built.
 * ===================================================================*/

/* --- Small utilities ---------------------------------------------- */
.req            { color: var(--bad); font-weight: 600; }
.stat__of       { font-size: .58em; color: var(--text-3); font-weight: 500; }
.check--all     { border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.prefix--after  { border-left: 0; border-right: 1px solid var(--line); border-radius: 0 var(--r) var(--r) 0; }

.grid--sidebar  { grid-template-columns: minmax(240px, 320px) 1fr; }
@media (max-width: 900px) { .grid--sidebar { grid-template-columns: 1fr; } }

/* A grouping row inside a table, e.g. a date heading in the trip list. */
.table__section td {
  background: var(--rift-tint);
  font: 600 .72rem/1 var(--display);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 9px 14px;
}

/* --- Meter: the little share bar used all over the reports --------- */
.meter {
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  min-width: 60px;
}
.meter span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--rift);
  transition: width .3s ease;
}

/* --- Privilege matrix --------------------------------------------- */
.perm-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.perm-group {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px 10px;
  margin: 0;
  background: var(--paper);
}
.perm-group legend {
  font: 600 .68rem/1 var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rift);
  padding: 0 6px;
}
.perm-group .check { margin-bottom: 7px; align-items: flex-start; }
.perm-group .check span { line-height: 1.35; }
.perm-group .check .mono { display: block; opacity: .6; }

/* =====================================================================
 |  PRINTABLE DOCUMENTS — tickets, waybills, manifests, receipts
 * ===================================================================*/
body.printable {
  background: var(--paper);
  padding: 0 0 60px;
}

.print-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 18px;
  background: var(--ink);
  border-bottom: 3px solid var(--signal);
}

.doc {
  max-width: 760px;
  margin: 22px auto;
  padding: 0 16px;
}
.doc--narrow { max-width: 480px; }
.doc--wide   { max-width: 1000px; }
.doc--waybill { break-after: page; }
.doc--waybill:last-of-type { break-after: auto; }

.doc__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.doc__title {
  font: 600 .74rem/1 var(--display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 22px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}

.doc .stub {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.stub__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px 14px;
}
.stub__brand {
  font: 700 1.05rem/1.1 var(--display);
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--ink);
}
.stub__type {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 3px;
}
.stub__ref {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--rift);
}

.board--doc { border-radius: 0; margin: 0; }
.board--doc .board__route { font-size: clamp(1.3rem, 4.4vw, 2rem); }

.stub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px 18px;
  padding: 16px 20px;
}
.stub__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 16px 20px;
}
@media (max-width: 520px) { .stub__cols { grid-template-columns: 1fr; } }

.stub__label {
  display: block;
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 3px;
}
.stub__value {
  display: block;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.stub__amount {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}

.stub__notch { display: none; }   /* the tear line punches its own */

.stub__total {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}

.stub__sign {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 26px;
}
.stub__ruled {
  display: block;
  border-bottom: 1px solid var(--text-3);
  height: 30px;
  margin-bottom: 4px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.doc-table th {
  text-align: left;
  font: 600 .64rem/1 var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}
.doc-table td { padding: 8px; border-bottom: 1px solid var(--line); }
.doc-table--ruled td { height: 30px; }
.doc-table .right, .doc-table th.right { text-align: right; }

/* =====================================================================
 |  INSTALLER
 * ===================================================================*/
body.install {
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 3px, var(--slate) 3px 7px)
    fixed;
  min-height: 100vh;
  padding: 40px 16px 60px;
}
.install__wrap { max-width: 640px; margin: 0 auto; }

.install__head { text-align: center; margin-bottom: 26px; }
.install__head h1 {
  color: #fff;
  font-size: 1.6rem;
  margin: 18px 0 4px;
  letter-spacing: -.02em;
}
.install__head .muted { color: var(--on-dark-2); }
.install__head .board { max-width: 300px; margin: 0 auto; }

.install__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.install__steps li {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  padding: 8px 12px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, .07);
  color: var(--on-dark-2);
  font-size: .78rem;
  border: 1px solid transparent;
}
.install__steps li span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  font-size: .68rem;
  font-weight: 700;
}
.install__steps li.is-current {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink);
  font-weight: 600;
}
.install__steps li.is-current span { background: rgba(0, 0, 0, .2); }
.install__steps li.is-done { color: #fff; border-color: rgba(255, 255, 255, .2); }
.install__steps li.is-done span { background: var(--ok); color: #fff; }

.install__list { padding-left: 20px; line-height: 1.9; margin: 10px 0 0; }
.install__list--num { list-style: decimal; }
.install__foot { text-align: center; margin-top: 24px; color: var(--on-dark-2); }

.install .alert { margin-bottom: 14px; }

/* --- Print rules for the documents -------------------------------- */
@media print {
  body.printable { background: #fff; padding: 0; }
  .print-bar { display: none !important; }

  .doc { max-width: none; margin: 0; padding: 0; }
  .doc .stub { border: 1px solid #000; border-radius: 0; }

  .stub__ref   { color: #000 !important; }
  .doc-table td, .doc-table th { border-color: #000 !important; }
  .meter { border: 1px solid #000; }
  .meter span { background: #000 !important; }
}
