/* ==========================================================================
   Didar Poribohon — admin UI (Bootstrap 5.3)

   Fonts: Inter for English text, dates and numbers; Tiro Bangla for Bangla.
   Tiro Bangla has a single weight, so browser-made "fake bold" is switched
   off (font-synthesis) — Bangla stays crisp, hierarchy comes from size/colour.

   Seat colours keep their old meaning: green free, red booked, pink female,
   dark = my booking; plus indigo = picked by me (held), amber = held by
   someone else.
   ========================================================================== */

:root {
  --app-font: 'Inter', 'Tiro Bangla', 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --en-font: 'Inter', 'Tiro Bangla', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; /* Bangla digits fall back to Tiro Bangla, never a heavy system font */

  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-rgb: 79, 70, 229;

  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e8ef;
  --line-2: #eef1f6;
  --bg: #f4f6fa;
  --surface: #ffffff;

  --sidebar-bg: #0f172a;
  --sidebar-ink: #cbd5e1;
  --sidebar-muted: #64748b;
  --sidebar-hover: rgba(148, 163, 184, .10);
  --sidebar-active: rgba(99, 102, 241, .22);

  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;

  --seat-free: #16a34a;
  --seat-booked: #dc2626;
  --seat-female: #db2777;
  --seat-mine: #1e293b;
  --seat-myhold: #4f46e5;
  --seat-held: #f59e0b;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -20px rgba(16, 24, 40, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --content-max: 1320px;
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;

  --bs-body-font-family: var(--app-font);
  --bs-body-font-weight: 400;
  --bs-body-bg: #fff; /* tables, menus and modals are white; the page ground is painted on body */
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand-600);
  --bs-link-hover-color: var(--brand-700);
  --bs-link-color-rgb: 67, 56, 202;
  --bs-border-radius: var(--radius-sm);
}

html { -webkit-text-size-adjust: 100%; font-synthesis: none; }

body {
  font-family: var(--app-font);
  font-size: 15px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--ink); letter-spacing: -.01em; line-height: 1.35; }
b, strong, .fw-bold { font-weight: 600 !important; }
.fw-semibold { font-weight: 500 !important; }
a { text-decoration: none; transition: color .15s var(--ease); }
.en { font-family: var(--en-font); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.min-w-0 { min-width: 0; }
.flex-none { flex: none; }
.text-muted { color: var(--muted) !important; }
.small-muted { font-size: 13px; color: var(--muted); }

/* No fill-mode on purpose: a transform that stays after the animation would
   make every block its own stacking layer and push open dropdowns underneath
   the next card. */
@media (prefers-reduced-motion: no-preference) {
  .app-content > * { animation: page-in .3s var(--ease); }
  /* opacity only: a transform would trap the fixed bottom bars inside the page for a moment */
  @keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- Buttons ---------- */
.btn {
  font-weight: 500; border-radius: var(--radius-sm); padding: .56rem 1.05rem; letter-spacing: 0;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .32rem .7rem; font-size: 13.5px; border-radius: 9px; }
.btn-lg { padding: .72rem 1.35rem; font-size: 16px; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .65);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-600); --bs-btn-border-color: #c7d2fe;
  --bs-btn-hover-bg: var(--brand-50); --bs-btn-hover-color: var(--brand-700); --bs-btn-hover-border-color: #a5b4fc;
  --bs-btn-active-bg: var(--brand-100); --bs-btn-active-color: var(--brand-700); --bs-btn-active-border-color: #a5b4fc;
}
.btn-soft { background: var(--brand-50); color: var(--brand-700); border: 1px solid transparent; }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-light { --bs-btn-bg: #f3f5f9; --bs-btn-border-color: #f3f5f9; --bs-btn-hover-bg: #e8ecf3; --bs-btn-hover-border-color: #e8ecf3; --bs-btn-color: var(--ink-2); }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.spin { display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form-label, label.form-label { font-weight: 500; color: var(--ink-2); font-size: 13.5px; margin-bottom: .35rem; }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: #d9dee8;
  min-height: 44px;
  font-size: 15px;
  color: var(--ink);
  background-color: #fff;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .13);
}
.form-control::placeholder { color: #9ca3af; }
.form-check-input { border-color: #cbd2de; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .15); border-color: #a5b4fc; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: .35rem; }
label.required::after, .form-label.required::after { content: ' *'; color: var(--danger); }

.input-icon { position: relative; }
.input-icon > i.lead {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%); z-index: 2;
  color: #9ca3af; font-size: 16px; pointer-events: none;
}
.input-icon > .form-control { padding-left: 40px; }

/* legacy Bootstrap 4 helpers used by older screens */
.form-group { margin-bottom: 1rem; }
.float-right { float: right !important; }
.text-right { text-align: right !important; }
.font-weight-bold { font-weight: 600 !important; }

/* ---------- Dropdowns (Tom Select) ---------- */
.ts-wrapper.form-select { min-height: 44px; }
.ts-wrapper.form-select.focus { border-color: #a5b4fc; box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .13); }
.ts-wrapper.form-select .ts-control { padding: .5rem 2.3rem .5rem .85rem; min-height: 42px; align-items: center; font-size: 15px; }
.ts-wrapper.single .ts-control > .item { max-width: 100%; overflow: hidden; }
.ts-wrapper .ts-control > input { font-size: 15px; }
/* the list is attached to <body>, above cards, sticky bars and modals */
.ts-dropdown {
  border: 1px solid var(--line); border-radius: 14px; margin-top: 6px; padding: .35rem;
  box-shadow: 0 18px 40px -18px rgba(16, 24, 40, .35), 0 2px 6px rgba(16, 24, 40, .05);
  font-size: 14.5px; z-index: 1070; background: #fff; color: var(--ink); font-family: var(--app-font);
}
.ts-dropdown .ts-dropdown-content { max-height: 320px; }
.ts-dropdown .option { border-radius: 10px; padding: .55rem .7rem; }
.ts-dropdown .active { background: var(--brand-50); color: var(--ink); }
.ts-dropdown .option.selected { background: var(--brand-100); color: var(--brand-700); }
.ts-dropdown .no-results { padding: .7rem; color: var(--muted); text-align: center; }
.plugin-dropdown_input .dropdown-input {
  border: 1px solid var(--line) !important; border-radius: 10px; margin: .15rem 0 .4rem; padding: .5rem .75rem;
  box-shadow: none !important; background: #f9fafc;
}

.coach-opt { display: flex; align-items: center; gap: .55rem; min-width: 0; width: 100%; }
.coach-num { font-weight: 500; min-width: 38px; }
.coach-type {
  flex: none; font-size: 12px; padding: .05rem .5rem; border-radius: 999px; line-height: 1.6;
}
.coach-type.is-day { background: #fef3c7; color: #92400e; }
.coach-type.is-night { background: var(--brand-50); color: var(--brand-700); }
.coach-route { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ts-control .coach-route { color: var(--ink-2); }

/* ---------- Date picker (Flatpickr) ---------- */
.flatpickr-input[readonly], .form-control[readonly].flatpickr-input { background-color: #fff; cursor: pointer; }
.flatpickr-calendar {
  box-sizing: content-box; /* flatpickr's fixed width + our padding used to cut off Friday */
  font-family: var(--en-font); border-radius: 16px; padding: 6px; border: 0;
  box-shadow: 0 22px 50px -20px rgba(16, 24, 40, .4), 0 0 0 1px var(--line) !important;
}
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after { display: none; }
.flatpickr-months { padding-bottom: 4px; }
.flatpickr-months .flatpickr-month { height: 40px; }
.flatpickr-current-month { font-size: 15px; font-weight: 600; padding-top: 8px; }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { padding: 12px; border-radius: 10px; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: var(--brand); }
span.flatpickr-weekday { color: var(--muted); font-weight: 500; font-size: 12px; }
.flatpickr-day { border-radius: 10px; font-weight: 500; color: var(--ink); }
.flatpickr-day:hover { background: var(--brand-50); border-color: var(--brand-50); }
.flatpickr-day.today { border-color: #a5b4fc; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus { background: var(--brand); border-color: var(--brand); color: #fff; }
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: #c3c9d4; }

.date-quick { display: flex; gap: .35rem; margin-top: .45rem; }
.date-quick button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px;
  font-size: 12.5px; padding: .12rem .7rem; line-height: 1.6; transition: all .15s var(--ease);
}
.date-quick button:hover { border-color: #c7d2fe; color: var(--brand-700); }
.date-quick button.active { background: var(--brand-50); border-color: #c7d2fe; color: var(--brand-700); }

/* ==========================================================================
   App shell — sidebar pinned left, page content boxed and centred on the right
   ========================================================================== */
.app-shell { position: relative; min-height: 100vh; }

.app-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-ink);
  display: flex; flex-direction: column; z-index: 1040;
  transition: transform .28s var(--ease);
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.2rem; height: var(--topbar-h);
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  display: grid; place-items: center; color: #fff; font-size: 20px;
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .8);
}
.brand-text { line-height: 1.2; min-width: 0; }
.brand-text strong { display: block; color: #fff; font-size: 17px; font-weight: 600; }
.brand-text span { font-family: var(--en-font); font-size: 10.5px; color: var(--sidebar-muted); letter-spacing: .08em; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: .6rem .75rem 1rem; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .25); border-radius: 6px; }

.nav-section { font-size: 12px; color: var(--sidebar-muted); padding: .95rem .75rem .35rem; }
.side-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .56rem .75rem; margin: 2px 0; border-radius: 10px;
  color: var(--sidebar-ink); font-size: 15px; position: relative;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.side-link i { font-size: 17px; width: 22px; text-align: center; color: #94a3b8; flex: none; transition: color .15s var(--ease); }
.side-link:hover { background: var(--sidebar-hover); color: #fff; }
.side-link:hover i { color: #c7d2fe; }
.side-link.active { background: var(--sidebar-active); color: #fff; }
.side-link.active i { color: #a5b4fc; }
.side-link.active::before {
  content: ''; position: absolute; left: -.75rem; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: #818cf8;
}

.sidebar-user {
  margin: .75rem; padding: .7rem; border-radius: 12px;
  background: rgba(148, 163, 184, .08); display: flex; align-items: center; gap: .65rem;
}
.sidebar-user .avatar { background: rgba(99, 102, 241, .25); color: #c7d2fe; }
.sidebar-user .name { color: #fff; font-size: 14px; line-height: 1.3; }
.sidebar-user .role { color: var(--sidebar-muted); font-size: 12px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 15px;
  background: var(--brand-50); color: var(--brand-700);
}

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }

.app-topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--topbar-h);
  background: rgba(255, 255, 255, .9); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
/* the bar spans the full width; its contents line up with the content box */
.topbar-inner {
  height: 100%; width: 100%; max-width: var(--content-max); margin: 0 auto;
  display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
}
.topbar-title { font-weight: 600; font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-date { font-size: 13px; color: var(--muted); }
.topbar-toggle { display: none; }
.user-menu-btn {
  display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line);
  background: #fff; border-radius: 999px; padding: .25rem .8rem .25rem .3rem; color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.user-menu-btn .avatar { width: 32px; height: 32px; font-size: 13px; }
.user-menu-btn:hover { border-color: #cfd6e2; box-shadow: var(--shadow-sm); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: .4rem; font-size: 14.5px; }
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item i { color: var(--muted); }
.dropdown-item:active { background: var(--brand-50); color: var(--brand-700); }

.app-content { flex: 1; padding: 1.5rem; width: 100%; max-width: var(--content-max); margin: 0 auto; }
.app-footer { padding: 1rem 1.5rem 1.25rem; font-size: 12.5px; color: var(--muted); width: 100%; max-width: var(--content-max); margin: 0 auto; }

.sidebar-backdrop { display: none; }
.app-bottomnav { display: none; }

@media (max-width: 991.98px) {
  .app-shell { display: block; }
  .app-sidebar { transform: translateX(-100%); box-shadow: none; }
  body.sidebar-open .app-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  body.sidebar-open .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035;
  }
  .app-main { margin-left: 0; }
  .topbar-inner { padding: 0 1rem; }
  .topbar-toggle { display: inline-flex; }
  .topbar-date { display: none; }
  .app-content { padding: 1rem 1rem calc(var(--bottomnav-h) + 1.25rem); }
  .app-footer { display: none; }

  .app-bottomnav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: var(--bottomnav-h); background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app-bottomnav a, .app-bottomnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); font-size: 12px; border: 0; background: none;
  }
  .app-bottomnav i { font-size: 21px; line-height: 1; }
  .app-bottomnav .active { color: var(--brand-600); }
}

@media (max-width: 575.98px) {
  .user-menu-btn .user-meta { display: none; }
  .user-menu-btn { padding: .25rem; }
}

/* ==========================================================================
   Page building blocks
   ========================================================================== */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head p { margin: .15rem 0 0; color: var(--muted); font-size: 14px; }
.page-head .head-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-600); font-size: 21px; flex: none;
}

.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: var(--surface);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--line-2);
  padding: .95rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.card-header h2, .card-header h3, .card-title-x { font-size: 16px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-header h2 i, .card-title-x i { color: var(--brand-600); }
.card-body { padding: 1.25rem; }
.card-footer { background: #fbfcfe; border-top: 1px solid var(--line-2); padding: .85rem 1.25rem; }
.section-gap > * + * { margin-top: 1.25rem; }

.filter-bar .btn { min-height: 44px; }
.filter-bar-compact .card-body { padding: .9rem 1rem; }

/* Trip search (date + coach + button). Every field has a label row of the
   same height, and the fields sit on the bottom line, so the boxes and the
   button always line up. */
.trip-form { display: grid; gap: .85rem 1rem; grid-template-columns: minmax(0, 1fr); align-items: end; }
.tf-field { min-width: 0; }
.tf-label { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .25rem .5rem; min-height: 30px; margin-bottom: .35rem; }
.tf-label .form-label { margin: 0; }
.tf-label .date-quick { margin: 0; }
@media (min-width: 576px) {
  .trip-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tf-action { grid-column: 1 / -1; }
}
@media (min-width: 992px) {
  .trip-form { grid-template-columns: minmax(250px, 1fr) minmax(0, 1.5fr) minmax(160px, auto); }
  .tf-action { grid-column: auto; }
}

/* Stat cards */
.stat-card { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 1.05rem 1.2rem; }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 21px; }
.stat-value { font-family: var(--en-font); font-size: 26px; font-weight: 600; line-height: 1.15; }
.stat-label { font-size: 13.5px; color: var(--muted); }

.tone-brand { background: var(--brand-50); color: var(--brand-600); }
.tone-green { background: #dcfce7; color: #15803d; }
.tone-amber { background: #fef3c7; color: #b45309; }
.tone-rose { background: #ffe4e6; color: #be123c; }
.tone-sky { background: #e0f2fe; color: #0369a1; }
.tone-violet { background: #f3e8ff; color: #7e22ce; }
.tone-slate { background: #f1f5f9; color: #334155; }
.tone-teal { background: #ccfbf1; color: #0f766e; }

/* Welcome banner */
.welcome {
  border-radius: 20px; padding: 1.35rem 1.5rem; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #312e81 0%, #4338ca 45%, #6366f1 100%);
}
.welcome::after {
  content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.welcome h1 { color: #fff; font-size: 22px; margin: 0 0 .2rem; }
.welcome p { margin: 0; color: rgba(255, 255, 255, .78); }
.welcome .role-pill {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .7rem;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
  padding: .15rem .7rem; border-radius: 999px; font-size: 13px;
}

/* Quick action tiles */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.action-tile {
  display: flex; flex-direction: column; gap: .8rem; padding: 1.1rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); min-height: 130px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.action-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c7d2fe; color: var(--ink); }
.action-tile .tile-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; }
.action-tile strong { font-size: 15.5px; font-weight: 500; display: block; }
.action-tile span { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Tables */
.table { --bs-table-color: var(--ink); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .75rem .9rem; border-bottom-color: var(--line-2); vertical-align: middle; }
.table thead th {
  background: #f8f9fc; color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  border-bottom: 1px solid var(--line) !important; white-space: nowrap;
}
.table td, .table th { font-variant-numeric: tabular-nums; }
.table-hover > tbody > tr > * { transition: background-color .12s var(--ease); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8f9ff; }
.table tfoot th, .table tfoot td { background: #f8f9fc; font-weight: 500; }
.table-card { border-radius: var(--radius); overflow: hidden; }
.cell-sub { display: block; font-size: 13px; color: var(--muted); }

/* Booking tables become stacked cards on phones */
@media (max-width: 575.98px) {
  .table-stack, .table-stack tbody, .table-stack tfoot { display: block; width: 100%; }
  .table-stack thead { display: none; }
  .table-stack tbody tr {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: .45rem .5rem;
    padding: .9rem 1rem; border-bottom: 1px solid var(--line-2);
  }
  .table-stack tbody td { display: block; padding: 0 !important; border: 0 !important; min-width: 0 !important; background: transparent !important; box-shadow: none !important; }
  .table-stack tbody td.stack-full { grid-column: 1 / -1; }
  .table-stack tbody td.stack-end { grid-column: 3; grid-row: 1; text-align: right !important; }
  .table-stack tbody td[colspan] { grid-column: 1 / -1; }
  .table-stack tfoot tr { display: flex; justify-content: space-between; align-items: center; }
  .table-stack tfoot th, .table-stack tfoot td { border: 0; }
  .table-stack.table-striped > tbody > tr:nth-of-type(odd) { background: #f8fafc; }
}

/* DataTables */
div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
  border-radius: 10px; border: 1px solid #d9dee8; min-height: 38px; padding: .3rem .6rem;
}
div.dataTables_wrapper div.dataTables_length select { width: auto; padding-right: 2rem; display: inline-block; margin-right: .35rem; }
div.dataTables_wrapper div.dataTables_filter input { margin-left: 0; width: 220px; max-width: 100%; }
div.dataTables_wrapper .row { --bs-gutter-x: 1rem; }
div.dataTables_wrapper div.dataTables_info { color: var(--muted); font-size: 13.5px; padding-top: .9rem; }
div.dataTables_wrapper div.dataTables_paginate { padding-top: .5rem; }
.dt-toolbar { padding: 1rem 1.25rem .25rem; }
.dt-footer { padding: .25rem 1.25rem 1rem; }
.page-link { color: var(--brand-600); border-radius: 9px !important; margin: 0 2px; border-color: var(--line); font-family: var(--en-font); }
.active > .page-link, .page-link.active { background: var(--brand); border-color: var(--brand); }

/* Badges */
.badge { font-weight: 500; border-radius: 999px; padding: .38em .72em; font-size: 12px; }
.badge-soft-primary { background: var(--brand-50); color: var(--brand-700); }
.badge-soft-success { background: #dcfce7; color: #15803d; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; }
.badge-soft-warning { background: #fef3c7; color: #b45309; }
.badge-soft-secondary { background: #f1f5f9; color: #475569; }
.badge-soft-info { background: #e0f2fe; color: #0369a1; }
.badge-soft-pink { background: #fce7f3; color: #be185d; }

/* Seat chips used in lists */
.seat-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  min-width: 42px; justify-content: center; padding: .18rem .55rem; margin: 2px;
  border-radius: 8px; font-family: var(--en-font); font-weight: 600; font-size: 13px; line-height: 1.55;
  background: var(--brand-50); color: var(--brand-700); border: 1px solid #dfe3fb;
}
.seat-chip.chip-dark { background: var(--seat-mine); color: #fff; border-color: var(--seat-mine); }
.seat-chip.chip-female-mark { box-shadow: inset 0 -3px 0 var(--seat-female); }
.seat-chip.chip-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.seat-chip.chip-pink { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.seat-chip.chip-select { background: var(--seat-myhold); color: #fff; border-color: var(--seat-myhold); padding-right: .35rem; animation: chip-in .2s var(--ease); }
@keyframes chip-in { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.seat-chip .chip-x {
  border: 0; background: rgba(185, 28, 28, .12); color: #b91c1c; width: 20px; height: 20px;
  border-radius: 6px; display: inline-grid; place-items: center; font-size: 11px; margin-left: .2rem; padding: 0;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.seat-chip .chip-x:hover { background: #dc2626; color: #fff; }
.seat-chip.chip-select .chip-x { background: rgba(255, 255, 255, .2); color: #fff; }
.seat-chip.chip-select .chip-x:hover { background: #fff; color: var(--brand-700); }
.seat-select { cursor: pointer; user-select: none; }
.seat-select input { accent-color: var(--danger); margin-right: .15rem; }
.seat-select:has(input:checked) { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

.count-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 30px;
  padding: 0 .6rem; border-radius: 999px; background: #dcfce7; color: #15803d;
}

.info-list { display: grid; gap: .1rem; }
.info-list .t { font-weight: 500; }

/* Empty state */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state i { font-size: 38px; color: #cbd5e1; display: block; margin-bottom: .6rem; }
.empty-state strong { display: block; color: var(--ink-2); font-size: 16px; font-weight: 500; margin-bottom: .2rem; }

/* ==========================================================================
   Trip / booking screens
   ========================================================================== */
.trip-hero {
  border-radius: var(--radius); color: #fff; padding: 1.15rem 1.3rem;
  background: linear-gradient(120deg, #1e1b4b 0%, #3730a3 55%, #4f46e5 100%);
  position: relative; overflow: hidden;
}
.trip-hero::after {
  content: ''; position: absolute; right: -40px; bottom: -70px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none;
}
.trip-hero .company { font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.trip-hero h2 { color: #fff; font-size: 20px; margin: .1rem 0 .3rem; }
.trip-hero .route { color: rgba(255, 255, 255, .86); font-size: 14.5px; }
.trip-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; position: relative; z-index: 1; }
.trip-meta span {
  display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .7rem; border-radius: 999px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); font-size: 13.5px;
}
.trip-hero-compact { padding: 1rem 1.1rem; }
.trip-hero-compact h2 { font-size: 19px; }
.trip-hero-compact .trip-meta { margin-top: .65rem; gap: .35rem; }
.trip-hero-compact .trip-meta span { font-size: 13px; padding: .18rem .6rem; }

.legend { display: flex; flex-wrap: wrap; gap: .5rem; }
.legend-item {
  display: inline-flex; align-items: center; gap: .5rem; padding: .42rem .75rem;
  border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 14px;
}
.legend-item b { font-family: var(--en-font); font-size: 15px; font-weight: 600; }
.legend-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.legend-grid .legend-item { justify-content: flex-start; padding: .45rem .6rem; font-size: 13.5px; }
.legend-grid .legend-item b { margin-left: auto; }
.dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.dot-free { background: var(--seat-free); }
.dot-booked { background: var(--seat-booked); }
.dot-female { background: var(--seat-female); }
.dot-mine { background: var(--seat-mine); }
.dot-myhold { background: var(--seat-myhold); box-shadow: 0 0 0 2px #c7d2fe; }
.dot-mine-female { background: var(--seat-mine); box-shadow: inset 0 -3px 0 var(--seat-female); }
/* one full-width line under the legend, only while I have female-passenger bookings */
.legend-grid .legend-note { grid-column: 1 / -1; background: #fdf2f8; border-color: #fbcfe8; }
.text-pink { color: #be185d; }
.dot-held { background: repeating-linear-gradient(45deg, #f59e0b 0 3px, #fcd34d 3px 6px); }

.live-pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .6rem; border-radius: 999px; flex: none;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); font-size: 12.5px; color: #fff; white-space: nowrap;
  position: relative; z-index: 1;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: live-ping 1.8s var(--ease) infinite; }
@keyframes live-ping {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); }
  70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.live-pill.is-offline .live-dot { background: #fbbf24; animation: none; }

/* The coach */
.coach {
  --seat-h: 46px; --seat-gap: .55rem;
  max-width: 360px; margin: 0 auto; background: #fff;
  border: 2px solid #dfe4ee; border-radius: 34px 34px 18px 18px;
  padding: 1rem .9rem 1.1rem; position: relative;
}
.coach-front {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 .35rem .75rem; margin-bottom: .8rem; border-bottom: 2px dashed #e5e8ef;
  color: var(--muted); font-size: 12.5px;
}
.coach-front .door { display: inline-flex; align-items: center; gap: .35rem; }
.steering { width: 32px; height: 32px; color: #9ca3af; }
.seat-row { display: grid; grid-template-columns: 1fr 1fr 22px 1fr 1fr; gap: var(--seat-gap); margin-bottom: var(--seat-gap); }
.seat-row.back-row { grid-template-columns: repeat(5, 1fr); margin-top: .85rem; margin-bottom: 0; }
.seat {
  height: var(--seat-h); border-radius: 10px 10px 7px 7px; border: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--en-font); font-weight: 600; font-size: 13px; color: #fff; position: relative;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .14);
  transition: transform .15s var(--ease), filter .15s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
  padding: 0; width: 100%;
}
.seat-free { background: var(--seat-free); cursor: pointer; }
.seat-free:hover { transform: translateY(-2px); filter: brightness(1.08); }
.seat-booked { background: var(--seat-booked); cursor: not-allowed; }
.seat-female { background: var(--seat-female); cursor: not-allowed; }
.seat-mine { background: var(--seat-mine); cursor: zoom-in; }
/* my own female-passenger seat: still "mine" (dark) with a pink bottom border — no icon, no badge */
.seat-mine-female { background: var(--seat-mine); cursor: zoom-in; box-shadow: inset 0 -5px 0 var(--seat-female); }
/* report / supervisor users may open anyone's ticket (double click) */
.booking-page[data-view-all="1"] .seat-booked,
.booking-page[data-view-all="1"] .seat-female { cursor: zoom-in; }
.seat-held {
  background: repeating-linear-gradient(45deg, #f59e0b 0 7px, #fbbf24 7px 14px); color: #78350f; cursor: not-allowed;
  box-shadow: inset 0 -4px 0 rgba(120, 53, 15, .18);
}
.seat-myhold {
  background: var(--seat-myhold); cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 0 0 3px rgba(99, 102, 241, .28);
  animation: seat-glow 1.8s ease-in-out infinite;
}
.seat-myhold::after {
  content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
@keyframes seat-glow { 50% { box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .18), 0 0 0 5px rgba(99, 102, 241, .14); } }
.seat-changed { animation: seat-pop .35s var(--ease); }
.seat-myhold.seat-changed { animation: seat-pop .35s var(--ease), seat-glow 1.8s ease-in-out .35s infinite; }
@keyframes seat-pop { 0% { transform: scale(.86); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.seat.is-busy { opacity: .6; pointer-events: none; }
.seat[disabled], .seat[aria-disabled="true"] { opacity: 1; }
.seat-empty { visibility: hidden; }
/* 4-seat back row: the aisle carries on to the back */
.seat-row.back-row.has-aisle { grid-template-columns: 1fr 1fr 22px 1fr 1fr; }
/* engine cover and extra seats, both at the front: same seat size, centred */
.seat-strip { padding-bottom: .6rem; margin-bottom: .7rem; border-bottom: 2px dashed #e5e8ef; }
.strip-label { display: flex; align-items: center; justify-content: center; gap: .35rem; font-size: 12px; color: var(--muted); margin-bottom: .4rem; }
.strip-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--seat-gap); }
.strip-seats .seat { width: calc((100% - 22px - 3 * var(--seat-gap)) / 4); flex: none; }
/* layout editor preview */
.seat.seat-off {
  background: repeating-linear-gradient(45deg, #f1f5f9 0 6px, #e2e8f0 6px 12px); color: #94a3b8;
  box-shadow: inset 0 0 0 1.5px #cbd5e1; cursor: pointer; text-decoration: line-through;
}
.seat.has-booking { outline: 2px solid #ef4444; outline-offset: 1px; }
.map-hint { font-size: 12.5px; color: var(--muted); text-align: center; margin: .85rem 0 0; }

.cancel-banner {
  border-radius: var(--radius); padding: 2rem 1.25rem; text-align: center;
  background: #fef2f2; border: 1px dashed #fca5a5; color: #b91c1c;
}
.cancel-banner i { font-size: 38px; display: block; margin-bottom: .4rem; }
.cancel-banner strong { font-size: 19px; font-weight: 500; }

.selected-box {
  border: 1px dashed #c7d2fe; background: #f8f9ff; border-radius: 12px;
  padding: .65rem .8rem; min-height: 52px; display: flex; align-items: center; flex-wrap: wrap; gap: .2rem;
}
.selected-box .placeholder-text { color: var(--muted); font-size: 13.5px; }

/* hold countdown */
.hold-box {
  border-radius: 14px; padding: .75rem .9rem; margin-bottom: 1rem;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff); border: 1px solid #dfe3fb;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.hold-box[hidden] { display: none !important; }
.hold-head { display: flex; align-items: center; gap: .7rem; }
.hold-clock { display: inline-flex; align-items: center; gap: .35rem; font-size: 21px; color: var(--brand-700); flex: none; }
.hold-clock b { font-family: var(--en-font); font-weight: 600; font-variant-numeric: tabular-nums; }
.hold-text { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.hold-bar { height: 6px; border-radius: 99px; background: #e0e7ff; margin-top: .6rem; overflow: hidden; }
.hold-bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6366f1, #4338ca); border-radius: inherit; transition: width .5s linear; }
.hold-box.is-urgent { background: linear-gradient(135deg, #fff1f2, #ffe4e6); border-color: #fecdd3; }
.hold-box.is-urgent .hold-clock { color: #be123c; animation: urgent 1s ease-in-out infinite; }
.hold-box.is-urgent .hold-bar { background: #ffe4e6; }
.hold-box.is-urgent .hold-bar span { background: linear-gradient(90deg, #fb7185, #e11d48); }
@keyframes urgent { 50% { opacity: .55; } }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.form-grid .fg-wide { grid-column: 1 / -1; }

.booking-item { padding: .8rem 1.1rem; border-bottom: 1px solid var(--line-2); display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.booking-item:last-child { border-bottom: 0; }
.booking-item .time { font-size: 12.5px; color: var(--muted); }

/* Booking page grid: phones = one column; tablets = map + details;
   wide = info | map | form, so the whole trip fits without scrolling. */
.booking-grid {
  display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "trip" "legend" "map" "form" "mine";
}
.bk-trip { grid-area: trip; min-width: 0; }
.bk-legend { grid-area: legend; min-width: 0; }
.bk-map { grid-area: map; min-width: 0; }
.bk-form { grid-area: form; min-width: 0; }
.bk-mine { grid-area: mine; min-width: 0; }
.my-bookings-list { max-height: 420px; overflow: auto; }

@media (min-width: 992px) {
  .booking-grid {
    grid-template-columns: minmax(320px, 370px) minmax(0, 1fr);
    grid-template-areas: "map trip" "map legend" "map form" "mine mine";
    grid-template-rows: auto auto 1fr auto;
    align-items: start;
  }
  .booking-page .coach { --seat-h: 35px; --seat-gap: 6px; max-width: 330px; padding: .8rem .75rem .9rem; border-radius: 30px 30px 16px 16px; }
  .booking-page .coach-front { padding-bottom: .55rem; margin-bottom: .65rem; }
  .booking-page .seat-mine-female { box-shadow: inset 0 -4px 0 var(--seat-female); }
  .booking-page .seat-row.back-row { margin-top: .6rem; }
  .booking-page .seatmap-card .card-body { padding: 1rem; }
}
@media (min-width: 1360px) {
  .booking-grid {
    grid-template-columns: 290px minmax(320px, 360px) minmax(0, 1fr);
    grid-template-areas: "trip map form" "legend map form" "mine map form";
    grid-template-rows: auto auto 1fr;
  }
  .bk-mine { align-self: stretch; }
  .my-bookings-card { height: 100%; display: flex; flex-direction: column; }
  .my-bookings-list { flex: 1 1 0; min-height: 120px; max-height: 360px; }
}
@media (min-width: 992px) and (max-height: 820px) {
  .booking-page .coach { --seat-gap: 5px; }
}
/* desktop: seats as tall as the screen allows, so every coach shape (more rows,
   engine cover / extra strips) fits without scrolling — between 26 and 35 px */
@media (min-width: 992px) {
  body:has(.booking-page) .app-footer { display: none !important; }
  .booking-page .coach {
    --seat-h: clamp(22px, calc((100vh - 372px - var(--strips, 0) * 30px) / var(--rows, 11) - var(--seat-gap)), 35px);
  }
  .booking-page .seat-strip { padding-bottom: .4rem; margin-bottom: .5rem; }
  .booking-page .strip-label { font-size: 11.5px; margin-bottom: .2rem; }
}
/* taller screens keep the roomier spacing, so allow for it */
@media (min-width: 992px) and (min-height: 941px) {
  .booking-page .coach {
    --seat-h: clamp(22px, calc((100vh - 430px - var(--strips, 0) * 30px) / var(--rows, 11) - var(--seat-gap)), 35px);
  }
}

/* POS ticket — the passenger ticket and (settings) the identical supervisor
   copy below a tear line. Looks like a thermal receipt on screen; printed by
   the stand-alone ticket page (58 mm or 80 mm paper, from settings).
   Black only, so thermal printers print it sharp. */
.pos-ticket {
  --pos-ink: #111827; --pos-soft: #5b6472; --pos-pad: 16px; --pos-outside: #eef1f7;
  position: relative; width: 100%; max-width: 300px; margin: 0 auto 8px;
  background: #fff; color: var(--pos-ink); padding: 16px var(--pos-pad) 14px;
  font-size: 12px; line-height: 1.5; text-align: left;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 18px 36px -24px rgba(16, 24, 40, .5);
}
.pos-ticket.pos-80 { --pos-pad: 18px; max-width: 360px; font-size: 13px; padding-top: 18px; padding-bottom: 16px; }
/* torn-paper edge */
.pos-ticket::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 7px;
  background: radial-gradient(circle at 6px 0, #fff 6px, transparent 6.5px) 0 0 / 12px 7px repeat-x;
}

.pos-head { text-align: center; }
.pos-logo { display: block; width: 40px; height: 40px; object-fit: contain; margin: 0 auto 5px; }
.pos-brand { font-size: 1.5em; font-weight: 700; line-height: 1.2; }
.pos-sub { font-size: .66em; letter-spacing: .24em; color: var(--pos-soft); margin-top: 3px; }
.pos-contact { font-size: .74em; color: var(--pos-soft); line-height: 1.45; }

/* title row: small black pill (the copy's name) — thin line — ticket number.
   The pill is drawn with a thick border, not a background, so it prints even
   when the browser leaves "background graphics" off. */
.pos-title { display: flex; align-items: center; gap: 7px; margin: 10px 0 9px; }
.pos-pill {
  position: relative; overflow: hidden; flex: none;
  padding: 0 9px; border-radius: 999px;
  color: #fff; font-size: .74em; font-weight: 600; line-height: 1.75; letter-spacing: .02em;
}
.pos-pill::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 0; border-top: 4em solid var(--pos-ink); }
.pos-pill > span { position: relative; }
.pos-title-line { flex: 1; min-width: 8px; border-top: 1px solid var(--pos-ink); }
.pos-no { flex: none; font-size: .84em; font-weight: 700; letter-spacing: .02em; }

.pos-route { font-size: 1.06em; font-weight: 700; line-height: 1.35; }
.pos-grid { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; margin-top: 6px; }
.pos-grid > div { min-width: 0; }
.pos-grid .pos-wide { grid-column: 1 / -1; }
.pos-grid .pos-end { text-align: right; }
.pos-k { display: block; font-size: .72em; color: var(--pos-soft); line-height: 1.35; }
.pos-v { display: block; font-weight: 600; overflow-wrap: anywhere; }
.pos-time { display: block; font-size: .86em; line-height: 1.45; }

.pos-seatbox { border: 1.5px solid var(--pos-ink); border-radius: 7px; padding: 4px 9px 5px; margin: 10px 0 8px; }
.pos-seatbox-head { display: flex; justify-content: space-between; gap: 8px; font-size: .72em; color: var(--pos-soft); }
.pos-seat-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .5em; font-size: 1.8em; font-weight: 700; line-height: 1.25; letter-spacing: .01em; }
.pos-seat-list b { font-weight: 700; }

/* key → value rows, in small groups split by a dotted line */
.pos-rows + .pos-rows { margin-top: 5px; padding-top: 5px; border-top: 1px dotted var(--pos-ink); }
.pos-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 1px 0; font-size: .96em; }
.pos-row > span { color: var(--pos-soft); flex: none; }
.pos-row > b { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }

.pos-foot { text-align: center; font-size: .8em; line-height: 1.55; white-space: pre-line; margin-top: 9px; padding-top: 7px; border-top: 1px solid var(--pos-ink); }
.pos-printed { text-align: center; font-size: .68em; color: var(--pos-soft); margin-top: 5px; }

/* tear line between the passenger ticket and the supervisor copy
   (round notches at the edges on screen, like a perforated ticket) */
.pos-tear {
  position: relative; display: flex; align-items: center; gap: 6px;
  margin: 14px calc(-1 * var(--pos-pad)) 12px; padding: 0 var(--pos-pad);
  font-size: .7em; color: var(--pos-soft); white-space: nowrap;
}
.pos-tear-line { flex: 1; border-top: 1.5px dashed var(--pos-ink); }
.pos-tear-text i { font-size: 1.3em; margin-right: 3px; vertical-align: -.14em; }
.pos-tear::before, .pos-tear::after {
  content: ''; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; background: var(--pos-outside);
}
.pos-tear::before { left: -8px; }
.pos-tear::after { right: -8px; }

/* Ticket preview modal — a bottom sheet on phones */
.ticket-modal .modal-dialog { max-width: 410px; }
.ticket-modal .modal-content { border: 0; border-radius: 22px; background: #eef1f7; overflow: hidden; }
.ticket-modal .modal-header { background: #fff; border-bottom: 1px solid var(--line-2); padding: .85rem 1.1rem; }
.ticket-modal .modal-title { font-weight: 600; font-size: 16px; }
.ticket-modal .modal-body { padding: 1.1rem 1rem 1.4rem; }
.ticket-modal .modal-footer { background: #fff; border-top: 1px solid var(--line-2); padding: .7rem .9rem; gap: .5rem; flex-wrap: nowrap; }
.ticket-modal .modal-footer > * { margin: 0; flex: 1; }
.ticket-modal .modal-footer [hidden] { display: none !important; }
@media (max-width: 575.98px) {
  .ticket-modal .modal-dialog { margin: 0; max-width: none; height: 100%; min-height: 100%; display: flex; align-items: flex-end; }
  .ticket-modal.fade .modal-dialog { transform: translateY(100%); transition: transform .3s var(--ease); }
  .ticket-modal.show .modal-dialog { transform: none; }
  .ticket-modal .modal-content { max-height: 92%; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .ticket-modal .modal-header { position: relative; padding-top: 1.15rem; }
  .ticket-modal .modal-header::before {
    content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px;
    border-radius: 99px; background: #d5dae4;
  }
  .ticket-modal .modal-footer .btn { min-height: 50px; }
}

/* Printable sheet (supervisor report) */
.sheet { max-width: 980px; margin: 0 auto; }
.sheet-head {
  text-align: center; padding: 1.1rem 1rem; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(120deg, #1e1b4b, #4338ca); color: #fff;
}
.sheet-head .company { font-size: 18px; }
.sheet-head .sub { color: rgba(255, 255, 255, .85); font-size: 14.5px; }

/* ==========================================================================
   Access control & settings screens
   ========================================================================== */
.perm-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.perm-group + .perm-group { margin-top: .9rem; }
.perm-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .6rem .9rem; background: #f8f9fc; border-bottom: 1px solid var(--line-2); font-weight: 500;
}
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .1rem .75rem; padding: .6rem .9rem; }
.perm-item { display: flex; align-items: flex-start; gap: .55rem; padding: .35rem 0; }
.perm-item .form-check-input { margin-top: .3rem; flex: none; }
.perm-item label { cursor: pointer; }
.perm-item .inherited { font-size: 11.5px; color: var(--brand-600); }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .5rem; }
.check-card {
  display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: 11px; cursor: pointer; background: #fff;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.check-card:hover { border-color: #c7d2fe; }
.check-card .form-check-input { margin-top: .25rem; flex: none; }
.check-card:has(input:checked) { border-color: #a5b4fc; background: #f7f8ff; }
.check-card .title { font-weight: 500; font-size: 14px; line-height: 1.4; }
.check-card .sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.role-card { height: 100%; }
.role-card .role-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: .35rem; }
.status-dot.on { background: var(--success); }
.status-dot.off { background: #94a3b8; }
.password-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; background: #f8fafc; padding: .1rem .45rem; border-radius: 6px; border: 1px solid var(--line); }

.option-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.option-chips button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .2rem .8rem;
  font-size: 13px; color: var(--ink-2); transition: all .15s var(--ease);
}
.option-chips button:hover, .option-chips button.active { border-color: #c7d2fe; background: var(--brand-50); color: var(--brand-700); }
.setting-row { display: flex; gap: 1rem; align-items: flex-start; }
.setting-row + .setting-row { border-top: 1px solid var(--line-2); padding-top: 1.1rem; margin-top: 1.1rem; }
.setting-row .setting-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex: none; }
.number-input { max-width: 150px; }
.number-input .form-control { font-family: var(--en-font); font-weight: 500; text-align: center; }

/* ==========================================================================
   Login — dusk road with a coach driving across (desktop: left panel;
   phones: a short scene on top and the login sheet below)
   ========================================================================== */
.login-page { background: #f4f6fa; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, 1fr); background: #fff; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 2.75rem 3rem 2rem;
  display: flex; flex-direction: column; gap: 2rem; min-height: 100vh;
  background:
    radial-gradient(circle at 78% 18%, rgba(167, 139, 250, .35) 0, transparent 38%),
    radial-gradient(circle at 12% 30%, rgba(99, 102, 241, .45) 0, transparent 42%),
    linear-gradient(180deg, #1e1b4b 0%, #312e81 52%, #4338ca 100%);
}
.auth-brand { display: flex; align-items: center; gap: .85rem; position: relative; z-index: 2; }
.auth-brand .brand-mark { width: 50px; height: 50px; font-size: 24px; background: rgba(255, 255, 255, .14); box-shadow: none; border: 1px solid rgba(255, 255, 255, .2); }
.auth-brand-name { font-size: 21px; line-height: 1.25; }
.auth-brand-en { font-family: var(--en-font); font-size: 11.5px; letter-spacing: .14em; color: rgba(255, 255, 255, .7); }
.auth-copy { position: relative; z-index: 2; max-width: 480px; }
.auth-copy h1 { color: #fff; font-size: 38px; line-height: 1.3; margin: 0 0 .9rem; font-weight: 400; }
.auth-copy p { color: rgba(255, 255, 255, .8); font-size: 16px; line-height: 1.7; margin: 0 0 1.25rem; }
.auth-features { display: flex; flex-wrap: wrap; gap: .5rem; }
.auth-features span {
  display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); font-size: 14px;
}
.auth-copyright { position: absolute; z-index: 4; left: 3rem; bottom: 10px; font-size: 12px; color: rgba(255, 255, 255, .55); }

/* the road scene sits on the bottom edge of the panel */
.road-scene { position: relative; height: 270px; margin: auto -3rem -2rem; flex: none; }
.scene-moon {
  position: absolute; right: 12%; top: 0; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef9c3, #fde68a 60%, #fbbf24);
  box-shadow: 0 0 40px 10px rgba(253, 230, 138, .35);
}
.scene-cloud {
  position: absolute; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, .14);
  animation: cloud-drift 38s linear infinite;
}
.scene-cloud::before { content: ''; position: absolute; left: 22%; top: -10px; width: 44%; height: 24px; border-radius: 999px; background: inherit; }
.scene-cloud.c1 { width: 120px; top: 28px; left: -140px; }
.scene-cloud.c2 { width: 84px; top: 70px; left: -100px; animation-duration: 52s; animation-delay: -20s; }
.scene-city { position: absolute; left: 0; right: 0; bottom: 64px; width: 100%; height: 110px; color: rgba(15, 12, 50, .45); }
.scene-trees { position: absolute; left: 0; right: 0; bottom: 62px; display: flex; justify-content: space-around; }
.scene-trees span { width: 22px; height: 40px; position: relative; }
.scene-trees span::before { content: ''; position: absolute; left: 3px; right: 3px; top: 0; height: 30px; border-radius: 50% 50% 45% 45%; background: #1f2a5c; }
.scene-trees span::after { content: ''; position: absolute; left: 10px; width: 3px; bottom: 0; height: 12px; background: #151a3d; }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(180deg, #232a4d 0, #1a1f3b 100%); border-top: 3px solid #3b4270; }
.road-line { position: absolute; left: 0; right: 0; top: 30px; height: 3px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 34px, transparent 34px 70px); }
.bus-drive {
  position: absolute; bottom: 30px; left: -300px; width: 250px;
  /* negative delay: the bus is already on the road when the page opens */
  animation: bus-drive 11s linear -4s infinite; will-change: left;
}
.bus-svg { display: block; width: 100%; height: auto; animation: bus-bounce .5s ease-in-out infinite alternate; }
.bus-svg .wheel-rot { transform-box: fill-box; transform-origin: center; animation: wheel-spin .45s linear infinite; }
.bus-svg .bus-beam { animation: beam 1.6s ease-in-out infinite alternate; }
.bus-shadow { position: absolute; left: 6%; right: 6%; bottom: -6px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .35); filter: blur(4px); }
@keyframes bus-drive { from { left: -300px; } to { left: 105%; } }
@keyframes bus-bounce { from { transform: translateY(0); } to { transform: translateY(-1.5px); } }
@keyframes wheel-spin { to { transform: rotate(360deg); } }
@keyframes beam { from { opacity: .55; } to { opacity: 1; } }
@keyframes cloud-drift { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 300px)); } }

/* the form side */
.auth-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: #f8fafc; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 26px; margin-bottom: .3rem; font-weight: 400; }
.auth-card .form-control { min-height: 52px; font-size: 16px; }
.auth-card .input-icon i.lead { left: 15px; font-size: 18px; }
.auth-card .input-icon .form-control { padding-left: 46px; }
.auth-card .toggle-pass { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #9ca3af; padding: .45rem; z-index: 2; font-size: 17px; }
.auth-card .btn-lg { min-height: 54px; }
.auth-alert { border-radius: 12px; }
.remember-row { display: flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; font-size: 14.5px; color: var(--ink-2); }
.remember-row .form-check-input { width: 1.15rem; height: 1.15rem; margin: 0; flex: none; }
.remember-row small { color: var(--muted); font-size: 12.5px; }
.auth-foot { margin-top: 2rem; font-size: 12.5px; color: var(--muted); display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem 1rem; }
.auth-mobile-hero { display: none; }

@media (max-width: 991.98px) {
  .auth-shell { display: block; min-height: 100vh; }
  .auth-art { display: none; }
  .auth-form-wrap {
    min-height: 100vh; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0;
    background: radial-gradient(circle at 85% 10%, rgba(167, 139, 250, .35) 0, transparent 40%),
                linear-gradient(180deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
  }
  .auth-mobile-hero { display: block; color: #fff; padding: calc(1.5rem + env(safe-area-inset-top)) 1.25rem 0; }
  .auth-mobile-hero .auth-brand-name { font-size: 22px; }
  .auth-mobile-hero .auth-brand-en { letter-spacing: 0; font-family: var(--app-font); font-size: 13px; }
  .road-scene.is-mini { height: 150px; margin: .75rem -1.25rem 0; }
  .road-scene.is-mini .scene-city { bottom: 44px; height: 70px; }
  .road-scene.is-mini .road { height: 44px; }
  .road-scene.is-mini .road-line { top: 20px; }
  .road-scene.is-mini .bus-drive { bottom: 20px; width: 170px; left: -200px; animation-duration: 8s; animation-delay: -3s; }
  @keyframes bus-drive-mini { from { left: -200px; } to { left: 105%; } }
  .road-scene.is-mini .bus-drive { animation-name: bus-drive-mini; }
  .auth-card {
    flex: 1; max-width: none; background: #fff; border-radius: 26px 26px 0 0; margin-top: -14px; position: relative; z-index: 3;
    padding: 1.75rem 1.35rem calc(1.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -14px 34px -22px rgba(0, 0, 0, .55);
  }
  .auth-card h2 { font-size: 23px; }
}
/* tablets: a centred login card over the dusk scene, not a full-width form */
@media (min-width: 576px) and (max-width: 991.98px) {
  .auth-mobile-hero { padding-left: 2rem; padding-right: 2rem; }
  .road-scene.is-mini { height: 190px; margin-left: -2rem; margin-right: -2rem; }
  .road-scene.is-mini .bus-drive { width: 210px; }
  .auth-card {
    flex: none; width: calc(100% - 3rem); max-width: 480px; margin: -30px auto 2.5rem;
    border-radius: 26px; padding: 2rem 2rem 1.6rem; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55);
  }
}
/* short phones: a slimmer scene so the whole form fits without scrolling */
@media (max-width: 575.98px) and (max-height: 700px) {
  .auth-mobile-hero { padding-top: calc(1rem + env(safe-area-inset-top)); }
  .auth-mobile-hero .brand-mark { width: 42px; height: 42px; font-size: 20px; }
  .auth-mobile-hero .auth-brand-name { font-size: 19px; }
  .road-scene.is-mini { height: 112px; margin-top: .4rem; }
  .road-scene.is-mini .scene-city { height: 52px; bottom: 38px; }
  .road-scene.is-mini .road { height: 38px; }
  .road-scene.is-mini .road-line { top: 17px; }
  .road-scene.is-mini .bus-drive { width: 140px; bottom: 16px; }
  .auth-card { padding-top: 1.35rem; }
  .auth-card h2 { font-size: 21px; }
  .auth-card p.mb-4 { margin-bottom: 1rem !important; }
  .auth-card .form-control { min-height: 48px; }
  .auth-card .btn-lg { min-height: 50px; }
  .auth-foot { margin-top: 1.1rem; }
}
/* short laptop screens: keep the scene and the text apart */
@media (min-width: 992px) and (max-height: 780px) {
  .auth-art { gap: 1.4rem; padding-top: 2rem; }
  .auth-copy h1 { font-size: 32px; margin-bottom: .6rem; }
  .auth-copy p { font-size: 15px; margin-bottom: .9rem; }
  .road-scene { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .bus-drive { animation: none; left: 30%; }
  .bus-svg, .bus-svg .wheel-rot, .scene-cloud, .bus-svg .bus-beam { animation: none; }
}
/* Error pages */
.error-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.error-card { max-width: 460px; text-align: center; }
.error-card .code { font-family: var(--en-font); font-size: 64px; font-weight: 700; line-height: 1; color: var(--brand-600); }
.error-card .icon { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 1.1rem; font-size: 34px; }

/* Toasts — calm snackbars; full width under the app bar on phones */
#toast-container > div {
  font-family: var(--app-font); border-radius: 14px; opacity: 1; width: 360px; font-size: 14.5px; line-height: 1.5;
  padding: 13px 16px 13px 48px; background-position: 16px center; background-size: 20px;
  box-shadow: 0 16px 34px -14px rgba(15, 23, 42, .5); color: #fff;
}
#toast-container > div:hover { box-shadow: 0 16px 34px -14px rgba(15, 23, 42, .6); }
#toast-container > .toast-success { background-color: #15803d; }
#toast-container > .toast-error { background-color: #be123c; }
#toast-container > .toast-warning { background-color: #b45309; }
#toast-container > .toast-info { background-color: #3730a3; }
#toast-container.toast-top-full-width { top: calc(var(--topbar-h) + 8px + env(safe-area-inset-top)); left: 10px; right: 10px; width: auto; }
#toast-container.toast-top-full-width > div { width: 100%; margin: 0 0 8px; }
@media (min-width: 992px) { #toast-container.toast-top-right { top: calc(var(--topbar-h) + 12px); right: 20px; } }

/* Alerts (SweetAlert2 via the mixin in app.js): soft icon tile, app buttons;
   on phones they come up from the bottom like an action sheet */
.swal2-container.app-swal-container { padding: 1rem; backdrop-filter: blur(2px); }
.swal2-container.swal2-backdrop-show { background: rgba(15, 23, 42, .45) !important; }
.app-swal {
  font-family: var(--app-font) !important; border-radius: 22px !important; padding: 1.6rem 1.4rem 1.3rem !important;
  width: 26rem !important; max-width: 100%; box-shadow: 0 30px 60px -24px rgba(15, 23, 42, .55);
}
.swal2-icon.app-swal-icon {
  width: 58px !important; height: 58px !important; margin: .1rem auto 1rem !important; border: 0 !important;
  border-radius: 18px; font-size: 26px; place-items: center;
}
.swal2-icon.app-swal-icon .bi { line-height: 1; }
.app-swal-title { font-size: 19px !important; font-weight: 400 !important; color: var(--ink) !important; padding: 0 !important; line-height: 1.45 !important; }
.app-swal-text { font-size: 14.5px !important; color: var(--muted) !important; margin: .55rem 0 0 !important; padding: 0 !important; line-height: 1.6 !important; }
.app-swal-actions { display: flex !important; gap: .6rem; width: 100%; margin: 1.35rem 0 0 !important; padding: 0 !important; flex-wrap: nowrap; }
.app-swal-actions .btn { flex: 1; margin: 0 !important; min-height: 46px; font-size: 15px; }
.app-swal-actions .btn-light { background: #f1f3f8; border-color: #f1f3f8; }
.app-swal .swal2-footer { border-top: 1px solid var(--line-2); margin: 1rem 0 0; padding: .75rem 0 0; }
.swal-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem; margin-bottom: .6rem; }
.swal-passenger { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem .6rem; font-size: 14px; color: var(--ink-2); background: #f6f7fb; border-radius: 12px; padding: .45rem .8rem; }
.swal-note { font-size: 13.5px; color: var(--muted); }
.app-swal-in { animation: swal-in .22s var(--ease); }
.app-swal-out { animation: swal-out .15s ease-in forwards; }
@keyframes swal-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes swal-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (max-width: 575.98px) {
  .swal2-container.app-swal-container { padding: 0; align-items: flex-end !important; }
  .app-swal {
    width: 100% !important; border-radius: 24px 24px 0 0 !important; margin: 0 !important;
    padding: 1.4rem 1.15rem calc(1.1rem + env(safe-area-inset-bottom)) !important;
  }
  .app-swal::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 99px; background: #d5dae4; margin: -.6rem auto 1rem; }
  .app-swal-in { animation: sheet-in .26s var(--ease); }
  .app-swal-out { animation: sheet-out .18s ease-in forwards; }
  @keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
  .app-swal-actions .btn { min-height: 50px; }
}
/* ==========================================================================
   Mobile app shell — phones and the Android WebView app
   ========================================================================== */
html, body { -webkit-tap-highlight-color: transparent; }
a, button, .btn, .seat, label, .form-check-input { touch-action: manipulation; }
.seat, .btn, .app-bottomnav, .action-tile, .side-link, .seat-chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

@media (hover: none) {
  .action-tile:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }
  .seat-free:hover { transform: none; filter: none; }
}
.action-tile:active { transform: scale(.97); }
.seat-free:active { transform: scale(.94); }

.page-loader {
  position: fixed; top: 0; left: 0; z-index: 2000; height: 3px; width: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, #818cf8, #c7d2fe, #818cf8);
  box-shadow: 0 0 10px rgba(129, 140, 248, .8);
}
.page-loader.run { opacity: 1; width: 88%; transition: width 6s cubic-bezier(.08, .7, .1, 1), opacity .15s; }

.offline-banner {
  position: fixed; left: 12px; right: 12px; z-index: 1060;
  bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem;
  background: #111827; color: #fff; border-radius: 14px; font-size: 14px;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5);
}
.offline-banner[hidden] { display: none !important; }
@media (min-width: 992px) { .offline-banner { left: auto; right: 24px; bottom: 24px; width: 340px; } }

.topbar-back { display: none; }
.is-webview .no-webview { display: none !important; }
.mobile-cta { display: none; }

@media (max-width: 991.98px) {
  :root { --topbar-h: 58px; --bottomnav-h: 66px; }
  body { background: #f1f3f8; overscroll-behavior-y: none; }
  .app-shell { background: #f1f3f8; }

  .app-topbar {
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: linear-gradient(115deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    border-bottom: 0; backdrop-filter: none; color: #fff;
    box-shadow: 0 8px 20px -14px rgba(30, 27, 75, .9);
  }
  .topbar-inner { padding: 0 .45rem; gap: .35rem; }
  .app-topbar .topbar-title { color: #fff; font-size: 18px; padding-left: .15rem; }
  .app-topbar .topbar-toggle, .topbar-back {
    display: inline-grid; place-items: center; flex: none;
    width: 42px; height: 42px; border-radius: 12px; border: 0;
    background: transparent; color: #fff; font-size: 23px; padding: 0;
  }
  .app-topbar .topbar-toggle i { font-size: 24px !important; }
  .app-topbar .topbar-toggle:active, .topbar-back:active { background: rgba(255, 255, 255, .16); color: #fff; }
  .app-topbar.has-back .topbar-toggle { display: none; }
  .user-menu-btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; padding: .2rem; }
  .user-menu-btn .avatar { width: 34px; height: 34px; background: #fff; color: var(--brand-700); }
  .user-menu-btn .bi-chevron-down { display: none; }

  .page-head { margin-bottom: .85rem; align-items: center; }
  .page-head .head-icon, .page-head h1 { display: none; }
  .page-head p { margin: 0; font-size: 13px; line-height: 1.5; }
  .page-head .btn { padding: .4rem .8rem; font-size: 13.5px; min-height: 38px; }

  .app-content { padding: .85rem .75rem calc(var(--bottomnav-h) + 1.5rem + env(safe-area-inset-bottom)); }
  .section-gap > * + * { margin-top: 1rem; }
  .card { border-radius: 18px; border-color: #e6e9f1; }
  .card-header { padding: .85rem 1rem; }
  .card-header h2, .card-header h3, .card-title-x { font-size: 16px; }
  .card-body { padding: 1rem; }
  .form-control, .form-select, .ts-wrapper.form-select { min-height: 50px; font-size: 16px; border-radius: 13px; }
  .ts-wrapper.form-select .ts-control { min-height: 48px; font-size: 16px; }
  .ts-dropdown .ts-dropdown-content { max-height: 55vh; }
  .ts-dropdown .option { padding: .7rem .75rem; }
  textarea.form-control { min-height: 90px; }
  .btn { min-height: 46px; border-radius: 13px; }
  .btn-sm { min-height: 36px; border-radius: 10px; }
  .btn-lg { min-height: 54px; font-size: 17px; }
  .date-quick button { padding: .25rem .85rem; font-size: 13px; }

  .app-bottomnav {
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    padding: 6px 6px env(safe-area-inset-bottom);
    border-top: 1px solid #e7eaf3; box-shadow: 0 -10px 26px -20px rgba(15, 23, 42, .45);
  }
  .app-bottomnav a, .app-bottomnav button { gap: 3px; font-size: 11.5px; color: #6b7280; }
  .app-bottomnav .nav-ico { width: 58px; height: 32px; border-radius: 999px; display: grid; place-items: center; transition: background-color .2s var(--ease); }
  .app-bottomnav .nav-ico i { font-size: 21px; }
  .app-bottomnav .active { color: var(--brand-700); }
  .app-bottomnav .active .nav-ico { background: var(--brand-100); }

  .app-sidebar { width: min(84vw, 300px); border-radius: 0 22px 22px 0; padding-top: env(safe-area-inset-top); }

  #toast-container.toast-top-right { top: calc(var(--topbar-h) + 10px + env(safe-area-inset-top)); }

  .welcome { border-radius: 20px; padding: 1.1rem; }
  .welcome h1 { font-size: 20px; }
  .welcome .btn { min-height: 40px; padding: .4rem .8rem; }
  .action-grid { grid-template-columns: repeat(3, 1fr); gap: .6rem; }
  .action-tile { min-height: 0; padding: .9rem .35rem .8rem; gap: .55rem; align-items: center; text-align: center; border-radius: 18px; }
  .action-tile .tile-icon { width: 50px; height: 50px; border-radius: 16px; font-size: 22px; }
  .action-tile strong { font-size: 13.5px; line-height: 1.35; }
  .action-tile span { display: none; }

  div.dataTables_wrapper div.dataTables_length { display: none; }
  div.dataTables_wrapper div.dataTables_filter { text-align: left; }
  div.dataTables_wrapper div.dataTables_filter label { width: 100%; }
  div.dataTables_wrapper div.dataTables_filter input { width: 100%; min-height: 46px; font-size: 16px; border-radius: 12px; }
  .dt-toolbar { padding: .8rem 1rem .5rem; }
  div.dataTables_wrapper div.dataTables_info { text-align: center; padding-top: .6rem; }
  div.dataTables_wrapper div.dataTables_paginate ul.pagination { justify-content: center !important; margin-top: .25rem; }

  .trip-switch { min-height: 48px; }
  .legend-grid .legend-item { padding: .4rem .5rem; font-size: 13px; }

  .mobile-cta {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    position: fixed; left: 10px; right: 10px; z-index: 1025;
    bottom: calc(var(--bottomnav-h) + 10px + env(safe-area-inset-bottom));
    padding: .6rem .6rem .6rem 1rem; border-radius: 16px;
    background: #1e1b4b; color: #fff; box-shadow: 0 16px 30px -14px rgba(30, 27, 75, .75);
    animation: cta-in .22s var(--ease);
    transition: background-color .3s var(--ease);
  }
  .mobile-cta .btn { min-height: 42px; background: #fff; color: var(--brand-700); border: 0; }
  .mobile-cta[hidden] { display: none !important; }
  .mobile-cta.is-urgent { background: #9f1239; }
  .mobile-cta .cta-time { font-family: var(--en-font); font-weight: 600; margin-left: .25rem; }
  @keyframes cta-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

  .sticky-submit {
    position: fixed; left: 0; right: 0; z-index: 1025; margin: 0 !important;
    bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: rgba(255, 255, 255, .97); box-shadow: 0 -10px 24px -18px rgba(15, 23, 42, .45);
  }
  .sticky-submit .card-body { padding: .6rem .75rem; }
  .sticky-submit .btn { min-height: 50px; }
  .actionbar-spacer { height: 80px; }
}
@media (min-width: 992px) { .actionbar-spacer { display: none; } }
@media (max-width: 420px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   App components (lists, stats, sheets…) — phone first
   ========================================================================== */
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
.section-title { display: flex; align-items: center; gap: .45rem; font-size: 14px; color: var(--muted); margin: 0 0 .6rem; }
.section-title i { color: var(--brand-600); }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.avatar { overflow: hidden; }
.avatar-lg { width: 44px; height: 44px; font-size: 17px; }
.avatar-xl { width: 96px; height: 96px; font-size: 38px; }
.btn-link-plain { border: 0; background: none; padding: 0; color: var(--brand-600); font: inherit; }
.form-narrow { max-width: 760px; }
@media (max-width: 575.98px) { .btn-block-sm { width: 100%; } }

/* stat strip: one card, three numbers — never squeezed on small phones */
.stat-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.stat-cell { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.2rem; min-width: 0; }
.stat-cell + .stat-cell { border-left: 1px solid var(--line-2); }
.stat-cell .stat-icon { width: 46px; height: 46px; border-radius: 14px; font-size: 20px; }
.stat-text { min-width: 0; }
.stat-cell .stat-value { font-family: var(--en-font); font-size: 26px; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-cell .stat-label { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
@media (max-width: 767.98px) {
  .stat-cell { flex-direction: column; align-items: flex-start; gap: .55rem; padding: .85rem .8rem .8rem; }
  .stat-cell .stat-icon { width: 36px; height: 36px; border-radius: 11px; font-size: 16px; }
  .stat-cell .stat-value { font-size: 22px; }
  .stat-cell .stat-label { font-size: 12.5px; }
}

/* dashboard welcome */
.welcome-row { display: flex; align-items: center; gap: 1rem; position: relative; z-index: 1; }
.welcome-avatar { width: 56px; height: 56px; font-size: 22px; background: rgba(255, 255, 255, .16); color: #fff; border: 2px solid rgba(255, 255, 255, .28); flex: none; }
.welcome .welcome-date { margin: 0 0 .1rem; font-size: 13px; color: rgba(255, 255, 255, .75); }
.welcome h1 { margin: 0 0 .1rem; }
.welcome-cta { flex: none; display: inline-flex; align-items: center; gap: .4rem; }
@media (max-width: 575.98px) {
  .welcome-row { flex-wrap: wrap; gap: .8rem; }
  .welcome-avatar { width: 48px; height: 48px; font-size: 19px; }
  .welcome-cta { width: 100%; justify-content: center; min-height: 44px; }
}

/* ranked list (top bookers) */
.rank-badge {
  flex: none; min-width: 42px; height: 30px; padding: 0 .55rem; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: .2rem; font-size: 13px; background: #f1f5f9; color: #475569;
}
.rank-badge.rank-1 { background: #fef3c7; color: #b45309; }
.rank-badge.rank-2 { background: #eef2f7; color: #475569; }
.rank-badge.rank-3 { background: #ffe4e6; color: #be123c; }
.rank-stats { display: flex; gap: .4rem; flex: none; }
.rank-stat { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: .3rem .5rem; border-radius: 12px; line-height: 1.2; }
.rank-stat b { font-family: var(--en-font); font-size: 15px; font-weight: 600; }
.rank-stat small { font-size: 11.5px; opacity: .85; }
.rank-stat.is-green { background: #dcfce7; color: #15803d; }
.rank-stat.is-amber { background: #fef3c7; color: #b45309; }

/* ---------- page-by-page lists ---------- */
.list-card { overflow: hidden; }
.list-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-2); background: #fbfcfe; align-items: center; }
.list-search { position: relative; flex: 1 1 260px; min-width: 0; }
.list-search > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; z-index: 1; }
.list-search .form-control { padding-left: 40px; background: #fff; }
.lt-filters { display: flex; gap: .6rem; flex: 2 1 380px; min-width: 0; align-items: center; }
.lt-filters > .ts-wrapper, .lt-filters > select, .lt-filters > .input-icon { flex: 1 1 0; min-width: 0; }
.list-card.is-loading [data-list-body] { opacity: .45; pointer-events: none; transition: opacity .15s; }
.list-card.is-loading .list-toolbar { background-image: linear-gradient(90deg, transparent, rgba(99, 102, 241, .12), transparent); background-size: 200% 100%; animation: list-load 1s linear infinite; }
@keyframes list-load { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.dl-item { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line-2); min-width: 0; }
.dl-item:last-child { border-bottom: 0; }
.dl-item:hover { background: #fafbff; }
.dl-item.is-off { opacity: .72; }
.dl-main { flex: 1; min-width: 0; }
.dl-title { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; font-size: 15px; color: var(--ink); line-height: 1.4; min-width: 0; }
.dl-date { font-size: 12.5px; color: var(--muted); }
.dl-sub { font-size: 13.5px; color: var(--ink-2); margin-top: .1rem; }
.dl-meta { display: flex; flex-wrap: wrap; gap: .15rem 1rem; margin-top: .25rem; font-size: 13px; color: var(--muted); min-width: 0; }
.dl-meta > * { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; }
.dl-meta a { color: var(--brand-600); }
.dl-address { max-width: 100%; }
.dl-side { display: flex; align-items: center; gap: .4rem; flex: none; }
.dl-side form { margin: 0; }
.dl-when { flex-direction: column; align-items: flex-end; gap: 0; font-size: 13px; color: var(--ink-2); text-align: right; }
.dl-when small { color: var(--muted); font-size: 12px; }
.dl-people { display: flex; flex-wrap: wrap; gap: .3rem .5rem; margin-top: .4rem; }
.dl-people > span { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; background: #f6f7fb; border-radius: 9px; padding: .18rem .55rem; color: var(--ink-2); max-width: 100%; }
.dl-people small { color: var(--muted); font-size: 11.5px; }
.dl-people .is-danger { background: #fff1f2; }

.date-tile, .seat-tile, .coach-tile {
  flex: none; width: 50px; height: 52px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-700); line-height: 1.1;
}
.date-tile b { font-family: var(--en-font); font-size: 19px; font-weight: 600; }
.date-tile span { font-family: var(--en-font); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.date-tile.is-danger { background: #fee2e2; color: #b91c1c; }
.date-tile.is-muted { background: #f1f5f9; color: #64748b; }
.seat-tile { font-family: var(--en-font); font-weight: 600; font-size: 15px; background: #fee2e2; color: #b91c1c; }
.seat-tile.is-neutral { background: var(--brand-50); color: var(--brand-700); }
.coach-tile { gap: .1rem; }
.coach-tile i { font-size: 14px; }
.coach-tile b { font-size: 13px; font-weight: 400; }
.coach-tile.is-day { background: #fef3c7; color: #92400e; }
.coach-tile.is-night { background: var(--brand-50); color: var(--brand-700); }

/* grouped lists (passengers under each counter) */
.dl-group + .dl-group { border-top: 6px solid #f4f6fa; }
.dl-group-head { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.1rem; background: #fbfcfe; border-bottom: 1px solid var(--line-2); }
.dl-group-title { font-size: 15px; color: var(--ink); }
.dl-compact { padding: .7rem 1.1rem; align-items: flex-start; }
.dl-seats { display: flex; flex-wrap: wrap; gap: .1rem; flex: none; max-width: 42%; }
.report-row { align-items: flex-start; }
.report-seats { display: flex; flex-wrap: wrap; gap: .1rem; margin-top: .45rem; }

.seat-chip.has-x { padding: 0 .2rem 0 0; }
.seat-chip .chip-label { border: 0; background: none; color: inherit; font: inherit; padding: .18rem .55rem; border-radius: 8px; }
.seat-chip .chip-label:hover { text-decoration: underline; }
.seat-chip form { display: inline-flex; }

.list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .8rem 1.1rem; border-top: 1px solid var(--line-2); background: #fbfcfe; }
.list-range { font-size: 13.5px; color: var(--muted); }
.list-range b { color: var(--ink-2); font-weight: 500; }
.list-pager { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.lp-btn, .lp-num {
  min-width: 38px; height: 38px; padding: 0 .6rem; border-radius: 11px; border: 1px solid var(--line); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); font-family: var(--en-font); font-size: 14px;
}
.lp-btn:hover, .lp-num:hover { border-color: #c7d2fe; color: var(--brand-700); }
.lp-num.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.lp-btn.disabled { opacity: .4; pointer-events: none; }
.lp-gap { color: var(--muted); padding: 0 .1rem; }
.lp-status { font-size: 13.5px; color: var(--ink-2); padding: 0 .4rem; }
/* the full "আমার বুকিং" page: never squeezed into the booking page's small scroll box */
.my-bookings-list.is-full { flex: none !important; max-height: none !important; min-height: 0 !important; overflow: visible !important; }

@media (max-width: 767.98px) {
  .list-toolbar { padding: .75rem .85rem; }
  .list-search { flex-basis: 100%; }
  .lt-filters { flex-basis: 100%; }
  .lt-filters-wide { flex-wrap: wrap; }
  .lt-filters-wide > .ts-wrapper { flex-basis: 100%; }
  .dl-item { padding: .8rem .9rem; gap: .75rem; align-items: flex-start; }
  .dl-group-head, .dl-compact { padding-left: .9rem; padding-right: .9rem; }
  .date-tile, .seat-tile, .coach-tile { width: 46px; height: 48px; border-radius: 13px; }
  .dl-title { font-size: 14.5px; }
  .dl-when { font-size: 12px; }
  .dl-compact { flex-wrap: wrap; }
  .dl-compact .dl-seats { max-width: none; order: 2; flex-basis: 100%; }
  .list-foot { justify-content: center; }
  .list-pager { margin: 0 auto; }
  .list-range { width: 100%; text-align: center; }
}

/* ---------- form helpers ---------- */
.form-toggle { min-height: 48px; }
.check-all-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .75rem; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; background: #fff; cursor: pointer; user-select: none; }
.check-all-pill .form-check-input { margin: 0; }
.seg-control { display: flex; background: #f1f3f8; border-radius: 12px; padding: 4px; gap: 4px; }
.seg-control input { position: absolute; opacity: 0; pointer-events: none; }
.seg-control label {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 38px; border-radius: 9px;
  font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; transition: background-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.seg-control input:checked + label { background: #fff; color: var(--brand-700); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.seg-control input[value="2"]:checked + label { color: #be185d; }
.seg-control input:focus-visible + label { outline: 2px solid #a5b4fc; outline-offset: 1px; }

/* trip form with a 4th field (days) */
@media (min-width: 992px) {
  .trip-form.tf-4 { grid-template-columns: minmax(230px, 1fr) minmax(0, 1.4fr) 150px minmax(150px, auto); }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  .trip-form.tf-4 .tf-coach { grid-column: 1 / -1; }
}

/* multiple bus info: one row per day */
.day-head { grid-template-columns: 170px repeat(4, minmax(0, 1fr)); gap: .75rem; padding: .55rem 1.1rem; background: #f8f9fc; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.day-row { display: grid; grid-template-columns: 170px repeat(4, minmax(0, 1fr)); gap: .75rem; align-items: center; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.day-row:last-child { border-bottom: 0; }
.day-date { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; font-size: 14px; }
.day-row .form-label { font-size: 12.5px; margin-bottom: .2rem; }
@media (max-width: 991.98px) {
  .day-row { grid-template-columns: 1fr 1fr; padding: .9rem; gap: .6rem .75rem; }
  .day-date { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- settings ---------- */
.setting-title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .25rem; }
.form-check-input.switch-lg { width: 2.9em; height: 1.55em; margin: 0; cursor: pointer; }
.logo-picker { display: flex; align-items: center; gap: 1rem; }
.logo-preview {
  position: relative; width: 84px; height: 84px; border-radius: 22px; flex: none; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #4338ca); display: grid; place-items: center; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .7);
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-initial { color: #fff; font-size: 34px; }
.logo-edit { position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--brand-700); font-size: 13px; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
#removeLogoBtn.active { background: #fee2e2; }
.brand-mark.has-logo { background: #fff; padding: 3px; overflow: hidden; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }

/* ---------- profile ---------- */
.profile-card { overflow: hidden; }
.profile-cover { height: 86px; background: linear-gradient(120deg, #312e81, #4f46e5 60%, #7c3aed); }
.profile-photo { position: relative; display: inline-block; margin-top: -48px; cursor: pointer; }
.profile-photo .avatar { border: 4px solid #fff; box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .5); background: var(--brand-50); }
.photo-edit { position: absolute; right: 2px; bottom: 4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; border: 3px solid #fff; font-size: 13px; }
.photo-busy { position: absolute; inset: 4px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .7); color: var(--brand); }

/* ---------- sidebar extras ---------- */
.sidebar-user-link { display: flex; align-items: center; gap: .65rem; min-width: 0; flex: 1; color: inherit; }
.sidebar-user-link:hover { color: inherit; }
.sidebar-logout {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(148, 163, 184, .12); color: #cbd5e1;
  display: grid; place-items: center; font-size: 17px; transition: background-color .15s var(--ease), color .15s var(--ease);
}
.sidebar-logout:hover { background: rgba(248, 113, 113, .2); color: #fecaca; }

/* ---------- booking page ---------- */
.trip-switch { background: #fff; border: 1px solid var(--line); color: var(--ink); min-height: 48px; border-radius: 14px; }
.trip-switch .bi-chevron-down { transition: transform .2s var(--ease); }
.trip-switch[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
#passengerCard { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.booking-who { margin-top: .15rem; font-size: 14px; }
.booking-side { display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; flex: none; }
.booking-item .seat-chip { margin-left: 0; }
@media (max-width: 991.98px) {
  .my-bookings-list { max-height: none; overflow: visible; }
  .selected-box .chip-x, .seat-chip .chip-x { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
  /* phones: the seat map comes sooner — slimmer trip card, no company line */
  .booking-grid { gap: .75rem; }
  .bk-trip .company { display: none; }
  .bk-trip .trip-hero { padding: .85rem 1rem; }
  .bk-trip .trip-hero h2 { font-size: 18px; margin: 0 0 .15rem; }
  .bk-trip .trip-meta { margin-top: .5rem; }
  .booking-page .seatmap-card .card-header { padding: .7rem 1rem; }
  .booking-page .coach { padding: .8rem .75rem .9rem; }
  .booking-page .coach-front { padding-bottom: .55rem; margin-bottom: .65rem; }
}
/* desktop: the whole booking fits the screen, even on a 1366×768 laptop */
@media (min-width: 992px) and (max-height: 940px) {
  body:has(.booking-page) .app-footer { display: none !important; }
  body:has(.booking-page) .app-content { padding-top: .9rem; padding-bottom: .9rem; }
  .booking-page #tripSearchBox { margin-bottom: .8rem !important; }
  .booking-page .filter-bar-compact .card-body { padding: .6rem .9rem; }
  .booking-page .filter-bar-compact .tf-label { min-height: 26px; margin-bottom: .2rem; }
  .booking-page .card-header { padding: .55rem 1rem; }
  .booking-page .seatmap-card .card-body { padding: .7rem; }
  .booking-page .map-hint { display: none; }
  .booking-page .coach { padding: .6rem .7rem .7rem; }
  .booking-page .coach-front { padding-bottom: .4rem; margin-bottom: .5rem; }
  .booking-page .steering { width: 26px; height: 26px; }
  .booking-page .selection-card .card-body { padding: .85rem 1rem; }
  .booking-page .form-grid { gap: .6rem .8rem; }
  .booking-page #refer { height: 44px; min-height: 44px; resize: none; }
  .booking-page #bookingForm .form-hint { display: none; }
  .booking-page .hold-box { display: flex; align-items: center; gap: .75rem; padding: .5rem .8rem; margin-bottom: .75rem; }
  .booking-page .hold-text { display: none; }
  .booking-page .hold-bar { flex: 1; margin-top: 0; }
  .booking-page .trip-hero-compact { padding: .8rem 1rem; }
  .booking-page .trip-hero-compact .trip-meta { margin-top: .45rem; }
  .booking-page .legend-grid .legend-item { padding: .35rem .55rem; }
  .booking-page .selected-box { min-height: 46px; padding: .45rem .7rem; }
}

/* ---------- coach layout editor ---------- */
.layout-field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line-2); }
.layout-field.is-last { border-bottom: 0; padding-bottom: 0; }
.layout-field .seg-control { min-width: 200px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; flex: none; }
.stepper button { width: 42px; height: 42px; border: 0; background: #f6f7fb; color: var(--ink-2); font-size: 16px; }
.stepper button:active { background: var(--brand-50); color: var(--brand-700); }
.stepper input { width: 52px; height: 42px; border: 0; text-align: center; font-family: var(--en-font); font-size: 17px; font-weight: 600; color: var(--ink); background: #fff; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.layout-summary { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-bottom: .9rem; }
.layout-summary span { font-size: 13px; background: #f6f7fb; border-radius: 999px; padding: .2rem .7rem; color: var(--ink-2); }
.layout-summary b { font-family: var(--en-font); font-weight: 600; }
.layout-summary .is-off { background: #f1f5f9; color: #64748b; }
.seat-chip.chip-off { background: #f1f5f9; color: #475569; border-color: #e2e8f0; padding-right: .35rem; }
.layout-coach { max-width: 380px; }
@media (min-width: 992px) {
  .layout-preview-card { position: sticky; top: calc(var(--topbar-h) + 16px); }
}
@media (max-width: 575.98px) {
  .layout-field { flex-wrap: wrap; }
  .layout-field .seg-control { min-width: 0; width: 100%; }
}

/* multiple delete: bigger tick targets with the passenger name */
.select-seats { display: flex; flex-wrap: wrap; gap: .45rem; padding: .8rem 1.1rem 1rem; }
.seat-select { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .7rem; border-radius: 11px; margin: 0; min-height: 40px; max-width: 100%; }
.seat-select input { width: 16px; height: 16px; flex: none; }
.seat-select small { font-family: var(--app-font); font-weight: 400; font-size: 12px; color: var(--muted); max-width: 140px; }
.seat-select.is-female { background: #fce7f3; border-color: #fbcfe8; color: #be185d; }

/* ---------- phone shell extras ---------- */
@media (max-width: 991.98px) {
  .app-bottomnav { grid-template-columns: repeat(var(--tabs, 4), 1fr); }
  /* while typing, the bottom tabs and action bars step aside for the keyboard */
  body.keyboard-open .app-bottomnav,
  body.keyboard-open .mobile-cta,
  body.keyboard-open .sticky-submit,
  body.keyboard-open .offline-banner { display: none !important; }
  body.keyboard-open .app-content { padding-bottom: 1.5rem; }
  .offline-banner { bottom: calc(var(--bottomnav-h) + 76px + env(safe-area-inset-bottom)); }
  .sticky-submit-sm {
    position: sticky; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); z-index: 5;
    background: rgba(255, 255, 255, .97); box-shadow: 0 -10px 24px -18px rgba(15, 23, 42, .45);
  }
  .sticky-submit-sm .btn { width: 100%; min-height: 50px; }
  .action-grid { gap: .55rem; }
  .action-tile { padding: .85rem .35rem .75rem; border-radius: 18px; }
  .action-tile .tile-icon { width: 46px; height: 46px; border-radius: 15px; font-size: 21px; }
  .action-tile strong { font-size: 13px; }
  /* Tom Select lists open as a bottom sheet */
  body > .ts-dropdown.ts-sheet {
    position: fixed !important; top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: auto !important; max-width: 640px; margin: 0 auto !important; z-index: 1070; font-size: 16px; border: 0;
    border-radius: 22px 22px 0 0; padding: 1rem .6rem calc(.7rem + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 40px -14px rgba(15, 23, 42, .45); animation: sheet-up .22s var(--ease);
  }
  body > .ts-dropdown.ts-sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 99px; background: #d5dae4; margin: -.45rem auto .6rem; }
  body > .ts-dropdown.ts-sheet .ts-dropdown-content { max-height: 62vh; overscroll-behavior: contain; }
  body > .ts-dropdown.ts-sheet .option { padding: .8rem .85rem; min-height: 48px; display: flex; align-items: center; }
  body.ts-sheet-open { overflow: hidden; }
  body.ts-sheet-open::after { content: ''; position: fixed; inset: 0; z-index: 1065; background: rgba(15, 23, 42, .45); animation: fade-in .2s; }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}

/* Tom Select: placeholder when there is no typing box (touch), soft focus in the search box,
   and no pre-highlighted first option on touch screens */
.ts-wrapper.single:not(.has-items) .ts-control[data-placeholder]::before {
  content: attr(data-placeholder); color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.plugin-dropdown_input .dropdown-input:focus { outline: 0; border-color: #a5b4fc !important; box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .12) !important; }
@media (pointer: coarse) {
  .ts-dropdown .option.active:not(.selected) { background: transparent; }
}
/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .app-sidebar, .app-topbar, .app-bottomnav, .app-footer, .no-print, .dt-toolbar, .dt-footer, .mobile-cta,
  .list-toolbar, .list-pager, .sticky-submit, .actionbar-spacer, .trip-switch, .page-head p, .page-head .btn,
  .offline-banner, #toast-container { display: none !important; }
  .app-shell { display: block; }
  .app-main { margin: 0 !important; }
  .app-content { padding: 0 !important; max-width: none; }
  body { background: #fff !important; }
  .page-head { margin-bottom: .75rem; }
  .page-head h1, .page-head .head-icon { display: block !important; }
  .page-head .head-icon { display: none !important; }
  .card { box-shadow: none !important; }
  .dl-item, .dl-group-head, .booking-item { break-inside: avoid; }
  .trip-hero, .sheet-head, .welcome, .seat-chip, .badge, .date-tile, .seat-tile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
