:root {
  --app-bg: #f5f7f9;
  --app-border: #dce1e5;
  --app-ink: #18212b;
  /* Chart series, in this fixed order (validated for colour-blind separation on white). */
  --chart-series-1: #2a78d6;
  --chart-series-2: #eb6834;
  --chart-series-3: #1baf7a;
  --chart-series-4: #eda100;
  --chart-series-5: #e87ba4;
  --chart-series-6: #008300;
  --chart-series-7: #6250d6;
  --chart-series-8: #e34948;
  --theme-general: #167d5a;
  --theme-general-hover: #116849;
  --theme-general-active: #0e583e;
  --theme-general-ink: #0e4e38;
  --theme-general-soft: #d5ebe3;
  --theme-general-tint: #eaf6f2;
  --theme-general-foreground: #fff;
  --theme-general-hover-foreground: #fff;
  --theme-general-rgb: 22, 125, 90;
  --theme-company: #6f42c1;
  --theme-company-hover: #59359a;
  --theme-company-active: #4c2d84;
  --theme-company-ink: #452978;
  --theme-company-soft: #e2d9f3;
  --theme-company-tint: #f1edf9;
  --theme-company-foreground: #fff;
  --theme-company-hover-foreground: #fff;
  --theme-company-rgb: 111, 66, 193;
  --theme-driver: #0d6efd;
  --theme-driver-hover: #0b5ed7;
  --theme-driver-active: #094fb6;
  --theme-driver-ink: #08449d;
  --theme-driver-soft: #d2e2ff;
  --theme-driver-tint: #e9f1ff;
  --theme-driver-foreground: #fff;
  --theme-driver-hover-foreground: #fff;
  --theme-driver-rgb: 13, 110, 253;
  --theme-outstanding: #9a6108;
  --theme-outstanding-hover: #815107;
  --theme-outstanding-active: #6f4606;
  --theme-outstanding-ink: #5f3c05;
  --theme-outstanding-soft: #eddfce;
  --theme-outstanding-tint: #f6f0e9;
  --theme-outstanding-foreground: #fff;
  --theme-outstanding-hover-foreground: #fff;
  --theme-outstanding-rgb: 154, 97, 8;
  /* Shared UI scale: keep equivalent elements consistent across pages. */
  --ui-page-title-size: 1.45rem;
  --ui-page-subtitle-size: 0.86rem;
  --ui-section-title-size: 1rem;
  --ui-list-title-size: 0.86rem;
  --ui-meta-size: 0.74rem;
  --ui-button-size: 0.82rem;
  --ui-button-small-size: 0.74rem;
  --ui-badge-size: 0.62rem;
  --ui-entity-name-size: 0.88rem;
  /* Rem so controls grow with the text-size setting; equals 34px / 29px at 100%. */
  --ui-control-height: 2.43rem;
  --ui-control-small-height: 2.07rem;
  --ui-text-scale: 1;
}

/* Cross-page component consistency overrides. */
.badge,
.entity-type-badge,
.driver-type-badge,
.driver-history-badge,
.driver-inactive-badge,
.status-badge,
.tour-table-status,
.recent-activity-badge,
.recent-tour-status,
.recent-entity-type,
.tour-activity-entity-type,
.transaction-kind-badge,
.admin-log-badge,
.extra-charge-badge,
.tour-note-label {
  font-size: var(--ui-badge-size) !important;
}

.entity-name-text,
.ledger-entity-name,
.master-data-name,
.driver-picker-name,
.temporary-driver-suggestion-name,
.temporary-company-suggestion-name,
.recent-activity-entity strong,
.tour-activity-entity-name {
  font-size: var(--ui-entity-name-size) !important;
}

html {
  font-size: calc(14px * var(--ui-text-scale));
  scrollbar-gutter: stable;
}

body {
  background: var(--app-bg);
  color: var(--app-ink);
  min-height: 100vh;
}

.btn {
  display: inline-flex;
  min-height: var(--ui-control-height);
  align-items: center;
  justify-content: center;
  font-size: var(--ui-button-size);
  line-height: 1.2;
}

.btn-sm {
  min-height: var(--ui-control-small-height);
  padding: 0.22rem 0.48rem;
  font-size: var(--ui-button-small-size);
}

.btn-lg {
  min-height: 42px;
  font-size: 0.95rem;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--theme-general-ink);
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--theme-general);
  border-radius: 7px;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 12%);
  font-size: 0.9rem;
}

.brand-name {
  white-space: nowrap;
}

.brand-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 0.38rem;
  min-width: 0;
}

.app-version {
  color: #6c757d;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.login-brand {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.navbar .dropdown-menu {
  border-color: var(--app-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgb(31 49 42 / 10%);
}

.navbar .dropdown-item {
  padding-block: 0.5rem;
}

.nav-quick-links {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  margin-right: 0.5rem;
}

/* Larger text sizes wrap whole nav items onto a new row instead of breaking words. */
.navbar .nav-link,
.navbar-collapse .btn {
  white-space: nowrap;
}

.navbar > .app-container {
  flex-wrap: wrap;
}

/* Text-size control: next to the menu button on narrow screens, after 退出 on desktop. */
.text-scale-menu {
  order: 10;
  margin-left: 0.5rem;
}

.text-scale-toggle {
  min-width: var(--ui-control-height);
  padding-inline: 0.5rem;
  font-weight: 600;
}

.text-scale-panel {
  min-width: 11rem;
  padding: 0.6rem 0.7rem 0.4rem;
}

.text-scale-title {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
}

.text-scale-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.text-scale-controls .btn {
  min-width: 2.6rem;
}

.text-scale-reset {
  display: block;
  margin: 0.3rem auto 0;
  text-decoration: none;
}

.nav-quick-links .nav-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: rgb(0 0 0 / 65%);
  font-size: calc(1rem + 2px);
  font-weight: 600;
  white-space: nowrap;
}

.nav-quick-links .nav-link:hover,
.nav-quick-links .nav-link:focus {
  color: var(--theme-general);
}

.btn-dispatch {
  --bs-btn-color: var(--theme-general-foreground);
  --bs-btn-bg: var(--theme-general);
  --bs-btn-border-color: var(--theme-general);
  --bs-btn-hover-color: var(--theme-general-hover-foreground);
  --bs-btn-hover-bg: var(--theme-general-hover);
  --bs-btn-hover-border-color: var(--theme-general-hover);
  --bs-btn-focus-shadow-rgb: var(--theme-general-rgb);
  --bs-btn-active-color: var(--theme-general-hover-foreground);
  --bs-btn-active-bg: var(--theme-general-active);
  --bs-btn-active-border-color: var(--theme-general-active);
}

.btn-outline-dispatch {
  --bs-btn-color: var(--theme-general-ink);
  --bs-btn-border-color: var(--theme-general);
  --bs-btn-hover-color: var(--theme-general-foreground);
  --bs-btn-hover-bg: var(--theme-general);
  --bs-btn-hover-border-color: var(--theme-general);
  --bs-btn-focus-shadow-rgb: var(--theme-general-rgb);
  --bs-btn-active-color: var(--theme-general-hover-foreground);
  --bs-btn-active-bg: var(--theme-general-hover);
  --bs-btn-active-border-color: var(--theme-general-hover);
}

/* "有备注" filter: same brown as the 有备注 label in tour rows. */
.btn-notes {
  --bs-btn-color: var(--theme-outstanding-foreground);
  --bs-btn-bg: var(--theme-outstanding);
  --bs-btn-border-color: var(--theme-outstanding);
  --bs-btn-hover-color: var(--theme-outstanding-hover-foreground);
  --bs-btn-hover-bg: var(--theme-outstanding-hover);
  --bs-btn-hover-border-color: var(--theme-outstanding-hover);
  --bs-btn-focus-shadow-rgb: var(--theme-outstanding-rgb);
  --bs-btn-active-color: var(--theme-outstanding-hover-foreground);
  --bs-btn-active-bg: var(--theme-outstanding-hover);
  --bs-btn-active-border-color: var(--theme-outstanding-hover);
}

.btn-outline-notes {
  --bs-btn-color: var(--theme-outstanding-ink);
  --bs-btn-border-color: var(--theme-outstanding);
  --bs-btn-hover-color: var(--theme-outstanding-foreground);
  --bs-btn-hover-bg: var(--theme-outstanding);
  --bs-btn-hover-border-color: var(--theme-outstanding);
  --bs-btn-focus-shadow-rgb: var(--theme-outstanding-rgb);
  --bs-btn-active-color: var(--theme-outstanding-hover-foreground);
  --bs-btn-active-bg: var(--theme-outstanding-hover);
  --bs-btn-active-border-color: var(--theme-outstanding-hover);
}

.btn-company {
  --bs-btn-color: var(--theme-company-foreground);
  --bs-btn-bg: var(--theme-company);
  --bs-btn-border-color: var(--theme-company);
  --bs-btn-hover-color: var(--theme-company-hover-foreground);
  --bs-btn-hover-bg: var(--theme-company-hover);
  --bs-btn-hover-border-color: var(--theme-company-hover);
  --bs-btn-focus-shadow-rgb: var(--theme-company-rgb);
  --bs-btn-active-color: var(--theme-company-hover-foreground);
  --bs-btn-active-bg: var(--theme-company-active);
  --bs-btn-active-border-color: var(--theme-company-active);
}

.btn-outline-company {
  --bs-btn-color: var(--theme-company-ink);
  --bs-btn-border-color: var(--theme-company);
  --bs-btn-hover-color: var(--theme-company-foreground);
  --bs-btn-hover-bg: var(--theme-company);
  --bs-btn-hover-border-color: var(--theme-company);
  --bs-btn-focus-shadow-rgb: var(--theme-company-rgb);
  --bs-btn-active-color: var(--theme-company-hover-foreground);
  --bs-btn-active-bg: var(--theme-company-hover);
  --bs-btn-active-border-color: var(--theme-company-hover);
}

.btn-driver {
  --bs-btn-color: var(--theme-driver-foreground);
  --bs-btn-bg: var(--theme-driver);
  --bs-btn-border-color: var(--theme-driver);
  --bs-btn-hover-color: var(--theme-driver-hover-foreground);
  --bs-btn-hover-bg: var(--theme-driver-hover);
  --bs-btn-hover-border-color: var(--theme-driver-hover);
  --bs-btn-focus-shadow-rgb: var(--theme-driver-rgb);
  --bs-btn-active-color: var(--theme-driver-hover-foreground);
  --bs-btn-active-bg: var(--theme-driver-active);
  --bs-btn-active-border-color: var(--theme-driver-active);
}

.btn-outline-driver {
  --bs-btn-color: var(--theme-driver-ink);
  --bs-btn-border-color: var(--theme-driver);
  --bs-btn-hover-color: var(--theme-driver-foreground);
  --bs-btn-hover-bg: var(--theme-driver);
  --bs-btn-hover-border-color: var(--theme-driver);
  --bs-btn-focus-shadow-rgb: var(--theme-driver-rgb);
  --bs-btn-active-color: var(--theme-driver-hover-foreground);
  --bs-btn-active-bg: var(--theme-driver-hover);
  --bs-btn-active-border-color: var(--theme-driver-hover);
}

.alert-dispatch {
  border-color: var(--theme-general-soft);
  background: var(--theme-general-tint);
  color: var(--theme-general-ink);
}

.tour-table + .pagination-wrap .page-item.active .page-link {
  border-color: var(--theme-general);
  background: var(--theme-general);
}

.nav-quick-links .nav-theme-driver:not(.active):hover,
.nav-quick-links .nav-theme-driver:not(.active):focus {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-tint);
  border-radius: 6px;
}

.nav-quick-links .nav-theme-company:not(.active):hover,
.nav-quick-links .nav-theme-company:not(.active):focus {
  color: var(--theme-company-ink);
  background: var(--theme-company-tint);
  border-radius: 6px;
}

.nav-quick-links .nav-theme-neutral:not(.active):hover,
.nav-quick-links .nav-theme-neutral:not(.active):focus {
  color: var(--theme-general-ink);
  background: var(--theme-general-tint);
  border-radius: 6px;
}

.nav-quick-links .nav-link.active {
  color: #fff !important;
  border-radius: 6px;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 12%);
}

.nav-quick-links .nav-theme-company.active {
  color: var(--theme-company-foreground) !important;
  background: var(--theme-company) !important;
}

.nav-quick-links .nav-theme-company.active:hover,
.nav-quick-links .nav-theme-company.active:focus {
  color: #fff !important;
  color: var(--theme-company-hover-foreground) !important;
  background: var(--theme-company-hover) !important;
}

.nav-quick-links .nav-theme-driver.active {
  color: var(--theme-driver-foreground) !important;
  background: var(--theme-driver) !important;
}

.nav-quick-links .nav-theme-driver.active:hover,
.nav-quick-links .nav-theme-driver.active:focus {
  color: #fff !important;
  color: var(--theme-driver-hover-foreground) !important;
  background: var(--theme-driver-hover) !important;
}

.nav-quick-links .nav-theme-neutral.active {
  color: #fff !important;
  color: var(--theme-general-foreground) !important;
  background: var(--theme-general) !important;
}

.nav-quick-links .nav-theme-neutral.active:hover,
.nav-quick-links .nav-theme-neutral.active:focus {
  color: #fff !important;
  color: var(--theme-general-hover-foreground) !important;
  background: var(--theme-general-hover) !important;
}

.admin-section {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: #fff;
}

.admin-unlock-wrap {
  display: grid;
  min-height: min(58vh, 430px);
  place-items: center;
}

.admin-unlock-panel {
  width: min(100%, 340px);
  padding: 1.2rem;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: #fff;
}

.admin-unlock-heading h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.admin-unlock-heading p {
  margin: 0.25rem 0 1rem;
  color: #6c757d;
  font-size: 0.82rem;
}

.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--app-border);
}

.admin-section-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.admin-section-heading p {
  margin: 0.18rem 0 0;
  color: #6c757d;
  font-size: 0.8rem;
}

.admin-theme-section {
  position: relative;
  padding-bottom: 1rem;
}

.theme-settings-form {
  padding: 0 1rem;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.theme-picker-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 44px;
  min-width: 0;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.theme-picker-swatch {
  width: 38px;
  height: 38px;
  border: 1px solid rgb(0 0 0 / 12%);
  border-radius: 6px;
  background: var(--picker-color);
}

.theme-picker-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.theme-picker-copy small {
  color: #6c757d;
  line-height: 1.25;
}

.theme-color-input {
  width: 44px;
  height: 38px;
  padding: 2px;
  border: 1px solid #adb5bd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.theme-color-value {
  grid-column: 2 / 4;
  color: #6c757d;
  font-size: 0.75rem;
}

.theme-settings-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin: 0.8rem 1rem 0;
}

@media (max-width: 991.98px) {
  .theme-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .price-audit-filter .price-audit-filter-main,
  .price-audit-filter .price-audit-filter-extra {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-picker-grid {
    grid-template-columns: 1fr;
  }

  .theme-picker-card {
    grid-template-columns: 34px minmax(0, 1fr) 42px;
    padding: 0.55rem 0.65rem;
  }

  .theme-picker-swatch {
    width: 34px;
    height: 34px;
  }
}

.admin-check-idle,
.admin-check-result {
  margin: 0.85rem 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 6px;
}

.admin-check-idle {
  color: #66717b;
  background: #f5f7f9;
}

.admin-check-result {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-check-result.is-success {
  color: #146c43;
  background: #edf8f2;
  border-left: 4px solid #198754;
}

.admin-check-result.is-danger {
  color: #842029;
  background: #fff2f3;
  border-left: 4px solid #dc3545;
}

.admin-log-entry {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--app-border);
}

.admin-log-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
  color: #6c757d;
  font-size: 0.75rem;
}

.admin-log-badge {
  padding: 0.15rem 0.38rem;
  border-radius: 4px;
  font-weight: 700;
}

.admin-log-badge.is-frontend {
  color: #8a5700;
  background: #fff3cd;
}

.admin-log-badge.is-backend {
  color: #9f2d37;
  background: #f8d7da;
}

.admin-log-message {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.admin-log-entry details {
  margin-top: 0.5rem;
  color: #5f6871;
  font-size: 0.75rem;
}

.admin-log-entry summary {
  cursor: pointer;
}

.admin-log-entry pre {
  max-height: 18rem;
  margin: 0.45rem 0 0;
  padding: 0.65rem;
  overflow: auto;
  color: #2f3942;
  background: #f5f7f9;
  border-radius: 5px;
  font-size: 0.72rem;
  white-space: pre-wrap;
}

.admin-log-empty {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border: 0;
}

.admin-log-path {
  padding: 0.55rem 1rem;
  color: #7a838b;
  background: #fafbfc;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.wechat-binding-list {
  border-top: 1px solid var(--app-border);
}

.wechat-binding-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--app-border);
}

.wechat-binding-row:last-child {
  border-bottom: 0;
}

.wechat-binding-row > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.wechat-binding-row small {
  color: #6c757d;
}

.admin-danger-section {
  border-color: #e4c7ca;
}

.admin-reset-details > summary {
  padding: 0.75rem 1rem;
  color: #a12d38;
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

.admin-reset-details[open] > summary {
  border-bottom: 1px solid #ead6d8;
  background: #fff8f8;
}

.admin-reset-body {
  padding: 0.85rem 1rem 1rem;
}

.admin-form-details > summary {
  width: fit-content;
  padding-block: 0.4rem;
  color: var(--theme-general-ink);
  cursor: pointer;
  font-weight: 600;
}

.admin-form-body {
  padding-top: 0.5rem;
}

.maintenance-message {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.admin-reset-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 575.98px) {
  /* Keeps brand, text-size button and menu button on one row at larger text sizes. */
  .navbar-toggler {
    padding-inline: 0.45rem;
  }

  .admin-section-heading {
    align-items: flex-start;
    padding: 0.7rem 0.75rem;
  }

  .admin-section-heading .btn {
    min-height: 34px;
    padding: 0.3rem 0.55rem;
    white-space: nowrap;
  }

  .admin-check-idle,
  .admin-check-result {
    margin: 0.7rem 0.75rem;
  }

  .admin-log-entry {
    padding: 0.7rem 0.75rem;
  }

  .admin-reset-details > summary,
  .admin-reset-body {
    padding-inline: 0.75rem;
  }

  .admin-reset-fields {
    grid-template-columns: 1fr;
  }
}

.nav-quick-basic-menu {
  min-width: 0;
}

.nav-quick-basic-menu > .nav-link {
  display: inline-flex !important;
  width: 100%;
  visibility: visible !important;
  opacity: 1 !important;
}

.app-container {
  width: 100%;
  max-width: 1080px;
}

@media (max-width: 991.98px) {
  .navbar > .app-container {
    position: relative;
  }

  .navbar-brand {
    order: 1;
  }

  .text-scale-menu {
    order: 2;
    margin-left: auto;
  }

  .navbar-toggler {
    order: 3;
    margin-left: 0.4rem;
  }

  .nav-quick-links {
    display: grid;
    order: 4;
    width: 100%;
    margin: 0.35rem 0 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid #edf0f2;
  }

  .nav-quick-links .nav-link {
    min-width: 0;
    padding: 0.48rem 0.2rem 0.2rem;
    font-size: calc(0.82rem + 2px);
    text-align: center;
  }

  #mainNav {
    position: absolute;
    z-index: 1035;
    top: 100%;
    right: 0.75rem;
    left: 0.75rem;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding: 0.55rem;
    border: 1px solid var(--app-border);
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgb(24 33 43 / 14%);
  }
}

.login-shell {
  min-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.login-filing {
  font-size: 0.76rem;
  line-height: 1.2;
  text-align: center;
}

.login-filing a {
  color: #6c757d;
  text-decoration: none;
}

.login-filing a:hover,
.login-filing a:focus {
  color: var(--theme-general-ink);
  text-decoration: underline;
}

.login-filing-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.9rem;
}

.login-police-filing {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.login-filing-icon {
  width: auto;
  height: 1.5em;
}

.login-filing-notice {
  max-width: 480px;
  margin: 0.35rem auto 0;
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
  line-height: 1.5;
}

.login-panel,
.form-shell {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 1rem;
}

/* Multiple-choice checkboxes on master data forms (package routes). */
.checkbox-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.35rem 1rem;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.checkbox-choice-list .form-check {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.summary-card {
  --summary-accent: #4c667a;
  --summary-tint: #f7f9fa;
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: space-between;
  color: inherit;
  text-decoration: none;
  background: var(--summary-tint);
  border: 1px solid var(--app-border);
  border-left: 4px solid var(--summary-accent);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.summary-card:hover,
.summary-card:focus-visible {
  color: inherit;
  border-color: color-mix(in srgb, var(--summary-accent) 55%, var(--app-border));
  box-shadow: 0 5px 14px rgb(24 33 43 / 8%);
  transform: translateY(-1px);
}

.summary-card-dispatch {
  --summary-accent: var(--theme-general);
  --summary-tint: var(--theme-general-tint);
}

.summary-card-receivable {
  --summary-accent: var(--theme-general);
  --summary-tint: var(--theme-general-tint);
}

.summary-card-company {
  --summary-accent: var(--theme-company);
  --summary-tint: var(--theme-company-tint);
}

.summary-card-driver {
  --summary-accent: var(--theme-driver);
  --summary-tint: var(--theme-driver-tint);
}

.summary-card.summary-card-outstanding > strong {
  color: var(--theme-outstanding);
}

.summary-card-month {
  --summary-accent: #59646d;
  --summary-tint: #f7f8f9;
}

.summary-card-label {
  color: #4f5b66;
  font-size: 0.82rem;
  font-weight: 650;
}

.summary-card strong {
  color: var(--summary-accent);
  font-size: 1.45rem;
  line-height: 1;
}

.summary-card-unit {
  margin-left: 0.15rem;
  font-size: 0.72em;
  font-weight: 650;
}

.summary-card small {
  color: #6c757d;
  font-size: 0.76rem;
}

.summary-card-foreign {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.2rem;
  padding-top: 0.3rem;
  border-top: 1px solid color-mix(in srgb, var(--app-border) 75%, transparent);
  color: #5f6871;
  font-size: 0.68rem;
  line-height: 1.2;
}

.summary-card-foreign span,
.summary-card-foreign small {
  font-size: inherit;
  white-space: nowrap;
}

.summary-card-foreign span {
  font-size: calc(0.68rem + 2px);
}

.summary-card-foreign b {
  color: var(--theme-outstanding);
  font-weight: 700;
}

.summary-card-foreign small {
  color: #6c757d;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.achievement-band {
  padding: 0.75rem 0.9rem;
  border-top: 2px solid #3f789f;
  border-bottom: 1px solid #d4e1ea;
  background: #f3f8fc;
}

.achievement-heading {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.achievement-heading h2 {
  margin: 0;
  color: #285f84;
  font-size: 1.05rem;
  font-weight: 750;
}

.achievement-heading p {
  margin: 0;
  color: #65736c;
  font-size: 0.78rem;
}

.achievement-matrix {
  width: 85%;
  margin-right: auto;
  margin-left: auto;
  border-top: 1px solid #d7e4ed;
  font-variant-numeric: tabular-nums;
}

.achievement-matrix-row {
  display: grid;
  grid-template-columns: 0.65fr repeat(4, minmax(0, 1fr));
  align-items: center;
  min-height: 2rem;
  border-bottom: 1px solid #dfe9f0;
  text-align: center;
}

.achievement-matrix-row:last-child {
  border-bottom: 0;
}

.achievement-matrix-head {
  min-height: 1.7rem;
  background: #eaf3f9;
  color: #65717c;
  font-size: 0.72rem;
  font-weight: 700;
}

.achievement-period {
  color: #52615a;
  font-size: 0.78rem;
}

.achievement-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
}

.achievement-value > strong {
  font-size: 1.05rem;
  line-height: 1;
}

.achievement-value small {
  color: #6c757d;
  font-size: 0.68rem;
  font-weight: 650;
}

.achievement-tour > strong {
  color: var(--theme-general);
}

.achievement-receipt > strong {
  color: var(--theme-company);
}

.achievement-payment > strong {
  color: var(--theme-driver);
}

.achievement-total {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff6d8;
}

.achievement-total > strong {
  color: #212529;
}

.achievement-total-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(1em + 1px);
}

.dashboard-kpi-group {
  min-width: 0;
}

.dashboard-kpi-title {
  margin: 0 0 0.4rem;
  color: #596570;
  font-size: 0.78rem;
  font-weight: 700;
}

.dashboard-kpi-period {
  margin-left: 0.25rem;
  color: #7b858e;
  font-weight: 500;
}

.dashboard-kpi-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-kpi-heading > span {
  color: #7b858e;
  font-size: 0.7rem;
}

.unsettled-month-list {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-left: 4px solid #59646d;
  border-radius: 8px;
  background: #f7f8f9;
  font-variant-numeric: tabular-nums;
}

.unsettled-month-row {
  display: grid;
  grid-template-columns: 1.15fr repeat(2, minmax(0, 1fr));
  min-height: 38px;
  align-items: center;
  padding: 0.32rem 0.65rem;
  border-bottom: 1px solid #e2e6e9;
  text-align: center;
}

.unsettled-month-row:last-child {
  border-bottom: 0;
}

.unsettled-month-head {
  min-height: 30px;
  color: #6c757d;
  background: #eef1f3;
  font-size: 0.68rem;
  font-weight: 700;
}

.unsettled-month-row > strong {
  color: #46515b;
  font-size: 0.8rem;
}

.unsettled-month-row a,
.unsettled-cleared {
  justify-self: center;
  padding: 0.15rem 0.42rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.unsettled-company-link {
  color: var(--theme-company-ink);
  background: var(--theme-company-soft);
}

.unsettled-driver-link {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-soft);
}

.unsettled-cleared {
  color: #6f7b84;
  background: #e9edef;
}

.unsettled-month-empty {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  color: #65717c;
  background: #f8faf9;
  font-size: 0.78rem;
}

.dashboard-kpi-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.dashboard-kpi-group-dispatch .dashboard-kpi-items {
  /* Today is narrowest; the cumulative card keeps room for its date range. */
  grid-template-columns: minmax(max-content, 0.8fr) minmax(max-content, 1fr) minmax(0, 1.25fr);
}

.dashboard-kpi-group-dispatch .summary-card strong {
  font-size: calc(1.45rem - 1px);
}

/* Dispatch cards size to their content instead of the shared card minimum. */
.dashboard-kpi-group-dispatch .summary-card {
  min-height: 0;
}

.recent-activity-list {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #fff;
}

.recent-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 40px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0.5rem;
  border-bottom: 1px solid #e8ecef;
}

.recent-activity-row:last-child {
  border-bottom: 0;
}

.recent-activity-link {
  display: grid;
  min-width: 0;
  grid-template-columns: max-content max-content max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
}

.recent-activity-link:hover,
.recent-activity-link:focus-visible {
  color: inherit;
  background: #f8fafb;
}

.recent-activity-link time {
  display: inline-flex;
  gap: 0.2rem;
  color: #6c757d;
  font-size: 0.71rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.recent-activity-badge {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.35rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.recent-activity-action {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.recent-tour-status {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0.04rem 0.25rem;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
}

.recent-activity-badge.is-general {
  border-left: 3px solid var(--theme-general);
  border-radius: 0;
  color: #34404a;
  background: transparent;
}

.recent-activity-badge.is-company {
  border-left: 3px solid var(--theme-company);
  border-radius: 0;
  color: var(--theme-company-ink);
  background: transparent;
}

.recent-activity-badge.is-driver {
  border-left: 3px solid var(--theme-driver);
  border-radius: 0;
  color: var(--theme-driver-ink);
  background: transparent;
}

.recent-activity-badge.is-void {
  color: #842029;
  background: transparent;
  border: 0;
  border-left: 3px solid #b02a37;
  border-radius: 0;
}

.recent-activity-badge.is-transition {
  color: #805500;
  background: transparent;
  border: 0;
  border-left: 3px solid #c58a13;
  border-radius: 0;
}

.recent-activity-row.is-void-event {
  background: #fff8f8;
}

.recent-activity-row.is-tour-transition {
  background: #fffdf6;
}

.recent-activity-row.is-voided-record .recent-activity-link {
  color: #6c757d;
}

.recent-activity-entity {
  display: block;
  min-width: 0;
  line-height: 1.35;
}

.recent-activity-entity > * + * {
  margin-left: 0.22rem;
}

.recent-activity-entity strong,
.recent-activity-detail {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recent-activity-entity small {
  color: #6c757d;
  font-size: 0.68rem;
}

.recent-activity-entity .recent-entity-type {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  justify-content: center;
  padding: 0.05rem 0.24rem;
  border-radius: 4px;
  font-weight: 600;
  line-height: 1;
}

.recent-activity-entity .recent-entity-type.is-company {
  color: var(--theme-company-ink);
  background: var(--theme-company-soft);
}

.recent-activity-entity .recent-entity-type.is-driver {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-soft);
}

.recent-activity-entity strong {
  font-size: 0.82rem;
}

.recent-activity-entity .recent-activity-tour-date {
  padding-left: 0.25rem;
  border-left: 1px solid #d9dee2;
  color: #68747f;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.recent-activity-detail {
  color: #6c757d;
  font-size: 0.72rem;
  line-height: 1.25;
}

.recent-activity-amount {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.recent-payment-state {
  display: grid;
  color: #6c757d;
  font-size: var(--ui-badge-size);
  font-weight: 400;
}

.recent-activity-row form,
.recent-activity-row form .btn {
  margin: 0;
  white-space: nowrap;
}

.recent-activity-row form .btn {
  min-height: 28px;
  padding: 0.12rem 0.38rem;
  line-height: 1.15;
}

.pagination-wrap.recent-activity-pagination {
  flex-direction: row;
  justify-content: center;
  gap: 0.65rem;
}

.recent-activity-pagination .page-item.active .page-link {
  border-color: var(--theme-general);
  background: var(--theme-general);
}

[data-async-pagination].is-loading {
  pointer-events: none;
  opacity: 0.55;
}

.async-page-updated {
  animation: async-page-ready 0.45s ease-out;
}

@keyframes async-page-ready {
  from { opacity: 0.72; }
  to { opacity: 1; }
}

.tour-activity-list {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #fff;
}

.tour-activity-row {
  display: grid;
  grid-template-columns: 5.5rem 118px minmax(0, 1fr) auto;
  min-height: 38px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.55rem;
  border-bottom: 1px solid #e8ecef;
}

.tour-activity-row:last-child {
  border-bottom: 0;
}

.tour-activity-row time,
.tour-activity-row small,
.tour-activity-detail {
  color: #6c757d;
  font-size: 0.72rem;
}

.tour-activity-row time,
.tour-activity-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tour-activity-row time {
  text-align: center;
}

.tour-activity-title {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0.1rem 0.32rem;
  border-left: 3px solid var(--theme-general);
  color: #34404a;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.tour-activity-title.is-company {
  color: var(--theme-company-ink);
  border-left-color: var(--theme-company);
}

.tour-activity-title.is-driver {
  color: var(--theme-driver-ink);
  border-left-color: var(--theme-driver);
}

.tour-activity-title.is-void {
  color: #842029;
  border-left-color: #b02a37;
}

.tour-activity-title.is-tour-void {
  color: #842029;
  border-left-color: #b02a37;
}

.tour-activity-title.is-transition {
  color: #805500;
  border-left-color: #c58a13;
}

.tour-activity-row.is-tour-void {
  background: #fff8f8;
}

.tour-activity-row.is-transition {
  background: #fffdf6;
}

.tour-activity-detail {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem 0.25rem;
  line-height: 1.25;
}

.tour-activity-detail > span:last-child,
.tour-activity-entity-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tour-activity-entity-type {
  display: inline-flex;
  min-height: 19px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0.05rem 0.24rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
}

.tour-activity-entity-type.is-company {
  color: var(--theme-company-ink);
  background: var(--theme-company-soft);
}

.tour-activity-entity-type.is-driver {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-soft);
}

.tour-activity-entity-name {
  flex: 0 1 auto;
  color: #36404a;
  font-size: 0.74rem;
}

@media (max-width: 575.98px) {
  .tour-activity-row {
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    gap: 0.15rem 0.35rem;
    padding: 0.28rem 0.4rem;
  }

  .tour-activity-row time {
    grid-column: 1;
    grid-row: 1;
    font-size: 0.64rem;
    line-height: 1.4;
  }

  .tour-activity-row.has-detail time {
    grid-row: 1 / span 2;
  }

  .tour-activity-row time span {
    display: block;
  }

  .tour-activity-title {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.72rem;
  }

  .tour-activity-row small {
    display: none;
  }

  .tour-activity-detail {
    grid-column: 2 / -1;
    grid-row: 2;
    line-height: 1.25;
  }

  .tour-activity-amount {
    grid-column: 3;
    grid-row: 1;
  }

  .tour-activity-amount {
    font-size: 0.76rem;
  }
}

@media (max-width: 575.98px) {
  .recent-activity-row {
    min-height: 38px;
    gap: 0.3rem;
    padding: 0.18rem 0.35rem;
  }

  .transaction-record-list .payment-record {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }

  .transaction-record-list .payment-record-main {
    width: 100%;
  }

  .transaction-record-list .transaction-record-actions {
    justify-content: flex-end;
  }

  .transaction-record-list .payment-record > .status-badge {
    align-self: flex-end;
  }

  .recent-activity-link {
    grid-template-columns: 2.55rem max-content minmax(0, 1fr) max-content;
    gap: 0.12rem 0.22rem;
  }

  .recent-activity-detail {
    grid-column: 3 / -1;
    grid-row: 2;
  }

  .recent-activity-detail:empty {
    display: none;
  }

  .recent-activity-entity {
    grid-column: auto;
    grid-row: auto;
  }

  .recent-activity-amount {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
  }

  .recent-activity-link time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1.1;
    white-space: nowrap;
    font-size: 0.64rem;
  }

  .recent-activity-badge {
    padding-inline: 0.22rem;
    font-size: 0.66rem;
  }

  .recent-activity-action {
    gap: 0.16rem;
  }

  .recent-tour-status {
    min-height: 17px;
    padding-inline: 0.18rem;
    font-size: 0.6rem;
  }

  .recent-activity-entity > * + * {
    margin-left: 0.12rem;
  }

  .recent-activity-entity small {
    font-size: 0.62rem;
  }

  .recent-activity-entity .recent-entity-type {
    min-height: 17px;
    padding-inline: 0.18rem;
  }

  .recent-activity-entity strong,
  .recent-activity-amount {
    font-size: 0.76rem;
  }

  .recent-activity-row form .btn {
    min-height: 26px;
    padding: 0.1rem 0.32rem;
    font-size: 0.7rem;
  }

  .pagination-wrap.recent-activity-pagination {
    flex-direction: row;
    align-items: center;
  }
}

.dashboard-kpi-group-month .summary-card,
.dashboard-kpi-group-total .summary-card {
  min-height: 94px;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.report-kpis > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.2rem;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.8rem;
}

.report-kpis span,
.report-kpis small {
  color: #6c757d;
  font-size: 0.82rem;
}

.report-kpis strong {
  overflow-wrap: anywhere;
  font-size: 1.08rem;
}

.report-filter {
  display: grid;
  grid-template-columns: minmax(15rem, 1.6fr) repeat(3, minmax(0, 1fr)) auto auto;
  align-items: end;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.75rem;
}

.report-filter .form-label {
  margin-bottom: 0.2rem;
  font-size: 0.79rem;
}

.report-filter .form-control,
.report-filter .form-select,
.report-filter .btn {
  font-size: 0.97rem;
}

.report-table-wrap {
  width: 100%;
  margin-inline: auto;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.report-table {
  width: 100%;
  min-width: 560px;
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-table th {
  color: #52605b;
  background: #f4f7f6;
  font-size: 0.8rem;
  font-weight: 600;
}

.report-table td,
.report-table th {
  height: 42px;
  padding: 0.5rem 0.65rem;
  vertical-align: middle;
}

.report-table td:first-child,
.report-table th:first-child {
  text-align: left;
}

.report-table td:nth-child(2),
.report-table td:nth-child(3),
.report-table th:nth-child(2),
.report-table th:nth-child(3) {
  text-align: center;
}

.report-table td:nth-child(n + 4),
.report-table th:nth-child(n + 4) {
  text-align: right;
}

.report-date-short {
  display: none;
}

.page-heading-inline {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-heading-inline h1,
.page-sticky-tools h1.h3 {
  font-size: var(--ui-page-title-size);
  line-height: 1.2;
}

.page-heading-inline p {
  font-size: var(--ui-page-subtitle-size);
  line-height: 1.25;
}

.entity-name-with-badge,
.entity-heading-name,
.entity-source-heading {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.3rem;
}

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

.entity-type-badge {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.entity-type-badge.is-company {
  color: var(--theme-company-ink);
  background: var(--theme-company-soft);
}

.entity-type-badge.is-driver {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-soft);
}

.page-heading-inline.tour-detail-heading,
.page-heading-inline .tour-detail-identity {
  align-items: center;
}

.page-heading-inline .tour-detail-identity {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  color: #344054;
  font-size: var(--ui-entity-name-size);
  line-height: 1.3;
  white-space: normal;
}

.tour-detail-identity strong {
  color: var(--theme-driver-ink);
  font-size: var(--ui-entity-name-size);
  font-weight: 700;
}

.tour-detail-identity .entity-name-text {
  overflow: visible;
  white-space: normal;
}

.tour-detail-route {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tour-detail-identity-divider {
  color: #98a2b3;
  font-weight: 400;
}

.btn-outline-warning {
  --bs-btn-color: #8a4b00;
  --bs-btn-border-color: #a85f00;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #a85f00;
  --bs-btn-hover-border-color: #965400;
  --bs-btn-focus-shadow-rgb: 168, 95, 0;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #965400;
  --bs-btn-active-border-color: #864b00;
}

.page-list-header > .btn {
  align-self: center;
}

.page-sticky-tools {
  position: sticky;
  z-index: 1010;
  top: var(--app-navbar-height, 0px);
  margin-right: -0.3rem;
  margin-left: -0.3rem;
  padding: 0.35rem 0.3rem 0.45rem;
  background: var(--app-bg);
  box-shadow: 0 1px 0 rgba(24, 33, 43, 0.08);
}

.page-sticky-tools.ledger-month-shortcuts,
.page-sticky-tools .ledger-month-shortcuts {
  margin-bottom: 0;
}

.data-list {
  width: 100%;
  margin-inline: auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--app-border);
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row.is-inactive {
  background: #f4f4f4;
}

.data-row.is-inactive > :not(.data-row-actions) {
  opacity: 0.55;
}

.driver-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}

/* Driver identity marks (신아 / 公结): one oval style on every page. */
.driver-company-badge,
.driver-settlement-company-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 25px;
  min-width: 25px;
  height: 15px;
  min-height: 15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--theme-driver-foreground);
  background: var(--theme-driver);
  font-size: var(--ui-badge-size);
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}

.driver-settlement-company-badge {
  color: var(--theme-company-foreground);
  background: var(--theme-company);
}

.driver-type-badge.is-regular {
  color: #075985;
  background: #e0f2fe;
}

.driver-type-badge.is-temporary {
  color: #854d0e;
  background: #fef3c7;
}

.driver-history-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0.1rem 0.4rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  color: #495057;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.driver-history-badge.has-history {
  color: #146c43;
  border-color: #a3cfbb;
  background: #d1e7dd;
}

.driver-history-badge.no-history {
  color: #842029;
  border-color: #f1aeb5;
  background: #f8d7da;
}

.master-data-row-main,
.master-data-row-info,
.driver-row-main,
.driver-row-info {
  display: flex;
  align-items: center;
  min-width: 0;
}

.master-data-row-main,
.driver-row-main {
  flex: 1 1 auto;
  gap: 0.65rem;
}

.master-data-row-info {
  display: block;
}

.master-data-name-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.driver-row-info {
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.master-data-sequence {
  width: 1.4rem;
  flex: 0 0 1.4rem;
  color: #6c757d;
  font-size: 0.78rem;
  text-align: center;
}

.data-row-actions,
.data-row-actions form {
  align-items: center;
  margin: 0;
}

.data-row-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-confirm-overlay {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.action-confirm-overlay[hidden] {
  display: none;
}

.action-confirm-panel {
  width: min(100%, 390px);
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}

.action-confirm-panel p {
  margin-bottom: 1rem;
  color: #495057;
  line-height: 1.55;
  white-space: pre-line;
}

.action-confirm-input {
  margin: -0.25rem 0 1rem;
}

.action-confirm-input .form-label {
  color: #6c252b;
  font-size: 0.82rem;
  font-weight: 600;
}

.action-confirm-input .form-control {
  border-color: #dc9ca2;
  text-align: center;
}

.action-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

body.has-action-confirm {
  overflow: hidden;
}

.range-picker-overlay {
  position: fixed;
  z-index: 2050;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.range-picker-overlay[hidden] {
  display: none;
}

body.has-range-picker {
  overflow: hidden;
}

.range-picker-panel {
  --range-accent: var(--theme-general);
  --range-accent-ink: var(--theme-general-ink);
  --range-accent-soft: var(--theme-general-soft);
  width: min(100%, 390px);
  padding: 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}

.range-picker-panel.range-picker-theme-company {
  --range-accent: var(--theme-company);
  --range-accent-ink: var(--theme-company-ink);
  --range-accent-soft: var(--theme-company-soft);
}

.range-picker-panel.range-picker-theme-driver {
  --range-accent: var(--theme-driver);
  --range-accent-ink: var(--theme-driver-ink);
  --range-accent-soft: var(--theme-driver-soft);
}

.range-picker-heading,
.range-picker-nav,
.range-picker-footer {
  display: flex;
  align-items: center;
}

.range-picker-confirm {
  color: #fff;
  background: var(--range-accent);
  border-color: var(--range-accent);
}

.range-picker-confirm:hover,
.range-picker-confirm:focus-visible {
  color: #fff;
  background: var(--range-accent-ink);
  border-color: var(--range-accent-ink);
}

.range-picker-confirm:disabled {
  color: #fff;
  background: #9ba5ae;
  border-color: #9ba5ae;
  opacity: 0.65;
}

.range-picker-heading {
  justify-content: space-between;
  gap: 0.75rem;
}

.range-picker-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.range-picker-heading p {
  margin: 0.15rem 0 0;
  color: #68747f;
  font-size: 0.75rem;
}

.range-picker-close,
.range-picker-nav button {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #4f5b66;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 1.35rem;
  line-height: 1;
}

.range-picker-close:hover,
.range-picker-nav button:hover {
  color: var(--range-accent-ink);
  background: var(--range-accent-soft);
}

.range-picker-nav {
  justify-content: space-between;
  margin-top: 0.55rem;
}

.range-picker-nav strong {
  color: #28333d;
  font-size: 0.9rem;
}

.range-picker-weekdays,
.range-picker-grid.is-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.range-picker-weekdays {
  margin-top: 0.25rem;
  color: #7a858f;
  font-size: 0.66rem;
  text-align: center;
}

.range-picker-weekdays span {
  padding: 0.25rem 0;
}

.range-picker-grid.is-date-grid {
  gap: 0.12rem;
}

.range-picker-grid.is-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.range-picker-cell {
  min-width: 0;
  color: #27323c;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 5px;
}

.range-picker-day {
  min-height: 2.35rem;
  aspect-ratio: 1;
  padding: 0;
  font-size: 0.78rem;
}

.range-picker-month {
  min-height: 2.35rem;
  font-size: 0.82rem;
}

.range-picker-cell:hover,
.range-picker-cell:focus-visible {
  border-color: var(--range-accent);
  outline: 0;
}

.range-picker-cell.is-outside {
  color: #adb5bd;
}

.range-picker-cell.is-in-range {
  color: var(--range-accent-ink);
  background: var(--range-accent-soft);
  border-radius: 2px;
}

.range-picker-cell.is-start,
.range-picker-cell.is-end {
  color: #fff;
  background: var(--range-accent);
  border-color: var(--range-accent);
  font-weight: 700;
}

.range-picker-footer {
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--app-border);
}

#range-picker-clear {
  margin-right: auto;
}

.range-picker-field {
  min-width: 0;
}

.range-picker-field > .form-label {
  margin-bottom: 0.22rem;
  color: #66727c;
  font-size: 0.75rem;
  font-weight: 600;
}

.range-picker-trigger {
  display: block;
  width: 100%;
  min-height: 52px;
  align-items: center;
  padding: 0.38rem 0.55rem;
  color: #28333d;
  background: #fbfcfd;
  border: 1px solid #6c757d;
  border-radius: 7px;
  text-align: center;
}

.range-picker-trigger:hover,
.range-picker-trigger:focus-visible {
  border-color: var(--theme-general);
  box-shadow: 0 0 0 0.18rem rgba(var(--theme-general-rgb), 0.12);
}

.range-picker-field[data-range-theme="company"] .range-picker-trigger:hover,
.range-picker-field[data-range-theme="company"] .range-picker-trigger:focus-visible {
  border-color: var(--theme-company);
  box-shadow: 0 0 0 0.18rem rgba(var(--theme-company-rgb), 0.12);
}

.range-picker-field[data-range-theme="driver"] .range-picker-trigger:hover,
.range-picker-field[data-range-theme="driver"] .range-picker-trigger:focus-visible {
  border-color: var(--theme-driver);
  box-shadow: 0 0 0 0.18rem rgba(var(--theme-driver-rgb), 0.12);
}

.range-picker-current {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}

.range-picker-current.is-single {
  display: flex;
  justify-content: center;
}

.range-picker-point {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.range-picker-point small {
  margin-bottom: 0.12rem;
  color: #7a858f;
  font-size: calc(0.66rem + 1px);
  font-weight: 500;
}

.range-picker-point strong {
  max-width: 100%;
  overflow: hidden;
  color: #25313b;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 0.9rem;
  font-variant-numeric: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.range-picker-duration {
  padding: 0.14rem 0.36rem;
  color: var(--theme-general-ink);
  background: var(--theme-general-soft);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.range-picker-field[data-range-theme="company"] .range-picker-duration {
  color: var(--theme-company-ink);
  background: var(--theme-company-soft);
}

.range-picker-field[data-range-theme="driver"] .range-picker-duration {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-soft);
}

.range-picker-current.is-empty .range-picker-point strong {
  color: #53606b;
  font-size: 0.9rem;
}

.btn,
.navbar-toggler {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: #6c757d;
}

.tour-day-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.time-shortcut {
  width: 4.5rem;
  flex: 0 0 4.5rem;
  padding: 0.3375rem 0.675rem;
  font-size: calc(1rem - 1px);
}

.time-shortcut.time-shortcut-current {
  width: 3.6rem;
  flex-basis: 3.6rem;
}

.tour-range-filter {
  display: grid;
  grid-template-columns: minmax(16rem, 426px);
  justify-content: center;
  align-items: end;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.75rem;
}

.tour-status-filters {
  display: flex;
  gap: 0.35rem;
}

.tour-status-filters .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  min-height: 1.82rem;
  padding: 0.12rem 0.2rem;
  font-size: 0.72rem;
}

.tour-table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}

.tour-range-filter .form-label {
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
}

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

.pagination {
  flex-wrap: wrap;
}

.page-link {
  min-width: 34px;
  text-align: center;
}

.ledger-filter-panel {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.75rem;
}

.ledger-range-filter {
  display: grid;
  grid-template-columns: minmax(16rem, 336px);
  justify-content: center;
  align-items: end;
  gap: 0.6rem;
}

.ledger-range-filter .form-label {
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
}

.ledger-range-filter .form-control {
  min-width: 0;
}

.ledger-month-shortcuts {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ledger-month-shortcuts {
  justify-content: center;
  margin-bottom: 0.6rem;
}

.ledger-balance-filter {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: -0.25rem 0 0.45rem;
}

.ledger-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.ledger-header-actions .btn {
  white-space: nowrap;
}

.ledger-history-button {
  padding-inline: 0.55rem;
  font-size: 0.78rem;
}

.page-list-header .btn,
.page-list-header .ledger-history-button {
  font-size: calc(var(--ui-button-size) + 2px);
}

.ledger-balance-filter .btn {
  min-width: 3.25rem;
  min-height: 1.82rem;
  padding: 0.12rem 0.2rem;
  font-size: 0.72rem;
}

.ledger-batch-action {
  display: flex;
  justify-content: flex-end;
}

.ledger-batch-action form {
  margin: 0;
}

.ledger-table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.4rem;
}

.ledger-table-tools .ledger-balance-filter {
  margin: 0;
}

.ledger-detail-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ledger-detail-list-heading h2,
.ledger-detail-list-heading .ledger-balance-filter {
  margin: 0;
}

.ledger-detail-list-heading h2,
.tour-summary > h2,
.company-driver-settlement-heading h2,
.ledger-detail-panel > h2 {
  font-size: var(--ui-section-title-size);
  line-height: 1.25;
}

.ledger-detail-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.ledger-detail-heading-actions .ledger-balance-filter {
  margin: 0;
}

.ledger-batch-button {
  min-width: 7.25rem;
  min-height: var(--ui-control-height);
  padding: 0.35rem 0.65rem;
  font-size: var(--ui-button-size);
  white-space: nowrap;
}

.ledger-view-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  max-width: 30rem;
  margin-inline: auto;
  padding: 0.3rem;
  border: 1px solid var(--app-border);
  border-radius: 7px;
  background: #fff;
}

.ledger-view-tab {
  min-height: var(--ui-control-height);
  padding: 0.3rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #59636e;
  font-size: var(--ui-button-size);
  font-weight: 600;
}

.ledger-view-tab.is-company:hover,
.ledger-view-tab.is-company:focus-visible {
  color: var(--theme-company-ink);
  background: var(--theme-company-tint);
}

.ledger-view-tab.is-driver:hover,
.ledger-view-tab.is-driver:focus-visible {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-tint);
}

.ledger-view-tab.is-company.is-active {
  border-color: var(--theme-company);
  color: var(--theme-company-ink);
  background: var(--theme-company-soft);
}

.ledger-view-tab.is-driver.is-active {
  border-color: var(--theme-driver);
  color: var(--theme-driver-ink);
  background: var(--theme-driver-soft);
}

.ledger-detail-panel[hidden] {
  display: none !important;
}

.ledger-outstanding-filter.ledger-filter-company,
.ledger-outstanding-filter.ledger-filter-driver {
  border-color: var(--theme-outstanding);
  background: #fff;
  color: var(--theme-outstanding-ink);
}

.ledger-outstanding-filter.ledger-filter-company:hover,
.ledger-outstanding-filter.ledger-filter-company:focus,
.ledger-outstanding-filter.ledger-filter-company.is-active,
.ledger-outstanding-filter.ledger-filter-driver:hover,
.ledger-outstanding-filter.ledger-filter-driver:focus,
.ledger-outstanding-filter.ledger-filter-driver.is-active {
  border-color: var(--theme-outstanding);
  background: var(--theme-outstanding);
  color: var(--theme-outstanding-foreground);
}

.ledger-table {
  width: 100%;
  margin-inline: auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.ledger-table-header,
.ledger-table-row {
  display: grid;
  grid-template-columns: 2rem minmax(5rem, 1.2fr) repeat(4, minmax(0, 1fr));
  align-items: center;
  column-gap: 0.5rem;
  text-align: center;
}

.driver-ledger-table .ledger-table-header,
.driver-ledger-table .ledger-table-row {
  grid-template-columns: 2rem minmax(7rem, 1.5fr) minmax(2.6rem, 0.55fr) repeat(2, minmax(0, 1fr));
  column-gap: 0.4rem;
}

.ledger-table-header {
  min-height: 36px;
  padding: 0.42rem 0.75rem;
  background: #f4f6f8;
  border-bottom: 1px solid var(--app-border);
  color: #65717c;
  font-size: 0.75rem;
  font-weight: 700;
}

.ledger-table-row {
  min-height: 42px;
  padding: 0.42rem 0.75rem;
  border-bottom: 1px solid #e8ecef;
  color: inherit;
  font-size: var(--ui-list-title-size);
  text-decoration: none;
}

.ledger-table-row:last-child {
  border-bottom: 0;
}

.ledger-table-row:hover {
  background: #f8fafb;
  color: inherit;
}

.ledger-table-header > :first-child,
.ledger-table-row > :first-child,
.ledger-table-header > :nth-child(2),
.ledger-table-row > :nth-child(2) {
  text-align: center;
}

.ledger-table-row > :nth-child(2) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ledger-entity-name {
  min-width: 0;
  overflow: hidden;
  font-size: calc(1em + 1px);
  text-overflow: ellipsis;
}

.ledger-entity-name.entity-name-with-badge {
  justify-content: center;
}

.company-ledger-entity {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  font-size: calc(1em + 2px);
  white-space: normal;
}

.company-ledger-table .ledger-table-header,
.company-ledger-table .ledger-table-row {
  grid-template-columns: 2rem minmax(7.5rem, 1.65fr) minmax(2.5rem, 0.5fr) repeat(2, minmax(0, 1fr));
}

.company-ledger-name-line {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.company-ledger-name-line .entity-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-settlement-list-note {
  display: flex;
  max-width: 100%;
  align-items: center;
  flex-direction: column;
  color: var(--theme-driver-ink);
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
}

.company-settlement-list-amounts {
  display: block;
  white-space: nowrap;
}

.ledger-sequence {
  color: #7a858f;
  font-size: var(--ui-meta-size);
  font-weight: 400;
  text-align: center;
}

.ledger-table-row > span,
.ledger-table-row > strong {
  white-space: nowrap;
}

.ledger-money-stack {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  line-height: 1.2;
}

.ledger-table-row > .ledger-money-stack {
  white-space: normal;
}

.ledger-extra-value {
  color: #3f6d82;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.ledger-extra-value.ledger-extra-outstanding {
  font-size: 0.76rem;
  font-weight: 700;
}

.ledger-finance-overview {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 6px;
}

.ledger-overview-subheading {
  margin: 0.55rem 0 0.3rem;
  color: var(--theme-driver-ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.ledger-finance-row {
  display: grid;
  grid-template-columns: minmax(7.25rem, 1.25fr) repeat(3, minmax(0, 1fr));
  align-items: center;
  min-height: 2.65rem;
  text-align: center;
}

.ledger-finance-company .ledger-finance-row {
  grid-template-columns: minmax(7.25rem, 1.05fr) minmax(13rem, 1.8fr) repeat(2, minmax(0, 1fr));
}

.ledger-finance-row + .ledger-finance-row {
  border-top: 1px solid var(--app-border);
}

.ledger-finance-row > * {
  min-width: 0;
  padding: 0.45rem 0.35rem;
  white-space: nowrap;
}

.ledger-finance-row > * + * {
  border-left: 1px solid var(--app-border);
}

.ledger-finance-header {
  min-height: 2rem;
  color: #5e6872;
  background: #f5f7f9;
  font-size: 0.76rem;
  font-weight: 600;
}

.ledger-finance-regular {
  background: #fff;
}

.ledger-finance-extra {
  background: #f2f7fa;
}

.ledger-finance-amounts {
  display: grid;
  gap: 0.3rem;
}

.ledger-finance-row strong {
  font-size: 0.98rem;
}

.ledger-finance-row strong:first-child {
  font-size: 0.88rem;
}

.ledger-finance-composition {
  display: block;
  margin-top: 0.12rem;
  color: #6c757d;
  font-size: 0.66rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.ledger-finance-composition > span {
  display: block;
}

.ledger-finance-empty {
  padding: 0.4rem 0.6rem;
  border-top: 1px solid var(--app-border);
  color: #7b858e;
  background: #fafbfc;
  font-size: 0.75rem;
  text-align: center;
}

.company-driver-settlement {
  padding: 0.8rem;
  border: 1px solid rgba(var(--theme-driver-rgb), 0.3);
  border-radius: 8px;
  background: var(--theme-driver-tint);
}

.company-driver-settlement-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.company-driver-settlement-heading p {
  margin: 0.15rem 0 0.65rem;
  color: #6c757d;
  font-size: 0.78rem;
}

@media (max-width: 575.98px) {
  .company-driver-settlement {
    padding: 0.65rem;
  }
}

.nav-quick-basic-menu:hover > .dropdown-menu,
.nav-quick-basic-menu:focus-within > .dropdown-menu {
  display: block;
}

.ledger-entry,
.payment-record {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--app-border);
}

.ledger-entry:last-child,
.payment-record:last-child {
  border-bottom: 0;
}

.ledger-entry {
  padding-block: 0.45rem;
}

.ledger-entry-main {
  display: grid;
  gap: 0.2rem;
  font-size: calc(1rem - 1px);
}

.payment-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ledger-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ledger-quick-payment {
  flex: 0 0 auto;
}

.ledger-entry-top .settled-line {
  flex: 0 0 auto;
  margin-top: 0;
}

.async-action-updated {
  background: #edf7ef;
  transition: background-color 0.8s ease;
}

.async-action-pending {
  opacity: 0.65;
}

.payment-record-main {
  min-width: 0;
  flex: 1 1 auto;
}

.transaction-record-title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.transaction-kind-badge {
  padding: 0.1rem 0.32rem;
  border-radius: 4px;
  color: #315b78;
  background: #e8f1f7;
  font-size: 0.68rem;
  font-weight: 700;
}

.transaction-kind-badge.is-extra {
  color: #755100;
  background: #fff0c2;
}

.transaction-record-extra {
  background: #fffdf7;
}

.transaction-record-datetime {
  color: #5f6871;
  font-size: calc(1em - 1px);
}

.transaction-record-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.payment-record-tour-link {
  display: inline-block;
  margin-top: 0.25rem;
  color: #315b78;
  font-size: 0.76rem;
  text-decoration: none;
}

.payment-record-tour-link:hover {
  text-decoration: underline;
}

.payment-allocation-details {
  margin-top: 0.25rem;
  font-size: 0.78rem;
}

.payment-allocation-details summary {
  width: fit-content;
  color: #52606d;
  cursor: pointer;
}

.payment-allocation-list {
  display: grid;
  gap: 0;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}

.payment-allocation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 0.08rem;
}

.payment-allocation-row > a {
  min-width: 0;
  flex: 1 1 auto;
}

.payment-allocation-row.is-voided > a {
  color: #6c757d;
}

.payment-allocation-actions {
  flex: 0 0 auto;
}

.payment-allocation-actions .btn {
  min-height: 23px;
  padding: 0.08rem 0.3rem;
  font-size: var(--ui-button-small-size);
}

.payment-reversal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  color: #6c757d;
}

.payment-allocation-list a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  color: #315b78;
  text-decoration: none;
}

.payment-allocation-tour-info {
  min-width: 0;
  line-height: 1.35;
}

.payment-allocation-list a:hover {
  text-decoration: underline;
}

.payment-allocation-list strong {
  flex: 0 0 auto;
}

.ledger-entry-link {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.ledger-entry-link > .fw-semibold {
  font-size: var(--ui-list-title-size);
  line-height: 1.3;
}

.ledger-entry-link > .small {
  font-size: var(--ui-meta-size);
  line-height: 1.35;
}

.ledger-balance {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  font-size: 0.9rem;
  text-align: right;
}

.statement-export-panel {
  padding: 0.75rem;
  border: 1px solid #b8c9d6;
  border-radius: 8px;
  background: #f7fafc;
}

.statement-export-head,
.statement-export-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.statement-export-head {
  margin-bottom: 0.5rem;
}

.statement-export-text {
  min-height: 180px;
  resize: vertical;
  font-size: 0.82rem;
  line-height: 1.55;
}

.statement-export-actions {
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.statement-export-feedback {
  margin-right: auto;
}

.ledger-outstanding-company {
  color: var(--theme-outstanding);
}

.ledger-outstanding-driver {
  color: var(--theme-outstanding);
}

.summary-grid .ledger-outstanding-company span,
.summary-grid .ledger-outstanding-company strong {
  color: var(--theme-outstanding);
}

.summary-grid .ledger-outstanding-driver span,
.summary-grid .ledger-outstanding-driver strong {
  color: var(--theme-outstanding);
}

.settled-line {
  margin-top: 0.5rem;
  color: var(--theme-company);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
}

.payment-record.is-voided {
  background: #f8f9fa;
  opacity: 0.7;
}

.settled-line.no-settlement-line {
  color: #6c757d;
  font-weight: 500;
}

.compact-empty {
  padding-block: 1.5rem;
}

.tour-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--app-border);
}

.today-tours-section .dashboard-tour-row {
  min-height: 44px;
  padding-block: 0.45rem;
}

.dashboard-tour-sequence {
  color: #7a858f;
  font-size: 0.72rem;
  text-align: center;
}

.dashboard-tour-people {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dashboard-tour-route {
  overflow: hidden;
  color: var(--bs-secondary-color);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-table {
  width: 100%;
  margin-inline: auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.tour-table-header,
.tour-table-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 2.268fr) minmax(5rem, 0.7fr) repeat(3, minmax(5.5rem, 1fr));
  align-items: center;
  gap: 0.45rem;
}

.tour-table-header {
  min-height: 36px;
  padding: 0.5rem 0.75rem;
  background: #f4f6f8;
  border-bottom: 1px solid var(--app-border);
  color: #65717c;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.tour-table-row {
  min-height: 48px;
  padding: 0.48rem 0.75rem;
  border-bottom: 1px solid var(--app-border);
  color: inherit;
  text-decoration: none;
}

.tour-table-row:last-child {
  border-bottom: 0;
}

.tour-table-row:hover {
  background: #f8fafb;
}

.tour-table-row.is-cancelled {
  background: #fafafa;
  color: #6c757d;
}

.tour-table-info {
  min-width: 0;
  overflow: hidden;
}

.tour-table-date {
  font-size: var(--ui-list-title-size);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.dashboard-tour-table .tour-table-header,
.dashboard-tour-table .tour-table-row {
  grid-template-columns: 1.6rem minmax(0, 1.6fr) minmax(0, 1fr) 3.5rem;
}

.tour-table-info strong,
.tour-table-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-table-info small {
  color: #6c757d;
}

.tour-note-label {
  margin-left: 0.35rem;
  color: #9a6700;
  font-size: 0.75em;
  font-weight: 400;
  white-space: nowrap;
}

.tour-item-note {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #176b45;
  font-weight: 400;
}

.tour-item-note form {
  margin: 0;
}

.tour-item-note .btn {
  min-height: 24px;
  padding: 0.08rem 0.3rem;
  font-size: 0.68rem;
  line-height: 1.1;
}

.tour-table-status,
.tour-table-money,
.tour-table-empty {
  text-align: right;
  white-space: nowrap;
}

.tour-table-status {
  font-weight: 700;
}

.tour-table-status.status-dispatched,
.tour-table-status.status-settled {
  color: var(--theme-general-ink);
  background: var(--theme-general-soft);
}

.tour-table-status.status-draft {
  color: #b42318;
  background: #fde2e2;
}

.tour-table-status {
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  text-align: center;
  overflow: visible;
  letter-spacing: 0;
}

.tour-table-status.status-cancelled {
  color: #6c757d;
}

.tour-table-extra {
  color: #8a5200;
}

.tour-table-empty {
  color: #adb5bd;
}

.tour-detail-row:last-child {
  border-bottom: 0;
}

.tour-detail-main {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.tour-item-heading-row,
.tour-item-meta-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.tour-item-heading-row .entity-source-heading,
.tour-item-meta-row > :first-child {
  min-width: 0;
}

.tour-item-meta-row {
  margin-top: 0.15rem;
}

.tour-detail-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: calc(1rem - 1px);
  text-align: right;
}

.tour-detail-side > span {
  white-space: nowrap;
}

.tour-detail-receipt {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  flex: 0 0 auto;
}

.tour-item-heading-row .tour-detail-receipt {
  min-width: max-content;
}

.tour-detail-receipt .btn,
.tour-summary-payment .btn {
  white-space: nowrap;
}

.tour-summary-payment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.tour-summary-payment > .text-secondary {
  min-width: 0;
}

.company-received-value,
.summary-grid .company-received-value span,
.summary-grid .company-received-value strong,
.company-received-value .ledger-extra-value {
  color: var(--theme-company);
}

.driver-paid-value,
.summary-grid .driver-paid-value span,
.summary-grid .driver-paid-value strong,
.driver-paid-value .ledger-extra-value,
.driver-settled-line {
  color: var(--theme-driver);
}

.quick-settlement-complete {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.quick-settlement-complete form {
  margin: 0;
}

.quick-payment-warning {
  color: #b02a37;
  font-size: 0.75rem;
  line-height: 1.2;
  max-width: 9rem;
}

.extra-charge-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.45rem;
  padding: 0.4rem 0.5rem;
  border-left: 3px solid #d19a21;
  background: #fff9e8;
  font-size: calc(1rem - 2px);
}

.extra-charge-line > div:first-child {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.extra-charge-badge {
  color: #7a4800;
  font-weight: 700;
}

.extra-charge-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.extra-charge-actions .btn {
  min-height: 30px;
  padding: 0.18rem 0.4rem;
  font-size: calc(0.875rem - 2px);
  white-space: nowrap;
}

.extra-charge-line .small {
  font-size: calc(0.875rem - 2px);
}

.extra-charge-line .status-badge {
  min-height: 24px;
  padding: 0.12rem 0.4rem;
  font-size: calc(0.82rem - 2px);
}

.extra-charge-line .quick-payment-warning {
  font-size: calc(0.75rem - 2px);
}

.editor-section,
.tour-summary {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.8rem;
}

.tour-items {
  display: grid;
  gap: 0.75rem;
}

.tour-item-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.8rem;
}

.editor-section .row,
.tour-item-card .row {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.65rem;
}

.editor-section .form-label,
.tour-item-card .form-label {
  margin-bottom: 0.3rem;
}

.tour-driver-heading,
.item-company-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 0.35rem;
}

.temporary-driver-switch,
.temporary-company-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 0 0.3rem;
  color: #495057;
  font-size: 0.78rem;
  white-space: nowrap;
}

.temporary-driver-switch .form-check-input,
.temporary-company-switch .form-check-input {
  margin: 0;
}

.temporary-driver-control .input-group > .form-control,
.temporary-company-control .input-group > .form-control {
  min-width: 0;
}

.temporary-driver-control .input-group .btn,
.temporary-company-control .input-group .btn {
  padding-right: 0.55rem;
  padding-left: 0.55rem;
  white-space: nowrap;
}

.driver-picker {
  position: relative;
}

.driver-picker-toggle,
.driver-picker-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #212529;
  background: #fff;
  text-align: left;
}

.driver-picker-toggle {
  min-height: 38px;
  padding: 0.35rem 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.driver-picker-toggle:focus {
  border-color: var(--theme-driver-soft);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-driver-rgb), 0.2);
}

#driver-picker-selection,
.web-select-selection {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.driver-picker-chevron {
  flex: 0 0 auto;
  color: #6c757d;
}

.driver-picker-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  right: 0;
  width: max(100%, 18rem);
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #adb5bd;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgb(0 0 0 / 16%);
}

.driver-picker-option {
  min-height: 42px;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-bottom: 1px solid #e9ecef;
}

.driver-picker-option:last-child {
  border-bottom: 0;
}

#driver-picker-selection .driver-picker-name,
.web-select-selection .driver-picker-name {
  font-size: 0.82rem;
  font-weight: 700;
}

.driver-picker-option .driver-picker-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.driver-picker-option:hover,
.driver-picker-option:focus-visible,
.driver-picker-option.is-selected {
  background: var(--theme-driver-tint);
}

.driver-picker-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-picker-badges {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.driver-picker-badges .driver-history-badge {
  min-height: 17px;
  padding: 0.06rem 0.22rem;
  font-size: 0.6rem;
}

/* Web dropdowns on the tour form (route, package, company, currency, settlement company). */
.web-select .driver-picker-toggle {
  min-height: var(--ui-control-height);
}

.web-select .driver-picker-menu {
  right: auto;
  left: 0;
  width: max(100%, 10rem);
  max-width: calc(100vw - 2rem);
}

.web-select-general .driver-picker-toggle:focus {
  border-color: var(--theme-general-soft);
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-general-rgb), 0.2);
}

.web-select-general .driver-picker-option:hover,
.web-select-general .driver-picker-option:focus-visible,
.web-select-general .driver-picker-option.is-selected {
  background: var(--theme-general-tint);
}

.web-select-company .driver-picker-toggle:focus {
  border-color: var(--theme-company-soft);
  box-shadow: 0 0 0 0.2rem rgba(var(--theme-company-rgb), 0.2);
}

.web-select-company .driver-picker-option:hover,
.web-select-company .driver-picker-option:focus-visible,
.web-select-company .driver-picker-option.is-selected {
  background: var(--theme-company-tint);
}

.web-select-meta {
  flex: 0 0 auto;
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
  white-space: nowrap;
}

.tour-settlement-company-badge,
.tour-table-info .driver-company-badge {
  margin-left: 0.3rem;
}

.temporary-driver-suggestions,
.temporary-company-suggestions {
  position: relative;
  z-index: 10;
  max-height: 220px;
  margin-top: 0.25rem;
  overflow-y: auto;
  border: 1px solid #adb5bd;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 16px rgb(0 0 0 / 12%);
}

.temporary-driver-suggestions {
  max-width: 100%;
}

.temporary-driver-suggestion,
.temporary-company-suggestion {
  display: flex;
  width: 100%;
  min-height: 36px;
  padding: 0.4rem 0.55rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  border-bottom: 1px solid #e9ecef;
  color: #212529;
  background: #fff;
  text-align: left;
}

.temporary-driver-suggestion:last-child,
.temporary-company-suggestion:last-child {
  border-bottom: 0;
}

.temporary-driver-suggestion:hover,
.temporary-driver-suggestion:focus-visible,
.temporary-company-suggestion:hover,
.temporary-company-suggestion:focus-visible {
  background: var(--theme-general-tint);
}

.temporary-driver-suggestion-name,
.temporary-company-suggestion-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.temporary-driver-suggestion-meta,
.temporary-company-suggestion-meta {
  flex: 0 0 auto;
  color: #6c757d;
  font-size: 0.72rem;
  white-space: nowrap;
}

.temporary-driver-suggestion-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.temporary-driver-suggestion-meta .driver-history-badge,
.driver-inactive-badge {
  min-height: 17px;
  padding: 0.06rem 0.22rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1;
}

.driver-inactive-badge {
  color: #5d6670;
  background: #e8ebee;
}

.tour-item-card .form-control,
.tour-item-card .form-select,
.tour-item-card .form-control-lg,
.tour-item-card .form-select-lg {
  min-height: 34px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.tour-item-core {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

.tour-item-stack {
  min-width: 0;
}

.tour-item-primary-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.tour-item-fields {
  display: grid;
  grid-column: 2;
  /* People, package price, head fee, per-person total, source total; the last track is empty space. */
  grid-template-columns: minmax(2.5rem, 0.25fr) minmax(3.5rem, 0.335fr) minmax(3.5rem, 0.3fr) minmax(4.5rem, 0.8fr) minmax(5rem, 0.8fr) minmax(0, 0.515fr);
  align-items: end;
  gap: 0.5rem;
}

.tour-price-field {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-direction: column;
}

.tour-price-field .form-label {
  font-size: var(--ui-meta-size);
  line-height: 1.4;
}

.tour-price-field .form-control {
  width: 100%;
  min-width: 0;
  padding-inline: 0.3rem;
  font-size: var(--ui-list-title-size);
}

.tour-company-total .form-label {
  color: var(--theme-company-ink);
}

.tour-company-total output {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--theme-company-ink);
  background: var(--theme-company-tint);
  border-color: var(--theme-company-soft);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tour-pricing-note {
  margin: 0 0 0.6rem;
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
}

.tour-item-core > .item-extra-fields,
.tour-item-core > .item-price-cap-note {
  grid-column: 2;
  min-width: 0;
}

.item-price-cap-note {
  color: var(--theme-outstanding-ink);
  font-size: var(--ui-meta-size);
}

.item-price-cap-note[hidden] {
  display: none;
}

.item-package-label {
  position: relative;
}

.tour-item-card .item-price-help {
  display: block;
  min-height: 0;
  margin-left: auto;
  padding: 0.15rem 0 0;
  border: 0;
  font-size: var(--ui-meta-size);
  line-height: 1.2;
  text-decoration: none;
}

.item-title {
  margin: 0;
  color: #6c757d;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.tour-item-source {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.45rem;
}

.btn.item-remove {
  position: absolute;
  top: -2px;
  right: 0;
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
}

.summary-grid > div {
  display: flex;
  flex-direction: column;
}

.summary-grid span {
  color: #6c757d;
  font-size: 0.85rem;
}

.summary-grid strong {
  font-size: 1.15rem;
}

.summary-grid .tour-summary-extra span,
.summary-grid .tour-summary-extra strong {
  color: #805500;
}

.tour-action-disabled {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.tour-action-disabled small {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #efc5c9;
  border-radius: 5px;
  color: #7e3037;
  background: #fff4f5;
  font-size: 0.73rem;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.tour-action-disabled small strong {
  flex: 0 0 auto;
  padding: 0.08rem 0.25rem;
  border-radius: 3px;
  color: #fff;
  background: #b14a54;
  font-size: 0.64rem;
  white-space: nowrap;
}

/* Historical price check. */
.price-audit-warning {
  color: var(--theme-outstanding-ink);
}

.price-audit-dialog {
  width: min(560px, calc(100% - 1.5rem));
  max-height: calc(100% - 2rem);
  overflow-y: auto;
  padding: 1.2rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  color: var(--app-ink);
  font-size: var(--ui-list-title-size);
}

.price-audit-dialog > .btn-close {
  float: right;
}

.price-audit-dialog:not([open]) {
  display: none;
}

.price-audit-dialog.is-fallback[open] {
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 1080;
  display: block;
  max-height: calc(100vh - 2rem);
  margin: 0;
  background: var(--bs-body-bg);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.3);
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
}

.price-audit-edit-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.price-audit-edit-prices label {
  min-width: 0;
  font-weight: 600;
}

.price-audit-edit-prices label.is-company {
  color: var(--theme-company-ink);
}

.price-audit-edit-prices label.is-driver {
  color: var(--theme-driver-ink);
}

.price-audit-edit-prices small {
  display: block;
  margin-top: 0.2rem;
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
  font-weight: 400;
}

.price-audit-live {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  font-size: var(--ui-meta-size);
}

.price-audit-live dt {
  font-weight: 400;
  color: var(--bs-secondary-color);
}

.price-audit-live dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.price-audit-sync {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.price-audit-sync.is-company {
  border-color: var(--theme-company-soft);
  background: var(--theme-company-tint);
}

.price-audit-sync.is-driver {
  border-color: var(--theme-driver-soft);
  background: var(--theme-driver-tint);
}

.price-audit-sync legend {
  float: none;
  width: auto;
  margin-bottom: 0.35rem;
  font-size: var(--ui-list-title-size);
  font-weight: 600;
}

.price-audit-confirm-list {
  margin-bottom: 0.75rem;
  padding-left: 1.1rem;
}

.price-audit-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.price-audit-notice {
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--theme-outstanding);
  color: var(--theme-outstanding-ink);
  background: var(--theme-outstanding-tint);
  font-size: var(--ui-meta-size);
}

.price-audit-filter {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--app-border);
}

.price-audit-filter-main,
.price-audit-filter-extra {
  display: grid;
  align-items: end;
  gap: 0.6rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.price-audit-filter-extra {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 0.5rem;
}

.price-audit-filter-main > .range-picker-field {
  grid-column: span 2;
}

.price-audit-filter-main > *,
.price-audit-filter-extra > * {
  min-width: 0;
}

.price-audit-filter .form-label {
  font-size: var(--ui-meta-size);
}

.price-audit-filter .form-select {
  font-size: var(--ui-list-title-size);
}

.price-audit-more {
  margin-top: 0.6rem;
  font-size: var(--ui-meta-size);
}

.price-audit-more summary {
  width: fit-content;
  padding-block: 0.3rem;
  cursor: pointer;
}

.price-audit-count {
  margin-bottom: 0.25rem;
  font-size: var(--ui-meta-size);
}

.price-audit-count strong {
  font-size: var(--ui-section-title-size);
}

.price-audit-row {
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--app-border);
  font-size: var(--ui-list-title-size);
  overflow-wrap: anywhere;
}

.price-audit-head,
.price-audit-driver,
.price-audit-line,
.price-audit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
}

.price-audit-head {
  margin-bottom: 0.4rem;
}

.price-audit-driver {
  gap: 0.25rem;
}

.price-audit-line {
  margin-top: 0.3rem;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid;
}

.price-audit-line.is-company {
  background: var(--theme-company-tint);
  border-color: var(--theme-company);
}

.price-audit-line.is-driver {
  background: var(--theme-driver-tint);
  border-color: var(--theme-driver);
}

.price-audit-line.is-company .price-audit-side-label {
  color: var(--theme-company-ink);
}

.price-audit-line.is-driver .price-audit-side-label {
  color: var(--theme-driver-ink);
}

.price-audit-line small,
.price-audit-state {
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
}

.price-audit-delta {
  color: var(--theme-outstanding-ink);
  font-weight: 600;
}

.price-audit-state.price-audit-warning {
  color: var(--theme-outstanding-ink);
}

.price-audit-row > .price-audit-warning {
  display: block;
  margin-top: 0.3rem;
  font-size: var(--ui-meta-size);
}

.price-audit-actions {
  margin-top: 0.5rem;
}

.price-audit-table-link {
  margin-left: auto;
  font-size: var(--ui-meta-size);
}

.price-audit-history {
  font-size: var(--ui-meta-size);
  margin-top: 0.4rem;
}

.price-audit-history > div {
  padding-block: 0.4rem;
  border-bottom: 1px solid var(--app-border);
}

.price-audit-history small {
  display: block;
  font-size: var(--ui-meta-size);
  overflow-wrap: anywhere;
}

.tour-detail-row[id^="tour-item-"] {
  scroll-margin-top: 12rem;
}

/* Price table. */
.price-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
  margin-top: 0.45rem;
  font-size: var(--ui-meta-size);
}

.price-company-group,
.price-driver-group {
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border-left: 3px solid;
}

.price-company-group {
  background: var(--theme-company-tint);
  border-color: var(--theme-company);
}

.price-driver-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 0.5rem;
  background: var(--theme-driver-tint);
  border-color: var(--theme-driver);
}

.price-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.4rem;
  color: var(--app-ink);
  font-size: var(--ui-meta-size);
}

.price-item small {
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
}

.price-amount {
  white-space: nowrap;
}

.price-edit-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: var(--ui-meta-size);
}

#price-list .price-data-row {
  display: block;
}

.price-data-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.price-data-heading .btn {
  flex-shrink: 0;
}

.price-amount {
  font-weight: 700;
  font-size: var(--ui-list-title-size);
}

.price-amount.is-company {
  color: var(--theme-company-ink);
}

.price-amount.is-driver {
  color: var(--theme-driver-ink);
}

.price-overrides {
  margin: 0.4rem 0 0;
  padding-top: 0.3rem;
  border-top: 1px solid var(--theme-company-soft);
}

.price-overrides > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 0.15rem;
}

.price-overrides dt {
  overflow-wrap: anywhere;
  font-weight: 400;
}

.price-overrides dd {
  margin: 0;
}

.price-overrides-heading {
  color: var(--theme-company-ink);
}

.price-section {
  margin-bottom: 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #fff;
}

.price-section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--app-border);
  font-size: var(--ui-section-title-size);
  font-weight: 700;
}

.price-section-title small {
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
  font-weight: 400;
}

.price-default-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.price-default-field {
  min-width: 0;
  padding: 0.65rem;
  border-top: 3px solid;
}

.price-default-field.is-company {
  background: var(--theme-company-tint);
  border-color: var(--theme-company);
}

.price-default-field.is-driver {
  background: var(--theme-driver-tint);
  border-color: var(--theme-driver);
}

.price-default-field.is-company .form-label,
.price-company-section .price-section-title {
  color: var(--theme-company-ink);
}

.price-default-field.is-driver .form-label {
  color: var(--theme-driver-ink);
}

.price-default-field .form-text {
  margin-top: 0.2rem;
  font-size: var(--ui-meta-size);
}

.price-section-note {
  margin: 0.75rem 0 0;
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
}

.company-price-table {
  border: 1px solid var(--app-border);
  border-radius: 6px;
  overflow: hidden;
}

.company-price-head,
.company-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.25rem 0.6rem;
  padding: 0.4rem 0.6rem;
}

.company-price-head {
  color: var(--bs-secondary-color);
  background: var(--app-bg);
  font-size: var(--ui-meta-size);
  font-weight: 700;
}

.company-price-row {
  border-top: 1px solid var(--app-border);
}

.company-price-row label {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-price-row.has-own-price {
  background: var(--theme-company-tint);
}

.company-price-row.is-inactive label {
  color: var(--bs-secondary-color);
  font-weight: 400;
}

.company-price-error {
  grid-column: 1 / -1;
}

.price-combo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.9rem;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--app-border);
}

.price-combo-name {
  flex: 1 1 10rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.price-combo-row form {
  margin: 0;
}

.price-combo-form {
  margin-top: 0.75rem;
}

.price-combo-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.price-combo-fields > * {
  min-width: 0;
}

.price-combo-fields .is-driver .form-label {
  color: var(--theme-driver-ink);
}

.price-combo-fields legend.form-label {
  font-size: inherit;
}

.price-combo-choice {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--ui-control-small-height);
  cursor: pointer;
}

.price-combo-choice .form-check-input {
  margin-top: 0;
}

.price-cap-note {
  color: var(--theme-outstanding-ink);
  font-size: var(--ui-meta-size);
}

.price-cap-note[hidden] {
  display: none;
}

.company-price-row .price-cap-note {
  grid-column: 3;
  grid-row: 1;
}

.price-default-field .price-cap-note {
  margin-top: 0.2rem;
}

.price-effective-date {
  margin-bottom: 0.75rem;
}

.price-effective-date .form-control {
  max-width: 12rem;
}

.price-effective-date .form-text {
  margin-top: 0.2rem;
  font-size: var(--ui-meta-size);
}

.price-last-change {
  display: inline-block;
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
  text-decoration: none;
}

.price-last-change:hover {
  text-decoration: underline;
}

.price-change-list {
  display: grid;
}

.price-change-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.2rem 0.75rem;
  padding-block: 0.4rem;
  border-bottom: 1px solid var(--app-border);
  font-size: var(--ui-meta-size);
}

.price-change-row:last-child {
  border-bottom: 0;
}

.price-change-row time,
.price-change-meta {
  color: var(--bs-secondary-color);
  font-variant-numeric: tabular-nums;
}

.price-change-subject {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* On the all-packages history page: which package (with its routes, names repeat across routes). */
.price-change-package {
  grid-column: 2 / -1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.price-change-package + .price-change-subject {
  grid-column: 2;
}

.price-change-values {
  font-variant-numeric: tabular-nums;
}

.price-change-meta,
.price-change-actions {
  grid-column: 2 / -1;
}

.price-change-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
}

.price-change-actions details[open] {
  flex-basis: 100%;
}

.price-backfill {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--app-border);
}

.price-backfill summary {
  width: fit-content;
  color: var(--bs-link-color);
  cursor: pointer;
}

.price-backfill-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.price-backfill-fields > :first-child {
  grid-column: 1 / -1;
}

.price-backfill-fields .form-text {
  font-size: var(--ui-meta-size);
}

.price-trend {
  position: relative;
  margin: 0;
}

.price-trend-chart {
  height: 16rem;
}

.is-series-1 { --series-color: var(--chart-series-1); }
.is-series-2 { --series-color: var(--chart-series-2); }
.is-series-3 { --series-color: var(--chart-series-3); }
.is-series-4 { --series-color: var(--chart-series-4); }
.is-series-5 { --series-color: var(--chart-series-5); }
.is-series-6 { --series-color: var(--chart-series-6); }
.is-series-7 { --series-color: var(--chart-series-7); }
.is-series-8 { --series-color: var(--chart-series-8); }

.price-trend-key {
  display: inline-block;
  flex-shrink: 0;
  width: 0.9rem;
  height: 2px;
  margin-right: 0.35rem;
  border-radius: 1px;
  background: var(--series-color);
  vertical-align: middle;
}

/* Rows of the ECharts tooltip (its HTML comes from price_chart.js). */
.price-trend-tip-date {
  margin-bottom: 0.2rem;
  color: var(--bs-secondary-color);
}

.price-trend-tip-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.price-trend-tip-key {
  display: inline-block;
  width: 0.9rem;
  height: 2px;
  border-radius: 1px;
}

.price-trend-tip-row span:last-child {
  color: var(--bs-secondary-color);
}

.price-trend-periods {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.5rem;
  font-size: var(--ui-meta-size);
}

.price-trend-series {
  display: grid;
  grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
  gap: 0.15rem 0.75rem;
}

.price-trend-label {
  display: flex;
  align-items: center;
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bs-secondary-color);
  font-size: inherit;
  text-align: left;
}

button.price-trend-label {
  cursor: pointer;
}

button.price-trend-label[aria-pressed="false"] {
  text-decoration: line-through;
  opacity: 0.55;
}

.price-trend-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.75rem;
  font-variant-numeric: tabular-nums;
}

.price-trend-note {
  margin: 0;
  color: var(--bs-secondary-color);
}

.price-trend-toggle {
  margin-top: 0.5rem;
}

.price-trend-toggle summary {
  width: fit-content;
  color: var(--bs-link-color);
  font-size: var(--ui-meta-size);
  cursor: pointer;
}

.price-trend-toggle .price-trend {
  margin-top: 0.5rem;
}

.price-backfill-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-top: 0.6rem;
}

.price-backfill-message {
  min-width: 0;
  scroll-margin-top: 12rem;
  color: var(--theme-general-ink);
  font-size: var(--ui-meta-size);
}

.price-backfill-message.is-error {
  color: var(--bs-danger);
}

.price-change-date-edit summary {
  width: fit-content;
  color: var(--bs-link-color);
  cursor: pointer;
}

.price-change-date-edit form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin-top: 0.3rem;
}

.price-change-date-edit .form-control {
  width: auto;
}

.price-change-date-edit small {
  color: var(--bs-secondary-color);
}

.row-order-actions {
  display: inline-flex;
  gap: 0.25rem;
}

.row-order-actions form {
  margin: 0;
}

.tour-action-with-note {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.tour-action-note {
  color: var(--bs-secondary-color);
  font-size: var(--ui-meta-size);
  line-height: 1.2;
  text-align: center;
}

.tour-state-action-form {
  width: fit-content;
  justify-self: start;
}

.tour-state-action-button {
  width: auto;
  min-width: 0;
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  font-size: calc(0.9rem - 2px);
}

.tour-action-disabled > .tour-state-action-button {
  align-self: center;
}

.tour-management-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tour-management-actions > form {
  margin: 0;
}

.tour-management-actions .btn-lg {
  font-size: calc(1rem - 2px);
}

.tour-management-actions .tour-state-action-button {
  font-size: calc(0.9rem - 2px);
}

.tour-management-actions.is-confirmed {
  flex-wrap: nowrap;
}

.tour-management-actions.is-confirmed .tour-action-disabled small {
  padding: 0.25rem 0.3rem;
  gap: 0.2rem;
  font-size: 0.64rem;
}

.tour-management-actions.is-confirmed .tour-action-disabled small strong {
  font-size: 0.58rem;
}

.btn.item-notes-toggle {
  min-height: 28px;
  padding: 0.15rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.btn.item-notes-toggle.has-note {
  color: #146c43;
  border-color: #198754;
}

.btn.item-extra-toggle {
  min-height: 28px;
  padding: 0.15rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.btn.item-extra-toggle.has-extra {
  color: #854d0e;
  border-color: #d19a21;
  background: #fff8e1;
}

.item-extra-fields {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 6rem minmax(7rem, 1fr) auto;
  align-items: end;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #e1b85b;
}

.item-extra-fields[hidden] {
  display: none;
}

.item-extra-fields .btn {
  min-height: 34px;
}

.extra-summary {
  color: #8a5200;
  font-weight: 600;
}

.extra-ledger-line {
  color: #3f6d82;
}

.extra-ledger-line strong {
  font-size: calc(1em + 1px);
  font-weight: 700;
}

.extra-ledger-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.35rem 0.45rem;
  border-left: 3px solid #7faabd;
  background: #f1f7f9;
}

.extra-ledger-action-row .settled-line {
  margin-top: 0;
  white-space: nowrap;
}

.extra-ledger-action-row .btn {
  white-space: nowrap;
}

.item-notes-dialog {
  width: min(92vw, 420px);
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgb(0 0 0 / 18%);
}

.item-notes-dialog::backdrop {
  background: rgb(0 0 0 / 30%);
}

.item-notes-dialog-head,
.item-notes-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.item-notes-dialog-head {
  margin-bottom: 0.75rem;
}

.item-notes-dialog-actions {
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-draft {
  color: #765500;
  background: #fff3cd;
}

.status-confirmed {
  color: var(--theme-company-ink);
  background: var(--theme-company-soft);
}

.status-dispatched {
  color: var(--theme-general-ink);
  background: var(--theme-general-soft);
}

.status-paid {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-soft);
}

.status-settled {
  color: var(--theme-driver-ink);
  background: var(--theme-driver-soft);
}

.form-check-input:checked {
  border-color: var(--theme-general);
  background-color: var(--theme-general);
}

.form-check-input:focus {
  border-color: var(--theme-general-soft);
  box-shadow: 0 0 0 0.25rem rgba(var(--theme-general-rgb), 0.2);
}

.status-cancelled {
  color: #842029;
  background: #f8d7da;
}

.status-voided {
  color: #5f6872;
  background: #e9ecef;
}

.form-control,
.form-select {
  min-height: 38px;
}

.btn {
  min-height: var(--ui-control-height);
}

.btn-sm {
  min-height: var(--ui-control-small-height);
}

.form-control-lg,
.form-select-lg,
.btn-lg {
  min-height: 40px;
  padding: 0.4rem 0.65rem;
  font-size: 1rem;
}

@media (min-width: 576px) and (max-width: 1099.98px) {
  .tour-table-header,
  .tour-table-row {
    grid-template-columns: 3.5rem minmax(0, 2.268fr) minmax(4.25rem, 0.595fr) repeat(3, minmax(5.5rem, 1fr));
  }

  .tour-table-status {
    padding-right: 0.2rem;
    padding-left: 0.2rem;
    font-size: calc(1rem - 1px);
  }

  .report-table-wrap {
    overflow-x: hidden;
  }

  .report-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .ledger-filter-panel {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.55rem;
  }

  .ledger-month-shortcuts {
    flex: 0 0 auto;
    margin-bottom: 0;
  }

  .ledger-month-shortcuts .btn {
    padding-right: 0.45rem;
    padding-left: 0.45rem;
  }

  .ledger-range-filter {
    flex: 0 1 auto;
    grid-template-columns: minmax(15rem, 280px) auto;
    gap: 0.4rem;
    margin-left: 0.4rem;
  }
}

@media (max-width: 575.98px) {
  .price-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }

  /* Price form: company price on its own row, the two driver prices side by side. */
  .price-default-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-default-field:first-child {
    grid-column: 1 / -1;
  }

  .price-combo-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-price-head,
  .company-price-row {
    grid-template-columns: minmax(0, 1fr) 8.5rem;
  }

  .company-price-head > span:last-child {
    display: none;
  }

  .company-price-row .price-cap-note {
    grid-column: 1 / -1;
    grid-row: auto;
    text-align: right;
  }

  .price-change-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .price-change-meta,
  .price-change-actions,
  .price-change-package,
  .price-change-package + .price-change-subject {
    grid-column: 1;
  }

  .price-backfill-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .price-trend-series {
    grid-template-columns: minmax(0, 1fr);
  }

  .achievement-band {
    padding: 0.65rem 0.5rem;
  }

  .achievement-matrix-row {
    grid-template-columns: 2.5rem repeat(4, minmax(0, 1fr));
  }

  .achievement-matrix-head {
    font-size: 0.66rem;
  }

  .achievement-value > strong {
    font-size: 0.98rem;
  }

  .brand-name {
    font-size: 1rem;
  }

  .navbar-collapse {
    padding-top: 0.5rem;
  }

  .tour-day-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .tour-day-nav .btn {
    min-width: 0;
    padding-inline: 0.25rem;
  }

  .time-shortcut,
  .time-shortcut.time-shortcut-current {
    width: 100%;
    flex-basis: auto;
  }

  .tour-range-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .tour-status-filters {
    flex: 0 0 auto;
  }

  .tour-status-filters .btn {
    min-width: 3.25rem;
    padding: 0.12rem 0.2rem;
  }

  .pagination-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-kpis {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

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

  .unsettled-month-row {
    min-height: 36px;
    padding-right: 0.4rem;
    padding-left: 0.4rem;
  }

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

  .summary-card {
    min-height: 88px;
    padding: 0.65rem 0.7rem;
  }

  .summary-card strong {
    font-size: 1.2rem;
  }

  .dashboard-kpi-group-dispatch .summary-card strong {
    font-size: calc(1.2rem - 1px);
  }

  .dashboard-kpi-group-month .summary-card,
  .dashboard-kpi-group-total .summary-card {
    min-height: 80px;
  }

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

  .report-filter .range-picker-field,
  .report-filter .report-filter-field {
    grid-column: span 2;
  }

  .report-table-wrap {
    overflow-x: hidden;
  }

  .report-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 0.72rem;
  }

  .report-table td,
  .report-table th {
    padding: 0.42rem 0.2rem;
    line-height: 1.25;
  }

  .report-table-summary th:first-child {
    width: 18%;
  }

  .report-table-summary th:nth-child(2),
  .report-table-summary th:nth-child(3) {
    width: 10%;
  }

  .report-table-summary th:nth-child(4) {
    width: 18%;
  }

  .report-table-summary th:nth-child(5) {
    width: 20%;
  }

  .report-table-summary th:nth-child(6) {
    width: 24%;
  }

  .report-table td:first-child,
  .report-table th:first-child {
    white-space: normal;
  }

  .report-table td:not(:first-child),
  .report-table th:not(:first-child) {
    white-space: nowrap;
  }

  .report-date-full {
    display: none;
  }

  .report-date-short {
    display: inline;
  }

  .ledger-range-filter {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .ledger-month-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ledger-table-header,
  .ledger-table-row {
    grid-template-columns: 1.2rem minmax(5rem, 1.2fr) repeat(4, minmax(0, 1fr));
    column-gap: 0.12rem;
  }

  .driver-ledger-table .ledger-table-header,
  .driver-ledger-table .ledger-table-row {
    grid-template-columns: 1.2rem minmax(6.5rem, 1.5fr) minmax(2.2rem, 0.45fr) repeat(2, minmax(0, 1fr));
    column-gap: 0.12rem;
  }

  .company-ledger-table .ledger-table-header,
  .company-ledger-table .ledger-table-row {
    grid-template-columns: 1.2rem minmax(6.5rem, 1.65fr) minmax(2.2rem, 0.5fr) repeat(2, minmax(0, 1fr));
  }

  .ledger-entity-name.entity-name-with-badge {
    gap: 0.15rem;
  }

  .ledger-entity-name .entity-type-badge {
    min-height: 16px;
    padding-inline: 0.15rem;
    font-size: 0.58rem;
  }

  .ledger-table-header {
    padding: 0.36rem 0.45rem;
    font-size: 0.66rem;
  }

  .ledger-table-row {
    min-height: 40px;
    padding: 0.38rem 0.45rem;
    font-size: 0.72rem;
  }

  .ledger-extra-value {
    font-size: 0.62rem;
  }

  .ledger-extra-value.ledger-extra-outstanding {
    font-size: 0.66rem;
  }

  .tour-item-card {
    padding-bottom: 0.45rem;
  }

  .tour-item-core {
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: 0.5rem;
  }

  .tour-item-primary-fields {
    gap: 0.5rem;
    margin-bottom: 0.35rem;
  }

  .tour-item-core .form-label {
    font-size: 0.82rem;
  }

  .tour-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 3fr) minmax(0, 5fr);
    gap: 0.5rem;
  }

  .tour-meta-grid > * {
    width: auto;
    padding: 0;
  }

  .tour-meta-field {
    display: block;
    min-width: 0;
  }

  .tour-meta-field .form-label {
    margin: 0 0 0.25rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .tour-meta-field .form-control,
  .tour-meta-field .form-select {
    min-width: 0;
    padding-right: 1.65rem;
    padding-left: 0.45rem;
    font-size: 0.9rem;
  }

  .tour-meta-date .form-control {
    padding-right: 0.3rem;
  }

  .tour-item-fields {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.5fr);
    gap: 0.35rem;
  }

  .tour-item-card .tour-item-fields .form-label {
    min-height: 2.8em;
    display: flex;
    align-items: end;
    font-size: var(--ui-meta-size);
    white-space: normal;
  }

  .tour-item-core > .item-extra-fields,
  .tour-item-core > .item-price-cap-note {
    grid-column: 1 / -1;
  }

  .item-extra-fields {
    grid-template-columns: minmax(5.5rem, 1fr) 5rem minmax(6rem, 1fr) auto;
    gap: 0.35rem;
  }

  .tour-item-card .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .data-row {
    min-height: 42px;
    padding: 0.34rem 0.55rem;
    align-items: center;
    flex-direction: row;
    gap: 0.4rem;
  }

  .data-row > :first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .data-row > .d-flex {
    width: auto;
    flex: 0 0 auto;
  }

  .data-row > .d-flex > * {
    flex: 0 0 auto;
  }

  .data-row .data-row-actions {
    gap: 0.2rem !important;
  }

  .data-row .data-row-actions .btn {
    min-height: 30px;
    padding: 0.18rem 0.35rem;
    font-size: 0.7rem;
  }

  .driver-data-row {
    min-height: 42px;
    padding: 0.34rem 0.55rem;
    align-items: center;
    flex-direction: row;
    gap: 0.4rem;
  }

  .driver-row-main {
    gap: 0.35rem;
  }

  .driver-row-info {
    gap: 0.2rem 0.3rem;
  }

  .master-data-name {
    max-width: 5rem;
    overflow: hidden;
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .package-data-name {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: max-content;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  .package-data-info {
    flex: 1 1 auto;
    overflow: visible;
  }

  .master-data-sequence {
    width: 1.1rem;
    flex-basis: 1.1rem;
    font-size: 0.7rem;
  }

  .driver-data-row .driver-type-badge,
  .driver-data-row .driver-history-badge,
  .master-data-name-line .driver-history-badge {
    min-height: 18px;
    padding: 0.08rem 0.25rem;
    font-size: 0.62rem;
  }

  .driver-data-row .data-row-actions {
    width: auto;
    flex: 0 0 auto;
    gap: 0.2rem !important;
  }

  .driver-data-row .data-row-actions > * {
    flex: 0 0 auto;
  }

  .driver-data-row .data-row-actions .btn {
    min-height: 30px;
    padding: 0.18rem 0.35rem;
    font-size: 0.7rem;
  }

  .tour-detail-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .extra-charge-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .extra-charge-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .tour-detail-side {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.1rem;
  }

  .today-tours-section .dashboard-tour-row {
    min-height: 40px;
    padding-block: 0.4rem;
  }

  .tour-table-header,
  .tour-table-row {
    grid-template-columns: 2.65rem minmax(0, 1fr) 2.4rem 3.3rem 3.3rem 3.85rem;
    gap: 0.08rem;
  }

  .tour-table-header {
    padding: 0.42rem 0.4rem;
    font-size: 0.68rem;
    line-height: 1.15;
  }

  .tour-table-row {
    min-height: 46px;
    padding: 0.45rem 0.32rem;
    font-size: 0.72rem;
  }

  .dashboard-tour-table .tour-table-header,
  .dashboard-tour-table .tour-table-row {
    grid-template-columns: 1.1rem minmax(0, 1.6fr) minmax(0, 1fr) 2.6rem;
  }

  .tour-table-info strong {
    font-size: 0.75rem;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .tour-table-date {
    font-size: 0.72rem;
  }

  .tour-table-info .entity-name-with-badge {
    max-width: 100%;
    flex-wrap: wrap;
    vertical-align: middle;
  }

  .tour-table-info .entity-name-text {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .tour-table-info small {
    font-size: 0.68rem;
  }

  .tour-table-money,
  .tour-table-status {
    font-size: 0.7rem;
  }

  .extra-ledger-action-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .extra-ledger-action-row form,
  .extra-ledger-action-row .btn {
    width: 100%;
  }

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

  .ledger-finance-row {
    grid-template-columns: minmax(5.6rem, 1.15fr) repeat(3, minmax(0, 1fr));
  }

  .ledger-finance-company .ledger-finance-row {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr) repeat(2, minmax(0, 1fr));
  }

  .ledger-finance-row > * {
    padding-inline: 0.18rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ledger-finance-row strong {
    font-size: 0.8rem;
  }

  .ledger-finance-row strong:first-child {
    font-size: 0.8rem;
  }

  .ledger-finance-composition {
    display: block;
    margin-top: 0.08rem;
    font-size: 0.58rem;
    line-height: 1.15;
  }

  .ledger-entry-main {
    gap: 0.2rem;
  }

  .ledger-entry-top {
    align-items: center;
  }

  .ledger-entry-link,
  .ledger-balance {
    width: 100%;
  }

  .ledger-balance {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem 0.65rem;
    flex-wrap: wrap;
    text-align: right;
  }

  .statement-export-actions {
    flex-wrap: wrap;
  }
}
