:root {
  color-scheme: light;
  --bg: #f5f4f2;
  --panel: #ffffff;
  --panel-soft: #faf9f7;
  --line: #e0dfdb;
  --line-strong: #c9c7c2;
  --text: #111111;
  --muted: #686865;
  --brand: #e30613;
  --brand-dark: #b5000c;
  --brand-soft: #fff0f1;
  --brand-ink: #0d0d0d;
  --brand-gray: #bcbcbb;
  --green: #2f9b69;
  --amber: #d9901f;
  --red: #e30613;
  --ink-soft: #f0efec;
  --shadow: 0 18px 45px rgba(17, 17, 17, 0.11);
  font-family:
    Montserrat, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11171b;
  --panel: #182229;
  --panel-soft: #1f2b33;
  --line: #2d3c45;
  --line-strong: #40525d;
  --text: #e7edf1;
  --muted: #9aabb4;
  --brand: #4fb4d2;
  --brand-dark: #8bd3e8;
  --brand-soft: #16313b;
  --brand-ink: #071116;
  --brand-gray: #9aabb4;
  --green: #53c58e;
  --amber: #e2a73f;
  --red: #f06b6b;
  --ink-soft: #23313a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  background:
    radial-gradient(circle at 95% -20%, rgba(227, 6, 19, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(188, 188, 187, 0.16), transparent 28%),
    var(--bg);
  color: var(--text);
}

body[data-theme="dark"] {
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

body[data-page="login"] {
  min-width: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  background:
    linear-gradient(110deg, var(--panel) 0%, var(--panel) 64%, rgba(227, 6, 19, 0.08) 100%);
  border-bottom: 1px solid var(--line);
}

.topbar::after,
.login-card::after,
.driver-hero::after,
.dispatcher-hero::after,
.statistics-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 34%, rgba(227, 6, 19, 0.18) 35%, rgba(227, 6, 19, 0.18) 39%, transparent 40%),
    radial-gradient(ellipse at 20% 50%, transparent 48%, rgba(227, 6, 19, 0.16) 49%, rgba(227, 6, 19, 0.16) 54%, transparent 55%);
  opacity: 0.38;
}

.topbar::after {
  right: -120px;
  top: -90px;
  width: 420px;
  height: 260px;
  transform: rotate(-6deg);
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  width: 152px;
  max-width: 24vw;
  min-height: 48px;
}

.brand-logo {
  display: block;
  width: 152px;
  max-width: 100%;
  max-height: 48px;
  height: auto;
  object-fit: contain;
}

.brand-logo-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 6px;
}

body[data-theme="dark"] .brand-logo {
  width: 152px;
  max-width: 100%;
}

body[data-page="driver"] .brand-logo-link {
  width: min(152px, 48vw);
  max-width: 48vw;
}

body[data-page="driver"][data-theme="dark"] .brand-logo {
  width: 152px;
  max-width: 100%;
}

.driver-brand-lockup {
  align-items: flex-start;
  flex-wrap: wrap;
}

.driver-brand-lockup .driver-subtitle {
  flex-basis: 100%;
  margin-left: 0;
}

.topbar-actions {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.theme-toggle:hover {
  border-color: var(--brand);
}

.theme-toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.theme-toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  transition: transform 0.18s ease;
}

body[data-theme="dark"] .theme-toggle-track span {
  transform: translateX(16px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-family:
    "Montserrat Alternates", Montserrat, "Segoe UI", system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-family:
    "Montserrat Alternates", Montserrat, "Segoe UI", system-ui, sans-serif;
  font-size: 20px;
}

.view-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.main-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 14px;
}

.tab-button {
  border: 0;
  border-radius: 6px;
  padding: 9px 16px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.tab-button.is-active {
  color: #ffffff;
  background: var(--brand);
  box-shadow: 0 6px 14px rgba(227, 6, 19, 0.22);
}

main {
  padding: 18px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.dispatcher-view {
  width: min(1260px, 100%);
  margin-inline: auto;
  max-width: 1260px;
}

.dispatcher-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 16px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.dispatcher-hero > *,
.statistics-hero > *,
.driver-hero > *,
.login-card > * {
  position: relative;
  z-index: 1;
}

.dispatcher-hero::after,
.statistics-hero::after {
  right: -96px;
  bottom: -76px;
  width: 340px;
  height: 220px;
  transform: rotate(7deg);
}

.dispatcher-hero h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.dispatcher-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.dispatcher-badge {
  display: grid;
  min-width: 112px;
  min-height: 88px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.dispatcher-badge span {
  color: var(--brand);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.dispatcher-badge strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.dispatcher-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dispatcher-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 268px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(31, 48, 58, 0.08);
}

.dispatcher-card-wide {
  grid-column: 1 / -1;
  min-height: 0;
}

.dispatcher-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dispatcher-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.dispatcher-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.dispatcher-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(227, 6, 19, 0.11);
  color: var(--brand);
}

.dispatcher-icon.success {
  background: rgba(47, 155, 105, 0.13);
  color: var(--green);
}

.dispatcher-icon.danger {
  background: rgba(216, 72, 72, 0.12);
  color: var(--red);
}

.dispatcher-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.dispatcher-form {
  display: grid;
  gap: 12px;
}

.dispatcher-form-inline {
  grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 0.8fr) minmax(110px, 0.6fr) auto;
  align-items: end;
}

.dispatcher-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dispatcher-form input,
.dispatcher-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}

.dispatcher-form button {
  min-height: 40px;
}

.dispatcher-result {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 800;
}

.dispatcher-result:empty {
  display: none;
}

.dispatcher-result.is-pending {
  border-style: solid;
  color: var(--brand-dark);
}

.dispatcher-result.is-success {
  border-style: solid;
  border-color: rgba(47, 155, 105, 0.45);
  color: var(--green);
  background: rgba(47, 155, 105, 0.08);
}

.dispatcher-result.is-error {
  border-style: solid;
  border-color: rgba(216, 72, 72, 0.45);
  color: var(--red);
  background: rgba(216, 72, 72, 0.08);
}

.statistics-view {
  width: min(1420px, 100%);
  margin-inline: auto;
  max-width: 1420px;
}

.statistics-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(227, 6, 19, 0.1), transparent 46%),
    var(--panel);
  box-shadow: var(--shadow);
}

.statistics-hero h2 {
  margin-bottom: 6px;
  font-size: 25px;
}

.statistics-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.statistics-hero-total {
  display: grid;
  min-width: 148px;
  min-height: 92px;
  place-items: center;
  border: 1px solid rgba(227, 6, 19, 0.24);
  border-radius: 8px;
  background: rgba(227, 6, 19, 0.1);
}

.statistics-hero-total span {
  color: var(--brand);
  font-size: 36px;
  font-weight: 950;
  line-height: 1;
}

.statistics-hero-total strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.statistics-filters {
  display: grid;
  grid-template-columns: 1.15fr repeat(5, minmax(132px, 0.72fr)) minmax(132px, 0.82fr) minmax(190px, 1.1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.statistics-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.statistics-filters input,
.statistics-filters select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}

.statistics-search-field {
  min-width: 180px;
}

.statistics-status {
  min-height: 22px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.statistics-status[data-status="error"] {
  color: var(--red);
}

.statistics-status[data-status="success"] {
  color: var(--green);
}

.statistics-active-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.statistics-active-filter[hidden] {
  display: none;
}

.statistics-active-filter span,
.statistics-active-filter small {
  color: var(--muted);
}

.statistics-active-filter em {
  max-width: 420px;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-active-filter button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--panel);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.statistics-insight {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.statistics-insight[hidden] {
  display: none;
}

.statistics-insight-head {
  display: grid;
  gap: 4px;
}

.statistics-insight-head span {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.statistics-insight-head strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.statistics-insight-head small {
  color: var(--muted);
  font-weight: 800;
}

.statistics-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.statistics-insight-grid div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.statistics-insight-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.statistics-insight-grid strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}

.statistics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.stat-kpi {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(31, 48, 58, 0.07);
}

.stat-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-kpi strong {
  color: var(--text);
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
}

.stat-kpi small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stat-kpi.is-positive strong {
  color: var(--green);
}

.stat-kpi.is-negative strong {
  color: var(--red);
}

.stat-kpi-money strong {
  color: var(--brand);
  font-size: 26px;
}

.stat-kpi-total-money strong {
  color: var(--green);
  font-size: 25px;
}

.statistics-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
  gap: 12px;
}

.statistics-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(31, 48, 58, 0.07);
}

.statistics-panel-wide {
  grid-column: 1 / -1;
}

.statistics-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.statistics-panel h3 {
  margin: 0 0 3px;
  font-size: 18px;
}

.statistics-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.statistics-chart-legend {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.statistics-panel-legend {
  flex: 0 0 auto;
}

.statistics-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.statistics-chart-legend i,
.statistics-donut-list i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.stat-color-current {
  background: var(--brand);
}

.stat-color-compare {
  background: var(--amber);
}

.statistics-line-chart {
  position: relative;
  min-height: 260px;
}

.statistics-tooltip {
  position: fixed;
  z-index: 2000;
  display: grid;
  gap: 7px;
  min-width: 220px;
  max-width: min(360px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(8, 20, 31, 0.22);
  pointer-events: none;
}

.statistics-tooltip[hidden] {
  display: none;
}

.statistics-tooltip strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

.statistics-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.statistics-tooltip em {
  font-style: normal;
}

.statistics-tooltip b {
  color: var(--text);
  font-weight: 950;
  text-align: right;
}

.statistics-line-chart svg {
  width: 100%;
  height: 260px;
  overflow: visible;
}

.stat-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.stat-axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stat-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.stat-line-current {
  stroke: var(--brand);
}

.stat-line-compare {
  stroke: var(--amber);
  stroke-dasharray: 8 7;
}

.stat-point-current {
  fill: var(--panel);
  stroke: var(--brand);
  stroke-width: 3;
}

.stat-point-compare {
  fill: var(--panel);
  stroke: var(--amber);
  stroke-width: 3;
}

.stat-interactive-point {
  cursor: pointer;
  transition: r 0.16s ease, fill 0.16s ease, stroke-width 0.16s ease;
}

.stat-interactive-point:hover,
.stat-interactive-point:focus,
.stat-interactive-point.is-selected-stat {
  fill: var(--brand);
  outline: none;
  r: 7px;
  stroke-width: 4;
}

.statistics-donut-wrap {
  display: grid;
  grid-template-columns: 156px 1fr;
  gap: 14px;
  align-items: center;
}

.statistics-donut {
  display: grid;
  width: 156px;
  height: 156px;
  place-items: center;
  border-radius: 50%;
  position: relative;
}

.statistics-donut::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: var(--panel);
}

.statistics-donut span,
.statistics-donut small {
  position: relative;
  z-index: 1;
}

.statistics-donut span {
  align-self: end;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}

.statistics-donut small {
  align-self: start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.statistics-donut-list {
  display: grid;
  gap: 8px;
}

.statistics-donut-list button {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.statistics-donut-list button:hover,
.statistics-donut-list button:focus,
.statistics-donut-list button.is-selected-stat {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  outline: none;
  transform: translateY(-1px);
}

.statistics-donut-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-donut-list strong {
  color: var(--text);
}

.statistics-status-breakdown {
  display: grid;
  gap: 12px;
}

.statistics-status-row {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.statistics-status-row:hover,
.statistics-status-row:focus,
.statistics-status-row.is-selected-stat {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  outline: none;
  transform: translateY(-1px);
}

.statistics-status-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.statistics-status-row strong {
  color: var(--text);
}

.statistics-mini-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink-soft);
}

.statistics-mini-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.statistics-bars {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.statistics-bars-compact {
  max-height: 420px;
}

.statistics-city-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.statistics-city-grid h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
}

.statistics-bar-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(280px, 1fr) minmax(88px, auto);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.statistics-bar-row:hover,
.statistics-bar-row:focus,
.statistics-bar-row.is-selected-stat {
  border-color: var(--brand);
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(31, 48, 58, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.statistics-bar-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.statistics-bar-title strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-bar-title span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-bar-stack {
  display: grid;
  gap: 5px;
}

.statistics-bar-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
}

.statistics-bar-line span {
  display: block;
  min-width: 2px;
  height: 12px;
  border-radius: 999px;
  background: var(--brand);
}

.statistics-bar-line.is-compare span {
  background: var(--amber);
}

.statistics-bar-line strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  text-align: right;
}

.statistics-bar-delta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.statistics-bar-delta small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}

.statistics-bar-delta.is-positive {
  color: var(--green);
}

.statistics-bar-delta.is-negative {
  color: var(--red);
}

.booking-view {
  width: min(1680px, 100%);
  margin-inline: auto;
  max-width: 1680px;
}

.booking-subtabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 14px;
}

.booking-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(460px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.booking-card {
  min-height: 0;
}

.booking-passengers-card,
.booking-result-card {
  grid-column: 1 / -1;
}

.booking-form {
  display: grid;
  gap: 12px;
}

.booking-form label,
.booking-passenger-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.booking-form input,
.booking-form select,
.booking-passenger-row input,
.booking-passenger-row select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}

.booking-city-row,
.booking-form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.booking-city-field {
  position: relative;
}

.booking-city-results {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.booking-city-results:empty {
  display: none;
}

.booking-city-option {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 800;
}

.booking-city-option:hover {
  background: var(--ink-soft);
}

.booking-city-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.booking-trips {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.booking-trip-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.booking-trip-item:hover,
.booking-trip-item.is-selected {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(31, 48, 58, 0.12);
}

.booking-trip-item.is-low-seats {
  border-color: rgba(216, 72, 72, 0.4);
}

.booking-trip-time {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(227, 6, 19, 0.1);
  color: var(--brand-dark);
  font-weight: 900;
}

.booking-trip-main strong,
.booking-trip-main small,
.booking-trip-meta strong,
.booking-trip-meta small {
  display: block;
}

.booking-trip-main strong {
  font-size: 15px;
}

.booking-trip-main small,
.booking-trip-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-trip-meta {
  text-align: right;
}

.booking-trip-badge {
  display: inline-flex;
  margin-left: 4px;
  color: var(--brand);
}

.booking-selected-trip {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.booking-selected-trip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-passenger-list {
  display: grid;
  gap: 10px;
}

.booking-passenger-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) minmax(160px, 0.6fr);
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.booking-passenger-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: var(--ink-soft);
  color: var(--brand-dark);
  font-weight: 900;
}

.booking-result-summary,
.booking-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.booking-result-summary {
  padding-top: 0;
  color: var(--text);
  font-weight: 800;
}

.booking-result-total {
  color: var(--brand-dark);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 0;
}

.booking-ticket-list {
  display: grid;
}

.booking-ticket-row span,
.booking-ticket-row em,
.booking-result-summary span:not(.booking-result-total) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.booking-ticket-row em {
  max-width: 220px;
  overflow: hidden;
  color: var(--brand-dark);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-ticket-cost {
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 950;
  white-space: nowrap;
}

.booking-result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
}

.booking-warning {
  color: var(--amber);
  font-weight: 800;
}

.booking-history-card {
  grid-column: 1 / -1;
}

.booking-history-head {
  align-items: center;
}

.booking-history-head > div {
  min-width: 0;
  flex: 1;
}

.booking-history-refresh {
  flex: 0 0 auto;
}

.booking-history-list {
  display: grid;
  gap: 8px;
}

.booking-history-empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
}

.booking-history-empty strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.booking-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.booking-history-item.is-open {
  border-color: rgba(227, 6, 19, 0.34);
  box-shadow: 0 12px 30px rgba(31, 48, 58, 0.1);
}

.booking-history-toggle {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 0;
  padding: 11px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.booking-history-toggle:hover {
  background: rgba(227, 6, 19, 0.08);
}

.booking-history-chevron {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: var(--ink-soft);
  color: var(--brand-dark);
}

.booking-history-chevron svg,
.booking-history-icon-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.booking-history-item.is-open .booking-history-chevron svg {
  transform: rotate(90deg);
}

.booking-history-main,
.booking-history-meta {
  min-width: 0;
}

.booking-history-main strong,
.booking-history-main small,
.booking-history-meta strong,
.booking-history-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-history-main strong {
  font-size: 14px;
  font-weight: 950;
}

.booking-history-main small,
.booking-history-meta small,
.booking-history-trip small,
.booking-history-trip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-history-meta {
  text-align: right;
}

.booking-history-meta strong {
  color: var(--brand-dark);
  font-size: 18px;
  font-weight: 950;
}

.booking-history-actions {
  display: grid;
  align-items: center;
  padding: 8px 10px 8px 0;
}

.booking-history-icon-link,
.booking-history-no-pdf {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 950;
  text-decoration: none;
}

.booking-history-icon-link:hover {
  border-color: var(--brand);
  background: rgba(227, 6, 19, 0.1);
}

.booking-history-no-pdf {
  color: var(--muted);
  opacity: 0.72;
}

.booking-history-details {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 0 12px 12px 50px;
}

.booking-history-trip {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.booking-history-trip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-history-tickets {
  display: grid;
  gap: 6px;
}

.booking-history-ticket {
  display: grid;
  grid-template-columns: minmax(96px, 0.52fr) minmax(0, 1.5fr) minmax(112px, auto);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.booking-history-ticket-number,
.booking-history-ticket-info,
.booking-history-ticket-price {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.booking-history-ticket-price {
  text-align: right;
}

.booking-history-ticket strong,
.booking-history-ticket span,
.booking-history-ticket small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-history-ticket-number small {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 950;
}

.booking-history-ticket-info small,
.booking-history-ticket-price small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.booking-history-ticket small {
  color: var(--muted);
}

.booking-history-ticket .booking-history-ticket-number small {
  color: var(--brand-dark);
}

.booking-history-ticket-price strong {
  color: var(--brand-dark);
  font-weight: 950;
  white-space: nowrap;
}

.booking-grid {
  grid-template-columns: 1fr;
}

.booking-search-card,
.booking-results-card {
  grid-column: 1 / -1;
}

.booking-search-panel {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) 42px minmax(190px, 1.2fr) minmax(150px, 0.7fr) minmax(120px, 0.5fr) minmax(150px, 0.62fr);
  align-items: end;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(28, 46, 58, 0.14);
}

.booking-input-shell {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  background: #e8eef6;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.booking-input-shell:focus-within {
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.13);
}

.booking-input-shell i,
.booking-swap-button svg {
  color: #718096;
}

.booking-input-shell svg,
.booking-swap-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.booking-form .booking-input-shell input,
.booking-form .booking-input-shell select {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: #0c2036;
  font-weight: 900;
}

.booking-form .booking-input-shell select {
  appearance: none;
  cursor: pointer;
}

.booking-form .booking-input-shell select option {
  background: #ffffff;
  color: #0c2036;
  font-weight: 900;
}

.booking-form .booking-input-shell input::placeholder {
  color: #4b5b70;
}

.booking-swap-button {
  display: inline-grid;
  width: 42px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0c2036;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.booking-swap-button:hover {
  background: rgba(227, 6, 19, 0.08);
  transform: translateY(-1px);
}

.booking-search-button {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: #e50914;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.booking-search-button:hover {
  background: #c90811;
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(229, 9, 20, 0.22);
}

.booking-city-results {
  z-index: 60;
}

.booking-city-option {
  display: grid;
  gap: 2px;
}

.booking-city-option strong,
.booking-city-option small {
  display: block;
}

.booking-city-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-trips {
  max-height: none;
  gap: 14px;
}

.booking-trip-item {
  grid-template-columns: minmax(150px, 0.85fr) minmax(110px, 0.55fr) minmax(180px, 1fr) minmax(90px, 0.45fr) minmax(180px, 1fr) minmax(130px, 0.55fr);
  min-height: 112px;
  border-radius: 0;
  padding: 18px 20px;
  background: #ffffff;
  border-color: #d7dde5;
}

.booking-trip-item.is-selected {
  border-color: #0c2d57;
  box-shadow: inset 0 0 0 1px #0c2d57, 0 12px 26px rgba(12, 45, 87, 0.1);
}

.booking-trip-main strong,
.booking-trip-price strong,
.booking-trip-point strong,
.booking-trip-way strong,
.booking-trip-action strong,
.booking-trip-main small,
.booking-trip-price small,
.booking-trip-point small,
.booking-trip-way small,
.booking-trip-action small {
  display: block;
}

.booking-trip-main strong {
  color: #4d5662;
  font-size: 17px;
}

.booking-trip-main small,
.booking-trip-point small,
.booking-trip-way small,
.booking-trip-action small {
  margin-top: 6px;
  color: #5e6874;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.booking-trip-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  margin-left: 0;
  color: #0c2036;
  text-decoration: underline;
}

.booking-trip-price {
  color: #5a6470;
  text-align: center;
}

.booking-trip-price strong {
  font-size: 30px;
  line-height: 1;
}

.booking-trip-price small {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 900;
}

.booking-trip-point,
.booking-trip-way,
.booking-trip-action {
  text-align: center;
}

.booking-trip-point strong,
.booking-trip-way strong {
  color: #5a6470;
  font-size: 22px;
}

.booking-trip-action strong {
  display: inline-flex;
  min-width: 116px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border-radius: 4px;
  background: #e50914;
  color: #ffffff;
  font-size: 16px;
}

.booking-trip-item.is-low-seats .booking-trip-action strong {
  background: #9ca3af;
}

.booking-trip-card {
  display: grid;
  border: 1px solid #d7dde5;
  background: #ffffff;
}

.booking-trip-card .booking-trip-item {
  border: 0;
}

.booking-trip-card.is-open {
  border-color: #0c2d57;
  box-shadow: 0 14px 28px rgba(12, 45, 87, 0.08);
}

.booking-trip-card.is-open .booking-trip-item {
  border-bottom: 1px dashed #cbd5e1;
}

.booking-inline-form {
  display: grid;
  gap: 14px;
  padding: 22px 24px 24px;
  background: #fbfdff;
}

.booking-inline-head {
  display: grid;
  gap: 4px;
}

.booking-inline-head strong {
  color: #0c2036;
  font-size: 18px;
}

.booking-inline-head span {
  color: #5e6874;
  font-size: 13px;
  font-weight: 800;
}

.booking-inline-options {
  display: grid;
  grid-template-columns: minmax(260px, 440px) minmax(150px, 220px);
  align-items: end;
  gap: 12px;
}

.booking-inline-phone,
.booking-inline-count {
  max-width: 440px;
}

.booking-inline-count small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.booking-passenger-count-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(34px, 1fr));
  gap: 6px;
}

.booking-passenger-count-button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.booking-passenger-count-button:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.booking-passenger-count-button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #071116;
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.14);
}

.booking-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.booking-inline-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.booking-inline-status.is-pending {
  color: var(--brand-dark);
}

.booking-inline-status.is-success {
  color: var(--green);
}

.booking-inline-status.is-error {
  color: var(--red);
}

.booking-selected-trip {
  grid-template-columns: minmax(0, 1fr);
}

.dispatcher-result:empty {
  display: none;
}

.dispatcher-result-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar,
.legend,
.schedule-frame {
  background: var(--panel);
  border: 1px solid var(--line);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border-radius: 8px 8px 0 0;
}

.week-controls,
.filters,
.legend {
  display: flex;
  align-items: center;
  gap: 12px;
}

.refresh-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.toolbar-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
}

.icon-button,
.ghost-button,
.primary-button {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.icon-button {
  width: 38px;
  font-size: 28px;
  line-height: 1;
}

.ghost-button {
  padding: 0 14px;
}

.primary-button {
  padding: 0 16px;
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(227, 6, 19, 0.18);
}

.icon-button:hover,
.ghost-button:hover,
.ghost-link:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.primary-button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  box-shadow: 0 10px 24px rgba(227, 6, 19, 0.24);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.danger-button {
  color: var(--red);
}

.search-field {
  display: grid;
  grid-template-columns: auto 260px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 16% 18%, rgba(227, 6, 19, 0.14), transparent 26%),
    linear-gradient(135deg, transparent 0 38%, rgba(227, 6, 19, 0.09) 38% 41%, transparent 41%),
    var(--bg);
}

.login-card {
  position: relative;
  overflow: hidden;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card::after {
  right: -110px;
  bottom: -88px;
  width: 260px;
  height: 220px;
  transform: rotate(8deg);
}

.login-brand-logo-link {
  display: inline-flex;
  width: 168px;
  max-width: 70vw;
  min-height: 52px;
  height: auto;
  margin-bottom: 18px;
}

.login-brand-logo {
  display: block;
  width: 168px;
  max-width: 100%;
  max-height: 52px;
  height: auto;
  object-fit: contain;
}

.login-theme-toggle {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.login-card h1 {
  margin: 4px 0 8px;
  font-size: 26px;
}

.login-muted,
.form-message {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label,
.user-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input,
.user-form input,
.user-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--red);
}

@media (max-width: 560px) {
  .login-page {
    align-items: stretch;
    min-height: 100svh;
    padding: 16px;
  }

  .login-card {
    align-self: center;
    width: 100%;
    padding: 22px 18px;
    box-shadow: 0 14px 34px rgba(31, 48, 58, 0.12);
  }

  .login-theme-toggle {
    position: static;
    justify-self: start;
    margin-bottom: 16px;
  }

  .login-card h1 {
    font-size: 23px;
    line-height: 1.15;
  }

  .login-muted {
    line-height: 1.45;
  }

  .login-form input,
  .login-form button {
    min-height: 46px;
    font-size: 16px;
  }
}

.legend {
  padding: 10px 16px;
  border-top: 0;
  border-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: -1px;
}

.dot.low {
  background: #d9eee6;
}

.dot.mid {
  background: #ffe4aa;
}

.dot.high {
  background: #ffc5c5;
}

.dot.full {
  background: var(--red);
}

.schedule-frame {
  height: calc(100vh - 186px);
  min-height: 520px;
  overflow: auto;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.schedule-grid {
  display: grid;
  grid-template-columns: minmax(360px, 460px) repeat(7, minmax(132px, 1fr));
  min-width: 1300px;
}

.grid-cell {
  min-height: 42px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.grid-cell.has-open-menu {
  position: relative;
  z-index: 90;
  overflow: visible;
}

.grid-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px;
  background: var(--brand-soft);
  font-weight: 800;
  text-align: center;
}

.today-head {
  background: linear-gradient(180deg, #ffe8a3 0%, #ffd56a 100%);
  color: #13242c;
  box-shadow: inset 0 -3px 0 #f59e0b;
}

.tree-head {
  left: 0;
  z-index: 7;
  justify-content: flex-start;
  padding-left: 16px;
}

.row-label {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  overflow: hidden;
}

.row-country {
  background: var(--brand-soft);
  font-weight: 800;
}

.row-group {
  background: #f7fbfd;
  font-weight: 700;
}

.row-city {
  background: #ffffff;
  color: #324650;
  font-weight: 700;
}

.row-route {
  background: #ffffff;
  font-size: 13px;
  line-height: 1.25;
}

.indent-0 {
  padding-left: 14px;
}

.indent-1 {
  padding-left: 34px;
}

.indent-2 {
  padding-left: 58px;
}

.indent-3 {
  padding-left: 68px;
}

.expand-button {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 15px;
}

.route-code {
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 13px;
}

.route-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.summary-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px;
  background: #fbfdfe;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  isolation: isolate;
}

.empty-summary-cell {
  color: var(--muted);
  font-size: 18px;
  font-weight: 850;
}

.ticket-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px;
  isolation: isolate;
}

.cell-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.cell-menu {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 40;
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
}

.cell-menu-group {
  position: relative;
}

.cell-menu-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-dark);
  font-size: 0;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.summary-cell:hover .cell-menu-button,
.ticket-cell:hover .cell-menu-button,
.cell-menu.is-open .cell-menu-button {
  opacity: 1;
}

.cell-menu-button:hover,
.cell-menu-group.is-open .cell-menu-button {
  border-color: var(--line-strong);
  background: #ffffff;
}

.cell-menu-popover {
  position: absolute;
  top: 28px;
  right: 0;
  display: none;
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(31, 48, 58, 0.24);
  z-index: 45;
}

.cell-menu-group.is-open .cell-menu-popover {
  display: grid;
  gap: 3px;
  z-index: 120;
}

.cell-menu-popover button,
.cell-menu-popover a {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 0 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-align: left;
}

.cell-menu-popover button:hover,
.cell-menu-popover a:hover {
  background: var(--ink-soft);
}

.cell-menu-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: currentColor;
}

.cell-menu-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ticket-cell::before,
.summary-cell.low::before,
.summary-cell.mid::before,
.summary-cell.high::before,
.summary-cell.full::before {
  content: "";
  position: absolute;
  inset: 8px 10px;
  z-index: -1;
  border-radius: 6px;
  background: var(--cell-bg, #e8f5ef);
}

.summary-cell.low::before,
.summary-cell.mid::before,
.summary-cell.high::before,
.summary-cell.full::before {
  z-index: 0;
}

.ticket-cell.low,
.summary-cell.low {
  --cell-bg: #dff2ea;
}

.ticket-cell.mid,
.summary-cell.mid {
  --cell-bg: #ffe7b5;
}

.ticket-cell.high,
.summary-cell.high {
  --cell-bg: #ffd1d1;
}

.ticket-cell.full,
.summary-cell.full {
  --cell-bg: #e14f4f;
  color: #ffffff;
}

.summary-cell.low,
.summary-cell.mid,
.summary-cell.high {
  color: var(--text);
}

.ticket-value {
  font-weight: 800;
}

.ticket-capacity {
  color: currentColor;
  opacity: 0.75;
}

.ticket-booked {
  color: currentColor;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
}

.ticket-bus-side {
  position: absolute;
  right: 12px;
  top: 50%;
  max-width: 74px;
  overflow: hidden;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.1;
  opacity: 0.96;
  text-overflow: ellipsis;
  transform: translateY(-50%);
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(23, 35, 43, 0.08);
}

.admin-main {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding-bottom: 28px;
}

.admin-layout,
.system-settings-panel,
.user-admin-panel,
.fleet-admin-panel,
.audit-panel,
.seat-layout-panel {
  width: min(1120px, 100%);
  min-height: calc(100vh - 116px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.user-admin-panel,
.system-settings-panel,
.fleet-admin-panel,
.audit-panel,
.seat-layout-panel {
  min-height: auto;
}

.system-settings-form {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto minmax(240px, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.system-settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.system-settings-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}

.settings-note {
  align-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.settings-note[data-status="success"] {
  color: var(--green);
}

.settings-note[data-status="error"] {
  color: var(--red);
}

.audit-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.audit-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.audit-filters input,
.audit-filters select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.audit-filter-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.audit-filter-actions .primary-button,
.audit-filter-actions .ghost-button {
  flex: 1 1 112px;
  min-width: 0;
  padding-inline: 12px;
  white-space: nowrap;
}

.audit-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.audit-empty {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 800;
}

.audit-empty.is-error {
  border-color: #f0b4b4;
  color: var(--red);
}

.audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 14px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.audit-item[data-audit-status="failed"] {
  border-color: #f0b4b4;
  background: linear-gradient(90deg, rgba(229, 72, 77, 0.08), rgba(255, 255, 255, 0));
}

.audit-item-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.audit-item-main > strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.audit-item-topline,
.audit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.audit-type,
.audit-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-status {
  background: rgba(49, 151, 111, 0.12);
  color: var(--green);
}

.audit-item[data-audit-status="failed"] .audit-status {
  background: rgba(229, 72, 77, 0.12);
  color: var(--red);
}

.audit-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audit-details {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  overflow: hidden;
}

.audit-details summary {
  cursor: pointer;
  padding: 9px 10px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

.audit-details pre {
  max-height: 260px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-tree {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.empty-state {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
}

.admin-node {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}

.admin-node-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-node-main > div {
  min-width: 0;
  flex: 1;
}

.admin-node strong {
  display: block;
  font-size: 14px;
}

.admin-node span {
  color: var(--muted);
  font-size: 12px;
}

.admin-node-type {
  justify-self: end;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--ink-soft);
  font-weight: 800;
}

.admin-node-actions {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  max-width: 100%;
  margin-left: auto;
  min-width: 0;
}

.node-action {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.node-action:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.node-action.is-danger {
  color: var(--red);
}

.node-action.is-danger:hover {
  border-color: #f0b4b4;
  background: #fff0f0;
}

.node-offset-select,
.node-grouping-select {
  height: 28px;
  min-width: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.node-grouping-select {
  width: min(170px, 100%);
  min-width: 132px;
  max-width: 100%;
  font-size: 12px;
}

.admin-node-group {
  margin-left: 12px;
}

.admin-node-city {
  margin-left: 24px;
}

.admin-node-route {
  margin-left: 36px;
  background: #fbfdfe;
}

.admin-node[draggable="true"] {
  cursor: grab;
}

.admin-node.is-dragging {
  opacity: 0.45;
}

.admin-node.is-drop-target {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.admin-node.is-drop-before {
  transform: translateY(8px);
}

.admin-node.is-drop-after {
  transform: translateY(-8px);
}

.admin-node.is-drop-before::before,
.admin-node.is-drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.12);
}

.admin-node.is-drop-before::before {
  top: -8px;
}

.admin-node.is-drop-after::after {
  bottom: -8px;
}

.admin-children {
  display: grid;
  gap: 6px;
}

.drag-handle {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: var(--ink-soft);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e8f5ef;
  color: #22664a;
  font-size: 12px;
  font-weight: 800;
}

.user-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr auto;
  align-items: end;
  gap: 12px;
}

.user-form-actions {
  display: inline-flex;
  gap: 8px;
}

.users-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.user-row strong,
.user-row span {
  display: block;
}

.user-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-row-actions {
  display: inline-flex;
  gap: 8px;
}

.fleet-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fleet-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.fleet-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.fleet-form {
  display: grid;
  gap: 10px;
}

.fleet-form label,
.assignment-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.fleet-form input,
.fleet-form select,
.assignment-field select,
.assignment-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}

.fleet-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.fleet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.fleet-row > div:first-child {
  min-width: 0;
}

.fleet-row strong,
.fleet-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fleet-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fleet-icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
  color: var(--brand-dark);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.fleet-icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fleet-icon-button:hover {
  border-color: var(--brand);
  background: rgba(227, 6, 19, 0.09);
  transform: translateY(-1px);
}

.fleet-icon-button.is-danger {
  color: var(--red);
}

.fleet-icon-button.is-danger:hover {
  border-color: #f0b4b4;
  background: #fff0f0;
}

.seat-layout-heading-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.seat-layout-builder {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.seat-layout-sidebar {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
  align-self: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.seat-layout-sidebar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.seat-layout-sidebar input,
.seat-layout-sidebar select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}

.seat-layout-sidebar-title {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.seat-tool-palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(42px, 1fr));
  gap: 8px;
}

.seat-tool-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  font-weight: 850;
  text-align: center;
  cursor: pointer;
}

.seat-tool-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink-soft);
  color: var(--brand-dark);
}

.seat-tool-seat-number {
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.seat-tool-svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.seat-tool-label {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.seat-tool-button:hover .seat-tool-icon,
.seat-tool-button.is-selected .seat-tool-icon {
  background: rgba(227, 6, 19, 0.12);
  color: var(--brand);
}

.seat-tool-button:hover,
.seat-tool-button.is-selected {
  border-color: var(--brand);
  background: rgba(227, 6, 19, 0.09);
}

.seat-cell-editor {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.seat-cell-editor[hidden] {
  display: none;
}

.seat-cell-editor strong {
  color: var(--brand-dark);
}

.seat-layout-workbench {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  align-items: start;
}

.seat-deck {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 24px 24px 8px 8px;
  padding: 16px 14px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 24%),
    var(--panel-soft);
}

.seat-deck-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.seat-deck-title span {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(var(--seat-cols), minmax(42px, 1fr));
  gap: 5px;
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 12px;
  border: 4px solid var(--text);
  border-radius: 36px 36px 14px 14px;
  background: var(--panel);
}

.seat-grid-cell {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition:
    border-color 0.14s ease,
    background 0.14s ease,
    color 0.14s ease,
    transform 0.14s ease;
}

.seat-grid-cell:hover,
.seat-grid-cell.is-selected {
  border-color: var(--brand);
  background: rgba(227, 6, 19, 0.1);
  color: var(--brand-dark);
  transform: translateY(-1px);
}

.seat-grid-cell strong {
  display: grid;
  width: 100%;
  min-height: 30px;
  place-items: center;
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(#a6abb0 0 68%, #45494d 68% 100%);
  color: #111827;
  font-size: 16px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.seat-cell-driver span,
.seat-cell-toilet span,
.seat-cell-stairs span,
.seat-cell-table span,
.seat-cell-door span {
  display: grid;
  width: 100%;
  min-height: 30px;
  place-items: center;
  border-radius: 6px;
  padding: 0 3px;
  color: #0f172a;
  font-size: 11px;
  line-height: 1.05;
}

.seat-cell-driver span {
  background: #bae6fd;
}

.seat-cell-toilet span {
  background: #ddd6fe;
}

.seat-cell-stairs span {
  background: repeating-linear-gradient(90deg, #ffffff 0 8px, #cbd5e1 8px 10px);
}

.seat-cell-table span {
  background: #d1d5db;
}

.seat-cell-door span {
  background: #bbf7d0;
}

.seat-coordinate {
  opacity: 0.34;
}

.assignment-modal {
  display: flex;
  flex-direction: column;
  width: min(620px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 26px 80px rgba(23, 35, 43, 0.28);
  overflow: hidden;
}

.assignment-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--panel-soft);
  overflow: auto;
}

.sale-opening-modal {
  width: min(780px, calc(100vw - 48px));
}

.sale-opening-hint {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.sale-stop-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--panel-soft);
  overflow: auto;
}

.sale-stop-list.is-loading {
  opacity: 0.72;
}

.sale-stop-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.sale-stop-item.is-open {
  border-color: rgba(217, 144, 31, 0.55);
  background: #fff7e8;
}

.sale-stop-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sale-stop-main strong,
.sale-stop-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sale-stop-main strong {
  color: var(--text);
  font-size: 14px;
}

.sale-stop-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sale-stop-status {
  color: var(--brand-dark) !important;
}

.sale-stop-actions {
  display: inline-flex;
  flex: 0 0 auto;
}

.sale-opening-footer {
  align-items: center;
  justify-content: space-between;
}

.sale-opening-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assignment-choice-list {
  display: grid;
  gap: 7px;
  max-height: 340px;
  overflow: auto;
}

.assignment-choice-item {
  display: grid;
  grid-template-columns: 20px 18px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.assignment-choice-item input {
  width: 16px;
  height: 16px;
}

.assignment-choice-dot,
.assignment-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-soft);
}

.assignment-choice-text {
  min-width: 0;
}

.assignment-choice-text strong,
.assignment-choice-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-choice-text small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(10, 26px);
  gap: 7px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.color-swatch.is-selected {
  border-color: var(--brand);
  box-shadow:
    0 0 0 3px rgba(227, 6, 19, 0.14),
    inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--brand-ink);
  color: #ffffff;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 35, 43, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.tickets-modal {
  display: flex;
  flex-direction: column;
  width: min(1560px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 26px 80px rgba(23, 35, 43, 0.28);
  overflow: hidden;
}

.seat-layout-modal {
  display: flex;
  flex-direction: column;
  width: min(1220px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 26px 80px rgba(23, 35, 43, 0.28);
  overflow: hidden;
}

.seat-layout-modal-body {
  overflow: auto;
  padding: 16px;
  background: var(--panel-soft);
}

.seat-layout-modal .seat-layout-builder {
  margin-top: 0;
}

.seat-layout-modal .seat-layout-sidebar {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.seat-layout-modal-actions {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 8px;
}

.seat-layout-modal-actions .ghost-button {
  min-width: 0;
}

.seat-layout-icon-action {
  display: grid;
  width: 42px;
  min-height: 38px;
  place-items: center;
  padding: 0;
}

.seat-layout-icon-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tickets-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.tickets-modal-header h2 {
  max-width: 980px;
  overflow: hidden;
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tickets-modal-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tickets-modal-close {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.tickets-modal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.transfer-badge {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  place-items: center;
  border: 1px solid rgba(227, 6, 19, 0.38);
  border-radius: 999px;
  background: rgba(227, 6, 19, 0.1);
  color: var(--brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
}

.tickets-modal-table-wrap {
  position: relative;
  overflow: auto;
}

.tickets-report-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  color: #000000;
  font-family: Calibri, "Segoe UI", sans-serif;
}

.tickets-report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 32px;
  border: 1px solid #777777;
  padding: 4px 7px;
  background: #cccccc;
  color: #000000;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.tickets-report-table td {
  height: 28px;
  border: 1px solid #bfbfbf;
  padding: 3px 7px;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  white-space: nowrap;
}

.tickets-report-table tbody tr:hover td {
  background: var(--brand-soft);
}

.tickets-report-table tbody tr.is-transfer-row td {
  background: var(--brand-soft);
}

.tickets-report-table tbody tr.is-transfer-start td {
  border-top: 2px solid var(--brand);
}

.tickets-report-table tbody tr.is-transfer-end td {
  border-bottom: 2px solid var(--brand);
}

.tickets-report-table tbody tr.is-transfer-row td:first-child {
  border-left: 4px solid var(--brand);
}

.tickets-report-table tbody tr.is-transfer-row:hover td {
  background: #e1f1fb;
}

.transfer-follow {
  color: var(--brand);
  font-weight: 900;
}

.ticket-confirm-cell {
  text-align: center;
}

.ticket-confirm-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
  cursor: pointer;
}

.ticket-confirm-checkbox:disabled {
  cursor: progress;
  opacity: 0.62;
}

.tickets-modal-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.route-picker-modal {
  display: flex;
  flex-direction: column;
  width: min(820px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 26px 80px rgba(23, 35, 43, 0.28);
  overflow: hidden;
}

.route-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.route-picker-search {
  grid-template-columns: auto minmax(280px, 1fr);
  flex: 1;
}

.route-picker-list {
  display: grid;
  gap: 6px;
  max-height: min(560px, calc(100vh - 240px));
  padding: 12px 16px;
  overflow: auto;
  background: var(--panel-soft);
}

.route-picker-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.route-picker-item:hover {
  border-color: var(--brand);
}

.route-picker-item.is-disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--panel-soft);
  opacity: 0.72;
}

.route-picker-item input {
  width: 16px;
  height: 16px;
}

.route-picker-empty {
  padding: 28px 16px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.route-picker-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.stop-sorter-modal {
  width: min(760px, calc(100vw - 48px));
}

.stop-sorter-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stop-sorter-search {
  display: flex;
  flex: 0 0 min(320px, 44vw);
  align-items: center;
  gap: 8px;
}

.stop-sorter-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.stop-sorter-search input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
}

.stop-sorter-list {
  display: grid;
  gap: 7px;
  max-height: min(580px, calc(100vh - 250px));
  padding: 12px 16px;
  overflow: auto;
  background: var(--panel-soft);
}

.stop-sorter-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px 34px 68px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.stop-sorter-item.is-disabled {
  opacity: 0.62;
}

.stop-sorter-item strong,
.stop-sorter-item span {
  display: block;
}

.stop-sorter-item strong {
  color: var(--text);
  font-size: 14px;
}

.stop-sorter-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stop-sorter-index {
  color: var(--brand-dark);
  text-align: right;
}

.stop-sorter-enabled {
  display: grid;
  grid-template-columns: 20px auto;
  align-items: center;
  gap: 4px;
  min-width: 30px;
  height: 26px;
  place-items: center;
  cursor: pointer;
}

.stop-sorter-enabled-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.stop-sorter-enabled input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stop-sorter-enabled span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-soft);
}

.stop-sorter-enabled small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.stop-sorter-enabled input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
}

.stop-sorter-enabled input:checked + span::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) translateY(-1px);
}


.stop-sorter-actions {
  display: grid;
  grid-template-columns: repeat(4, 26px);
  gap: 4px;
}

.stop-sorter-actions button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.stop-sorter-actions button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.stop-sorter-item.is-dragging {
  opacity: 0.5;
}

.stop-sorter-item.is-drop-before {
  transform: translateY(8px);
}

.stop-sorter-item.is-drop-after {
  transform: translateY(-8px);
}

.stop-sorter-item.is-drop-before::before,
.stop-sorter-item.is-drop-after::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.12);
}

.stop-sorter-item.is-drop-before::before {
  top: -8px;
}

.stop-sorter-item.is-drop-after::after {
  bottom: -8px;
}

@media (max-width: 760px) {
  .stop-sorter-help {
    align-items: stretch;
    flex-direction: column;
  }

  .stop-sorter-search {
    flex-basis: auto;
  }

  .stop-sorter-item {
    grid-template-columns: 24px 34px minmax(0, 1fr);
  }

  .stop-sorter-item .status-pill,
  .stop-sorter-actions {
    grid-column: 3;
  }
}

body[data-page="driver"] {
  min-width: 0;
  background:
    radial-gradient(circle at top left, rgba(227, 6, 19, 0.12), transparent 32vw),
    var(--bg);
}

body[data-page="driver"][data-theme="dark"] {
  background: var(--bg);
}

.driver-shell {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.driver-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.driver-hero::after {
  right: -72px;
  top: -54px;
  width: 220px;
  height: 170px;
  transform: rotate(-10deg);
}

.driver-hero h1 {
  font-size: clamp(26px, 8vw, 36px);
}

.driver-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.driver-logout {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 800;
}

.driver-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.driver-summary span,
.driver-section-heading span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.driver-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.compact-theme-toggle {
  min-width: 48px;
  padding: 0 8px;
}

.driver-content {
  display: grid;
  gap: 12px;
}

.driver-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 0;
}

.driver-section-heading h2 {
  font-size: 20px;
}

.driver-section-heading span {
  display: grid;
  min-width: 34px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--brand);
}

.driver-trip-list {
  display: grid;
  gap: 12px;
}

.driver-trip-card,
.driver-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(31, 48, 58, 0.09);
}

.driver-trip-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.driver-trip-date {
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.driver-trip-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.28;
}

.driver-trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.driver-trip-meta span,
.driver-trip-meta a {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.driver-co-drivers {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.driver-trip-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.driver-trip-actions .primary-button,
.driver-trip-actions .ghost-button {
  width: 100%;
  min-height: 44px;
}

.driver-empty {
  display: grid;
  gap: 6px;
  padding: 22px 16px;
  text-align: center;
}

.driver-empty strong {
  font-size: 17px;
}

.driver-empty span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.driver-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  align-items: end;
  background: rgba(23, 35, 43, 0.46);
}

.driver-sheet-backdrop[hidden] {
  display: none;
}

.driver-sheet {
  display: grid;
  grid-template-rows: auto 1fr;
  max-height: min(88vh, 860px);
  border: 1px solid var(--line-strong);
  border-radius: 14px 14px 0 0;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 -18px 55px rgba(23, 35, 43, 0.28);
}

.driver-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.driver-sheet-header h2 {
  max-width: calc(100vw - 86px);
  overflow: hidden;
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-sheet-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.driver-ticket-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow: auto;
  background: var(--panel-soft);
}

.driver-ticket-loading {
  padding: 28px 12px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.driver-ticket-legend {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.driver-ticket-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.driver-booking-swatch {
  width: 16px;
  height: 12px;
  border-radius: 4px;
  background: #ffe0a3;
  box-shadow: inset 0 0 0 1px rgba(23, 35, 43, 0.1);
}

.driver-ticket-group {
  display: grid;
  gap: 7px;
}

.driver-ticket-group h3,
.driver-ticket-station h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  border-radius: 7px;
}

.driver-ticket-group h3 {
  padding: 9px 11px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 18px;
}

.driver-ticket-station {
  display: grid;
  gap: 6px;
}

.driver-ticket-station h4 {
  padding: 8px 11px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}

.driver-ticket-group span,
.driver-ticket-station span {
  color: var(--muted);
  font-size: 12px;
}

.driver-ticket-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.driver-ticket-item.is-booking {
  background: #ffe0a3;
  color: var(--brand-ink);
}

.driver-ticket-item.is-transfer {
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
}

.driver-ticket-item.is-transfer.is-booking {
  background: linear-gradient(90deg, rgba(227, 6, 19, 0.08), rgba(227, 6, 19, 0.08)), #ffe0a3;
}

.driver-ticket-item.is-transfer-start {
  border-top-color: var(--brand);
}

.driver-ticket-item.is-transfer-end {
  border-bottom-color: var(--brand);
}

.driver-ticket-main {
  min-width: 0;
}

.driver-ticket-main strong,
.driver-ticket-main span,
.driver-ticket-arrival,
.driver-ticket-price,
.driver-ticket-phone {
  display: block;
}

.driver-ticket-main strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-ticket-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.driver-ticket-phone {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  font-weight: 900;
}

.driver-ticket-phone a {
  color: inherit;
  text-decoration: none;
}

.driver-confirm-mark {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 13px;
}

.driver-confirm-mark::before {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 5px;
  border-bottom: 2px solid #16a34a;
  border-left: 2px solid #16a34a;
  content: "";
  transform: rotate(-45deg);
}

.driver-ticket-arrival {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.driver-ticket-price {
  justify-self: end;
  color: var(--brand-dark);
  font-weight: 900;
}

@media (min-width: 640px) {
  .driver-shell {
    padding: 22px;
  }

  .driver-sheet {
    width: min(720px, calc(100vw - 36px));
    margin: 0 auto;
    border-radius: 14px 14px 0 0;
  }
}

body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .ghost-button,
body[data-theme="dark"] .primary-button,
body[data-theme="dark"] .ghost-link,
body[data-theme="dark"] .search-field input,
body[data-theme="dark"] .expand-button,
body[data-theme="dark"] .cell-menu-button,
body[data-theme="dark"] .cell-menu-popover,
body[data-theme="dark"] .node-action,
body[data-theme="dark"] .node-offset-select,
body[data-theme="dark"] .node-grouping-select,
body[data-theme="dark"] .user-form input,
body[data-theme="dark"] .user-form select,
body[data-theme="dark"] .system-settings-form input,
body[data-theme="dark"] .audit-filters input,
body[data-theme="dark"] .audit-filters select,
body[data-theme="dark"] .fleet-form input,
body[data-theme="dark"] .fleet-form select,
body[data-theme="dark"] .seat-layout-sidebar input,
body[data-theme="dark"] .seat-layout-sidebar select,
body[data-theme="dark"] .assignment-field select,
body[data-theme="dark"] .assignment-field input,
body[data-theme="dark"] .login-form input,
body[data-theme="dark"] .dispatcher-form input,
body[data-theme="dark"] .dispatcher-form select,
body[data-theme="dark"] .booking-form input,
body[data-theme="dark"] .booking-form select,
body[data-theme="dark"] .booking-passenger-row input,
body[data-theme="dark"] .booking-passenger-row select,
body[data-theme="dark"] .stop-sorter-search input,
body[data-theme="dark"] .stop-sorter-actions button,
body[data-theme="dark"] .fleet-icon-button,
body[data-theme="dark"] .tickets-modal-close {
  background: var(--panel-soft);
  color: var(--text);
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .dispatcher-hero,
body[data-theme="dark"] .statistics-hero,
body[data-theme="dark"] .driver-hero {
  background: var(--panel);
}

body[data-theme="dark"] .topbar::after,
body[data-theme="dark"] .login-card::after,
body[data-theme="dark"] .driver-hero::after,
body[data-theme="dark"] .dispatcher-hero::after,
body[data-theme="dark"] .statistics-hero::after {
  display: none;
}

body[data-theme="dark"] .tab-button.is-active {
  color: #071116;
  box-shadow: 0 6px 14px rgba(79, 180, 210, 0.22);
}

body[data-theme="dark"] .primary-button {
  background: var(--brand);
  color: #071116;
  box-shadow: 0 8px 18px rgba(79, 180, 210, 0.2);
}

body[data-theme="dark"] .primary-button:hover {
  box-shadow: 0 10px 24px rgba(79, 180, 210, 0.26);
}

body[data-theme="dark"] .statistics-hero-total {
  border-color: rgba(79, 180, 210, 0.28);
  background: rgba(79, 180, 210, 0.12);
}

body[data-theme="dark"] .dispatcher-icon,
body[data-theme="dark"] .booking-trip-time {
  background: rgba(79, 180, 210, 0.13);
}

body[data-theme="dark"] .booking-history-item.is-open {
  border-color: rgba(79, 180, 210, 0.34);
}

body[data-theme="dark"] .booking-history-icon-link:hover,
body[data-theme="dark"] .booking-swap-button:hover {
  background: rgba(79, 180, 210, 0.1);
}

body[data-theme="dark"] .booking-passenger-count-button.is-active {
  box-shadow: 0 0 0 3px rgba(79, 180, 210, 0.14);
}

body[data-theme="dark"] .transfer-badge {
  border-color: rgba(79, 180, 210, 0.38);
  background: rgba(79, 180, 210, 0.1);
}

body[data-theme="dark"] .admin-node.is-drop-before::before,
body[data-theme="dark"] .admin-node.is-drop-after::after {
  box-shadow: 0 0 0 4px rgba(79, 180, 210, 0.12);
}

body[data-theme="dark"] .cell-menu-button:hover,
body[data-theme="dark"] .cell-menu-group.is-open .cell-menu-button {
  border-color: var(--brand);
  background: #213944;
  color: var(--brand);
}

body[data-theme="dark"] .grid-cell,
body[data-theme="dark"] .row-route,
body[data-theme="dark"] .row-city,
body[data-theme="dark"] .summary-cell,
body[data-theme="dark"] .ticket-cell,
body[data-theme="dark"] .admin-node,
body[data-theme="dark"] .tickets-modal,
body[data-theme="dark"] .seat-layout-modal,
body[data-theme="dark"] .route-picker-modal,
body[data-theme="dark"] .route-picker-item,
body[data-theme="dark"] .stop-sorter-item,
body[data-theme="dark"] .login-card,
body[data-theme="dark"] .user-admin-panel,
body[data-theme="dark"] .system-settings-panel,
body[data-theme="dark"] .fleet-admin-panel,
body[data-theme="dark"] .audit-panel,
body[data-theme="dark"] .audit-item,
body[data-theme="dark"] .seat-layout-panel,
body[data-theme="dark"] .fleet-card,
body[data-theme="dark"] .fleet-row,
body[data-theme="dark"] .seat-layout-sidebar,
body[data-theme="dark"] .seat-cell-editor,
body[data-theme="dark"] .seat-deck,
body[data-theme="dark"] .seat-grid,
body[data-theme="dark"] .seat-tool-button,
body[data-theme="dark"] .assignment-modal,
body[data-theme="dark"] .assignment-choice-item,
body[data-theme="dark"] .sale-stop-item,
body[data-theme="dark"] .user-row,
body[data-theme="dark"] .dispatcher-hero,
body[data-theme="dark"] .dispatcher-card,
body[data-theme="dark"] .booking-city-results,
body[data-theme="dark"] .booking-trip-item,
body[data-theme="dark"] .empty-state {
  background: var(--panel);
}

body[data-theme="dark"] .dispatcher-badge,
body[data-theme="dark"] .dispatcher-result,
body[data-theme="dark"] .booking-selected-trip,
body[data-theme="dark"] .booking-passenger-row,
body[data-theme="dark"] .audit-empty,
body[data-theme="dark"] .audit-details {
  background: var(--panel-soft);
}

body[data-theme="dark"] .booking-search-panel {
  border-color: var(--line);
  background: #17252d;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] .booking-input-shell {
  background: #22323b;
}

body[data-theme="dark"] .booking-input-shell:focus-within {
  background: #1c2931;
}

body[data-theme="dark"] .booking-form .booking-input-shell input,
body[data-theme="dark"] .booking-form .booking-input-shell select {
  background: transparent;
  color: var(--text);
}

body[data-theme="dark"] .booking-form .booking-input-shell select {
  color-scheme: dark;
}

body[data-theme="dark"] .booking-form .booking-input-shell select option {
  background: #1c2931;
  color: #f4fbff;
}

body[data-theme="dark"] .booking-form .booking-input-shell input::placeholder,
body[data-theme="dark"] .booking-input-shell i,
body[data-theme="dark"] .booking-swap-button svg {
  color: var(--muted);
}

body[data-theme="dark"] .booking-passenger-count-button {
  border-color: var(--line);
  background: #18272f;
  color: var(--text);
}

body[data-theme="dark"] .booking-passenger-count-button:hover {
  border-color: var(--brand);
}

body[data-theme="dark"] .booking-passenger-count-button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #071116;
}

body[data-theme="dark"] .booking-trip-item {
  border-color: var(--line);
  background: var(--panel);
}

body[data-theme="dark"] .booking-trip-card {
  border-color: var(--line);
  background: var(--panel);
}

body[data-theme="dark"] .booking-trip-card.is-open {
  border-color: var(--brand);
}

body[data-theme="dark"] .booking-trip-card.is-open .booking-trip-item {
  border-bottom-color: var(--line);
}

body[data-theme="dark"] .booking-inline-form {
  background: var(--panel-soft);
}

body[data-theme="dark"] .booking-inline-head strong {
  color: var(--text);
}

body[data-theme="dark"] .booking-inline-head span {
  color: var(--muted);
}

body[data-theme="dark"] .booking-result-total,
body[data-theme="dark"] .booking-ticket-cost,
body[data-theme="dark"] .booking-history-meta strong,
body[data-theme="dark"] .booking-history-ticket-price strong,
body[data-theme="dark"] .booking-history-ticket-number small {
  color: var(--brand);
}

body[data-theme="dark"] .booking-history-item,
body[data-theme="dark"] .booking-history-trip,
body[data-theme="dark"] .booking-history-ticket,
body[data-theme="dark"] .booking-history-icon-link,
body[data-theme="dark"] .booking-history-empty {
  background: var(--panel);
}

body[data-theme="dark"] .booking-history-toggle:hover {
  background: #213944;
}

body[data-theme="dark"] .booking-trip-main strong,
body[data-theme="dark"] .booking-trip-price,
body[data-theme="dark"] .booking-trip-point strong,
body[data-theme="dark"] .booking-trip-way strong {
  color: var(--text);
}

body[data-theme="dark"] .booking-trip-main small,
body[data-theme="dark"] .booking-trip-point small,
body[data-theme="dark"] .booking-trip-way small,
body[data-theme="dark"] .booking-trip-action small {
  color: var(--muted);
}

body[data-theme="dark"] .ticket-bus-side {
  background: rgba(24, 34, 41, 0.82);
  box-shadow: 0 0 0 1px rgba(231, 237, 241, 0.12);
}

body[data-theme="dark"] .grid-head {
  background: #22323b;
}

body[data-theme="dark"] .today-head {
  background: linear-gradient(180deg, #6f5018 0%, #9a6813 100%);
  color: #fff4d0;
  box-shadow: inset 0 -3px 0 #f59e0b;
}

body[data-theme="dark"] .row-country {
  background: #203640;
}

body[data-theme="dark"] .row-group,
body[data-theme="dark"] .row-city {
  background: #1c2931;
  color: var(--text);
}

body[data-theme="dark"] .admin-node-route,
body[data-theme="dark"] .tickets-modal-header,
body[data-theme="dark"] .tickets-modal-legend,
body[data-theme="dark"] .seat-layout-modal-body,
body[data-theme="dark"] .sale-opening-hint,
body[data-theme="dark"] .sale-stop-list,
body[data-theme="dark"] .route-picker-list,
body[data-theme="dark"] .stop-sorter-list,
body[data-theme="dark"] .stop-sorter-help {
  background: var(--panel-soft);
}

body[data-theme="dark"] .sale-stop-item.is-open {
  border-color: rgba(226, 167, 63, 0.62);
  background: #3a2d18;
}

body[data-theme="dark"] .tickets-report-table tbody tr.is-transfer-row td {
  background: #172f3a;
  color: #e7edf1;
}

body[data-theme="dark"] .tickets-report-table tbody tr.is-transfer-row:hover td {
  background: #1d3a46;
}

body[data-theme="dark"] .drag-handle,
body[data-theme="dark"] .status-pill {
  background: var(--ink-soft);
  color: var(--brand-dark);
}

body[data-theme="dark"] .admin-node.is-drop-target {
  background: #203640;
}

body[data-theme="dark"] .node-action.is-danger:hover {
  border-color: #7e4246;
  background: #3a2024;
}

body[data-theme="dark"] .fleet-icon-button:hover {
  border-color: var(--brand);
  background: #213944;
  color: var(--brand);
}

body[data-theme="dark"] .fleet-icon-button.is-danger {
  color: #ff8b8b;
}

body[data-theme="dark"] .fleet-icon-button.is-danger:hover {
  border-color: #7e4246;
  background: #3a2024;
}

body[data-theme="dark"] .ticket-cell.low,
body[data-theme="dark"] .summary-cell.low {
  --cell-bg: #214338;
}

body[data-theme="dark"] .ticket-cell.mid,
body[data-theme="dark"] .summary-cell.mid {
  --cell-bg: #57421c;
}

body[data-theme="dark"] .ticket-cell.high,
body[data-theme="dark"] .summary-cell.high {
  --cell-bg: #5a2b2f;
}

body[data-theme="dark"] .ticket-cell.full,
body[data-theme="dark"] .summary-cell.full {
  --cell-bg: #a93f44;
}

body[data-theme="dark"] .empty-ticket-cell {
  --cell-bg: #213038;
  color: var(--muted);
}

body[data-theme="dark"] .dot.low {
  background: #2e6654;
}

body[data-theme="dark"] .dot.mid {
  background: #7a5a21;
}

body[data-theme="dark"] .dot.high {
  background: #7a3b3f;
}

body[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.58);
}

body[data-theme="dark"] .tickets-report-table {
  background: var(--panel);
  color: var(--text);
}

body[data-theme="dark"] .tickets-report-table th {
  border-color: var(--line-strong);
  background: #22323b;
  color: var(--text);
}

body[data-theme="dark"] .tickets-report-table td {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

body[data-theme="dark"] .tickets-report-table tbody tr:hover td {
  background: #203640;
}

body[data-theme="dark"] .driver-trip-card,
body[data-theme="dark"] .driver-summary,
body[data-theme="dark"] .driver-hero,
body[data-theme="dark"] .driver-empty,
body[data-theme="dark"] .driver-sheet,
body[data-theme="dark"] .driver-ticket-item,
body[data-theme="dark"] .driver-ticket-legend,
body[data-theme="dark"] .driver-ticket-station h4 {
  background: var(--panel);
}

body[data-theme="dark"] .driver-sheet-header,
body[data-theme="dark"] .driver-ticket-list {
  background: var(--panel-soft);
}

body[data-theme="dark"] .driver-ticket-group h3 {
  background: #203640;
  color: var(--text);
}

body[data-theme="dark"] .driver-ticket-item.is-booking {
  background: #5c4219;
  color: var(--text);
}

body[data-theme="dark"] .driver-ticket-item.is-transfer {
  background: #172f3a;
}

body[data-theme="dark"] .driver-ticket-item.is-transfer.is-booking {
  background: linear-gradient(90deg, rgba(43, 122, 160, 0.18), rgba(43, 122, 160, 0.18)), #5c4219;
}

@media (max-width: 1280px) {
  body {
    min-width: 1000px;
  }

  .dispatcher-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .booking-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  .dispatcher-grid,
  .dispatcher-form-inline,
  .booking-city-row,
  .booking-form-pair,
  .booking-search-panel,
  .booking-inline-options,
  .booking-passenger-row,
  .audit-filters,
  .audit-item,
  .seat-layout-builder {
    grid-template-columns: 1fr;
  }

  .statistics-city-grid,
  .statistics-bar-row {
    grid-template-columns: 1fr;
  }

  .seat-layout-sidebar {
    position: static;
    max-height: none;
  }

  .booking-swap-button {
    width: 100%;
    height: 42px;
  }

  .booking-trip-item {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .booking-trip-price,
  .booking-trip-point,
  .booking-trip-way,
  .booking-trip-action,
  .booking-inline-actions {
    text-align: left;
  }

  .booking-history-toggle {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .booking-history-meta {
    grid-column: 2;
    text-align: left;
  }

  .booking-history-details {
    padding-left: 12px;
  }

  .booking-history-ticket {
    grid-template-columns: 1fr;
  }

  .booking-history-actions {
    padding-right: 8px;
  }

  .booking-inline-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
