@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap");

:root {
  --apr-burgundy: #7a2433;
  --apr-burgundy-dark: #521722;
  --apr-gold: #d4a017;
  --apr-gold-soft: #f3df9b;
  --apr-cream: #faf6ef;
  --apr-ink: #1c1917;
  --apr-muted: #57534e;
  --apr-border: #e7e0d4;
  --apr-surface: #ffffff;
  --apr-sky: #eff6ff;
  --apr-success: #ecfdf5;
  --apr-warning: #fffbeb;
  --apr-danger: #fef2f2;
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 8px 24px rgba(28, 25, 23, 0.08);
  --shadow-lg: 0 20px 50px rgba(82, 23, 34, 0.12);
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--apr-ink);
  background:
    radial-gradient(circle at top right, rgba(212, 160, 23, 0.08), transparent 28rem),
    linear-gradient(180deg, #fff 0%, var(--apr-cream) 100%);
}

a {
  color: var(--apr-burgundy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--apr-burgundy-dark);
}

main {
  flex: 1;
  padding-bottom: 3rem;
}

.container {
  width: min(1140px, 92vw);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(82, 23, 34, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--apr-gold), #b8860b);
  color: var(--apr-burgundy-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.brand small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-links a.nav-cta {
  background: var(--apr-gold);
  color: var(--apr-burgundy-dark) !important;
}

.nav-links a.nav-cta:hover {
  background: var(--apr-gold-soft);
}

/* Typography */
.page-header {
  padding: 2.25rem 0 1rem;
}

.page-header h1,
.section-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--apr-burgundy-dark);
}

.section-title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.page-header p,
.lead {
  margin: 0;
  color: var(--apr-muted);
  font-size: 1.05rem;
  max-width: 42rem;
}

.page-header-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header-actions,
.manifest-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-scan-link {
  font-weight: 700;
  color: var(--apr-burgundy);
}

.seating-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.section {
  margin: 2rem 0;
}

/* Hero */
.hero {
  padding: 2rem 0 0.5rem;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background:
    linear-gradient(135deg, rgba(82, 23, 34, 0.96), rgba(122, 36, 51, 0.92)),
    linear-gradient(180deg, #fff0, #fff0);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -3rem -4rem auto;
  width: 14rem;
  height: 14rem;
  border-radius: 999px;
  background: rgba(212, 160, 23, 0.18);
  pointer-events: none;
}

.hero-panel h2 {
  position: relative;
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  max-width: 16ch;
}

.hero-panel p {
  position: relative;
  max-width: 52rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
}

.hero-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.hero-card {
  background: var(--apr-surface);
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-md);
}

.hero-card h1,
.hero-card h2 {
  margin-top: 0;
  font-family: var(--font-display);
  color: var(--apr-burgundy-dark);
}

/* Cards & grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--apr-surface);
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d9cdb8;
}

.card h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--apr-burgundy-dark);
}

.card-body {
  flex: 1;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.meta {
  font-size: 0.92rem;
  color: var(--apr-muted);
  line-height: 1.55;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-gold {
  background: #fef3c7;
  color: #92400e;
}

.badge-burgundy {
  background: #fce7ea;
  color: var(--apr-burgundy-dark);
}

.badge-green {
  background: var(--apr-success);
  color: #047857;
}

.badge-muted {
  background: #f5f5f4;
  color: var(--apr-muted);
}

/* Buttons */
.button,
button.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--apr-burgundy);
  color: #fff !important;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.button:hover,
button.btn-primary:hover {
  background: var(--apr-burgundy-dark);
  transform: translateY(-1px);
}

.button.secondary {
  background: var(--apr-gold);
  color: var(--apr-burgundy-dark) !important;
}

.button.secondary:hover {
  background: var(--apr-gold-soft);
}

.button.ghost {
  background: transparent;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.button.small {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}

.run-status-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: fit-content;
  min-width: 8.75rem;
}

.run-status-controls .inline-form {
  display: block;
}

.run-status-controls .button.small {
  width: 100%;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
}

.manifest-status-bar .run-status-controls {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  width: auto;
  min-width: 0;
}

.manifest-status-bar .run-status-controls .button.small {
  width: auto;
}

/* Notices & messages */
.notice {
  background: var(--apr-sky);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  color: #1e3a8a;
  font-size: 0.94rem;
}

.notice-warning {
  background: var(--apr-warning);
  border-color: #fde68a;
  color: #92400e;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.messages li {
  padding: 0.85rem 1rem;
  margin-bottom: 0.55rem;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
}

.messages .success { background: var(--apr-success); color: #065f46; }
.messages .error { background: var(--apr-danger); color: #991b1b; }
.messages .warning { background: var(--apr-warning); color: #92400e; }

/* Forms */
form p {
  margin: 0 0 1rem;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--apr-ink);
  margin-bottom: 0.35rem;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  color: var(--apr-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #c4a574;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.18);
}

.form-section {
  margin-bottom: 1.5rem;
}

.form-section h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--apr-burgundy-dark);
}

.auth-card {
  max-width: 420px;
  margin: 2.5rem auto;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--apr-surface);
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

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

th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--apr-muted);
  background: #fafaf9;
}

th,
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--apr-border);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #fafaf9;
}

/* Staff layout */
.staff-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.1rem;
  margin-top: 1.25rem;
}

.staff-nav {
  background: var(--apr-surface);
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 5.5rem;
}

.staff-nav a {
  display: block;
  text-decoration: none;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--apr-ink);
  font-weight: 500;
}

.staff-nav a:hover {
  background: var(--apr-cream);
  color: var(--apr-burgundy-dark);
}

.staff-nav p {
  margin: 0 0 0.25rem;
}

.logout-form {
  margin: 0;
}

.logout-button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--apr-ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.logout-button:hover {
  background: var(--apr-cream);
  color: var(--apr-burgundy-dark);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0 0.5rem;
}

.report-filter-panel {
  margin: 0 0 0.5rem;
}

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

.report-filter-actions {
  display: flex;
  align-items: flex-end;
}

.report-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--apr-border);
}

.report-presets a {
  color: var(--apr-burgundy);
  font-weight: 600;
  text-decoration: none;
}

.report-presets a:hover {
  text-decoration: underline;
}

.report-stat-grid {
  margin-bottom: 1rem;
}

.stat {
  background: var(--apr-surface);
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-sm);
}

.stat span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--apr-muted);
  margin-bottom: 0.35rem;
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--apr-burgundy-dark);
}

.panel-block {
  margin-top: 1.25rem;
}

.panel-block h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--apr-burgundy-dark);
  margin: 0 0 0.75rem;
}

/* Footer */
.site-footer {
  background: var(--apr-ink);
  color: #d6d3d1;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.site-footer strong {
  color: #fff;
}

.site-footer a {
  color: var(--apr-gold-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.footer-note {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  color: #a8a29e;
}

/* Ticket desk & seating */
.desk-toolbar { margin-bottom: 1rem; }
.desk-search { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.desk-search .form-control { flex: 1; min-width: 220px; margin: 0; }
.desk-grid { display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 1rem; }
.ticket-header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.ticket-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-start; }
.ticket-desk-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.ticket-panel { margin: 0; }
.ticket-side-panel { grid-column: 2; grid-row: 1; }
.ticket-table-panel { grid-column: 1 / -1; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.form-grid .span-2 { grid-column: span 2; }
.financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--apr-cream);
  border-radius: var(--radius-md);
}
.financial-grid span {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apr-muted);
}
.financial-total strong { color: var(--apr-burgundy-dark); font-size: 1.2rem; }
.action-bar, .action-stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.action-stack { flex-direction: column; align-items: stretch; }
.action-details {
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: #fff;
}
.action-details summary { cursor: pointer; font-weight: 600; }
.action-details-body { margin-top: 0.75rem; display: grid; gap: 0.5rem; }
.run-picker { display: grid; gap: 0.55rem; }
.run-picker-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  background: #fff;
}
.run-picker-item:hover { border-color: #d9cdb8; box-shadow: var(--shadow-sm); }
.container.page-wide { width: min(1680px, 98vw); }

.staff-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 2rem 0 0.5rem;
}

.staff-page-header h1 {
  margin-bottom: 0.15rem;
}

.staff-page-header > .button,
.staff-page-header .directory-page-actions,
.staff-page-header .page-header-actions,
.staff-page-header .tour-action-links {
  flex-shrink: 0;
}

.staff-page-header.tour-coaches-header {
  padding: 0;
  margin-bottom: 0.75rem;
}

.directory-page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.directory-row-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}
.directory-row-actions .inline-form {
  margin: 0;
}
.button-link {
  border: 0;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}
.button-link.danger-link {
  color: #b91c1c;
}
.staff-form-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: 2px solid #808080;
  border-radius: 0.5rem;
  padding: 0;
  width: min(480px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  z-index: 121;
}
.staff-form-modal-wide {
  width: min(640px, calc(100vw - 2rem));
}
.staff-form-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.staff-form-modal-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  min-height: 0;
}
.staff-form-modal-form.manage-form-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.staff-form-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.staff-form-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.staff-form-modal-close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0.15rem 0.35rem;
}
.staff-form-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.staff-form-modal-body.manage-form-grid {
  margin: 0;
}
.staff-form-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 1rem;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  flex-shrink: 0;
}

.fleet-layout,
.directory-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.fleet-panel h2,
.directory-panel h2,
.directory-list h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}
.fleet-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.fleet-panel-header h2 {
  margin: 0;
}
.group-member-section {
  margin-top: 0.5rem;
}
.group-member-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.group-member-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.group-member-label {
  font-size: 0.85rem;
  color: var(--muted, #666);
}
.group-member-fields {
  display: grid;
  grid-template-columns: 1fr 8rem;
  gap: 0.5rem;
}
.new-contact-panel {
  margin: 0.25rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.45rem;
  background: #f8fafc;
}
.new-contact-panel h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}
.fleet-delete-panel {
  margin-bottom: 1rem;
}
.fleet-delete-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.fleet-delete-header h2 {
  margin: 0 0 0.35rem;
}
.fleet-swap-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.fleet-swap-form select {
  min-width: 12rem;
}
.fleet-delete-actions {
  margin-top: 1rem;
}
.fleet-delete-actions button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.directory-list { margin-bottom: 1rem; }
.directory-list-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.75rem;
}
.table-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  white-space: nowrap;
}
.tour-action-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.tour-form-panel {
  max-width: 640px;
}
.tour-form .form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.tour-link-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.7;
}
.tour-link-list a {
  font-weight: 700;
}
.tour-coaches-panel {
  margin-top: 1rem;
}

.tour-coaches-header .lead {
  margin-bottom: 0;
}
.tour-coach-add-form {
  margin-top: 1rem;
  max-width: 420px;
}
.inline-form {
  display: inline;
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--apr-burgundy-dark);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* Legacy seating chart */
.seating-page-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.seating-bottom-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.legacy-seating-shell {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "chart chart"
    "manage passengers";
}
.legacy-seating-header { grid-area: header; }
.seating-chart-panel { grid-area: chart; }
.seating-manage-panel { grid-area: manage; }
.passenger-list-panel { grid-area: passengers; }
.seating-mobile-toolbar { display: none; }
.seating-desktop-coach-picker { display: block; }
.seating-mobile-hint { display: none; }
.seating-desktop-hint { display: block; }
.passenger-cards { display: none; }
.passenger-search-label,
.passenger-search-input,
.passenger-list-count,
.passenger-search-empty { display: none; }
.passenger-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.passenger-list-header h2 { margin: 0; }
.seating-train-card {
  min-height: 280px;
  margin-bottom: 1rem;
}
.seating-manage-panel {
  position: sticky;
  top: 5.5rem;
  padding: 1rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
}
.seating-sidebar {
  position: sticky;
  top: 5.5rem;
  padding: 1rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
}
.sidebar-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.sidebar-nav {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 1rem;
}
.sidebar-link {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--apr-ink);
  font-weight: 600;
  font-size: 0.88rem;
  background: var(--apr-cream);
}
.sidebar-link:hover { background: #ececec; }
.sidebar-link.is-active {
  background: var(--apr-burgundy);
  color: #fff;
}
.sidebar-section {
  border-top: 1px solid var(--apr-border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}
.sidebar-section h3,
.sidebar-section h4 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}
.sidebar-hint {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--apr-muted);
  line-height: 1.4;
}
.tour-group-list {
  margin: 0 0 0.75rem;
  display: grid;
  gap: 0.5rem;
}
.tour-group-item {
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}
.tour-group-summary {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  list-style: none;
}
.tour-group-summary::-webkit-details-marker {
  display: none;
}
.tour-group-summary-main {
  display: grid;
  gap: 0.15rem;
}
.tour-group-range {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--apr-burgundy);
}
.tour-group-edit {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--apr-border);
}
.tour-group-clear-form {
  margin-top: 0.5rem;
}
.tour-group-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--apr-muted);
}
.seating-main-card {
  min-height: 420px;
}
.manage-form-grid {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
}
.manage-form-grid label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.seating-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--apr-muted);
}
.legacy-seating-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.legacy-seating-header h1 { margin-bottom: 0.15rem; }
.seating-stats { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.legacy-stat {
  padding: 0.35rem 0.65rem;
  border-radius: 0.25rem;
  background: #ececec;
  border: 1px solid #bdbdbd;
  font-size: 0.82rem;
  font-weight: 700;
}
.legacy-seating-board {
  background: #d4d0c8;
  border: 2px solid #808080;
  border-radius: 0.35rem;
  padding: 0.65rem;
  box-shadow: inset 0 0 0 1px #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.train-chart-stack {
  width: 100%;
  margin: 0.5rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.train-track {
  width: 100%;
  margin: 0;
  padding: 0 0 0.35rem;
  border-bottom: 2px solid #9ca3af;
}
.train-track-inner {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  min-height: 88px;
}
.seating-main-stack {
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.coach-grids-row,
.coach-grid-spacer,
.coach-grid-column,
.seat-column-grid,
.seat-row-legacy,
.seat-spacer-cell,
.legacy-coach-grid-single,
.seat-bands,
.seat-band,
.seat-pair,
.legacy-train-row,
.seating-manage-toolbar,
.legacy-seat-grid-wide,
.legacy-seat-row,
.seat-btn {
  display: none !important;
}
.train-car {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 88px;
  border: 2px solid #374151;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, #4ade80, #16a34a);
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.legacy-train-row { display: none; }

.coach-plan-single {
  background: #d4d0c8;
  border: 1px solid #808080;
  padding: 0.65rem 0.45rem 0.75rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  min-height: 220px;
  overflow: hidden;
  color: #1a1a1a;
}
.coach-plan-single .seat-label-code,
.coach-plan-single .seat-label-name {
  color: #1a1a1a;
  text-shadow: none;
}
.coach-plan-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #44403c;
  text-align: center;
  margin-bottom: 0.15rem;
}
.coach-plan-grid {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
  gap: 0;
}
.seat-coach-column {
  flex: 1 1 0;
  min-width: 0;
  background: #ebe6dc;
  border: 1px solid #b8a88a;
  padding: 0.12rem 0.08rem;
}
.seat-coach-column-extra {
  flex: 0 0 auto;
  min-width: 4.5rem;
  max-width: 5.5rem;
  background: #e8e0d0;
}
.seat-coach-gap {
  flex: 0 0 0.65rem;
  background: #d4d0c8;
}
.seat-column-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  height: 100%;
  min-height: 6.5rem;
  gap: 0.06rem;
}
.seat-column-aisle {
  width: 100%;
  flex: 0 0 0.28rem;
  border-top: 1px dashed #9ca3af;
  border-bottom: 1px dashed #9ca3af;
  background: #d4d0c8;
  margin: 0.08rem 0;
}
.seat-slot-empty {
  min-height: 1.55rem;
  flex: 0 0 1.55rem;
}
.seat-pair,
.seat-coach-row,
.seat-coach-aisle {
  display: none !important;
}
.seat-row-upper,
.seat-row-lower,
.seat-aisle-row,
.seat-grid-gap,
.seat-cell,
.seat-cell-extra,
.seat-band-upper,
.seat-band-lower,
.seat-column-tan,
.seat-column-extra,
.seat-band-h {
  display: none !important;
}
.seat-band-aisle { display: none; }
.seat-pair-h { display: none; }
.seat-unit {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.12rem;
  min-width: 0;
  width: 100%;
  padding: 0.04rem 0.02rem;
}
.seat-unit-sold .seat-unit-label {
  flex: 1 1 auto;
  min-width: 0;
}
.seat-icon-btn {
  width: 12px;
  height: 28px;
  border-radius: 1px;
  border: 1px solid #6b7280;
  padding: 0;
  cursor: grab;
  flex: 0 0 auto;
  background: #d9cdb8;
  transition: box-shadow 0.1s ease;
}
.seat-icon-btn:active { cursor: grabbing; }
.seat-icon-btn:hover,
.seat-icon-btn:focus-visible {
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
  outline: none;
  z-index: 2;
}
.seat-icon-btn.is-dragging { opacity: 0.45; }
.seat-icon-btn.is-drop-target,
.seat-icon-btn.is-selected,
.seat-icon-btn.seat-selected {
  box-shadow: 0 0 0 1px #fff, 0 0 0 2px #2563eb;
}
.seat-icon-btn.seat-open {
  background: #d9cdb8;
  border-color: #a8a29e;
}
.seat-icon-btn.seat-sold {
  background: #22c55e;
  border-color: #15803d;
}
.seat-icon-btn.seat-selected {
  background: #fbbf24;
  border-color: #d97706;
}
.seat-unit-label {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.1;
  overflow: visible;
}
.seat-label-code,
.seat-label-name {
  display: block;
  line-height: 1.1;
}
.seat-label-code {
  font-size: 0.6rem;
  font-weight: 700;
  color: #1a1a1a;
}
.seat-label-name {
  font-size: 0.54rem;
  font-weight: 800;
  color: #1a1a1a;
  text-transform: uppercase;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
.seat-label-meta {
  display: none;
}
.seat-unit-compact { display: none; }

.passenger-list-panel {
  padding: 0.85rem 1rem 1rem;
}
.passenger-list-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.legacy-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #d6d3d1;
}
.legacy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.legacy-table th,
.legacy-table td {
  border: 1px solid #d6d3d1;
  padding: 0.32rem 0.45rem;
  text-align: left;
}
.legacy-table th {
  background: #ececec;
  position: sticky;
  top: 0;
  z-index: 1;
}
.legacy-table tr.is-current-coach td {
  background: #fef9c3;
}
.legacy-table a {
  color: var(--apr-burgundy-dark);
  font-weight: 700;
  text-decoration: none;
}
.legacy-table a:hover { text-decoration: underline; }

.passenger-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--apr-border);
  border-radius: var(--radius-md);
  background: #fff;
}
.passenger-card.is-current-coach {
  border-color: #facc15;
  background: #fefce8;
}
.passenger-card.is-unassigned {
  border-style: dashed;
}
.passenger-card-pass-link {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.passenger-card.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}
@media (min-width: 768px) {
  .passenger-card[draggable="true"] {
    cursor: grab;
  }
}
.passenger-card-tag {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--apr-muted);
}
.passenger-card-name {
  margin: 0.1rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--apr-ink);
}
.passenger-card-meta {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--apr-muted);
}
.passenger-card-seat {
  text-align: right;
  min-width: 4.5rem;
}
.passenger-card-coach {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--apr-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.passenger-card-seat-link {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--apr-burgundy-dark);
  text-decoration: none;
}
.passenger-card-unassigned {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--apr-muted);
}
.passenger-cards-empty {
  margin: 0;
  color: var(--apr-muted);
  font-size: 0.92rem;
}
.seating-mobile-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}
.seating-mobile-actions .button {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 8.5rem;
  text-align: center;
  justify-content: center;
}

.seating-manage-toolbar { display: none; }
.train-car::before,
.train-car::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #111827;
  border: 2px solid #4b5563;
}
.train-car::before { left: 12px; }
.train-car::after { right: 12px; }
.train-car-loco {
  background: linear-gradient(180deg, #6b7280, #374151);
  color: #fff;
}
.train-car-coach { background: linear-gradient(180deg, #4ade80, #16a34a); }
.train-car.is-selected {
  background: linear-gradient(180deg, #f87171, #dc2626);
  border-color: #991b1b;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #dc2626;
}
.train-car-loco.is-selected {
  background: linear-gradient(180deg, #6b7280, #374151);
  border-color: #1f2937;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4b5563;
}
.train-car-label {
  font-size: clamp(0.72rem, 1.2vw, 0.95rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
  text-align: center;
  padding: 0 0.35rem;
  word-break: break-word;
}

.legacy-coach-grid-single {
  background: #f5f5f4;
  border: 1px solid #a8a29e;
  padding: 0.65rem;
  width: calc(100% - 0.5rem);
  margin: 0 auto;
  flex: 1;
  overflow-x: auto;
}
.legacy-coach-grid-title {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.seat-bands {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min-content;
}
.seat-band {
  display: flex;
  flex-direction: row;
  gap: 0.35rem;
  align-items: stretch;
}
.seat-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem;
  padding-right: 0.35rem;
  border-right: 1px dashed #c4b5a0;
  min-width: 108px;
}
.seat-pair:last-child { border-right: 0; padding-right: 0; }
.legacy-seat-grid-wide { display: none; }
.legacy-seat-row { display: none; }
.seat-btn {
  min-height: 1.55rem;
  min-width: 0;
  width: 100%;
  border-radius: 0.1rem;
  border: 1px solid #b8a88a;
  padding: 0.1rem 0.08rem;
  display: grid;
  gap: 0.02rem;
  align-content: center;
  justify-items: center;
  cursor: grab;
  font: inherit;
  background: #e8dcc8;
  color: #44403c;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  overflow: hidden;
}
.seat-btn:active { cursor: grabbing; }
.seat-btn.is-dragging { opacity: 0.45; }
.seat-btn.is-drop-target {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb;
}
.seat-btn:hover,
.seat-btn:focus-visible {
  transform: scale(1.04);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  outline: none;
  z-index: 2;
}
.seat-btn.is-selected,
.seat-btn.seat-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #2563eb;
}
.seat-code {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}
.seat-code-open { opacity: 0.55; font-size: 0.62rem; }
.seat-company {
  font-size: 0.5rem;
  font-weight: 800;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
}
.seat-meta {
  font-size: 0.48rem;
  font-weight: 700;
  line-height: 1;
}
.seat-meta-sub {
  font-size: 0.42rem;
  line-height: 1;
  opacity: 0.85;
}
.seat-btn.seat-open {
  background: #e8dcc8;
  min-height: 1.35rem;
}
.seat-btn.seat-sold {
  background: linear-gradient(180deg, #86efac, #4ade80);
  border-color: #16a34a;
  color: #14532d;
  min-height: 1.85rem;
}
.seat-btn.seat-sold .seat-company { font-size: 0.64rem; }

.seat-manage-heading {
  margin: 1rem 0 0.35rem;
  font-size: 0.88rem;
}
.seat-detail-meta-large dd {
  font-size: 1.05rem;
}
.seat-btn.seat-selected {
  background: linear-gradient(180deg, #fde68a, #fbbf24);
  border-color: #d97706;
}


@media (max-width: 980px) {
  .seating-page-layout,
  .seating-bottom-layout,
  .fleet-layout,
  .directory-layout { grid-template-columns: 1fr; }
  .seating-sidebar,
  .seating-manage-panel { position: static; max-height: none; }
  .train-track-inner { min-height: 72px; }
  .train-car { height: 72px; }
}

@media (max-width: 767px) {
  .legacy-seating-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "toolbar"
      "passengers"
      "chart"
      "manage";
  }

  .seating-mobile-toolbar {
    display: block;
    grid-area: toolbar;
    padding: 0.65rem;
    background: #fff;
    border: 1px solid var(--apr-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }

  .seating-mobile-toolbar .train-track {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .seating-mobile-toolbar .train-track-inner {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: auto;
    min-width: 100%;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .seating-mobile-toolbar .train-car {
    flex: 0 0 4.5rem;
    min-width: 4.5rem;
    height: 3.5rem;
  }

  .seating-mobile-toolbar .train-car::before,
  .seating-mobile-toolbar .train-car::after {
    display: none;
  }

  .seating-desktop-coach-picker,
  .seating-desktop-sidebar-nav {
    display: none !important;
  }

  .seating-chart-panel:not(.is-chart-open) {
    display: none !important;
  }

  .seating-manage-panel:not(.is-manage-open) {
    display: none !important;
  }

  .passenger-list-panel {
    padding: 0.85rem 0.9rem 1rem;
  }

  .passenger-search-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
  }

  .passenger-search-input {
    display: block;
    width: 100%;
    margin: 0 0 0.75rem;
  }

  .passenger-list-count {
    display: block;
    margin: 0;
    font-size: 0.82rem;
    color: var(--apr-muted);
  }

  .passenger-cards {
    display: grid;
    gap: 0.55rem;
  }

  .passenger-table-desktop {
    display: none !important;
  }

  .passenger-search-empty {
    display: block;
    margin: 0.5rem 0 0;
    color: var(--apr-muted);
    font-size: 0.88rem;
  }

  .passenger-search-empty[hidden] {
    display: none !important;
  }

  .passenger-card[hidden] {
    display: none !important;
  }

  .seating-mobile-hint { display: block; }
  .seating-desktop-hint { display: none; }

  .seating-chart-panel.is-chart-open {
    display: flex !important;
    flex-direction: column;
  }

  .seating-chart-panel.is-chart-open .coach-plan-single {
    overflow: hidden;
  }

  .seating-chart-panel.is-chart-open .coach-plan-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.15rem;
    padding-bottom: 0.35rem;
  }

  .seating-chart-panel.is-chart-open .seat-coach-column {
    flex: 0 0 4.75rem;
    min-width: 4.75rem;
  }

  .seating-chart-panel.is-chart-open .seat-coach-column-extra {
    min-width: 5.25rem;
    max-width: 5.25rem;
  }

  .seating-chart-panel.is-chart-open .seat-icon-btn {
    width: 18px;
    height: 34px;
  }

  .seating-chart-panel.is-chart-open .seat-label-code {
    font-size: 0.68rem;
  }

  .seating-chart-panel.is-chart-open .seat-label-name {
    font-size: 0.58rem;
  }

  .seat-popover {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: none;
    border-radius: 1rem 1rem 0 0;
    max-height: 85vh;
  }

  .legacy-seating-header h1 {
    font-size: 1.15rem;
  }

  .legacy-seating-header .lead {
    font-size: 0.82rem;
    line-height: 1.45;
  }
}

.seat-popover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 120;
}
.seat-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: 2px solid #808080;
  border-radius: 0.5rem;
  padding: 1.25rem 1.35rem;
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  z-index: 121;
}
.seat-popover::backdrop { background: rgba(15, 23, 42, 0.45); }
.seat-popover-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #57534e;
}
.seat-detail-empty {
  color: var(--apr-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.seat-detail-body { display: grid; gap: 0.65rem; }
.seat-detail-kicker {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--apr-muted);
}
.seat-detail-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.05;
  color: var(--apr-burgundy-dark);
  word-break: break-word;
  text-transform: uppercase;
}
.seat-detail-passenger {
  margin: 0;
  font-size: 1.15rem;
  color: var(--apr-ink);
}
.seat-detail-seat-code {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.seat-detail-meta {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}
.seat-detail-meta div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.35rem;
}
.seat-detail-meta dt {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apr-muted);
}
.seat-detail-meta dd { margin: 0; font-weight: 600; }
.seat-detail-status {
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.seat-detail-status.open { background: #e8dcc8; color: #44403c; }
.seat-detail-status.sold { background: #86efac; color: #14532d; }
.seat-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

@media (max-width: 980px) {
  .legacy-bottom-row { grid-template-columns: 1fr; min-width: 0; }
  .legacy-seating-board { min-width: 0; }
}
.tab-bar { display: flex; gap: 0.35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab-link {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--apr-muted);
  background: var(--apr-cream);
  font-weight: 600;
  font-size: 0.88rem;
}
.tab-link.active { background: var(--apr-burgundy); color: #fff; }
.passenger-platform {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffedd5, #fed7aa);
  border: 1px solid #fdba74;
}
.passenger-platform h3 { margin: 0 0 0.35rem; }
.platform-list { display: grid; gap: 0.65rem; margin-top: 0.75rem; }
.platform-card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: grid;
  gap: 0.35rem;
}
.assign-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.assign-form .form-control { flex: 1; min-width: 160px; margin: 0; }
.inline-form { display: inline; }

.nav-user-block {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.25rem;
}

.nav-user {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  padding: 0.55rem 0.85rem;
}

.nav-links .logout-form {
  margin: 0;
}

.nav-links .logout-button {
  display: inline-block;
  width: auto;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
  font-weight: 500;
}

.nav-links .logout-button:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.login-body main {
  min-height: calc(100vh - 5rem);
  display: grid;
  align-items: center;
}

@media (max-width: 760px) {
  .staff-shell {
    grid-template-columns: 1fr;
  }

  .staff-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .staff-nav p {
    margin: 0;
  }

  .nav-links {
    width: 100%;
  }

  .desk-grid,
  .ticket-desk-layout {
    grid-template-columns: 1fr;
  }

  .ticket-side-panel,
  .ticket-table-panel {
    grid-column: auto;
  }
}

.docs-index-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 1.5rem;
}

.docs-index-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.docs-index-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1);
}

.docs-index-card h2 {
  margin: 0 0 0.5rem;
  color: var(--apr-burgundy);
}

.docs-index-card p {
  margin: 0 0 0.75rem;
  color: var(--apr-muted);
}

.docs-index-link {
  font-weight: 700;
  color: var(--apr-burgundy);
}

.docs-back-link {
  margin-top: 0.5rem;
}

.docs-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  align-items: start;
}

.docs-sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.docs-sidebar-nav {
  display: grid;
  gap: 0.35rem;
}

.docs-sidebar-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--apr-ink);
}

.docs-sidebar-nav a.is-active,
.docs-sidebar-nav a:hover {
  color: var(--apr-burgundy);
}

.docs-sidebar-foot {
  margin: 1rem 0 0;
  font-size: 0.88rem;
}

.docs-article {
  padding: 1.25rem 1.5rem 1.75rem;
}

.docs-prose {
  max-width: 52rem;
  line-height: 1.55;
  color: var(--apr-ink);
}

.docs-prose > :first-child {
  margin-top: 0;
}

.docs-prose h1,
.docs-prose h2,
.docs-prose h3,
.docs-prose h4 {
  color: var(--apr-burgundy);
  line-height: 1.25;
  margin: 1.75rem 0 0.75rem;
}

.docs-prose h1 { font-size: 1.75rem; }
.docs-prose h2 { font-size: 1.35rem; border-bottom: 1px solid var(--apr-border); padding-bottom: 0.35rem; }
.docs-prose h3 { font-size: 1.1rem; }

.docs-prose p,
.docs-prose ul,
.docs-prose ol,
.docs-prose table {
  margin: 0 0 1rem;
}

.docs-prose ul,
.docs-prose ol {
  padding-left: 1.35rem;
}

.docs-prose li + li {
  margin-top: 0.25rem;
}

.docs-prose a {
  color: var(--apr-burgundy);
  font-weight: 600;
}

.docs-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f5f0ea;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
}

.docs-prose pre {
  overflow-x: auto;
  padding: 0.85rem 1rem;
  background: #1f1f1f;
  color: #f5f5f5;
  border-radius: var(--radius-md);
}

.docs-prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.docs-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.docs-prose th,
.docs-prose td {
  border: 1px solid var(--apr-border);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.docs-prose th {
  background: #faf7f2;
  font-weight: 700;
}

.docs-prose hr {
  border: 0;
  border-top: 1px solid var(--apr-border);
  margin: 1.5rem 0;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
}

/* Fleet / seating battleship grid */
.fleet-layout-chart { container-type: inline-size; min-width: 0; padding: 1rem; overflow: visible; width: 100%; }
.fleet-layout-chart .fleet-battleship-wrap { width: 100%; overflow-x: auto; display: flex; flex-direction: column; align-items: center; }
.fleet-layout-chart .fleet-battleship-grid-horizontal {
  --fleet-grid-ref-cols: 17; --fleet-grid-row-label: 2.25rem; --fleet-grid-inset: 0.94;
  --fleet-grid-chrome: calc(0.7rem + 2px + (var(--fleet-grid-ref-cols) - 1) * 2px);
  --fleet-grid-cell-size: clamp(1.65rem, calc((100cqi * var(--fleet-grid-inset) - var(--fleet-grid-row-label) - var(--fleet-grid-chrome)) / var(--fleet-grid-ref-cols)), 5rem);
  display: inline-grid; gap: 2px; background: #d6d3d1; border: 1px solid #a8a29e; padding: 0.35rem; border-radius: var(--radius-sm);
  grid-template-columns: var(--fleet-grid-row-label) repeat(var(--fleet-grid-length, 17), var(--fleet-grid-cell-size));
  grid-auto-rows: var(--fleet-grid-cell-size); min-width: 0; width: max-content;
}
.fleet-layout-chart .fleet-grid-cell { width: var(--fleet-grid-cell-size); height: var(--fleet-grid-cell-size); min-width: var(--fleet-grid-cell-size); min-height: var(--fleet-grid-cell-size); max-width: var(--fleet-grid-cell-size); max-height: var(--fleet-grid-cell-size); box-sizing: border-box; border: 1px solid #d6d3d1; border-radius: 2px; padding: 0.1rem; font: inherit; }
.fleet-grid-carriage-title { text-align: center; font-size: 0.9rem; font-weight: 800; letter-spacing: 0.04em; color: var(--apr-burgundy-dark); margin: 0 0 0.75rem; }
.fleet-grid-orientation { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin: 0 0 0.35rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #57534e; }
.fleet-grid-orient-arrow { font-size: 1rem; line-height: 1; }
.fleet-grid-length-label, .fleet-grid-width-label { display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 700; color: #57534e; text-align: center; }
.fleet-grid-width-label-aisle { font-style: italic; }
.fleet-grid-cell-label { display: block; font-size: 0.52rem; line-height: 1.1; text-align: center; word-break: break-word; color: #1c1917; pointer-events: none; }
.fleet-grid-seat-direction { display: block; font-size: 0.62rem; line-height: 1; margin-bottom: 0.08rem; font-weight: 700; }
.fleet-cell-empty { background: #fafaf9; }
.fleet-cell-passenger { background: linear-gradient(180deg, #86efac, #22c55e); border-color: #16a34a; }
.fleet-cell-bar { background: #d97706; border-color: #92400e; color: #fff; }
.fleet-cell-bar_stool { background: #f59e0b; border-color: #b45309; color: #fff; }
.fleet-cell-kitchen { background: #ef4444; border-color: #b91c1c; color: #fff; }
.fleet-cell-bathroom { background: #60a5fa; border-color: #1d4ed8; color: #fff; }
.fleet-cell-staff_door { background: #a78bfa; border-color: #6d28d9; color: #fff; }
.fleet-cell-staff_area { background: #8b5cf6; border-color: #5b21b6; color: #fff; }
.fleet-cell-supplies { background: #a8a29e; border-color: #57534e; color: #fff; }
.fleet-cell-other { background: #d6d3d1; border-color: #78716c; }
.fleet-cell-bar .fleet-grid-cell-label, .fleet-cell-bar_stool .fleet-grid-cell-label, .fleet-cell-kitchen .fleet-grid-cell-label, .fleet-cell-bathroom .fleet-grid-cell-label, .fleet-cell-staff_door .fleet-grid-cell-label, .fleet-cell-staff_area .fleet-grid-cell-label, .fleet-cell-supplies .fleet-grid-cell-label { color: #fff; font-weight: 700; }
.fleet-layout-chart.seating-battleship-chart { min-height: 0; }
.fleet-layout-chart .fleet-grid-cell.seat-icon-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; cursor: grab; }
.fleet-layout-chart .fleet-grid-cell.seat-icon-btn .fleet-grid-cell-label { font-size: clamp(0.45rem, 2.2cqi, 0.62rem); }
.fleet-layout-chart .fleet-grid-cell.seat-icon-btn.seat-sold { background: linear-gradient(180deg, #4ade80, #16a34a); border-color: #15803d; color: #fff; }
.fleet-layout-chart .fleet-grid-cell.seat-icon-btn.seat-open { background: linear-gradient(180deg, #86efac, #22c55e); border-color: #16a34a; }
.fleet-layout-chart .fleet-grid-cell.seat-icon-btn.is-selected, .fleet-layout-chart .fleet-grid-cell.seat-icon-btn.seat-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb; }
.fleet-layout-chart .coach-plan-single.fleet-coach-plan-fit { min-height: 0; overflow: visible; background: #d4d0c8; border: 1px solid #808080; padding: 0.65rem; }

/* Fleet carriage layout editor */
.fleet-grid-editor { display: flex; flex-direction: column; gap: 1rem; }
.fleet-grid-palette { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.fleet-paint-tool { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--apr-border); border-radius: var(--radius-sm); background: var(--apr-surface); padding: 0.35rem 0.55rem; font-size: 0.78rem; cursor: pointer; }
.fleet-paint-tool.is-active { border-color: var(--apr-gold-dark); box-shadow: 0 0 0 2px rgba(180, 134, 54, 0.25); }
.fleet-paint-swatch { width: 1rem; height: 1rem; border-radius: 2px; border: 1px solid rgba(0, 0, 0, 0.15); flex: 0 0 auto; }
.fleet-paint-eraser .fleet-paint-swatch { background: #f5f5f4; }
.fleet-paint-seat .fleet-paint-swatch { background: linear-gradient(180deg, #4ade80, #16a34a); }
.fleet-paint-bar .fleet-paint-swatch { background: #92400e; }
.fleet-paint-bar-stool .fleet-paint-swatch { background: #b45309; }
.fleet-paint-kitchen .fleet-paint-swatch { background: #dc2626; }
.fleet-paint-bathroom .fleet-paint-swatch { background: #2563eb; }
.fleet-paint-staff-door .fleet-paint-swatch { background: #7c3aed; }
.fleet-paint-staff-area .fleet-paint-swatch { background: #6d28d9; }
.fleet-paint-supplies .fleet-paint-swatch { background: #57534e; }
.fleet-paint-other .fleet-paint-swatch { background: #a8a29e; }
.fleet-direction-tool .fleet-paint-swatch {
  background: #f1f5f9;
  border-color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e293b;
}
.fleet-direction-tool[data-direction-tool="forward"] .fleet-paint-swatch::before { content: "▶"; }
.fleet-direction-tool[data-direction-tool="backward"] .fleet-paint-swatch::before { content: "◀"; }
.fleet-grid-cell.is-disabled { opacity: 0.35; cursor: not-allowed; background: repeating-linear-gradient(-45deg, #f5f5f4, #f5f5f4 4px, #e7e5e4 4px, #e7e5e4 8px); }
.fleet-grid-cell:hover, .fleet-grid-cell.is-pending-paint { outline: 2px solid var(--apr-gold); outline-offset: -1px; }
.fleet-layout-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; align-items: start; }
.fleet-tools-panel { padding: 1rem; }
.fleet-tools-panel-wide { grid-column: 1 / -1; }
.fleet-grid-resize-form .fleet-resize-range-line { margin: -0.15rem 0 0; font-size: 0.82rem; font-weight: 600; color: var(--apr-muted); white-space: nowrap; }
.fleet-slot-editor { padding: 1rem; }
.fleet-slot-editor h2 { margin: 0 0 0.75rem; font-size: 1rem; }
.fleet-slot-editor-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.fleet-layout-sidebar { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow: auto; }
.fleet-tour-assignment-list { margin: 0.5rem 0 0; padding-left: 1.1rem; }
