:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #17211d;
  --text: #17211d;
  --muted: #63706b;
  --line: #d9e0dd;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b42318;
  --warn: #ad5b00;
  --soft: #e8f3f1;
  --online-table-grid-line: #1f2937;
  --online-table-row-bg: #ffffff;
  --driver-paid-row-bg: #fff1a6;
  --shadow: 0 8px 24px rgba(21, 37, 32, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.driver-body {
  --driver-topbar-height: 58px;
  --driver-tabs-height: 48px;
  --brand-soft: var(--soft);
  --field-bg: #ffffff;
  --field-line: var(--line);
  --field-placeholder: #817766;
  --field-focus: rgba(15, 122, 95, 0.2);
  --on-brand: #ffffff;
  --fee-bg: #f8edcf;
  --upload-bg: #fff4c7;
  --upload-line: #c99a2e;
  --upload-text: #60410a;
  --topbar-bg: rgba(255, 250, 240, 0.96);
  --tabs-bg: rgba(241, 232, 214, 0.96);
  --error-bg: #ffebe3;
}

.driver-body.driver-theme-day,
.driver-body:not(.driver-theme-night) {
  color-scheme: light;
  --bg: #f1e8d6;
  --panel: #fffdf8;
  --ink: #121b18;
  --text: #121b18;
  --muted: #635847;
  --line: #d5c4a4;
  --brand: #0f7a5f;
  --brand-dark: #0b5b46;
  --danger: #a8341f;
  --warn: #8f4a00;
  --soft: #e5f3ec;
  --brand-soft: #e5f3ec;
  --shadow: 0 12px 34px rgba(80, 58, 20, 0.1);
  --field-bg: #ffffff;
  --field-line: #bda473;
  --field-placeholder: #817766;
  --field-focus: rgba(15, 122, 95, 0.2);
  --on-brand: #ffffff;
  --fee-bg: #f8edcf;
  --upload-bg: #fff4c7;
  --upload-line: #c99a2e;
  --upload-text: #60410a;
  --topbar-bg: rgba(255, 250, 240, 0.96);
  --tabs-bg: rgba(241, 232, 214, 0.96);
  --error-bg: #ffebe3;
}

.driver-body.driver-theme-night {
  color-scheme: dark;
  --bg: #001233;
  --panel: #071a36;
  --ink: #eef5ff;
  --text: #eef5ff;
  --muted: #c7d3e4;
  --line: #5c677d;
  --brand: #6f9ed8;
  --brand-dark: #d8e8ff;
  --danger: #fb7185;
  --warn: #d8c37a;
  --soft: #0f2f5c;
  --brand-soft: #102b51;
  --shadow: 0 18px 42px rgba(0, 8, 24, 0.36);
  --field-bg: #0d274c;
  --field-line: #62728d;
  --field-placeholder: #b9c7d8;
  --field-focus: rgba(111, 158, 216, 0.28);
  --on-brand: #001233;
  --fee-bg: #132f55;
  --upload-bg: #102b51;
  --upload-line: #7d8597;
  --upload-text: #dbeafe;
  --topbar-bg: rgba(0, 18, 51, 0.96);
  --tabs-bg: rgba(0, 24, 69, 0.96);
  --error-bg: #4b2231;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.driver-body .topbar {
  background: var(--topbar-bg);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.data-source-status {
  max-width: 1180px;
  margin: -4px auto 12px;
  padding: 8px 18px;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  border: 1px solid #badbc8;
  border-radius: 8px;
  background: #f3fbf4;
  color: #214532;
  font-size: 12px;
  line-height: 1.35;
}

.data-source-status[hidden] {
  display: none;
}

.data-source-status-main,
.data-source-status-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.data-source-status-main strong {
  color: inherit;
}

.data-source-status-main span,
.data-source-status-detail span {
  min-width: 0;
}

.data-source-status-detail {
  justify-content: flex-end;
  color: rgba(33, 69, 50, 0.82);
}

.data-source-status-badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: #d9f2df;
  color: #235d37;
  font-weight: 800;
}

.data-source-status-source {
  border-color: #bfd2df;
  background: #f3f7fb;
  color: #233f58;
}

.data-source-status-source .data-source-status-badge {
  background: #dcebf5;
  color: #244a68;
}

.data-source-status-warning {
  border-color: #e5c26d;
  background: #fff8e5;
  color: #604612;
}

.data-source-status-warning .data-source-status-badge {
  background: #f4d77d;
  color: #4d3608;
}

.brand-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 190px;
  max-width: 38vw;
  height: auto;
  display: block;
}

.brand-title strong {
  font-size: 18px;
}

.brand-title span {
  color: var(--muted);
  font-size: 13px;
}

.driver-clock {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--brand-dark);
  padding: 8px 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.driver-clock-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.driver-clock-time {
  color: var(--brand-dark);
  font-size: 19px;
  font-weight: 820;
  line-height: 1.05;
  white-space: nowrap;
}

.language-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.language-btn {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}

.language-btn.active {
  border-color: var(--brand);
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.driver-body.driver-theme-night .language-btn {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(15, 28, 47, 0.86);
  color: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.driver-body.driver-theme-night .language-btn.active {
  border-color: rgba(45, 212, 191, 0.72);
  background: rgba(45, 212, 191, 0.16);
  color: #99f6e4;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 18px 44px;
}

body.admin-body:not(.ledger-body) .topbar-inner,
body.admin-body:not(.ledger-body) .page {
  width: min(100%, calc(100vw - 24px));
  max-width: none;
}

.ops-manual-page {
  padding-bottom: 56px;
}

.ops-manual-hero {
  background: linear-gradient(135deg, #f8fafc 0%, #eef7f5 100%);
}

.ops-manual-hero h1 {
  margin: 6px 0 10px;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
}

.ops-manual-hero p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.ops-manual-kicker {
  color: var(--brand) !important;
  font-size: 14px !important;
  font-weight: 900;
}

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

.ops-manual-card {
  height: 100%;
}

.ops-manual-list,
.ops-manual-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.9;
}

.danger-list li::marker {
  color: #b91c1c;
}

.ops-manual-table-wrap {
  overflow-x: auto;
}

.ops-manual-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: var(--ink);
}

.ops-manual-table th,
.ops-manual-table td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.ops-manual-table th {
  background: #e7f3f1;
  color: #0f5750;
  font-weight: 900;
}

.ops-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ops-command-grid code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid rgba(20, 105, 97, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbfa;
  color: #0f5750;
  font-size: 13px;
  line-height: 1.45;
}

.driver-body .topbar-inner,
.driver-body .page {
  max-width: min(1560px, calc(100vw - 32px));
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 430px);
}

.driver-page {
  max-width: min(1560px, calc(100vw - 32px));
}

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.driver-login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 540px);
  min-height: min(760px, calc(100vh - 128px));
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #101821;
  box-shadow: 0 24px 64px rgba(16, 24, 33, 0.16);
  margin-bottom: 18px;
}

.driver-login-visual {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  color: #fff;
}

.driver-login-visual > img,
.driver-login-shade {
  position: absolute;
  inset: 0;
}

.driver-login-visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% 42%;
}

.driver-login-shade {
  background:
    linear-gradient(90deg, rgba(16, 24, 33, 0.18), rgba(16, 24, 33, 0.88)),
    linear-gradient(0deg, rgba(16, 24, 33, 0.78), rgba(16, 24, 33, 0.04) 52%);
}

.driver-login-brand-card {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 28px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 9px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px rgba(9, 18, 28, 0.18);
  backdrop-filter: blur(14px);
}

.driver-login-brand-card img {
  width: 176px;
  max-width: 34vw;
  height: auto;
}

.driver-login-brand-card span {
  color: #14355a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.driver-login-copy {
  position: absolute;
  right: auto;
  bottom: 26px;
  left: 28px;
  z-index: 1;
  max-width: min(620px, calc(100% - 56px));
  text-align: left;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.driver-login-copy > span {
  display: block;
  margin-bottom: 8px;
  color: #d6a95e;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.driver-login-copy h1 {
  margin: 0;
  font-size: clamp(34px, 4.5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.driver-login-copy p {
  max-width: 560px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.72;
}

.driver-login-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.driver-login-stats strong {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  backdrop-filter: blur(10px);
}

.driver-login-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
  background:
    radial-gradient(circle at 100% 0%, rgba(28, 139, 143, 0.1), transparent 34%),
    #fff;
}

.driver-login-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.driver-login-topline span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 9px;
  padding: 10px 12px;
  background: #eaf3f4;
  color: var(--brand-dark);
  font-weight: 900;
}

.driver-login-topline span::before {
  content: "✓";
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
}

.driver-login-topline small {
  max-width: 210px;
  color: var(--muted);
  line-height: 1.45;
  text-align: right;
}

.driver-login-content .panel-header {
  display: block;
  border-bottom: 0;
  padding: 0 0 18px;
}

.driver-login-content .panel-header h2 {
  margin-bottom: 0;
  color: #15212f;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
}

.driver-login-content .panel-body {
  padding: 0;
}

.driver-login-content .grid.two {
  grid-template-columns: 1fr;
}

/* driver-login-pin-gap-20260806a: keep the password label off the phone box. */
.driver-login-content #loginPinLabel {
  margin-top: 10px;
}

.driver-login-content input {
  min-height: 50px;
  border-radius: 8px;
  padding: 12px 14px;
}

.driver-login-content .account-sms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.driver-login-content .account-sms-row .btn {
  min-width: 118px;
  min-height: 50px;
  white-space: nowrap;
}

.driver-account-flow {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(20, 128, 118, 0.22);
  border-radius: 10px;
  background: rgba(20, 128, 118, 0.06);
}

.driver-account-flow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.driver-account-flow-header h3 {
  margin: 0;
  font-size: 20px;
  color: var(--primary-700);
}

.driver-account-flow-identity {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 700;
}

.account-flow-actions {
  margin-top: 10px;
}

.driver-login-content .driver-kind-option {
  border-radius: 9px;
}

.driver-login-content .driver-kind-field {
  margin-top: 14px;
}

.driver-login-content .driver-kind-field .field-label {
  margin-bottom: 8px;
  line-height: 1.15;
}

.driver-login-content .driver-kind-selector {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.driver-login-content .driver-kind-option {
  display: grid;
  min-height: 58px;
  padding: 9px 8px;
  place-items: center;
  text-align: center;
}

.driver-login-content .driver-kind-option strong {
  margin: 0;
  font-size: clamp(17px, 5vw, 20px);
  line-height: 1.1;
}

.driver-login-panel .button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.driver-login-panel .button-row .btn {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 800;
}

.driver-login-panel #driverForgotPinBtn {
  grid-column: 1 / -1;
}

.driver-login-panel .button-row .driver-app-download-btn,
.driver-login-panel .button-row .driver-ios-download-btn {
  color: #fff;
}

.driver-login-panel .button-row .driver-app-download-btn {
  background: #0b5fae;
  border-color: #0b5fae;
  position: relative;
  overflow: visible;
}

.driver-login-panel .button-row .driver-ios-download-btn {
  background: #0f766e;
  border-color: #0f766e;
}

.driver-app-update-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  box-shadow: 0 6px 14px rgba(217, 119, 6, 0.28);
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.app-download-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(11, 95, 174, 0.14), transparent 32rem),
    linear-gradient(180deg, #f7fbff 0%, #eef6fb 100%);
}

.app-download-page {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-download-card {
  width: 100%;
  padding: 28px 22px;
  border: 1px solid rgba(11, 95, 174, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 52px rgba(15, 60, 86, 0.14);
  text-align: center;
}

.app-download-icon {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15, 60, 86, 0.14);
}

.app-download-card h1 {
  margin: 16px 0 6px;
  font-size: 24px;
  color: #102333;
}

.app-download-subtitle,
.app-download-hint,
.app-download-url {
  color: #5c6d74;
}

.app-download-subtitle {
  margin: 0 0 18px;
}

.app-download-warning {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7e6;
  color: #805200;
  text-align: left;
  display: grid;
  gap: 4px;
}

.app-download-steps {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  text-align: left;
}

.app-download-steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(11, 95, 174, 0.1);
  border-radius: 12px;
  background: #f7fbff;
}

.app-download-badge {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #0b5fae;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.app-download-steps strong,
.app-download-steps span {
  display: block;
}

.app-download-steps strong {
  color: #102333;
}

.app-download-steps span {
  margin-top: 3px;
  color: #5c6d74;
  font-size: 13px;
  line-height: 1.55;
}

.app-download-primary {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  font-size: 17px;
}

.app-download-hint {
  margin: 14px 0 12px;
  font-size: 14px;
  line-height: 1.7;
}

.app-download-hint code {
  color: #0b5fae;
}

.app-download-copy {
  width: 100%;
}

.app-download-url {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.logged-driver-bar {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-dark);
}

.logged-driver-bar strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.logged-driver-bar small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.driver-section-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.driver-body.driver-form-locked {
  padding-top: calc(var(--driver-topbar-height) + var(--driver-tabs-height) + 1px);
}

.driver-body.driver-form-locked .topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  min-height: var(--driver-topbar-height);
}

.driver-body.driver-form-locked .topbar-inner {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) 94px;
  align-items: center;
  max-width: min(1560px, calc(100vw - 20px));
  min-height: var(--driver-topbar-height);
  padding: 8px 0;
  gap: 8px;
}

.driver-body.driver-form-locked .brand-block {
  display: contents;
}

.driver-body.driver-form-locked .brand-logo {
  grid-column: 1;
  width: 94px;
  height: 42px;
  max-width: none;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  object-fit: contain;
  padding: 5px 7px;
  box-shadow: none;
}

.driver-body.driver-theme-night .brand-logo {
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.18));
}

.driver-body.driver-theme-night.driver-form-locked .brand-logo {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.driver-body.driver-form-locked .brand-title {
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.driver-body.driver-form-locked .brand-title > span {
  display: none;
}

.driver-body.driver-form-locked .brand-title strong {
  display: grid;
  gap: 1px;
  max-width: 100%;
  max-height: 42px;
  overflow: hidden;
  color: var(--brand-dark);
  font-size: var(--activity-font-size, 18px);
  font-weight: 820;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.driver-body.driver-form-locked .activity-line {
  display: block;
  justify-self: center;
  max-width: 100%;
  width: fit-content;
}

.driver-body.driver-form-locked .activity-title.two-line .activity-line:first-child {
  font-size: 0.94em;
  font-weight: 800;
}

.driver-body.driver-form-locked .activity-title.two-line .activity-line:last-child {
  font-size: 1em;
  font-weight: 840;
}

.driver-body.driver-form-locked .driver-clock {
  grid-column: 3;
  width: 94px;
  height: 42px;
  min-width: 0;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  grid-template-rows: min-content min-content;
  align-content: center;
  align-items: center;
  justify-items: stretch;
  column-gap: 7px;
  row-gap: 1px;
  border-color: #cdb57f;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fff9ec 100%);
  padding: 5px 9px 5px 10px;
  overflow: hidden;
}

.driver-body.driver-theme-night.driver-form-locked .driver-clock {
  border-color: #64748b;
  background: #152235;
}

.driver-body.driver-form-locked .driver-clock::before {
  content: "";
  grid-row: 1 / 3;
  grid-column: 1;
  align-self: center;
  width: 3px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand);
}

.driver-body.driver-form-locked .driver-clock-date {
  grid-row: 1;
  grid-column: 2;
  justify-self: end;
  min-width: 0;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.05;
  white-space: nowrap;
}

.driver-body.driver-form-locked .driver-clock-time {
  grid-row: 2;
  grid-column: 2;
  justify-self: end;
  min-width: 0;
  margin-top: 1px;
  font-size: 18px;
  font-weight: 840;
  line-height: 1;
  letter-spacing: 0;
}

.driver-body.driver-form-locked .driver-section-tabs {
  position: fixed;
  top: calc(var(--driver-topbar-height) + 1px);
  right: 0;
  left: 0;
  z-index: 29;
  max-width: min(1560px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 6px 0 8px;
  background: var(--tabs-bg);
  backdrop-filter: blur(10px);
}

.driver-section-tab {
  position: relative;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.driver-body.driver-form-locked .driver-section-tab {
  min-height: 34px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 740;
}

.driver-section-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand, #fff);
}

.driver-section-tab.attention::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.driver-section-tab.attention:not(.active) {
  color: var(--brand-dark);
  border-color: rgba(15, 118, 110, 0.32);
  background: var(--soft);
}

.driver-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  border-radius: 999px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}

.driver-section-tab .driver-tab-badge {
  position: absolute;
  top: 3px;
  right: 4px;
  margin-left: 0;
}

.driver-section-tab.returned-alert::after {
  display: none;
}

.driver-returned-reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff7ed, #fff1f2);
  color: #7f1d1d;
  box-shadow: 0 10px 22px rgba(127, 29, 29, 0.08);
}

.driver-returned-reminder[hidden] {
  display: none;
}

.driver-returned-reminder strong,
.driver-returned-reminder span {
  display: block;
}

.driver-returned-reminder strong {
  font-size: 15px;
  font-weight: 850;
}

.driver-returned-reminder span {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: #9f1239;
}

.driver-returned-reminder .btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding-inline: 12px;
}

.driver-form-locked .pin-field {
  display: none;
}

.hero-body {
  padding: 18px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.admin-tabs {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.admin-tab {
  flex: 1;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.admin-tab.active {
  border-color: #b7d8d2;
  background: var(--brand);
  color: #fff;
}

.admin-tab-panel {
  margin-top: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.admin-sidebar {
  position: sticky;
  top: 12px;
  z-index: 7;
  min-width: 0;
}

.admin-sidebar-card {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.admin-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-sidebar-header strong,
.admin-sidebar-action strong {
  display: block;
  color: var(--ink);
}

.admin-sidebar-header .hint,
.admin-sidebar-action span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-sidebar-action {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.admin-sidebar-action.active {
  border-color: var(--brand);
  background: var(--soft);
}

.admin-main {
  min-width: 0;
}

.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.fee-section-hint {
  margin: 0 0 10px;
}

.required::after {
  content: " *";
  color: var(--danger);
}

.field.field-error input,
.field.field-error select,
.field.field-error textarea,
.field.field-error .calendar-input {
  border-color: var(--danger);
  background: var(--error-bg);
}

.field.field-error input:focus,
.field.field-error select:focus,
.field.field-error textarea:focus {
  outline-color: rgba(180, 35, 24, 0.18);
  border-color: var(--danger);
}

.field-message {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.field-error {
  scroll-margin-top: 92px;
}

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

.project-gate-card {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(224, 247, 242, 0.96), rgba(239, 253, 250, 0.96));
  color: var(--brand-dark);
}

.project-gate-card strong,
.project-gate-card span {
  display: block;
}

.project-gate-card strong {
  font-size: 15px;
  font-weight: 850;
}

.project-gate-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.driver-section-tab.driver-section-tab-locked,
.driver-section-tab:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.75);
}

.driver-body.driver-form-locked .field-error {
  scroll-margin-top: calc(var(--driver-topbar-height) + var(--driver-tabs-height) + 14px);
}

.driver-body.driver-form-locked .language-switch,
.driver-body.driver-form-locked #tripForm .panel-header .hint,
.driver-body.driver-form-locked #tripForm .receipt-header .hint,
.driver-body.driver-form-locked #tripForm .field > .hint,
.driver-body.driver-form-locked #tripForm > .panel-body > .hint,
.driver-body.driver-form-locked #tripForm .hint-action,
.driver-body.driver-form-locked #tripForm .address-match-status,
.driver-body.driver-form-locked #tripForm .invoice-info-toggle small,
.driver-body.driver-form-locked #mealSignupPanel .panel-header .hint {
  display: none !important;
}

.driver-body.driver-form-locked #tripForm .driver-identity-grid,
.driver-body.driver-form-locked #tripForm .pin-field,
.driver-body.driver-form-locked #tripForm .overseas-driver-field {
  display: none;
}

.driver-body.driver-form-locked .brand-title > span,
.driver-body.driver-form-locked .logged-driver-bar small {
  display: none;
}

.driver-body.driver-form-locked .logged-driver-bar {
  display: none !important;
}

.driver-body.driver-form-locked .logged-driver-bar {
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #fff;
}

.driver-body.driver-form-locked .logged-driver-bar > div {
  min-width: 0;
}

.driver-body.driver-form-locked .logged-driver-bar span {
  font-size: 12px;
}

.driver-body.driver-form-locked .logged-driver-bar strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-body.driver-form-locked .logged-driver-bar .btn {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
  width: auto;
}

.driver-body.driver-form-locked #tripForm .field > label:not(.check-row):not(.file-picker-label),
.driver-body.driver-form-locked #tripForm .other-fee-section > label,
.driver-body.driver-form-locked #tripForm .itinerary-field > label,
.driver-body.driver-form-locked #tripForm .image-upload-field > label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  width: fit-content;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.1;
}

.driver-body.driver-form-locked #tripForm .field > label:not(.check-row):not(.file-picker-label)::before,
.driver-body.driver-form-locked #tripForm .other-fee-section > label::before,
.driver-body.driver-form-locked #tripForm .itinerary-field > label::before,
.driver-body.driver-form-locked #tripForm .image-upload-field > label::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: var(--brand);
}

.driver-body.driver-form-locked #tripForm .required::after {
  margin-left: 0;
  color: var(--danger);
  font-size: 15px;
  font-weight: 900;
}

.driver-body.driver-form-locked #tripForm input:not([type="file"]):not([type="hidden"]):not([type="checkbox"]),
.driver-body.driver-form-locked #tripForm select,
.driver-body.driver-form-locked #tripForm textarea,
.driver-body.driver-form-locked #tripForm .calendar-input {
  min-height: 38px;
  height: 38px;
  border-color: var(--field-line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--ink);
  padding: 6px 11px;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.15;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.driver-body.driver-form-locked #tripForm textarea {
  resize: none;
  overflow: hidden;
}

.driver-body.driver-form-locked #tripForm input::placeholder,
.driver-body.driver-form-locked #tripForm textarea::placeholder {
  color: var(--field-placeholder);
  font-weight: 560;
  opacity: 1;
}

.driver-body.driver-form-locked #tripForm .fixed-shuttle-panel {
  margin-top: 2px;
}

.driver-body.driver-form-locked #tripForm .fixed-shuttle-toggle,
.driver-body.driver-form-locked #tripForm .fixed-shuttle-options,
.driver-body.driver-form-locked #tripForm .fixed-shuttle-extra > summary {
  min-height: 38px;
  border-radius: 8px;
}

.driver-body.driver-form-locked #tripForm .fixed-shuttle-toggle small,
.driver-body.driver-form-locked #tripForm .fixed-shuttle-extra small {
  font-size: 11px;
}

.driver-body.driver-form-locked #tripForm .fixed-shuttle-options input {
  min-height: 34px;
  height: 34px;
}

.driver-body.driver-form-locked #tripForm .calendar-input {
  padding: 6px 11px;
}

.driver-body.driver-form-locked #tripForm .calendar-input em {
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 850;
}

.driver-body.driver-form-locked #tripForm button,
.driver-body.driver-form-locked #tripForm .btn,
.driver-body.driver-form-locked #tripForm .file-picker-label,
.driver-body.driver-form-locked #tripForm .quick-date-btn,
.driver-body.driver-form-locked #tripForm .calendar-day {
  min-height: 38px;
  height: 38px;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 15.5px;
  line-height: 1.1;
}

.driver-body.driver-form-locked #tripForm [data-file-button-for="images"],
.driver-body.driver-form-locked #tripForm [data-file-button-for="expenseImages"] {
  width: min(220px, 100%) !important;
  max-width: 100%;
  justify-self: start !important;
  justify-content: space-between;
  padding-right: 14px;
}

.driver-body.driver-project-pending #tripForm .panel-body > :not(.errors):not(.notice):not(.project-gate-card):not(.project-picker-row) {
  opacity: 0.34;
  filter: grayscale(0.88);
  pointer-events: none;
  user-select: none;
}

.driver-body.driver-project-pending #tripForm .project-picker-row > .field:not(.project-picker-field) {
  opacity: 0.34;
  filter: grayscale(0.88);
  pointer-events: none;
  user-select: none;
}

.driver-body.driver-project-pending #tripForm .project-picker-field {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.32);
  border-radius: 10px;
  background: rgba(236, 253, 245, 0.82);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.08);
}

.driver-body.driver-theme-night.driver-project-pending #tripForm .project-gate-card {
  border-color: rgba(45, 212, 191, 0.32);
  background: linear-gradient(180deg, rgba(19, 78, 74, 0.88), rgba(15, 45, 59, 0.92));
}

.driver-body.driver-theme-night.driver-project-pending #tripForm .project-gate-card span {
  color: rgba(226, 244, 241, 0.76);
}

.driver-body.driver-theme-night.driver-project-pending #tripForm .project-picker-field {
  border-color: rgba(45, 212, 191, 0.38);
  background: rgba(15, 45, 59, 0.9);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}

.driver-body input,
.driver-body select,
.driver-body textarea,
.driver-body .calendar-input {
  border-color: var(--field-line);
  background: var(--field-bg);
  color: var(--ink);
}

.driver-body input::placeholder,
.driver-body textarea::placeholder {
  color: var(--field-placeholder);
  opacity: 1;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.check-row input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.check-row.compact {
  margin-top: -2px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.qr-label-input {
  min-height: 70px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--brand);
}

.driver-body input:focus,
.driver-body select:focus,
.driver-body textarea:focus {
  outline-color: var(--field-focus);
}

.plate-row,
.time-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
}

.time-row {
  grid-template-columns: 1fr 1fr;
}

.date-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-date-btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--brand-dark);
  padding: 6px 12px;
  cursor: pointer;
}

.quick-date-btn:hover {
  border-color: var(--brand);
  background: var(--soft);
}

.calendar-more-btn {
  border-color: var(--brand);
  background: var(--soft);
  font-weight: 700;
}

.quick-date-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hint-action {
  display: inline;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.hint-action:hover {
  text-decoration: underline;
}

.time-safety {
  margin: -2px 0 14px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--soft);
}

.calendar-picker {
  position: relative;
}

.calendar-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--ink);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.calendar-input em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.calendar-popover {
  position: static;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  margin-top: 8px;
  padding: 12px;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.calendar-toolbar select {
  min-height: 38px;
  padding: 6px 8px;
}

.calendar-nav {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar-weekdays {
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.calendar-day {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
}

.calendar-day:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--soft);
}

.calendar-day.today {
  border-color: #b8d8d2;
  color: var(--brand-dark);
  font-weight: 700;
}

.calendar-day.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.calendar-day.outside {
  color: var(--muted);
}

.calendar-day:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.overseas-driver-field {
  margin: 0 0 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--soft);
}

.overseas-driver-field .hint {
  margin: 0;
}

.driver-kind-field {
  margin: 0 0 14px;
}

.field-label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink);
  font-weight: 700;
}

.driver-kind-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.driver-kind-option {
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.driver-kind-option strong,
.driver-kind-option small {
  display: block;
}

.driver-kind-option strong {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.driver-kind-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.driver-kind-option.active {
  border-color: var(--brand);
  background: var(--soft);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.driver-kind-option.active strong::before {
  content: "✓ ";
}

.driver-kind-field .hint {
  margin: 8px 0 0;
}

.fee-total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--soft);
}

.fee-total-box span {
  color: var(--muted);
  font-size: 14px;
}

.fee-total-box strong {
  color: var(--brand-dark);
  font-size: 20px;
}

.fee-addable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.addable-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.addable-card > label,
.other-fee-section > label,
.itinerary-field > label,
.image-upload-field > label {
  font-size: 14px;
  font-weight: 700;
}

.addable-list,
.other-fee-list {
  display: grid;
  gap: 8px;
}

.fixed-shuttle-panel {
  display: grid;
  gap: 8px;
}

.fixed-shuttle-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid rgba(15, 128, 105, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 128, 105, 0.08), rgba(230, 168, 75, 0.10));
  cursor: pointer;
}

.fixed-shuttle-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.fixed-shuttle-toggle span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fixed-shuttle-toggle strong {
  color: var(--brand-dark);
  font-size: 14px;
  line-height: 1.1;
}

.fixed-shuttle-toggle small,
.fixed-shuttle-extra small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.fixed-shuttle-options {
  display: grid;
  grid-template-columns: auto 86px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 128, 105, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.fixed-shuttle-options[hidden],
.fixed-shuttle-extra[hidden] {
  display: none !important;
}

.fixed-shuttle-options label,
.fixed-shuttle-options span {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

.fixed-shuttle-options input {
  width: 86px;
  text-align: center;
}

.fixed-shuttle-extra {
  margin-top: 2px;
}

.fixed-shuttle-extra > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 11px;
  border: 1px dashed rgba(15, 128, 105, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-dark);
  cursor: pointer;
  list-style: none;
}

.fixed-shuttle-extra > summary::-webkit-details-marker {
  display: none;
}

.fixed-shuttle-extra > summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 750;
  line-height: 1;
}

.fixed-shuttle-extra[open] > summary::before {
  content: "-";
}

.fixed-shuttle-extra span {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 750;
}

.fixed-shuttle-extra small {
  grid-column: 2;
}

.addable-row {
  display: grid;
  align-items: center;
  gap: 8px;
}

.addable-row[hidden] {
  display: none !important;
}

.fee-entry-row {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.fee-entry-row > input:not([type="file"]) {
  grid-column: 1 / -1;
  width: 100%;
}

.fee-entry-row .file-picker-label {
  grid-column: 1;
  width: 100%;
}

.fee-entry-row .add-row-btn,
.fee-entry-row .add-row-spacer {
  grid-column: 2;
  justify-self: end;
}

.other-fee-row {
  grid-template-columns: 58px minmax(92px, 0.7fr) minmax(0, 1fr) minmax(112px, 0.8fr) 34px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--fee-bg);
}

.other-fee-row strong {
  padding-top: 12px;
  color: var(--brand-dark);
  font-size: 13px;
  white-space: nowrap;
}

.other-fee-row .fee-photo-preview {
  grid-column: 2 / -1;
}

.stops {
  display: grid;
  gap: 8px;
}

.stop-row {
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  position: relative;
}

.address-suggestions {
  grid-column: 1 / -1;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 80;
  max-height: min(var(--address-suggestion-max-height, 220px), 42vh);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 32px rgba(21, 37, 32, 0.18);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.address-suggestions.address-suggestions-above {
  top: auto;
  bottom: calc(100% + 6px);
}

.address-suggestions button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 3px 10px;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.address-suggestions button:last-child {
  border-bottom: 0;
}

.address-suggestions button:hover {
  background: var(--brand-soft);
}

.address-suggestions em {
  display: inline-flex;
  grid-row: 1 / span 2;
  align-self: center;
  margin-bottom: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.address-suggestions strong,
.address-suggestions span {
  display: block;
  overflow-wrap: anywhere;
}

.address-suggestions strong {
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.address-suggestions span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-body.driver-form-locked #tripForm .address-suggestions button {
  height: auto;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 0;
  font-size: inherit;
  line-height: inherit;
}

.address-match-status {
  grid-column: 1 / -1;
  padding: 7px 9px;
  border-radius: 7px;
  background: #ecfdf3;
  color: #166534;
  font-size: 12px;
  line-height: 1.45;
}

.address-match-status[data-address-status-type="warn"] {
  background: #fff7ed;
  color: #9a3412;
}

.address-match-status[data-address-status-type="hint"] {
  background: #f8fafc;
  color: var(--muted);
}

input.address-match-ok {
  border-color: #16a34a;
  background: #f8fff9;
}

.add-row-btn,
.remove-row-btn,
.add-row-spacer {
  width: 34px;
  height: 34px;
}

.add-row-btn,
.remove-row-btn {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.add-row-btn {
  background: var(--brand);
  color: #fff;
}

.remove-row-btn {
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: #fff7ed;
  color: #b42318;
}

.stop-row .remove-row-btn {
  grid-column: 2;
}

.stop-row .add-row-btn,
.stop-row .add-row-spacer {
  grid-column: 3;
}

.add-row-btn[hidden],
.remove-row-btn[hidden] {
  display: none !important;
}

.add-row-btn:disabled,
.remove-row-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.file-compact {
  min-height: 42px;
  padding: 8px;
  font-size: 12px;
}

.file-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
}

.file-picker-label {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.file-picker-label::after {
  content: "+";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.file-picker-label:hover {
  border-color: var(--brand);
  background: var(--soft);
}

.file-picker-label:hover::after {
  background: var(--brand-dark);
}

.image-upload-field .file-picker-label {
  justify-content: space-between;
  width: 100%;
  border-color: var(--upload-line);
  background: var(--upload-bg);
  color: var(--upload-text);
  padding: 9px 10px 9px 14px;
}

.image-upload-field .file-picker-label::after {
  width: 26px;
  height: 26px;
  font-size: 18px;
}

.image-upload-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.compact-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.compact-section {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.compact-section-grid .compact-section {
  margin-bottom: 0;
}

.compact-section[open] {
  border-color: var(--line);
  background: var(--panel);
}

.compact-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.compact-section-toggle::-webkit-details-marker {
  display: none;
}

.compact-section-toggle strong {
  display: block;
  color: var(--brand-dark);
  font-size: 15px;
}

.compact-section-toggle small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.compact-section-toggle em {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 22px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.compact-section-toggle em::before {
  content: "+";
}

.compact-section[open] .compact-section-toggle {
  border-bottom: 1px solid var(--line);
}

.compact-section[open] .compact-section-toggle em::before {
  content: "-";
}

.compact-section:not([open]) .compact-section-body {
  display: none;
}

.compact-section-body {
  padding: 14px;
}

.compact-section-body > .field,
.compact-section-body .field:last-child {
  margin-bottom: 0;
}

.invoice-info-card {
  margin: 4px 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.invoice-info-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.invoice-info-toggle::-webkit-details-marker {
  display: none;
}

.invoice-info-toggle strong {
  display: block;
  color: var(--brand-dark);
  font-size: 15px;
}

.invoice-info-toggle small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.invoice-info-toggle em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--brand);
  color: var(--on-brand, #fff);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.invoice-info-card[open] .invoice-info-toggle {
  border-bottom: 1px solid var(--line);
}

.invoice-info-card[open] .invoice-info-toggle em {
  background: var(--muted);
}

.invoice-info-card[open] .invoice-info-toggle em::before {
  content: "收起";
}

.invoice-info-card[open] .invoice-info-toggle em {
  font-size: 0;
}

.invoice-info-card[open] .invoice-info-toggle em::before {
  font-size: 13px;
}

.invoice-info-card:not([open]) .invoice-info-content {
  display: none;
}

.invoice-info-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 18px;
  align-items: start;
  padding: 16px;
}

.section-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.invoice-info-card h3 {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 18px;
}

.invoice-info-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.invoice-info-list div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.invoice-info-list dt {
  color: var(--muted);
  font-size: 13px;
}

.invoice-info-list dd {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.invoice-qr-block {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0;
}

.invoice-qr-block img {
  width: 176px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.invoice-qr-block figcaption {
  color: var(--muted);
  font-size: 13px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--on-brand, #fff);
  border-radius: 6px;
  min-height: 42px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

.btn.compact {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.btn.secondary {
  background: var(--panel);
  color: var(--brand-dark);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.notice,
.errors {
  display: none;
  margin: 0 0 14px;
  border-radius: 6px;
  padding: 12px 14px;
  line-height: 1.5;
}

.notice {
  background: var(--soft);
  color: var(--brand-dark);
}

.errors {
  background: var(--error-bg);
  color: var(--danger);
}

.notice.show,
.errors.show {
  display: block;
}

.floating-feedback {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 90;
  width: min(560px, calc(100vw - 28px));
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.floating-feedback.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.floating-feedback.notice {
  border: 1px solid rgba(15, 118, 110, 0.26);
  background: #ecfdf5;
  color: var(--brand-dark);
}

.floating-feedback.error {
  border: 1px solid rgba(180, 35, 24, 0.24);
  background: #fef3f2;
  color: var(--danger);
}

.receipt-box {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.receipt-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.receipt-header strong {
  display: block;
  margin-bottom: 4px;
}

.receipt-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.receipt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--soft);
}

.receipt-item strong {
  display: block;
  margin-bottom: 3px;
}

.receipt-item .hint {
  margin: 0;
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.image-save-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.72);
}

.receipt-action-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.62);
}

.my-trips-modal {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.64);
}

.submit-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.66);
}

.qr-scan-modal {
  position: fixed;
  inset: 0;
  z-index: 63;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 18, 28, 0.78);
}

.captcha-modal {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.66);
}

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

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

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

.submit-confirm-card {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
}

.qr-scan-card {
  width: min(520px, 100%);
  overflow: hidden;
  border-radius: 10px;
  background: #0f1f25;
  color: #fff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

.qr-scan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.qr-scan-header strong {
  display: block;
  margin-bottom: 4px;
  font-size: 20px;
}

.qr-scan-header .hint {
  color: rgba(255, 255, 255, 0.72);
}

.qr-scan-video-wrap {
  position: relative;
  overflow: hidden;
  background: #071114;
  aspect-ratio: 3 / 4;
}

.qr-scan-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-scan-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78vw, 320px);
  max-width: 82%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
}

.qr-scan-frame::before,
.qr-scan-frame::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  height: 2px;
  background: rgba(28, 163, 139, 0.92);
}

.qr-scan-frame::before {
  top: 18%;
}

.qr-scan-frame::after {
  bottom: 18%;
}

.qr-scan-status {
  margin: 0;
  padding: 14px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.qr-scan-status.error {
  color: #fecaca;
}

.captcha-card {
  width: min(420px, 100%);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
}

.captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.captcha-header strong {
  font-size: 20px;
}

.captcha-canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef8f5;
}

.captcha-track {
  position: relative;
  height: 48px;
  overflow: hidden;
  border: 1px solid #bdd7d2;
  border-radius: 999px;
  background: #f3fbf8;
  color: #58706b;
  font-weight: 800;
  line-height: 48px;
  text-align: center;
  user-select: none;
  touch-action: none;
}

.captcha-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(20, 132, 118, 0.2), rgba(20, 132, 118, 0.38));
  pointer-events: none;
}

.captcha-handle {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  line-height: 42px;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.28);
  cursor: grab;
  touch-action: none;
}

.captcha-handle:active {
  cursor: grabbing;
}

.captcha-track.verified {
  border-color: #8fd3ba;
  background: #ecfdf5;
  color: #047857;
}

.captcha-track.verified .captcha-progress {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(16, 185, 129, 0.5));
}

.captcha-message {
  margin-top: 8px;
}

.submit-confirm-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.submit-review-list {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.submit-review-list dt {
  color: var(--muted);
  font-size: 13px;
}

.submit-review-list dd {
  margin: 0;
  word-break: break-word;
}

.submit-review-list dt.review-highlight-label,
.submit-review-list dd.review-highlight {
  color: var(--danger);
  font-weight: 800;
}

.submit-review-list dd.review-highlight {
  border-radius: 6px;
  background: #fff5f5;
  padding: 2px 6px;
}

.submit-warning {
  margin: 10px 0 14px;
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff7ed;
  color: var(--warn);
  font-weight: 700;
}

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

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

.my-trips-card {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
}

.my-trips-panel {
  margin-top: 0;
}

.my-trips-panel .my-trips-card {
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 0;
  box-shadow: none;
}

.my-trips-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.my-trips-header strong {
  display: block;
  margin-bottom: 4px;
  font-size: 20px;
}

.my-trips-tabs {
  margin-bottom: 12px;
}

.my-trips-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.my-trips-filters select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font-size: 14px;
}

.my-trips-list {
  display: grid;
  gap: 10px;
}

.my-trip-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.my-trip-item strong {
  display: block;
  margin-bottom: 4px;
}

.my-trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.my-trip-return-reason {
  margin-top: 8px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff5f5;
  color: #991b1b;
  line-height: 1.5;
}

.my-trip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.my-trips-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: #fff;
  line-height: 1.6;
}

.receipt-action-card {
  width: min(460px, 100%);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
}

.receipt-action-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.trip-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 64;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 16px;
  background: rgba(15, 23, 42, 0.42);
}

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

.trip-preview-modal.trip-preview-edit-mode {
  align-items: center;
  justify-content: center;
}

.trip-preview-card {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #f8faf9;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.28);
}

.trip-preview-modal.trip-preview-edit-mode .trip-preview-card {
  width: min(1120px, calc(100vw - 32px));
  height: min(880px, calc(100vh - 32px));
  height: min(880px, calc(100dvh - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
}

.trip-preview-header {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: #fff;
}

.trip-preview-header strong {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
}

.trip-preview-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.trip-preview-modal.trip-preview-edit-mode .trip-preview-body,
.trip-preview-modal.trip-preview-edit-mode .trip-return-box {
  display: none;
}

.trip-preview-sheet {
  max-width: 680px;
  margin: 0 auto;
  border: 1px solid #d9e4e1;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.trip-preview-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid #dce7e3;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.trip-preview-sheet-head strong {
  display: block;
  font-size: 24px;
}

.trip-preview-sheet-head span {
  color: var(--muted);
}

.trip-preview-section {
  margin-top: 14px;
}

.trip-preview-section h4 {
  margin: 0 0 8px;
  color: #0f3f3a;
  font-size: 16px;
}

.trip-preview-grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
}

.trip-preview-grid dt {
  color: var(--muted);
  font-size: 13px;
}

.trip-preview-grid dd {
  margin: 0;
  word-break: break-word;
}

.trip-preview-grid .preview-highlight {
  color: var(--danger);
  font-weight: 800;
}

.trip-preview-grid dd.preview-highlight {
  border-radius: 6px;
  background: #fff5f5;
  padding: 2px 6px;
}

.trip-preview-grid .admin-edited-field {
  color: #a52828;
  font-weight: 800;
}

.admin-edit-mark {
  display: inline-block;
  margin-left: 0.35rem;
  border-radius: 999px;
  padding: 0.08rem 0.35rem;
  background: #fde2e2;
  color: #9b1c1c;
  font-size: 0.72em;
  font-weight: 800;
  vertical-align: middle;
}

.trip-preview-photos {
  display: grid;
  gap: 10px;
}

.trip-preview-photo-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.trip-preview-photo-group strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.trip-preview-photo-group em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.trip-preview-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.trip-preview-thumbs .trip-preview-thumb {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0;
  cursor: zoom-in;
}

.trip-preview-thumbs .trip-preview-thumb:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.32);
  outline-offset: 2px;
}

.trip-preview-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.72);
}

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

.image-lightbox-card {
  width: min(980px, 96vw);
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28);
}

.image-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-lightbox-stage {
  min-height: 220px;
  max-height: 74vh;
  display: grid;
  place-items: center;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
}

.image-lightbox-stage img {
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.trip-return-box {
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
  background: #fff;
}

.trip-return-box label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.trip-return-box textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
}

.trip-edit-box {
  flex: 1 1 auto;
  min-height: 0;
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  background: #fff;
}

.trip-edit-box::-webkit-scrollbar {
  width: 10px;
}

.trip-edit-box::-webkit-scrollbar-track {
  background: #eef5f3;
}

.trip-edit-box::-webkit-scrollbar-thumb {
  border: 2px solid #eef5f3;
  border-radius: 999px;
  background: #a9c9c3;
}

.trip-edit-box[hidden] {
  display: none;
}

.trip-edit-box h3 {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 18px;
}

.trip-edit-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trip-edit-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
  border: 1px solid #f0c2c2;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff8f8;
  box-shadow: 0 8px 22px rgba(153, 27, 27, 0.08);
}

.trip-edit-toolbar strong {
  display: block;
  color: var(--danger);
}

.trip-edit-toolbar span {
  color: #7f1d1d;
  font-size: 13px;
}

.trip-edit-impact-panel {
  margin: 0 0 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff1f2;
  color: #7f1d1d;
}

.trip-edit-impact-panel strong {
  display: block;
  margin-bottom: 4px;
}

.trip-edit-impact-panel ul {
  margin: 0;
  padding-left: 18px;
}

.trip-edit-section {
  margin: 0 0 12px;
  border: 1px solid #dce7e3;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.trip-edit-section h4 {
  margin: 0 0 10px;
  color: #0f3f3a;
  font-size: 16px;
}

.trip-edit-team-field {
  grid-column: 1 / -1;
}

.trip-edit-team-field select {
  margin-bottom: 8px;
}

.trip-edit-changed input,
.trip-edit-changed select,
.trip-edit-changed textarea {
  border-color: #dc2626;
  background: #fff7f7;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.trip-edit-related input,
.trip-edit-related select,
.trip-edit-related textarea {
  border-color: #f87171;
  background: #fff1f2;
}

.trip-edit-related label,
.trip-edit-changed label {
  color: #b91c1c;
}

.trip-edit-box textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

.trip-edit-upload-field textarea {
  min-height: 5rem;
}

.trip-edit-itinerary-source[hidden] {
  display: none;
}

.trip-edit-itinerary-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  border: 1px solid #cfe2dd;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f4fbf9;
}

.trip-edit-itinerary-tools span {
  color: #0f5d55;
  font-size: 13px;
  font-weight: 700;
}

.trip-edit-itinerary-tools span[data-status="warn"],
.trip-edit-itinerary-tools span[data-status="error"] {
  color: #b45309;
}

.trip-edit-itinerary-list {
  display: grid;
  gap: 8px;
}

.trip-edit-itinerary-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce7e3;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.trip-edit-itinerary-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #e8f3f1;
  color: #0f5d55;
  font-weight: 800;
}

.trip-edit-itinerary-row input {
  min-width: 0;
}

.trip-edit-itinerary-match {
  min-width: 54px;
  color: #047857;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.trip-edit-itinerary-match.warn {
  color: #b45309;
}

.trip-edit-itinerary-actions {
  display: flex;
  gap: 6px;
}

.trip-edit-itinerary-actions .btn {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.trip-edit-fees {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trip-edit-fee-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.45fr) minmax(0, 1fr);
  gap: 8px;
}

.trip-edit-bottom-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 12px -16px -14px;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(6px);
}

.receipt-action-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

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

.image-save-card {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.25);
}

.image-save-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.image-save-header strong {
  font-size: 18px;
}

.image-save-notice {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
}

.image-save-notice.error {
  background: var(--error-bg);
  color: var(--danger);
}

#receiptImagePreview,
#qrSaveImagePreview {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  -webkit-touch-callout: default;
  user-select: auto;
}

body.modal-open {
  overflow: hidden;
}

.button-row.compact {
  margin-top: 8px;
}

.image-save-actions {
  position: sticky;
  bottom: -16px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px -16px -16px;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.image-save-actions .btn {
  flex: 1 1 160px;
}

.qr-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
}

.qr-copy h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.qr-link {
  margin-top: 8px;
}

.qr-preview {
  display: grid;
  place-items: center;
}

.qr-preview img {
  width: 210px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.other-fee-list {
  display: grid;
  gap: 10px;
}

.other-fee-row {
  display: grid;
  grid-template-columns: 92px minmax(92px, 0.42fr) minmax(0, 1fr) minmax(150px, 0.65fr) 34px;
  gap: 10px;
  align-items: start;
}

.other-fee-row strong {
  color: var(--brand-dark);
  font-size: 14px;
  padding-top: 12px;
}

.fee-photo-control {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.other-fee-row .fee-photo-control {
  margin-top: 0;
}

.fee-photo-control label {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.fee-photo-control input[type="file"] {
  padding: 8px;
  font-size: 13px;
}

.fee-photo-control .hint {
  margin: 0;
  font-size: 12px;
}

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

.fee-photo-preview:empty {
  display: none;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.preview-item {
  position: relative;
}

.preview-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  border: 0;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(20, 28, 24, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
}

.image-links {
  display: grid;
  gap: 4px;
}

.image-links a {
  color: var(--brand-dark);
  text-decoration: underline;
}

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

.activity-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  background: #fff;
}

.activity-item.active {
  border-color: var(--brand);
  background: var(--soft);
}

.activity-item strong {
  display: block;
  margin-bottom: 4px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.submission-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  flex: 1 1 100%;
}

.submission-action-bar {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.submission-action-primary {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar-menu {
  position: relative;
  display: inline-block;
}

.toolbar-menu > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.toolbar-menu > summary::-webkit-details-marker {
  display: none;
}

.toolbar-menu[open] > summary {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--soft);
}

.toolbar-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  gap: 8px;
  min-width: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

.toolbar-menu:not([open]) .toolbar-menu-panel {
  display: none;
}

.toolbar-menu-panel .btn {
  width: 100%;
  justify-content: center;
}

.retention-alert {
  display: none;
  flex: 1 1 100%;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff7ed;
  color: var(--warn);
  line-height: 1.5;
}

.retention-alert.show {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.retention-alert strong {
  color: #8a3d00;
}

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

.view-tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  cursor: pointer;
}

.view-tab.active {
  background: var(--brand);
  color: #fff;
}

.submission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.summary-pill.pending {
  background: #fff7ed;
  color: var(--warn);
}

.summary-pill.warning {
  background: #fff7ed;
  color: var(--warn);
}

.summary-pill.danger-soft {
  background: #fef3f2;
  color: var(--danger);
}

.summary-pill.selected {
  background: var(--soft);
  color: var(--brand-dark);
}

.summary-detail {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.summary-detail > summary {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  background: #f8fbfa;
  color: var(--brand-dark);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.summary-detail > summary::-webkit-details-marker {
  display: none;
}

.summary-detail[open] > summary {
  border-color: var(--brand);
  background: var(--soft);
}

.summary-detail-list {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(620px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
}

.summary-detail:not([open]) .summary-detail-list {
  display: none;
}

.page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.page-size-control select {
  width: auto;
  min-width: 78px;
  min-height: 38px;
  padding: 7px 28px 7px 10px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 12px;
}

.admin-body #submissionPanel .panel-header {
  padding: 10px 14px;
  gap: 10px;
}

.admin-body #submissionPanel .panel-header h2 {
  flex: 0 0 auto;
  font-size: 17px;
}

.admin-body #submissionPanel #submissionCount {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
}

.admin-body #submissionPanel .panel-header .pagination-bar {
  flex: 0 0 auto;
  gap: 6px;
  margin: 0;
}

.admin-body #submissionPanel .panel-header .pagination-bar .btn {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 13px;
}

.admin-body #submissionPanel .panel-body {
  padding: 10px 14px 8px;
}

.admin-body #submissionPanel .toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  margin-bottom: 6px;
}

.admin-body #submissionPanel .view-tabs {
  width: 100%;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.admin-body #submissionPanel .view-tab {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-body #submissionPanel .retention-alert {
  min-height: 0;
  padding: 7px 9px;
  line-height: 1.35;
}

.admin-body #submissionPanel .submission-filter-grid {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1px;
  -webkit-overflow-scrolling: touch;
}

.admin-body #submissionPanel .submission-filter-grid input,
.admin-body #submissionPanel .submission-filter-grid select {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
}

.admin-body #submissionPanel .submission-action-bar {
  flex-wrap: nowrap;
  gap: 6px;
  padding: 6px;
  border-radius: 7px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.admin-body #submissionPanel .submission-action-primary {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
}

.admin-body #submissionPanel .submission-action-primary .btn,
.admin-body #submissionPanel .toolbar-menu > summary,
.admin-body #submissionPanel .page-size-control select {
  width: auto;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 13px;
  white-space: nowrap;
}

.admin-body #submissionPanel .toolbar-menu {
  flex: 0 0 auto;
}

.admin-body #submissionPanel .page-size-control {
  gap: 4px;
  font-size: 12px;
}

.admin-body #submissionPanel .page-size-control select {
  min-width: 68px;
}

.admin-body #submissionPanel .submission-summary {
  flex-wrap: nowrap;
  gap: 5px;
  margin: 0 0 6px;
  padding-bottom: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.admin-body #submissionPanel .summary-pill,
.admin-body #submissionPanel .summary-detail > summary {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-body #submissionPanel .table-wrap {
  width: 100%;
  height: var(--submission-table-fit-height, calc(100dvh - 360px));
  max-height: none;
  overflow: auto;
  scrollbar-gutter: stable;
}

.admin-body #submissionPanel .table-wrap.has-scrollbar-proxy {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.admin-body #submissionPanel .table-scrollbar-proxy {
  width: 100%;
  height: 22px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--surface);
  scrollbar-color: var(--primary) color-mix(in srgb, var(--primary) 12%, #ffffff 88%);
  scrollbar-gutter: stable;
  position: sticky;
  bottom: 0;
  z-index: 14;
}

.admin-body #submissionPanel .table-scrollbar-proxy[hidden] {
  display: none !important;
}

.admin-body #submissionPanel .table-scrollbar-proxy-inner {
  height: 1px;
  min-height: 1px;
}

.admin-body #submissionPanel .table-scrollbar-proxy::-webkit-scrollbar {
  height: 14px;
}

.admin-body #submissionPanel .table-scrollbar-proxy::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--primary) 12%, #ffffff 88%);
  border-radius: 999px;
}

.admin-body #submissionPanel .table-scrollbar-proxy::-webkit-scrollbar-thumb {
  background: var(--primary);
  border: 3px solid color-mix(in srgb, var(--primary) 12%, #ffffff 88%);
  border-radius: 999px;
}

.admin-body #submissionPanel .table-wrap table {
  width: max-content;
  min-width: max(1280px, 100%);
  table-layout: auto;
}

.admin-body #submissionPanel #submissionTableHead {
  position: sticky;
  top: 0;
  z-index: 8;
  background: #eef5f3;
}

.admin-body #submissionPanel #submissionTableHead th {
  position: static;
  z-index: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 980px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
  line-height: 1.35;
}

.column-filter-row th {
  padding-top: 0;
  background: #f8fbfa;
}

.table-head-filter {
  width: 100%;
  min-width: 92px;
  min-height: 34px;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

select.table-head-filter {
  padding-right: 24px;
}

.table-clear-filter-btn {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.submission-check {
  width: auto;
  min-height: auto;
}

.row-selected td {
  background: #f4fbf9;
}

.status-cell {
  min-width: 132px;
  white-space: nowrap;
}

.status-cell .badge,
.status-cell .retention-badge {
  margin-right: 6px;
  margin-bottom: 4px;
}

.mobile-row-action {
  display: none;
}

.activity-name-cell,
.project-cell {
  max-width: 180px;
  white-space: normal;
  word-break: break-word;
}

.submission-actions-cell {
  min-width: 178px;
  overflow: visible;
}

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.table-select-all-head,
.ledger-select-all-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  color: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.table-select-all-head input,
.ledger-select-all-control input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--primary);
}

.table-select-all-head input:disabled,
.ledger-select-all-control input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.compact-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  vertical-align: middle;
}

.compact-actions .btn {
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.row-action-menu {
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

.row-action-menu > summary {
  cursor: pointer;
  list-style: none;
}

.row-action-menu > summary::-webkit-details-marker {
  display: none;
}

.row-action-summary {
  user-select: none;
}

.row-action-menu[open] > summary {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--soft);
}

.row-action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 36;
  display: grid;
  gap: 5px;
  min-width: 132px;
  max-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.row-action-menu-panel .btn {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  justify-content: center;
  white-space: nowrap;
}

.row-action-menu:not([open]) .row-action-menu-panel {
  display: none;
}

.retention-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 9px;
  background: #edf7ed;
  color: #236823;
  font-size: 12px;
  white-space: nowrap;
}

.retention-badge.warning {
  background: #fff7ed;
  color: var(--warn);
}

.retention-badge.expired,
.retention-badge.protected {
  background: #fef3f2;
  color: var(--danger);
}

.retention-date,
.retention-note {
  display: none;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.itinerary-cell {
  max-width: 260px;
  line-height: 1.5;
}

.muted-cell,
.empty-cell {
  color: var(--muted);
}

.empty-cell {
  text-align: center;
  padding: 24px;
}

th {
  position: sticky;
  top: 0;
  background: #eef5f3;
  z-index: 1;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 9px;
  background: #edf7ed;
  color: #236823;
  font-size: 12px;
}

.badge.pending {
  background: #fff7ed;
  color: var(--warn);
}

.badge.warning {
  background: #fff7ed;
  color: var(--warn);
}

.badge.admin-created-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 850;
}

.activity-address-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.activity-address-list {
  display: grid;
  gap: 12px;
}

.project-material-selector {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fbfa;
}

.project-material-selector label {
  font-weight: 800;
  color: var(--text);
}

.project-material-selector span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.activity-address-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  box-shadow: 0 8px 18px rgba(16, 24, 33, 0.05);
  overflow: hidden;
}

.activity-address-card > summary::-webkit-details-marker {
  display: none;
}

.activity-address-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
}

.activity-address-card-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.activity-address-card-title strong {
  overflow-wrap: anywhere;
}

.activity-address-card-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.activity-address-card-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.activity-address-card-toggle {
  min-width: 48px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  background: #f8fbfa;
}

.activity-address-card-toggle .open-label {
  display: none;
}

.activity-address-card[open] .activity-address-card-toggle .closed-label {
  display: none;
}

.activity-address-card[open] .activity-address-card-toggle .open-label {
  display: inline;
}

.activity-address-card-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.activity-address-basic-grid {
  align-items: end;
}

.activity-address-locate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.activity-address-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.activity-address-actions.compact {
  margin-top: 0;
  justify-content: flex-start;
}

.project-material-media {
  border: 1px dashed #cfe2dd;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbfa;
}

.project-material-media-head,
.project-material-media-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-material-media-head {
  margin-bottom: 8px;
}

.project-material-upload {
  position: relative;
  overflow: hidden;
}

.project-material-media-list {
  display: grid;
  gap: 8px;
}

.project-material-media-preview {
  width: 96px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  flex: 0 0 auto;
}

.project-material-media-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-material-media-preview-video,
.project-material-media-preview-document {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.project-material-media-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.project-material-media-item span {
  min-width: 180px;
  flex: 1;
  font-weight: 700;
}

.activity-address-suggestions {
  display: grid;
  gap: 6px;
  max-height: 240px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #cfe2dd;
  border-radius: 8px;
  padding: 8px;
  background: #f4fbf9;
}

.activity-address-wechat-drop {
  margin: 10px 0;
  border: 1px dashed #c7d8d3;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  background: #f8fbfa;
}

.activity-address-wechat-drop.drag-over {
  border-color: var(--primary);
  background: #e9f7f3;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.activity-address-card.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(16, 128, 111, 0.22), 0 12px 28px rgba(16, 128, 111, 0.14);
}

.activity-address-wechat-drop strong {
  color: var(--primary);
}

.activity-address-wechat-drop span {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 12px;
}

.activity-address-wechat-actions {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.activity-address-wechat-actions input {
  min-width: 0;
}

.activity-address-wechat-drop small {
  width: 100%;
  color: #0f766e;
  font-weight: 700;
}

@media (max-width: 640px) {
  .activity-address-wechat-actions {
    grid-template-columns: 1fr 1fr;
  }

  .activity-address-wechat-actions input {
    grid-column: 1 / -1;
  }
}

.activity-address-suggestion-btn {
  min-height: 0;
  border: 1px solid #dbe7e2;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.activity-address-suggestion-btn strong,
.activity-address-suggestion-btn span {
  display: block;
}

.activity-address-suggestion-btn span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-create-field-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.admin-create-field-head label {
  margin-bottom: 0;
}

.admin-create-time-field {
  position: relative;
}

.admin-create-time-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.admin-create-time-unit {
  position: relative;
  min-width: 0;
}

.admin-create-time-trigger {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--field-line, var(--line));
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel, #fff);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.admin-create-time-trigger small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-create-time-trigger[aria-expanded="true"] {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.admin-create-time-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel, #fff);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
}

.admin-create-time-menu[hidden] {
  display: none;
}

.admin-create-time-menu-hour {
  grid-template-columns: repeat(6, minmax(34px, 1fr));
  min-width: 276px;
}

.admin-create-time-menu-minute {
  grid-template-columns: repeat(6, minmax(34px, 1fr));
  min-width: 234px;
}

.admin-create-time-option {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface, #fff);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.admin-create-time-option:hover,
.admin-create-time-option:focus-visible {
  border-color: var(--brand);
  background: var(--soft);
  outline: none;
}

.admin-create-time-option.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand, #fff);
}

.admin-create-itinerary-rows {
  display: grid;
  gap: 8px;
}

.admin-create-stop-row {
  display: grid;
  grid-template-columns: 34px minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: start;
  position: relative;
}

.admin-create-stop-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: var(--soft);
  color: var(--brand);
  font-weight: 900;
}

.admin-create-stop-row input {
  min-width: 0;
}

.admin-create-address-suggestions {
  grid-column: 2 / -1;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #cfe2dd;
  border-radius: 8px;
  padding: 8px;
  background: #f4fbf9;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.admin-create-address-suggestion-btn {
  min-height: 0;
  border: 1px solid #dbe7e2;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-create-address-suggestion-btn:hover {
  background: var(--brand-soft);
}

.admin-create-address-suggestion-btn strong,
.admin-create-address-suggestion-btn span {
  display: block;
  overflow-wrap: anywhere;
}

.admin-create-address-suggestion-btn span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-create-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.admin-create-upload-row .hint {
  min-height: 18px;
}

@media (max-width: 640px) {
  .admin-create-time-menu-hour {
    grid-template-columns: repeat(4, minmax(38px, 1fr));
    min-width: min(82vw, 300px);
  }

  .admin-create-time-menu-minute {
    grid-template-columns: repeat(3, minmax(44px, 1fr));
    min-width: min(68vw, 240px);
  }
}

.activity-address-driver-panel {
  margin: 14px 0;
  border-color: rgba(15, 118, 110, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfa 100%);
}

.activity-address-driver-list {
  display: grid;
  gap: 10px;
}

.activity-address-driver-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: #fff;
  overflow: hidden;
}

.activity-address-driver-card > summary::-webkit-details-marker {
  display: none;
}

.activity-address-driver-summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  cursor: pointer;
}

.activity-address-driver-summary > span:first-child {
  min-width: 0;
}

.activity-address-driver-toggle {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  background: #f8fafc;
}

.activity-address-driver-detail {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.activity-address-driver-card strong {
  display: block;
  color: var(--ink);
}

.activity-address-driver-card p {
  margin: 4px 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.activity-address-driver-card span,
.activity-address-driver-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.activity-address-driver-detail > small {
  white-space: pre-wrap;
}

.activity-address-driver-media {
  margin-top: 8px;
}

.activity-address-driver-media > span {
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--ink);
}

.activity-address-driver-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-address-driver-media-thumb {
  display: block;
  width: 76px;
  height: 62px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  appearance: none;
  cursor: pointer;
}

.activity-address-driver-media-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-address-driver-media-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--primary);
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.driver-project-media-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(2, 6, 23, 0.72);
}

.driver-project-media-modal[hidden] {
  display: none;
}

.driver-project-media-card {
  width: min(960px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 22px 60px rgba(2, 6, 23, 0.28);
}

.driver-project-media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.driver-project-media-header strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.driver-project-media-close {
  flex: 0 0 auto;
}

.driver-project-media-stage {
  min-height: 240px;
  max-height: 82vh;
  display: grid;
  place-items: center;
  overflow: auto;
  border-radius: 10px;
  background: #0f172a;
}

.driver-project-media-stage img,
.driver-project-media-stage video {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.driver-project-media-stage iframe {
  width: min(900px, 90vw);
  height: min(78vh, 720px);
  border: 0;
  background: #fff;
}

.activity-address-driver-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: stretch;
}

.activity-address-driver-actions .btn {
  flex: 1 1 140px;
  white-space: nowrap;
}

.activity-address-driver-actions .activity-address-direct-nav {
  justify-content: center;
}

.activity-address-map-choices {
  display: grid;
  flex: 1 1 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.activity-address-map-choice {
  min-width: 0;
  justify-content: center;
  padding-inline: 8px;
}

.meal-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.meal-admin-card,
.meal-driver-card,
.meal-batch-card,
.meal-qr-box,
.meal-empty {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.meal-admin-card {
  padding: 14px;
}

.meal-admin-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.meal-project-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.meal-project-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.meal-project-option input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.meal-project-option:has(input:checked) {
  border-color: #b7d8d2;
  background: var(--soft);
  color: var(--brand-dark);
}

.meal-batch-list,
.meal-driver-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.meal-list-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.meal-list-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.meal-view-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.meal-view-tab {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.meal-view-tab.active {
  border-color: #b7d8d2;
  background: var(--brand);
  color: #fff;
}

.meal-view-tab span {
  display: inline-flex;
  min-width: 20px;
  justify-content: center;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--brand-dark);
}

.meal-batch-card,
.meal-driver-card {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.meal-batch-card strong,
.meal-driver-card strong {
  display: block;
  margin-bottom: 4px;
}

.meal-driver-card .hint {
  display: block;
}

.meal-batch-stats,
.meal-driver-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.meal-driver-panel {
  margin: 14px 0;
  border-color: rgba(15, 118, 110, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfa 100%);
}

.meal-driver-current {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed #b7d8d2;
  border-radius: 10px;
  background: #eef8f6;
  color: var(--brand-dark);
}

.meal-driver-current span {
  color: var(--muted);
}

.meal-empty {
  padding: 14px;
  color: var(--muted);
  background: #fbfdfc;
}

.meal-driver-result {
  margin-top: 12px;
}

.meal-qr-box {
  padding: 14px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.meal-qr-box img {
  width: min(220px, 78vw, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.meal-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.meal-result.success {
  color: var(--brand-dark);
  background: var(--soft);
  border-color: #b7d8d2;
}

.meal-result.error {
  color: var(--danger);
  background: #fff1f1;
  border-color: #f2c1bd;
}

.meal-table-wrap {
  margin-top: 14px;
}

.meal-table-summary {
  caption-side: top;
  padding: 0 0 8px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.meal-table-wrap .table-head-filter {
  width: 100%;
  min-width: 82px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
}

.meal-table-wrap .table-head-filter.wide {
  min-width: 138px;
}

.meal-table-wrap .table-head-filter:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  background: #fff;
}

.driver-body.driver-theme-night .driver-login-panel {
  background: #08111f;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.driver-body.driver-theme-night .driver-login-content {
  background:
    radial-gradient(circle at 100% 0%, rgba(45, 212, 191, 0.13), transparent 36%),
    var(--panel);
  color: var(--ink);
}

.driver-body.driver-theme-night .driver-login-content .panel-header h2,
.driver-body.driver-theme-night .receipt-action-card strong,
.driver-body.driver-theme-night .image-save-header strong,
.driver-body.driver-theme-night .captcha-header strong,
.driver-body.driver-theme-night .submit-confirm-card strong {
  color: var(--ink);
}

.driver-body.driver-theme-night .driver-login-topline span {
  background: rgba(45, 212, 191, 0.14);
  color: #99f6e4;
}

.driver-body.driver-theme-night .driver-kind-option,
.driver-body.driver-theme-night .view-tabs,
.driver-body.driver-theme-night .my-trips-filters select,
.driver-body.driver-theme-night .meal-view-tabs,
.driver-body.driver-theme-night .meal-project-options,
.driver-body.driver-theme-night .meal-project-option,
.driver-body.driver-theme-night .fixed-shuttle-options,
.driver-body.driver-theme-night .fixed-shuttle-extra > summary {
  border-color: var(--line);
  background: var(--field-bg);
  color: var(--ink);
}

.driver-body.driver-theme-night .driver-kind-option.active,
.driver-body.driver-theme-night .view-tab.active,
.driver-body.driver-theme-night .meal-project-option:has(input:checked),
.driver-body.driver-theme-night .driver-section-tab.attention:not(.active) {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.14);
  color: #99f6e4;
}

.driver-body.driver-theme-night .driver-returned-reminder {
  border-color: rgba(251, 113, 133, 0.35);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.24), rgba(88, 28, 135, 0.18));
  color: #fecdd3;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.driver-body.driver-theme-night .driver-returned-reminder span {
  color: #fda4af;
}

.driver-body.driver-theme-night .fixed-shuttle-toggle {
  border-color: rgba(45, 212, 191, 0.24);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(96, 165, 250, 0.10));
}

.driver-body.driver-theme-night .remove-row-btn {
  border-color: rgba(248, 113, 113, 0.36);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}

.driver-body.driver-theme-night .receipt-box,
.driver-body.driver-theme-night .receipt-item,
.driver-body.driver-theme-night .my-trips-card,
.driver-body.driver-theme-night .my-trip-item,
.driver-body.driver-theme-night .my-trips-empty,
.driver-body.driver-theme-night .activity-address-driver-panel,
.driver-body.driver-theme-night .activity-address-driver-card,
.driver-body.driver-theme-night .meal-driver-panel,
.driver-body.driver-theme-night .meal-admin-card,
.driver-body.driver-theme-night .meal-driver-card,
.driver-body.driver-theme-night .meal-batch-card,
.driver-body.driver-theme-night .meal-qr-box,
.driver-body.driver-theme-night .meal-empty,
.driver-body.driver-theme-night .submit-confirm-card,
.driver-body.driver-theme-night .captcha-card,
.driver-body.driver-theme-night .receipt-action-card,
.driver-body.driver-theme-night .image-save-card {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.driver-body.driver-theme-night .activity-address-driver-panel,
.driver-body.driver-theme-night .meal-driver-panel {
  background: linear-gradient(180deg, #152235 0%, #101b2c 100%);
}

.driver-body.driver-theme-night .activity-address-driver-media-thumb,
.driver-body.driver-theme-night .activity-address-driver-media-link {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: #bfdbfe;
}

.driver-body.driver-theme-night .meal-driver-current,
.driver-body.driver-theme-night .notice,
.driver-body.driver-theme-night .fee-total-box,
.driver-body.driver-theme-night .time-safety,
.driver-body.driver-theme-night .overseas-driver-field,
.driver-body.driver-theme-night .address-suggestions button {
  background: var(--soft);
  color: var(--ink);
}

.driver-body.driver-theme-night .address-match-status {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.driver-body.driver-theme-night .address-match-status[data-address-status-type="warn"],
.driver-body.driver-theme-night .submit-warning,
.driver-body.driver-theme-night .badge.pending,
.driver-body.driver-theme-night .badge.warning {
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
}

.driver-body.driver-theme-night .address-match-status[data-address-status-type="hint"] {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
}

.driver-body.driver-theme-night input.address-match-ok {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.10);
}

.driver-body.driver-theme-night .meal-result.error,
.driver-body.driver-theme-night .my-trip-return-reason,
.driver-body.driver-theme-night .floating-feedback.error {
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.38);
}

.driver-body.driver-theme-night .meal-result.success,
.driver-body.driver-theme-night .floating-feedback.notice {
  background: rgba(45, 212, 191, 0.13);
  color: #99f6e4;
  border-color: rgba(45, 212, 191, 0.38);
}

.driver-body.driver-theme-night .view-tab.active,
.driver-body.driver-theme-night .meal-view-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--on-brand);
}

.driver-body.driver-theme-night .badge {
  background: rgba(45, 212, 191, 0.13);
  color: #99f6e4;
}

.driver-body.driver-theme-night .meal-table-wrap .table-head-filter:focus {
  background: var(--field-bg);
}

.footer {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  margin-top: 24px;
}

.mobile-only {
  display: none;
}

@media (max-width: 860px) {
  .topbar {
    position: static;
  }

  .driver-body {
    --driver-topbar-height: 58px;
    --driver-tabs-height: 48px;
  }

  .topbar-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
  }

  .brand-block {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    width: 100%;
  }

  .brand-logo {
    width: 150px;
    max-width: 48vw;
  }

  .brand-title {
    flex: 1;
    min-width: 0;
  }

  .brand-title strong {
    display: none;
  }

  .brand-title span {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .language-switch {
    justify-content: flex-start;
    width: 100%;
    gap: 5px;
  }

  .language-btn {
    min-height: 30px;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .floating-feedback {
    bottom: max(22px, env(safe-area-inset-bottom));
    width: calc(100vw - 22px);
    padding: 11px 12px;
    font-size: 13px;
  }

  .page {
    padding: 10px 10px 32px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-sidebar-card {
    max-height: none;
    padding: 10px;
  }

  .admin-sidebar-header {
    align-items: center;
  }

  .driver-page {
    max-width: 100%;
  }

  .driver-section-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0 10px;
  }

  .driver-body.driver-form-locked .topbar-inner {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr) 94px;
    align-items: center;
    gap: 8px;
    min-height: var(--driver-topbar-height);
    max-width: calc(100vw - 20px);
    padding: 8px 0;
  }

  .driver-body.driver-form-locked .brand-block {
    display: contents;
  }

  .driver-body.driver-form-locked .brand-logo {
    width: 94px;
    height: 42px;
    max-width: none;
  }

  .driver-body.driver-form-locked .brand-title {
    display: flex;
  }

  .driver-body.driver-form-locked .driver-clock {
    width: 94px;
    height: 42px;
    padding: 5px 9px 5px 10px;
    border-radius: 10px;
  }

  .driver-body.driver-form-locked .driver-clock-date {
    font-size: 10px;
  }

  .driver-body.driver-form-locked .driver-clock-time {
    font-size: 18px;
  }

  .driver-body.driver-form-locked .driver-section-tabs {
    max-width: calc(100vw - 20px);
    padding: 6px 0 8px;
  }

  .driver-section-tab {
    min-height: 34px;
    padding: 4px;
    font-size: 13px;
  }

  .driver-returned-reminder {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .driver-returned-reminder .btn {
    width: 100%;
  }

  .activity-address-driver-card {
    flex-direction: column;
    align-items: stretch;
  }

  .activity-address-driver-actions {
    justify-content: stretch;
  }

  .activity-address-driver-actions .btn {
    flex: 1 1 0;
  }

  .activity-address-map-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .activity-address-map-choice {
    font-size: 14px;
  }

  .project-material-selector {
    grid-template-columns: 1fr;
  }

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

  .my-trips-filters select {
    min-height: 36px;
    font-size: 13px;
  }

  .driver-login-panel {
    grid-template-columns: 1fr;
    min-height: auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 12px 34px rgba(16, 24, 33, 0.1);
    margin-bottom: 10px;
  }

  .driver-login-visual {
    min-height: 340px;
  }

  .driver-login-visual > img {
    object-position: 52% 10%;
  }

  .driver-login-shade {
    background:
      linear-gradient(90deg, rgba(16, 24, 33, 0.2), rgba(16, 24, 33, 0.76)),
      linear-gradient(0deg, rgba(16, 24, 33, 0.74), rgba(16, 24, 33, 0.04) 58%);
  }

  .driver-login-brand-card {
    margin: 14px;
    padding: 8px 10px;
  }

  .driver-login-brand-card img {
    width: 132px;
    max-width: 42vw;
  }

  .driver-login-brand-card span {
    font-size: 10px;
  }

  .driver-login-copy {
    right: auto;
    bottom: 14px;
    left: 16px;
    max-width: calc(100% - 32px);
  }

  .driver-login-copy > span {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .driver-login-copy h1 {
    font-size: 24px;
    line-height: 1.08;
  }

  .driver-login-copy p {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .driver-login-stats {
    gap: 6px;
    margin-top: 10px;
  }

  .driver-login-stats strong {
    padding: 5px 8px;
    font-size: 11px;
  }

  .driver-login-content {
    padding: 16px 14px 14px;
  }

  .driver-login-topline {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .driver-login-topline span {
    padding: 8px 10px;
    font-size: 13px;
  }

  .driver-login-topline small {
    max-width: 160px;
    font-size: 11px;
  }

  .driver-login-content .panel-header {
    padding-bottom: 14px;
  }

  .driver-login-content .panel-header h2 {
    margin-bottom: 7px;
    font-size: 28px;
  }

  .driver-login-content input {
    min-height: 48px;
  }

  .driver-login-panel .button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .driver-login-panel .button-row .btn {
    min-height: 44px;
  }

  .driver-kind-selector {
    gap: 8px;
  }

  .driver-kind-option {
    min-height: 74px;
    padding: 10px;
  }

  .driver-kind-option strong {
    font-size: 16px;
  }

  .logged-driver-bar {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  .logged-driver-bar .btn {
    width: 100%;
  }

  .hero {
    border-radius: 8px;
    box-shadow: none;
    margin-bottom: 10px;
  }

  .hero-body {
    padding: 12px;
  }

  .hero h1 {
    overflow-wrap: anywhere;
    margin-bottom: 5px;
    font-size: 20px;
    line-height: 1.25;
  }

  .hero p {
    font-size: 13px;
    line-height: 1.35;
  }

  .hero-actions {
    margin-top: 8px;
  }

  .hero-actions .btn {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .admin-tabs {
    overflow-x: auto;
    gap: 6px;
    margin-bottom: 10px;
    padding: 6px;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tab {
    flex: 0 0 auto;
    min-width: 96px;
    min-height: 38px;
    padding: 7px 10px;
    font-size: 14px;
  }

  .panel-header {
    display: block;
    padding: 12px;
  }

  .panel-header h2,
  .panel-header h3 {
    margin-bottom: 4px;
    font-size: 18px;
  }

  .panel-body {
    padding: 12px;
  }

  .layout,
  .grid.two,
  .grid.three,
  .compact-section-grid,
  .fee-addable-grid,
  .stops,
  .other-fee-row,
  .invoice-info-content {
    grid-template-columns: 1fr;
  }

  .fee-entry-row {
    grid-template-columns: minmax(0, 1fr) 74px 34px;
  }

  .fee-entry-row > input:not([type="file"]) {
    grid-column: auto;
  }

  .fee-entry-row .file-picker-label {
    grid-column: auto;
    width: 74px;
    min-height: 38px;
    padding: 0 6px;
    font-size: 12px;
    justify-self: end;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fee-entry-row .add-row-btn,
  .fee-entry-row .add-row-spacer {
    grid-column: auto;
    justify-self: end;
  }

  .other-fee-row {
    grid-template-columns: minmax(0, 1fr) 74px 34px;
    gap: 6px;
    padding: 6px;
    border-radius: 7px;
    background: var(--fee-bg);
  }

  .other-fee-row strong {
    display: none;
  }

  .other-fee-row > input[id^="otherFee"][inputmode="text"] {
    grid-column: 1;
    grid-row: 1;
    min-height: 38px;
  }

  .other-fee-row > input[id^="otherFeeNote"] {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 38px;
  }

  .other-fee-row .fee-photo-preview {
    grid-column: 1 / -1;
  }

  .other-fee-row .file-picker-label {
    grid-column: 2;
    grid-row: 1;
    width: 74px;
    min-height: 38px;
    padding: 0 6px;
    font-size: 12px;
    justify-self: end;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .other-fee-row .add-row-btn,
  .other-fee-row .add-row-spacer {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .fee-entry-row .file-picker-label::after,
  .other-fee-row .file-picker-label::after {
    width: 18px;
    height: 18px;
    font-size: 14px;
  }

  .invoice-info-list div {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .invoice-qr-block {
    justify-items: start;
  }

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

  .receipt-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .receipt-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .qr-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .qr-panel .button-row {
    align-items: stretch;
  }

  .qr-panel .button-row .btn {
    flex: 1 1 100%;
  }

  .qr-preview img {
    width: min(240px, 100%);
  }

  .submission-filter-grid {
    grid-template-columns: 1fr;
    flex-basis: 100%;
  }

  .submission-action-bar {
    align-items: stretch;
  }

  .submission-action-bar,
  .submission-action-primary {
    width: 100%;
  }

  .submission-action-primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .submission-action-primary .btn {
    width: 100%;
  }

  .submission-action-bar .page-size-control {
    width: 100%;
  }

  .submission-action-bar .toolbar-menu {
    flex: 1 1 calc(50% - 4px);
  }

  .submission-action-bar .toolbar-menu > summary {
    width: 100%;
    justify-content: center;
  }

  .toolbar-menu-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .summary-detail {
    width: 100%;
  }

  .summary-detail > summary {
    width: 100%;
    justify-content: center;
  }

  .summary-detail-list {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .pagination-bar {
    justify-content: flex-start;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab {
    flex: 1 1 auto;
  }

  .status-cell {
    white-space: normal;
  }

  .mobile-row-action {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .submit-review-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .captcha-modal {
    align-items: flex-end;
    padding: 12px;
  }

  .captcha-card {
    width: 100%;
    padding: 14px;
  }

  .captcha-track {
    height: 52px;
    line-height: 52px;
  }

  .captcha-handle {
    width: 46px;
    height: 46px;
    line-height: 46px;
  }

  .trip-preview-modal {
    padding: 0;
  }

  .trip-preview-card {
    width: 100%;
    max-width: none;
    max-height: 100vh;
    max-height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
  }

  .trip-preview-modal.trip-preview-edit-mode {
    align-items: stretch;
  }

  .trip-preview-modal.trip-preview-edit-mode .trip-preview-card {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
  }

  .trip-preview-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px;
  }

  .trip-preview-body {
    padding: 10px;
  }

  .trip-preview-sheet {
    padding: 12px;
  }

  .trip-preview-sheet-head {
    flex-direction: column;
  }

  .trip-preview-grid {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .trip-preview-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trip-return-box {
    padding: 10px 12px 12px;
  }

  .trip-edit-box {
    min-height: 0;
    padding: 10px 12px 12px;
  }

  .trip-edit-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    top: 0;
  }

  .trip-edit-section {
    padding: 10px;
  }

  .trip-edit-fees {
    grid-template-columns: 1fr;
  }

  .trip-edit-bottom-actions {
    margin: 10px -12px -12px;
    padding: 10px 12px;
  }

  .meal-admin-grid,
  .meal-batch-card,
  .meal-driver-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .meal-list-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .meal-view-tabs {
    width: 100%;
  }

  .meal-view-tab {
    flex: 1;
  }

  .meal-batch-stats,
  .meal-driver-actions {
    justify-content: flex-start;
  }

  .mobile-only {
    display: block;
  }
}

/* Driver Light Steel mobile preview 20260728 */
.driver-body.driver-light-steel-ui {
  --driver-simple-max: 440px;
  --driver-simple-radius: 18px;
  --driver-simple-line: #adb5bd;
  --driver-simple-soft: #e9ecef;
  --driver-simple-card: rgba(248, 249, 250, 0.98);
  --driver-simple-ink: #212529;
  --driver-simple-muted: #6c757d;
  --driver-steel-primary: #343a40;
  --driver-steel-primary-soft: #495057;
  --driver-steel-panel: rgba(255, 255, 255, 0.98);
  --driver-steel-tint: #dee2e6;
  color: var(--driver-simple-ink);
  background:
    linear-gradient(180deg, rgba(248, 249, 250, 0.96), rgba(233, 236, 239, 0.94)),
    var(--page-bg, #f8f9fa);
}

.driver-body.driver-light-steel-ui.driver-theme-night {
  --driver-simple-line: #adb5bd;
  --driver-simple-soft: #e9ecef;
  --driver-simple-card: rgba(248, 249, 250, 0.98);
  --driver-simple-ink: #212529;
  --driver-simple-muted: #6c757d;
}

.driver-body.driver-light-steel-ui .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 249, 250, 0.96);
  border-bottom: 1px solid rgba(173, 181, 189, 0.75);
  backdrop-filter: blur(12px);
}

.driver-body.driver-light-steel-ui .driver-page,
.driver-body.driver-light-steel-ui .topbar-inner,
.driver-body.driver-light-steel-ui.driver-form-locked .driver-section-tabs {
  width: min(var(--driver-simple-max), calc(100vw - 16px));
  max-width: min(var(--driver-simple-max), calc(100vw - 16px));
  margin-inline: auto;
}

.driver-body.driver-light-steel-ui .topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 8px 0;
}

.driver-body.driver-light-steel-ui .brand-block {
  gap: 8px;
  min-width: 0;
}

.driver-body.driver-light-steel-ui .brand-logo {
  max-width: 130px;
  filter: none;
}

.driver-body.driver-light-steel-ui .brand-title strong {
  display: block;
  color: var(--driver-simple-ink);
  font-size: 16px;
  line-height: 1.15;
}

.driver-body.driver-light-steel-ui .brand-title span {
  color: var(--driver-simple-muted);
  font-size: 11px;
  line-height: 1.3;
}

.driver-body.driver-light-steel-ui .driver-clock {
  min-width: 84px;
  padding: 7px 9px;
  color: var(--driver-simple-ink);
  background: #fff;
  border: 1px solid var(--driver-simple-line);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(33, 37, 41, 0.08);
}

.driver-body.driver-light-steel-ui .driver-clock-date {
  color: var(--driver-simple-muted);
  font-size: 11px;
}

.driver-body.driver-light-steel-ui .driver-clock-time {
  color: var(--driver-steel-primary);
  font-size: 21px;
  letter-spacing: 0;
}

.driver-body.driver-light-steel-ui .language-switch {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.driver-body.driver-light-steel-ui .language-btn {
  min-height: 32px;
  padding: 6px 4px;
  border-radius: 9px;
  color: var(--driver-simple-ink);
  background: #fff;
  border: 1px solid var(--driver-simple-line);
  font-size: 12px;
  font-weight: 800;
}

.driver-body.driver-light-steel-ui .language-btn.active {
  color: #fff;
  background: var(--driver-steel-primary);
  border-color: var(--driver-steel-primary);
}

.driver-body.driver-light-steel-ui .driver-page {
  padding: 12px 0 22px;
}

.driver-body.driver-light-steel-ui .driver-login-panel,
.driver-body.driver-light-steel-ui .panel,
.driver-body.driver-light-steel-ui .driver-returned-reminder,
.driver-body.driver-light-steel-ui .activity-address-driver-panel,
.driver-body.driver-light-steel-ui .meal-driver-panel,
.driver-body.driver-light-steel-ui .project-gate-card {
  overflow: hidden;
  border: 1px solid var(--driver-simple-line);
  border-radius: var(--driver-simple-radius);
  background: var(--driver-steel-panel);
  box-shadow: 0 18px 36px rgba(33, 37, 41, 0.1);
}

.driver-body.driver-light-steel-ui .driver-login-panel {
  display: grid;
  gap: 0;
}

.driver-body.driver-light-steel-ui .driver-login-visual {
  min-height: 210px;
  border-radius: 0;
}

.driver-body.driver-light-steel-ui .driver-login-shade {
  background: linear-gradient(180deg, rgba(33, 37, 41, 0.28), rgba(33, 37, 41, 0.72));
}

.driver-body.driver-light-steel-ui .driver-login-copy {
  inset: auto auto 16px 18px;
  max-width: calc(100% - 36px);
}

.driver-body.driver-light-steel-ui .driver-login-copy h1 {
  font-size: 27px;
  letter-spacing: 0;
}

.driver-body.driver-light-steel-ui .driver-login-copy p {
  font-size: 14px;
  line-height: 1.5;
}

.driver-body.driver-light-steel-ui .driver-login-content {
  padding: 16px;
}

.driver-body.driver-light-steel-ui .driver-login-topline {
  width: fit-content;
  margin-bottom: 12px;
  padding: 8px 10px;
  color: var(--driver-steel-primary);
  background: var(--driver-steel-tint);
  border-radius: 12px;
}

.driver-body.driver-light-steel-ui .panel-header {
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff, #f8f9fa);
  border-bottom: 1px solid rgba(173, 181, 189, 0.7);
}

.driver-body.driver-light-steel-ui .panel-header h2,
.driver-body.driver-light-steel-ui .activity-address-driver-panel h2,
.driver-body.driver-light-steel-ui .meal-driver-panel h2 {
  color: var(--driver-simple-ink);
  font-size: 23px;
  line-height: 1.16;
}

.driver-body.driver-light-steel-ui .panel-body {
  gap: 14px;
  padding: 15px;
}

.driver-body.driver-light-steel-ui #tripForm .grid,
.driver-body.driver-light-steel-ui #tripForm .grid.two,
.driver-body.driver-light-steel-ui #tripForm .grid.three,
.driver-body.driver-light-steel-ui .driver-identity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

.driver-body.driver-light-steel-ui .field label,
.driver-body.driver-light-steel-ui .field-label,
.driver-body.driver-light-steel-ui .fixed-shuttle-extra summary,
.driver-body.driver-light-steel-ui .invoice-info-toggle strong {
  color: var(--driver-simple-ink);
  font-size: 16px;
  font-weight: 850;
}

.driver-body.driver-light-steel-ui input,
.driver-body.driver-light-steel-ui select,
.driver-body.driver-light-steel-ui textarea,
.driver-body.driver-light-steel-ui .calendar-input {
  min-height: 54px;
  padding: 13px 14px;
  color: var(--driver-simple-ink);
  background: #fff;
  border: 1px solid #adb5bd;
  border-radius: 12px;
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.driver-body.driver-light-steel-ui input:focus,
.driver-body.driver-light-steel-ui select:focus,
.driver-body.driver-light-steel-ui textarea:focus {
  border-color: #495057;
  box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.16);
  outline: none;
}

.driver-body.driver-light-steel-ui .driver-kind-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.driver-body.driver-light-steel-ui .driver-kind-option,
.driver-body.driver-light-steel-ui .itinerary-field,
.driver-body.driver-light-steel-ui .image-upload-field,
.driver-body.driver-light-steel-ui .other-fee-section,
.driver-body.driver-light-steel-ui .invoice-info-card,
.driver-body.driver-light-steel-ui .time-safety,
.driver-body.driver-light-steel-ui .fee-total-box {
  background: #f8f9fa;
  border: 1px solid var(--driver-simple-line);
  border-radius: 14px;
}

.driver-body.driver-light-steel-ui .driver-kind-option.is-selected,
.driver-body.driver-light-steel-ui .project-picker-field {
  background: #e9ecef;
  border-color: #495057;
  box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.1);
}

.driver-body.driver-light-steel-ui .time-row,
.driver-body.driver-light-steel-ui .plate-row {
  gap: 9px;
}

.driver-body.driver-light-steel-ui .time-row select {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.driver-body.driver-light-steel-ui .date-quick-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.driver-body.driver-light-steel-ui .quick-date-btn,
.driver-body.driver-light-steel-ui .file-picker-label,
.driver-body.driver-light-steel-ui .add-row-btn {
  min-height: 44px;
  color: var(--driver-steel-primary);
  background: #f8f9fa;
  border: 1px solid var(--driver-simple-line);
  border-radius: 11px;
  font-weight: 850;
}

.driver-body.driver-light-steel-ui .addable-row {
  padding: 12px;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 14px;
}

.driver-body.driver-light-steel-ui .other-fee-row {
  grid-template-columns: 1fr;
}

.driver-body.driver-light-steel-ui .fee-total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 16px;
  background: linear-gradient(90deg, #f8f9fa, #e9ecef);
}

.driver-body.driver-light-steel-ui .fee-total-box strong {
  color: var(--driver-steel-primary);
  font-size: 26px;
}

.driver-body.driver-light-steel-ui .button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.driver-body.driver-light-steel-ui .btn {
  min-height: 50px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
}

.driver-body.driver-light-steel-ui .btn.primary,
.driver-body.driver-light-steel-ui #submitBtn {
  color: #fff;
  background: linear-gradient(180deg, #495057, #343a40);
  border-color: #343a40;
}

.driver-body.driver-light-steel-ui #submitBtn {
  grid-column: 1 / -1;
  min-height: 56px;
  order: -1;
  font-size: 18px;
}

.driver-body.driver-light-steel-ui .driver-section-tabs {
  position: sticky;
  top: 74px;
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px auto;
  padding: 6px;
  border: 1px solid var(--driver-simple-line);
  border-radius: 15px;
  background: rgba(248, 249, 250, 0.96);
  box-shadow: 0 10px 24px rgba(33, 37, 41, 0.08);
}

.driver-body.driver-light-steel-ui .driver-section-tab {
  min-height: 42px;
  padding: 8px 4px;
  color: var(--driver-simple-muted);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 900;
}

.driver-body.driver-light-steel-ui .driver-section-tab.active {
  color: #fff;
  background: #343a40;
  border-color: #343a40;
  box-shadow: 0 8px 18px rgba(33, 37, 41, 0.22);
}

.driver-body.driver-light-steel-ui .notice,
.driver-body.driver-light-steel-ui .errors,
.driver-body.driver-light-steel-ui .project-gate-card {
  border-radius: 13px;
}

.driver-body.driver-light-steel-ui .project-gate-card {
  display: block;
  padding: 14px;
  color: var(--driver-simple-ink);
  background: #e9ecef;
  border-color: #adb5bd;
}

.driver-body.driver-light-steel-ui .project-gate-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
}

.driver-body.driver-light-steel-ui .project-gate-card span {
  color: var(--driver-simple-muted);
  font-size: 14px;
}

.driver-body.driver-light-steel-ui.driver-project-pending #driverSectionTabs,
.driver-body.driver-light-steel-ui.driver-project-pending #activityAddressDriverPanel,
.driver-body.driver-light-steel-ui.driver-project-pending #mealSignupPanel,
.driver-body.driver-light-steel-ui.driver-project-pending .driver-returned-reminder {
  display: none !important;
}

.driver-body.driver-light-steel-ui.driver-project-pending #tripForm .panel-header {
  display: none !important;
}

.driver-body.driver-light-steel-ui.driver-project-pending #tripForm .panel-body > :not(.errors):not(.notice):not(.project-gate-card):not(.project-picker-row) {
  display: none !important;
}

.driver-body.driver-light-steel-ui.driver-project-pending #tripForm .project-picker-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.driver-body.driver-light-steel-ui.driver-project-pending #tripForm .project-picker-row > .field:not(.project-picker-field) {
  display: none !important;
}

.driver-body.driver-light-steel-ui.driver-project-pending #projectPickerField {
  padding: 16px;
  background: #fff;
  border: 1px solid #495057;
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(33, 37, 41, 0.12);
}

.driver-body.driver-light-steel-ui.driver-project-pending #projectPickerField label {
  margin-bottom: 8px;
  font-size: 18px;
}

.driver-body.driver-light-steel-ui.driver-project-pending #projectPickerField select,
.driver-body.driver-light-steel-ui.driver-project-pending #projectPickerField input {
  min-height: 58px;
  font-size: 18px;
  font-weight: 850;
}

.driver-body.driver-light-steel-ui.driver-project-pending #tripForm {
  margin-top: 10px;
}

@media (max-width: 480px) {
  .driver-body.driver-light-steel-ui {
    --driver-simple-max: 100%;
  }

  .driver-body.driver-light-steel-ui .driver-page,
  .driver-body.driver-light-steel-ui .topbar-inner,
  .driver-body.driver-light-steel-ui.driver-form-locked .driver-section-tabs {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
  }

  .driver-body.driver-light-steel-ui .brand-logo {
    max-width: 118px;
  }

  .driver-body.driver-light-steel-ui .driver-clock {
    min-width: 76px;
  }

  .driver-body:not(.driver-form-locked) .topbar-inner,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .topbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand clock"
      "lang lang";
    align-items: center;
    gap: 7px 12px;
    min-height: 0;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .driver-body:not(.driver-form-locked) .brand-block,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .brand-block {
    grid-area: brand;
    gap: 0;
    width: auto;
  }

  .driver-body:not(.driver-form-locked) .brand-logo,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .brand-logo {
    width: clamp(150px, 42vw, 166px);
    max-width: clamp(150px, 42vw, 166px);
  }

  .driver-body:not(.driver-form-locked) .brand-title,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .brand-title {
    display: none;
  }

  .driver-body:not(.driver-form-locked) .language-switch,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .language-switch {
    grid-area: lang;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    align-self: auto;
  }

  .driver-body:not(.driver-form-locked) .language-btn,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .language-btn {
    min-height: 28px;
    padding: 2px 4px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.05;
    font-weight: 820;
    white-space: nowrap;
  }

  .driver-body:not(.driver-form-locked) .driver-clock,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .driver-clock {
    grid-area: clock;
    align-self: center;
    justify-content: center;
    justify-items: end;
    min-width: 132px;
    min-height: 0;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .driver-body:not(.driver-form-locked) .driver-clock-date,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .driver-clock-date {
    color: rgba(219, 234, 254, 0.86);
    font-size: 13px;
    line-height: 1.05;
    font-weight: 820;
    letter-spacing: 0;
  }

  .driver-body:not(.driver-form-locked) .driver-clock-time,
  .driver-body.driver-light-steel-ui:not(.driver-form-locked) .driver-clock-time {
    color: #eaf2ff;
    font-size: 27px;
    line-height: 1.02;
    font-weight: 860;
    letter-spacing: 0;
  }

  .driver-body.driver-light-steel-ui .panel-body,
  .driver-body.driver-light-steel-ui .driver-login-content {
    padding: 13px;
  }
}

@media (max-width: 430px) {
  .driver-login-visual {
    min-height: 280px;
  }

  .driver-login-visual > img {
    object-position: 56% 10%;
  }

  .driver-login-brand-card span {
    display: none;
  }

  .driver-login-copy h1 {
    font-size: 22px;
  }

  .driver-login-stats {
    display: none;
  }

  .driver-login-topline {
    display: block;
  }

  .driver-login-topline small {
    display: block;
    max-width: none;
    margin-top: 8px;
    text-align: left;
  }

  .driver-kind-selector,
  .driver-login-panel .button-row {
    grid-template-columns: 1fr;
  }

  .driver-login-content .driver-kind-selector,
  .driver-login-panel .button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-login-panel #driverLoginBtn,
  .driver-login-panel #driverRegisterBtn {
    grid-column: auto;
  }

  .driver-login-panel .button-row .driver-app-download-btn,
  .driver-login-panel .button-row .driver-ios-download-btn {
    min-height: 48px;
    padding-right: 8px;
    padding-left: 8px;
    font-size: clamp(17px, 5vw, 20px);
  }

  .driver-login-content .account-sms-row {
    grid-template-columns: 1fr;
  }

  .driver-login-content .account-sms-row .btn {
    width: 100%;
  }

  .driver-login-panel #driverForgotPinBtn {
    grid-column: 1 / -1;
  }
}

.ledger-body {
  background: #f3f6f7;
}

.ledger-body .topbar-inner,
.ledger-body .page {
  max-width: none;
  width: 100%;
}

.ledger-topbar-inner {
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(260px, 1fr);
  align-items: start;
  padding: 6px 14px;
  gap: 6px 10px;
}

.ledger-body .topbar {
  background: rgba(255, 255, 255, 0.96);
}

.ledger-body .brand-block {
  gap: 9px;
}

.ledger-body .brand-logo {
  width: 170px;
  max-width: 28vw;
}

.ledger-body .brand-title {
  gap: 0;
}

.ledger-body .brand-title strong {
  font-size: 17px;
  line-height: 1.2;
}

.ledger-body .brand-title span {
  font-size: 12px;
  line-height: 1.25;
}

.ledger-page-nav-row {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.ledger-page-switcher {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.ledger-page-nav-row > .btn,
.ledger-page-switcher .btn {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.ledger-topbar-inner > .button-row,
.ledger-topbar-inner > .customer-billing-toolbar,
.ledger-topbar-inner > .ledger-cell-tools,
.ledger-topbar-inner > .ledger-row-tools {
  grid-column: 1 / -1;
}

.ledger-action-row {
  justify-content: flex-end;
  gap: 6px;
  margin-top: 0;
}

.ledger-action-row .btn {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
}

.ledger-context-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
}

.ledger-context-tools > [hidden] {
  display: none !important;
}

.ledger-page-nav-row > .btn:first-child {
  justify-self: start;
}

.ledger-page-nav-row > .btn:last-child {
  justify-self: end;
}

.ledger-page-switcher .btn[aria-current="page"],
.ledger-page-switcher .btn.active {
  background: var(--brand);
  color: var(--on-brand, #fff);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.ledger-cell-tools {
  display: flex;
  flex: 1 1 360px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 240px;
}

.ledger-cell-tools span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ledger-cell-tools button {
  min-height: 26px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 6px;
  padding: 3px 7px;
  background: #fff;
  color: #0f3d38;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.ledger-cell-tools button[data-ledger-color="#FFF59D"],
.ledger-cell-tools button[data-ledger-project-preview-driver-color="#FFF59D"],
.ledger-cell-tools button[data-ledger-project-preview-row-color="#FFF59D"] {
  background: #fff59d;
}

.ledger-cell-tools button[data-ledger-color="#BBF7D0"],
.ledger-cell-tools button[data-ledger-project-preview-driver-color="#BBF7D0"],
.ledger-cell-tools button[data-ledger-project-preview-row-color="#BBF7D0"] {
  background: #bbf7d0;
}

.ledger-cell-tools button[data-ledger-color="#BFDBFE"],
.ledger-cell-tools button[data-ledger-project-preview-driver-color="#BFDBFE"],
.ledger-cell-tools button[data-ledger-project-preview-row-color="#BFDBFE"] {
  background: #bfdbfe;
}

.ledger-cell-tools button[data-ledger-color="#FECACA"],
.ledger-cell-tools button[data-ledger-project-preview-driver-color="#FECACA"],
.ledger-cell-tools button[data-ledger-project-preview-row-color="#FECACA"] {
  background: #fecaca;
}

.ledger-cell-tools button[data-ledger-color="#E5E7EB"],
.ledger-cell-tools button[data-ledger-project-preview-driver-color="#E5E7EB"],
.ledger-cell-tools button[data-ledger-project-preview-row-color="#E5E7EB"] {
  background: #e5e7eb;
}

.ledger-cell-tools button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ledger-cell-tools button:hover {
  border-color: rgba(15, 118, 110, 0.62);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.16);
}

.ledger-row-tools {
  display: flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 6px 8px;
  background: #f7fbfa;
}

.ledger-row-tools span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.ledger-row-tool-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ledger-row-tool-buttons button {
  min-height: 30px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ledger-row-tool-buttons button:hover:not(:disabled) {
  border-color: rgba(15, 118, 110, 0.58);
  background: #ecfdf5;
}

.ledger-row-tool-buttons button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.ledger-row-tool-buttons button.danger {
  border-color: rgba(180, 35, 24, 0.28);
  color: #b42318;
}

.ledger-row-tool-buttons button.danger:hover:not(:disabled) {
  background: #fef3f2;
}

.ledger-page {
  padding: 8px 10px 18px;
}

.ledger-status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.ledger-status-panel > div:first-child {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.ledger-status-panel strong {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1.2;
}

.ledger-status-panel .hint {
  display: inline-flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  margin-top: 0;
  font-size: 12px;
  line-height: 1.35;
}

.ledger-status-panel .notice {
  flex: 0 1 auto;
  align-self: center;
  max-width: min(360px, 36vw);
  margin: 0;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.ledger-stat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}

.ledger-stat-badges span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  padding: 2px 7px;
  background: #eefaf7;
  color: #0f5f57;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.ledger-stat-badges a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 2px 7px;
  background: #eefaf7;
  color: #0f5f57;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.04);
}

.ledger-stat-badges a:hover,
.ledger-stat-badges a:focus-visible {
  border-color: #0f766e;
  background: #ddf6ef;
  outline: none;
}

.ledger-stat-badges strong {
  display: inline;
  color: #0f766e;
  font-size: 12px;
}

.billing-total-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 2px 10px;
  background: #eaf8ef;
  color: #0f4f48;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
}

.ledger-sheet-shell {
  max-width: 100%;
  border: 1px solid #2f3a3a;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ledger-view-tabs {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  padding: 2px;
  background: #eef7f5;
  gap: 2px;
}

.ledger-view-tab {
  min-width: 86px;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  background: transparent;
  color: #0f4f48;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.ledger-view-tab.active {
  background: #0f766e;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.18);
}

.ledger-view-tab:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.4);
  outline-offset: 2px;
}

.ledger-view {
  display: grid;
  gap: 8px;
}

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

.ledger-project-preview-panel {
  display: grid;
  gap: 6px;
}

.ledger-project-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  padding: 5px 8px;
  background: #f7fffc;
  box-shadow: var(--shadow);
}

.ledger-project-preview-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ledger-project-preview-header strong,
.ledger-project-preview-header .hint {
  display: inline-flex;
  line-height: 1.35;
}

.ledger-project-preview-header strong {
  flex: 0 0 auto;
  font-size: 15px;
}

.ledger-project-preview-header .hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ledger-project-preview-warnings {
  flex-shrink: 0;
}

.ledger-project-preview-warning-badge,
.ledger-project-preview-ok-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 850;
}

.ledger-project-preview-warning-badge {
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: #fff7f7;
  color: #b42318;
}

.ledger-project-preview-ok-badge {
  border: 1px solid rgba(15, 118, 110, 0.2);
  background: #e8f8f3;
  color: #0f5f57;
}

.ledger-unsettled-sheet th:first-child,
.ledger-unsettled-sheet td:first-child {
  width: 78px;
  text-align: center;
}

.ledger-unsettled-sheet td {
  vertical-align: middle;
}

.ledger-unsettled-sheet td strong {
  display: block;
  font-weight: 800;
}

.ledger-unsettled-sheet td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.ledger-unsettled-preview-btn {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 13px;
}

.ledger-unsettled-missing {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid rgba(185, 28, 28, 0.24);
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

.ledger-unsettled-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 230px;
}

.ledger-unsettled-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.ledger-unsettled-status-chip.included {
  background: #eefbf6;
  color: #0f766e;
}

.ledger-unsettled-status-chip.missing {
  background: #fff7ed;
  border-color: rgba(185, 28, 28, 0.24);
  color: #9a3412;
}

.ledger-project-preview-shell {
  border-color: rgba(15, 118, 110, 0.4);
}

.ledger-project-preview-scroll {
  max-height: 360px;
}

.ledger-legacy-preview-scroll {
  max-height: 360px;
}

.ledger-project-preview-sheet {
  min-width: 2100px;
}

.ledger-project-preview-sheet td {
  background: #fbfefe;
  height: 52px;
  max-height: 52px;
  overflow: hidden;
}

.ledger-project-preview-expanded-row td {
  height: auto;
  max-height: none;
}

.ledger-project-preview-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  max-height: 52px;
  box-sizing: border-box;
  padding: 5px 8px;
  color: #121826;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-align: center;
}

.ledger-project-preview-expanded-row .ledger-project-preview-cell {
  min-height: 52px;
  max-height: none;
}

.ledger-project-preview-money {
  color: #0f3d38;
  font-weight: 850;
}

.ledger-project-preview-driver-costs {
  display: block;
  position: relative;
  text-align: left;
  white-space: normal;
}

.ledger-project-driver-cost-box {
  display: grid;
  position: relative;
  min-height: 42px;
  max-height: 42px;
  padding-right: 80px;
  gap: 2px;
  overflow: hidden;
}

.ledger-project-driver-cost-box.expanded {
  max-height: none;
  padding-right: 0;
  overflow: visible;
}

.ledger-project-driver-cost-lines {
  display: grid;
  gap: 1px;
}

.ledger-project-driver-cost-source {
  margin: 2px 0 1px;
  padding: 1px 4px;
  border-left: 3px solid rgba(15, 118, 110, 0.45);
  color: #0f5f57;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  background: rgba(15, 118, 110, 0.08);
}

.ledger-project-driver-cost-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 1px 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.ledger-project-driver-cost-project {
  flex: 0 0 auto;
  max-width: 72px;
  border-radius: 999px;
  padding: 0 5px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f5f57;
  font-size: 10px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-project-driver-cost-text {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-project-driver-cost-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 900;
}

.ledger-project-driver-cost-paid {
  background: #dcfce7;
  color: #14532d;
  border-color: rgba(22, 101, 52, 0.24);
}

.ledger-project-driver-cost-paid .ledger-project-driver-cost-status {
  background: #15803d;
  color: #fff;
}

.ledger-project-driver-cost-partial {
  background: #fef3c7;
  color: #713f12;
  border-color: rgba(146, 64, 14, 0.28);
}

.ledger-project-driver-cost-partial .ledger-project-driver-cost-status {
  background: #b45309;
  color: #fff;
}

.ledger-project-driver-cost-unpaid .ledger-project-driver-cost-status {
  background: rgba(100, 116, 139, 0.16);
  color: #475569;
}

.ledger-project-driver-cost-line:hover,
.ledger-project-driver-cost-line.selected {
  border-color: rgba(15, 118, 110, 0.58);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.ledger-project-driver-cost-line.selected {
  background-image: linear-gradient(rgba(15, 118, 110, 0.08), rgba(15, 118, 110, 0.08));
}

.ledger-legacy-driver-cost-line {
  cursor: default;
}

.ledger-project-driver-cost-toggle {
  position: absolute;
  right: 5px;
  bottom: 4px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 6px;
  padding: 1px 6px;
  background: #f7fffc;
  color: #0f5f57;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.ledger-project-driver-cost-box.expanded .ledger-project-driver-cost-toggle {
  position: static;
  justify-self: end;
  margin-top: 2px;
}

.ledger-project-driver-cost-toggle:hover {
  background: #e8f8f3;
}

.ledger-project-driver-cost-box em {
  position: absolute;
  right: 5px;
  top: 4px;
  color: #64706b;
  font-size: 11px;
  font-style: normal;
}

.ledger-driver-cost-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1700;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.58);
}

.ledger-driver-cost-detail-modal[hidden] {
  display: none;
}

.ledger-driver-cost-detail-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 96vw);
  max-height: min(86vh, 760px);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 10px;
  overflow: hidden;
  background: #fffdf7;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
}

.ledger-driver-cost-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.18);
  padding: 12px 14px;
  background: #f8f3e8;
}

.ledger-driver-cost-detail-header strong,
.ledger-driver-cost-detail-header span {
  display: block;
}

.ledger-driver-cost-detail-header strong {
  color: #17201c;
  font-size: 18px;
}

.ledger-driver-cost-detail-header span {
  margin-top: 3px;
  color: #52635b;
  font-size: 13px;
}

.ledger-driver-cost-detail-body {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.ledger-driver-cost-detail-table-wrap {
  overflow: auto;
}

.ledger-driver-cost-detail-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.ledger-driver-cost-detail-table th,
.ledger-driver-cost-detail-table td {
  border: 1px solid rgba(30, 41, 59, 0.2);
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.ledger-driver-cost-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf2ef;
  color: #17201c;
  font-weight: 900;
}

.ledger-driver-cost-detail-paid-row td {
  background: #ecfdf5;
}

.ledger-driver-cost-detail-money {
  color: #7f1d1d;
  font-weight: 900;
}

.ledger-project-preview-edit-input {
  display: block;
  width: 100%;
  height: 38px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 6px;
  padding: 4px 7px;
  background: #fffdf2;
  color: #121826;
  font: inherit;
  line-height: 1.25;
  text-align: center;
  outline: none;
}

.ledger-project-preview-edit-input:focus {
  border-color: rgba(15, 118, 110, 0.45);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.ledger-project-preview-money-input {
  color: #0f3d38;
  font-weight: 850;
}

.ledger-project-preview-edited-input {
  color: #dc2626;
  font-weight: 850;
}

.ledger-project-preview-warning-cell {
  color: #b42318;
  font-weight: 900;
}

.ledger-project-preview-warning-detail td {
  padding: 7px 10px;
  background: #fff7f7;
  color: #b42318;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}

.ledger-sheet-scroll {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 178px);
  overflow-x: scroll;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  scrollbar-gutter: stable;
}

.ledger-sheet {
  width: auto;
  min-width: 2200px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
}

.driver-billing-sheet,
.customer-billing-sheet {
  min-width: 1500px;
}

.ledger-sheet th,
.ledger-sheet td {
  width: auto;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--online-table-grid-line);
  border-bottom: 1px solid var(--online-table-grid-line);
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.ledger-sheet th {
  position: sticky;
  top: 0;
  z-index: 6;
  min-height: 58px;
  padding: 6px;
  background: #cfeaf7;
  color: #111827;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
}

.ledger-head-cell {
  display: grid;
  gap: 5px;
  align-items: center;
  position: relative;
}

.ledger-head-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

.ledger-head-label {
  display: block;
  flex: 0 1 auto;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 0;
  max-width: calc(100% - 27px);
  overflow: hidden;
  text-overflow: clip;
}

.ledger-filter-menu-btn {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 5px;
  padding: 0;
  background: rgba(255, 255, 255, 0.86);
  color: #0f766e;
  font: 800 13px/1 system-ui, sans-serif;
  cursor: pointer;
}

.ledger-filter-menu-btn:hover,
.ledger-filter-menu-btn.active {
  border-color: rgba(15, 118, 110, 0.62);
  background: #0f766e;
  color: #fff;
}

.ledger-sheet th.ledger-filter-open {
  z-index: 32;
  overflow: visible;
}

.route-ledger-sheet th.ledger-filter-open[data-freeze-col] {
  z-index: 44;
}

.ledger-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(260px, 82vw);
  max-height: 320px;
  margin-top: 0;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: #10201d;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  text-align: left;
  white-space: normal;
}

.ledger-filter-menu-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #0f766e;
}

.ledger-filter-menu-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.ledger-filter-menu-actions button {
  min-height: 28px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 6px;
  padding: 0 8px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ledger-filter-menu-actions button:hover {
  background: #dff8ee;
}

.ledger-filter-menu-summary {
  margin-bottom: 8px;
  color: #66746f;
  font-size: 12px;
  font-weight: 700;
}

.ledger-filter-options {
  display: grid;
  gap: 4px;
  max-height: 210px;
  overflow: auto;
  padding-right: 2px;
}

.ledger-filter-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 6px;
  padding: 3px 4px;
  color: #17231f;
  font-size: 12px;
  font-weight: 700;
}

.ledger-filter-option input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: #0f766e;
}

.ledger-filter-option:hover {
  background: #f0fdfa;
}

.ledger-filter-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-filter-option em {
  color: #66746f;
  font-style: normal;
  font-size: 11px;
}

.ledger-filter-empty {
  padding: 8px 2px;
  color: #66746f;
  font-size: 12px;
  font-weight: 700;
}

.ledger-filter-input {
  width: 100%;
  min-height: 28px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 6px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #10201d;
  font: 600 12px/1.2 inherit;
  text-align: center;
  outline: none;
}

.ledger-filter-input:focus {
  border-color: rgba(15, 118, 110, 0.58);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.18);
}

.ledger-sheet th:nth-child(1),
.ledger-sheet td:nth-child(1) {
  min-width: 0;
}

.ledger-sheet th:nth-child(5),
.ledger-sheet td:nth-child(5),
.ledger-sheet th:nth-child(9),
.ledger-sheet td:nth-child(9) {
  min-width: 0;
}

.ledger-sheet th:nth-child(12),
.ledger-sheet td:nth-child(12),
.ledger-sheet th:nth-child(13),
.ledger-sheet td:nth-child(13) {
  min-width: 0;
}

.ledger-sheet-scroll::-webkit-scrollbar {
  height: 12px;
}

.ledger-sheet-scroll::-webkit-scrollbar-track {
  background: #e5ecea;
}

.ledger-sheet-scroll::-webkit-scrollbar-thumb {
  border: 3px solid #e5ecea;
  border-radius: 999px;
  background: #0f766e;
}

.ledger-sheet th.ledger-ops-head {
  background: #8ef093;
}

.ledger-sheet th.ledger-row-select-head {
  background: #e7f5f2;
}

.ledger-row-select-title {
  min-height: 52px;
  align-content: center;
  color: #0f3d38;
}

.ledger-sheet td.ledger-ops-cell {
  background: #f5fff5;
}

.ledger-sheet td.ledger-colored-cell {
  background-clip: padding-box;
}

.ledger-selected-cell {
  outline: 3px solid rgba(234, 179, 8, 0.8);
  outline-offset: -3px;
}

.ledger-row-select-cell {
  background: #fbfdfc;
  text-align: center;
}

.ledger-main-view .ledger-row-select-cell,
.driver-billing-body .ledger-row-select-cell {
  padding: 0 6px;
}

.ledger-row-select-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  white-space: nowrap;
}

.ledger-row-select-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.ledger-row-select-control input {
  width: 16px;
  height: 16px;
  accent-color: #0f766e;
}

.ledger-selected-row td {
  background-image: linear-gradient(rgba(15, 118, 110, 0.055), rgba(15, 118, 110, 0.055));
}

.ledger-sheet .empty-cell {
  padding: 24px;
  color: var(--muted);
  background: #fff;
}

.ledger-preview-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin-top: 6px;
  border: 1px solid rgba(15, 118, 110, 0.36);
  border-radius: 6px;
  padding: 3px 8px;
  background: #fff;
  color: #0f766e;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.ledger-main-view .ledger-preview-row-action,
.ledger-main-view .ledger-preview-unavailable,
.driver-billing-body .ledger-preview-row-action,
.driver-billing-body .ledger-preview-unavailable {
  margin-top: 0;
}

.ledger-preview-row-action:hover,
.ledger-preview-row-action:focus-visible {
  background: #e5f7f3;
  outline: none;
}

.ledger-preview-unavailable {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.ledger-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.62);
}

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

.ledger-preview-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(920px, 96vw);
  max-height: 92vh;
  max-height: 92dvh;
  border-radius: 10px;
  overflow: hidden;
  background: #f8faf9;
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.34);
}

.ledger-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: #fff;
}

.ledger-preview-header strong,
.ledger-preview-title-row strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
}

.ledger-preview-header span,
.ledger-preview-title-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.ledger-preview-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.ledger-preview-loading {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: #0f766e;
  font-weight: 850;
}

.ledger-preview-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.ledger-preview-badges {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ledger-preview-title-row em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  background: #e5f7f3;
  color: #0f766e;
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
}

.ledger-preview-title-row em.ledger-preview-source-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.ledger-preview-section {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.ledger-preview-section h4 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: #eefaf7;
  color: #0f5f57;
  font-size: 15px;
}

.ledger-preview-section dl {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.ledger-preview-section dt,
.ledger-preview-section dd {
  min-width: 0;
  border-bottom: 1px solid #edf2f1;
  padding: 9px 12px;
  line-height: 1.45;
}

.ledger-preview-section dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ledger-preview-section dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.ledger-preview-section dl dt:last-of-type,
.ledger-preview-section dl dd:last-of-type {
  border-bottom: 0;
}

.ledger-preview-warn {
  color: #b42318 !important;
  font-weight: 850;
}

.ledger-preview-fees {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ledger-preview-fees span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.ledger-preview-photos {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.ledger-preview-photo-group {
  display: grid;
  gap: 8px;
}

.ledger-preview-photo-group strong {
  color: var(--ink);
  font-size: 14px;
}

.ledger-preview-photo-group em {
  color: var(--muted);
  font-style: normal;
}

.ledger-preview-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ledger-preview-thumb {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.ledger-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ledger-preview-empty {
  color: var(--muted);
  font-size: 13px;
}

.ledger-input {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  padding: 6px 8px;
  background: transparent;
  color: #121826;
  font: inherit;
  text-align: center;
  outline: none;
}

.ledger-sheet .ledger-input {
  background: transparent !important;
}

.ledger-input:focus {
  background: #fffde8;
  box-shadow: inset 0 0 0 2px #eab308;
}

.route-ledger-sheet th.route-ledger-image-head,
.route-ledger-sheet td[data-type="image"] {
  background: #f5fff5;
}

.route-ledger-sheet th[data-freeze-col],
.route-ledger-sheet td[data-freeze-col] {
  position: sticky;
  background: #fff;
}

.route-ledger-sheet th[data-freeze-col] {
  z-index: 9;
  background: #cfeaf7;
}

.route-ledger-sheet td[data-freeze-col] {
  z-index: 4;
}

.route-ledger-sheet th[data-freeze-col="1"],
.route-ledger-sheet td[data-freeze-col="1"] {
  left: var(--route-freeze-left-1, 0);
}

.route-ledger-sheet th[data-freeze-col="2"],
.route-ledger-sheet td[data-freeze-col="2"] {
  left: var(--route-freeze-left-2, 0);
}

.route-ledger-sheet th[data-freeze-col="3"],
.route-ledger-sheet td[data-freeze-col="3"] {
  left: var(--route-freeze-left-3, 0);
  box-shadow: 3px 0 0 rgba(15, 23, 42, 0.12);
}

.route-ledger-sheet th.route-ledger-image-head[data-freeze-col],
.route-ledger-sheet td[data-type="image"][data-freeze-col] {
  background: #f5fff5;
}

.route-ledger-cell {
  display: -webkit-box;
  min-height: 32px;
  max-height: calc(1.35em * 4 + 14px);
  padding: 7px 8px;
  color: #121826;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.route-ledger-edit-input {
  display: block;
  width: 100%;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 8px;
  background: transparent;
  color: #121826;
  font: inherit;
  line-height: 1.35;
  text-align: inherit;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.route-ledger-sheet .route-ledger-cell,
.route-ledger-sheet .route-ledger-edit-input {
  background: transparent !important;
}

.route-ledger-edit-textarea {
  min-height: 58px;
  max-height: calc(1.35em * 4 + 18px);
  resize: vertical;
  overflow: auto;
}

.route-ledger-edit-input:hover {
  background: rgba(15, 118, 110, 0.04);
}

.route-ledger-edit-input:focus {
  border-color: rgba(15, 118, 110, 0.45);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.route-ledger-edited-input {
  color: #dc2626;
  font-weight: 800;
  background: #fff7f7;
}

.driver-billing-cell {
  display: -webkit-box;
  min-height: 31px;
  max-height: calc(1.28em * 2 + 12px);
  padding: 6px 7px;
  color: #121826;
  line-height: 1.28;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.customer-billing-driver-plate-cell {
  display: flex;
  min-height: 36px;
  max-height: 48px;
  min-width: max-content;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  overflow-wrap: normal;
  word-break: keep-all;
}

.billing-date-cell {
  display: flex;
  min-height: 36px;
  max-height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow-wrap: normal;
  word-break: keep-all;
}

.billing-date-year,
.billing-date-month-day {
  display: block;
  white-space: nowrap;
  line-height: 1.12;
}

.billing-date-year {
  color: #64706b;
  font-size: 11px;
  font-weight: 750;
}

.billing-date-month-day {
  color: #121826;
  font-size: 13px;
  font-weight: 850;
}

.customer-billing-driver-name,
.customer-billing-plate-no {
  display: block;
  white-space: nowrap;
}

.online-billing-fee-cell {
  background: #eaf8ef;
}

.driver-billing-computed-td {
  background: #f8fafc;
}

.driver-billing-warning-td {
  background: #fff7f7;
}

.driver-billing-payment-select {
  font-weight: 850;
}

.online-billing-fee-cell .driver-billing-cell,
.driver-billing-computed-td .driver-billing-cell,
.driver-billing-warning-td .driver-billing-cell,
.online-billing-fee-cell .driver-billing-edit-input {
  background: transparent;
}

.online-billing-fee-cell .driver-billing-edit-input:focus {
  background: #f6fff9;
}

.driver-billing-next-day {
  display: inline-block;
  margin-left: 2px;
  color: #dc2626;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  vertical-align: super;
}

.driver-billing-computed-cell {
  color: #0f3d38;
  font-weight: 800;
}

.driver-billing-warning-cell {
  color: #dc2626;
  font-weight: 900;
}

.driver-billing-edit-input {
  display: block;
  width: 100%;
  min-height: 31px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 7px;
  background: #fffdf2;
  color: #121826;
  font: inherit;
  text-align: center;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.driver-billing-sheet .driver-billing-edit-input {
  background: transparent;
}

.customer-billing-sheet .driver-billing-cell,
.customer-billing-sheet .driver-billing-computed-cell,
.customer-billing-sheet .customer-billing-cell {
  background: transparent !important;
}

.ledger-project-preview-sheet tbody .ledger-project-preview-cell,
.ledger-project-preview-sheet tbody .ledger-project-preview-money-input,
.ledger-project-preview-sheet tbody .ledger-project-preview-edited-input {
  background: transparent !important;
}

.ledger-sheet tbody .ledger-input,
.ledger-sheet tbody .route-ledger-edit-input,
.ledger-sheet tbody .driver-billing-edit-input,
.ledger-project-preview-sheet tbody .ledger-project-preview-edit-input {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.ledger-sheet tbody .ledger-input:focus,
.ledger-sheet tbody .route-ledger-edit-input:focus,
.ledger-sheet tbody .driver-billing-edit-input:focus,
.ledger-project-preview-sheet tbody .ledger-project-preview-edit-input:focus {
  background: transparent !important;
  box-shadow: inset 0 -2px 0 rgba(15, 118, 110, 0.42) !important;
}

.driver-billing-edit-input:focus {
  border-color: rgba(15, 118, 110, 0.45);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.driver-billing-edited-input {
  color: #dc2626;
  font-weight: 800;
}

.driver-billing-saving-input {
  border-color: rgba(220, 38, 38, 0.28);
}

.driver-billing-chauffeur-merge-td {
  vertical-align: middle !important;
}

.driver-billing-chauffeur-merge-box {
  display: flex;
  min-height: 100%;
  padding: 5px 7px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: inherit;
  line-height: 1.18;
  text-align: center;
}

.driver-billing-chauffeur-merge-label,
.driver-billing-chauffeur-merge-note {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.72;
  white-space: nowrap;
}

.driver-billing-chauffeur-merge-value {
  font-size: 14px;
  font-weight: 950;
  color: inherit;
  white-space: nowrap;
}

.customer-billing-layout {
  display: grid;
  gap: 14px;
}

.customer-billing-compact-topbar {
  align-items: center;
  gap: 8px 12px;
  padding-block: 8px;
}

.customer-billing-brand-block {
  min-width: min(520px, 100%);
  align-items: center;
  min-height: 56px;
  max-height: 56px;
  overflow: hidden;
}

.customer-billing-heading {
  min-width: 0;
  gap: 6px;
}

.customer-billing-heading strong {
  line-height: 1.2;
}

.customer-billing-heading .hint {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 8px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
}

.customer-billing-heading .ledger-stat-badges {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin: 0;
  overflow: hidden;
}

.customer-billing-heading .hint > span:last-child {
  flex: 1 1 auto;
  flex-basis: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-billing-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 380px) auto;
  align-items: start;
  gap: 8px 10px;
}

.customer-billing-actions {
  justify-content: flex-end;
  gap: 8px;
}

.customer-billing-group-select {
  --customer-billing-select-bg: var(--panel, #ffffff);
  --customer-billing-select-text: var(--ink, #10201c);
  --customer-billing-select-line: var(--line, #b9cfca);
  --customer-billing-select-focus: var(--brand, #0f766e);
  --customer-billing-option-bg: var(--panel, #ffffff);
  --customer-billing-option-text: var(--ink, #10201c);
  --customer-billing-option-group-text: var(--brand, #0f766e);
  --customer-billing-option-all-bg: var(--soft, #eef8f5);
  --customer-billing-option-all-text: var(--ink, #10201c);
  --customer-billing-option-porsche-bg: #f7e1e7;
  --customer-billing-option-porsche-text: #8b1d3c;
  --customer-billing-option-casual-bg: #edf7f2;
  --customer-billing-option-casual-text: #0f5f52;
  min-width: 210px;
  min-height: 38px;
  height: 38px;
  max-width: min(360px, 100%);
  cursor: pointer;
  color: var(--customer-billing-select-text);
  border-color: var(--customer-billing-select-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--customer-billing-select-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(12, 20, 17, 0.12);
  font-weight: 700;
}

.customer-billing-group-select:focus {
  border-color: var(--customer-billing-select-focus);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--customer-billing-select-focus) 24%, transparent),
    0 10px 24px rgba(12, 20, 17, 0.16);
}

.customer-billing-group-select option,
.customer-billing-group-select optgroup {
  background: var(--customer-billing-option-bg);
  color: var(--customer-billing-option-text);
}

.customer-billing-group-select optgroup {
  color: var(--customer-billing-option-group-text);
  font-weight: 800;
}

.customer-billing-group-select .customer-billing-option-all {
  background: var(--customer-billing-option-all-bg);
  color: var(--customer-billing-option-all-text);
  font-weight: 800;
}

.customer-billing-group-select .customer-billing-option-porsche {
  background: var(--customer-billing-option-porsche-bg);
  color: var(--customer-billing-option-porsche-text);
  font-weight: 760;
}

.customer-billing-group-select .customer-billing-option-casual {
  background: var(--customer-billing-option-casual-bg);
  color: var(--customer-billing-option-casual-text);
}

.customer-billing-notice {
  grid-column: auto;
  justify-self: end;
  min-height: 38px;
  height: 38px;
  margin-bottom: 0;
  max-width: min(260px, 100%);
  padding: 7px 10px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-billing-notice:not(.show) {
  display: none;
}

.customer-billing-group-section {
  display: grid;
  gap: 8px;
}

.customer-billing-group-section + .customer-billing-group-section {
  margin-top: 14px;
}

.customer-billing-directory {
  display: grid;
  gap: 14px;
}

.customer-billing-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--soft) 82%, transparent), color-mix(in srgb, var(--panel) 92%, transparent)),
    var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.customer-billing-directory-head strong,
.customer-billing-directory-head span {
  display: block;
}

.customer-billing-directory-head strong {
  font-size: 18px;
  font-weight: 900;
}

.customer-billing-directory-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.customer-billing-merge-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(420px, 100%);
}

.customer-billing-merge-actions span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0;
  border-radius: 999px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--brand) 10%, var(--soft));
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 850;
}

.customer-billing-directory-buckets {
  display: grid;
  gap: 14px;
}

.customer-billing-directory-bucket {
  display: grid;
  gap: 10px;
}

.customer-billing-directory-bucket h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 16px;
  font-weight: 900;
}

.customer-billing-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.customer-billing-project-card {
  position: relative;
  display: grid;
  min-height: 96px;
  align-content: start;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  box-shadow: 0 8px 20px rgba(12, 20, 17, 0.08);
  cursor: pointer;
}

.customer-billing-project-card.customer-billing-merge-selected {
  border-color: color-mix(in srgb, var(--brand) 62%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent),
    var(--panel);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--brand) 28%, transparent),
    0 10px 22px rgba(12, 20, 17, 0.12);
}

.customer-billing-merge-card {
  border-style: dashed;
}

.customer-billing-project-open {
  display: grid;
  width: 100%;
  min-width: 0;
  align-content: start;
  gap: 5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.customer-billing-project-open:focus-visible {
  border-radius: 6px;
  outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 3px;
}

.customer-billing-merge-check {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 32px;
  width: max-content;
  max-width: 100%;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-radius: 999px;
  padding: 5px 8px;
  background: color-mix(in srgb, var(--panel) 94%, var(--soft));
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(12, 20, 17, 0.08);
  user-select: none;
}

.customer-billing-merge-check:hover {
  border-color: color-mix(in srgb, var(--brand) 48%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.customer-billing-merge-selected .customer-billing-merge-check {
  border-color: color-mix(in srgb, var(--brand) 64%, var(--line));
  background: color-mix(in srgb, var(--brand) 18%, var(--panel));
  color: var(--brand-dark);
}

.customer-billing-merge-check input {
  box-sizing: border-box;
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--brand);
}

.customer-billing-merge-check span {
  display: inline;
  width: auto;
  max-width: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.customer-billing-project-card:hover,
.customer-billing-project-card:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 54%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(12, 20, 17, 0.14);
  outline: none;
}

.customer-billing-project-card span {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 9px;
  background: color-mix(in srgb, var(--brand) 14%, var(--soft));
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 850;
}

.customer-billing-company-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  background: color-mix(in srgb, var(--brand) 16%, var(--panel));
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.customer-billing-project-card .customer-billing-company-chip {
  margin-top: -2px;
}

.customer-billing-company-jiedebao {
  background: color-mix(in srgb, #f59e0b 24%, var(--panel));
  color: #7c2d12;
}

.customer-billing-company-tonghang {
  background: color-mix(in srgb, #64748b 20%, var(--panel));
  color: var(--text);
}

.customer-billing-project-card.customer-billing-option-porsche span {
  background: #f7e1e7;
  color: #8b1d3c;
}

.customer-billing-project-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-billing-project-card em,
.customer-billing-project-card b {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  font-weight: 760;
}

.customer-billing-project-card b {
  color: var(--brand-dark);
}

.customer-billing-detail-mode {
  min-height: 0;
}

.customer-billing-detail-section {
  min-height: 0;
  grid-template-rows: auto auto;
}

.customer-billing-detail-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  padding-top: 2px;
}

.customer-billing-back-list-btn {
  min-height: 34px;
  white-space: nowrap;
}

.customer-billing-detail-section .customer-billing-sheet-shell {
  min-height: 0;
}

.customer-billing-detail-section .ledger-sheet-scroll {
  height: var(--customer-billing-detail-scroll-height, calc(100dvh - 292px));
  max-height: none;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.customer-billing-table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 7px;
  background: #f8fbfa;
  padding: 6px 10px;
  color: var(--text);
}

.customer-billing-table-summary strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.customer-billing-company-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 92%, var(--soft));
  padding: 4px 7px;
  color: var(--text);
  white-space: nowrap;
}

.customer-billing-company-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-billing-company-control select {
  height: 26px;
  min-width: 72px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, var(--brand));
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.customer-billing-company-control select:last-child {
  min-width: 56px;
}

.customer-billing-table-summary span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e5f5ef;
  padding: 3px 9px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .customer-billing-directory-head {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-billing-merge-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .customer-billing-detail-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .customer-billing-company-control {
    grid-column: 1 / -1;
    width: max-content;
    max-width: 100%;
  }
}

.customer-billing-sheet-shell {
  min-width: 0;
}

.route-ledger-saving-input {
  border-color: rgba(220, 38, 38, 0.25);
}

.route-ledger-saved-input {
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}

.route-ledger-image-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  margin: 4px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 6px;
  padding: 6px 10px;
  background: #ecfdf5;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.route-ledger-image-link:hover {
  border-color: rgba(15, 118, 110, 0.5);
  background: #dff8ee;
}

.route-ledger-image-file {
  color: var(--muted);
  font-weight: 800;
}

.admin-body .ledger-sheet-shell,
.admin-body .ledger-sheet-scroll,
.admin-body .customer-billing-sheet-shell {
  border-color: var(--online-table-grid-line) !important;
}

.admin-body .ledger-sheet {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.admin-body .ledger-sheet th,
.admin-body .ledger-sheet td {
  border: 0 !important;
  border-right: 1px solid var(--online-table-grid-line) !important;
  border-bottom: 1px solid var(--online-table-grid-line) !important;
  background-clip: border-box;
  box-shadow: none !important;
}

.admin-body .ledger-sheet tr > :first-child {
  border-left: 1px solid var(--online-table-grid-line) !important;
}

.admin-body .ledger-sheet thead tr:first-child > * {
  border-top: 1px solid var(--online-table-grid-line) !important;
}

.admin-body .ledger-sheet tbody tr:not(.row-selected):not(.ledger-selected-row):not(.ledger-project-preview-warning-detail):not(.driver-billing-paid-row) > td:not(.ledger-colored-cell):not(.ledger-ops-cell):not(.ledger-row-select-cell):not(.online-billing-fee-cell):not(.driver-billing-computed-td):not(.driver-billing-warning-td):not([style*="background"]) {
  background-color: var(--online-table-row-bg) !important;
}

.customer-billing-sheet th[data-customer-freeze-col],
.customer-billing-sheet td[data-customer-freeze-col],
.ledger-project-preview-sheet th[data-ledger-project-freeze-col],
.ledger-project-preview-sheet td[data-ledger-project-freeze-col] {
  position: sticky;
  background-clip: border-box;
}

.customer-billing-sheet th[data-customer-freeze-col],
.ledger-project-preview-sheet th[data-ledger-project-freeze-col] {
  z-index: 38;
}

.customer-billing-sheet th.ledger-filter-open[data-customer-freeze-col],
.ledger-project-preview-sheet th.ledger-filter-open[data-ledger-project-freeze-col] {
  z-index: 72;
  overflow: visible;
}

.customer-billing-sheet td[data-customer-freeze-col],
.ledger-project-preview-sheet td[data-ledger-project-freeze-col] {
  z-index: 12;
}

.customer-billing-sheet td[data-customer-freeze-col]:not(.online-billing-fee-cell),
.ledger-project-preview-sheet td[data-ledger-project-freeze-col]:not([style*="background"]) {
  background-color: var(--online-table-row-bg) !important;
}

.customer-billing-sheet th[data-customer-freeze-edge],
.customer-billing-sheet td[data-customer-freeze-edge],
.ledger-project-preview-sheet th[data-ledger-project-freeze-edge],
.ledger-project-preview-sheet td[data-ledger-project-freeze-edge] {
  box-shadow: 4px 0 0 rgba(15, 23, 42, 0.12) !important;
}

.driver-billing-sheet th.driver-billing-freeze-col,
.driver-billing-sheet td.driver-billing-freeze-col {
  position: sticky;
}

.driver-billing-sheet th.driver-billing-freeze-col {
  z-index: 38;
  background: #cfeaf7;
}

.driver-billing-sheet th.driver-billing-freeze-col.ledger-filter-open {
  z-index: 68;
}

.driver-billing-sheet td.driver-billing-freeze-col {
  z-index: 12;
}

.driver-billing-sheet th.driver-billing-freeze-select {
  background: #e7f5f2;
}

.driver-billing-sheet td.driver-billing-freeze-select {
  background: #fbfdfc;
}

.driver-billing-sheet th.driver-billing-freeze-edge,
.driver-billing-sheet td.driver-billing-freeze-edge {
  box-shadow: 4px 0 0 rgba(15, 23, 42, 0.12);
}

.admin-body .driver-billing-sheet tbody tr.driver-billing-paid-row > td {
  background: #fff1a6 !important;
  background-color: #fff1a6 !important;
  background-image: none !important;
  color: #3f2f00 !important;
}

.admin-body .driver-billing-sheet tbody tr.driver-billing-paid-row .driver-billing-cell,
.admin-body .driver-billing-sheet tbody tr.driver-billing-paid-row .driver-billing-edit-input,
.admin-body .driver-billing-sheet tbody tr.driver-billing-paid-row .driver-billing-payment-select {
  background: transparent !important;
}

.route-ledger-hover-preview {
  position: fixed;
  z-index: 1200;
  display: none;
  min-height: 190px;
  max-height: 300px;
  border: 1px solid rgba(15, 118, 110, 0.26);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
  pointer-events: none;
}

.route-ledger-hover-preview.show {
  display: grid;
  place-items: center;
}

.route-ledger-hover-preview img {
  display: block;
  max-width: 100%;
  max-height: 284px;
  border-radius: 6px;
  object-fit: contain;
}

.route-ledger-image-loading {
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 18px;
  color: #0f766e;
  font-weight: 800;
  text-align: center;
}

.route-ledger-image-loading.error {
  color: #b91c1c;
}

.route-ledger-image-modal[hidden] {
  display: none;
}

.route-ledger-image-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 18px;
}

.route-ledger-image-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}

.route-ledger-image-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(920px, 96vw);
  max-height: 94vh;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.route-ledger-image-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.route-ledger-image-stage {
  display: grid;
  place-items: center;
  min-height: 220px;
  max-height: calc(94vh - 82px);
  overflow: auto;
  border-radius: 8px;
  background: #f8fafc;
}

.route-ledger-image-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(94vh - 98px);
  object-fit: contain;
}

.route-ledger-image-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.route-ledger-image-actions a,
.route-ledger-image-actions button {
  min-height: 34px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 7px;
  padding: 0 12px;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

@media (max-width: 720px) {
  .route-ledger-cell {
    -webkit-line-clamp: 4;
  }

  .route-ledger-edit-input {
    min-height: 34px;
    padding: 7px;
  }

  .route-ledger-image-modal {
    padding: 10px;
  }

  .route-ledger-image-dialog {
    width: 100%;
    max-height: 96vh;
    padding: 10px;
  }

  .route-ledger-image-stage {
    min-height: 260px;
    max-height: calc(96vh - 86px);
  }

  .route-ledger-image-stage img {
    max-height: calc(96vh - 104px);
  }
}

.ledger-auto-input {
  background: #fbfdff;
}

.ledger-edited-input {
  color: #0f5132;
  font-weight: 700;
}

.ledger-money-input {
  text-align: right;
}

.ledger-wide-input {
  text-align: center;
}

.ledger-saved-cell {
  animation: ledgerSavedFlash 0.85s ease;
}

.ledger-manual-row .ledger-input {
  background: #fffef2;
}

@keyframes ledgerSavedFlash {
  0% {
    background: #fff400;
  }
  100% {
    background: transparent;
  }
}

@media (max-width: 760px) {
  .ledger-stat-badges {
    gap: 4px;
  }

  .ledger-stat-badges span {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
  }

  .ledger-preview-modal {
    padding: 8px;
  }

  .ledger-preview-card {
    width: 100%;
    max-height: calc(100dvh - 16px);
  }

  .ledger-preview-header {
    padding: 12px;
  }

  .ledger-preview-section dl {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .ledger-preview-thumb {
    width: 72px;
    height: 72px;
  }

  .ledger-topbar-inner,
  .ledger-status-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .ledger-topbar-inner .button-row {
    justify-content: flex-start;
  }

  .ledger-cell-tools,
  .ledger-row-tools {
    flex: 1 1 auto;
    min-width: 0;
  }

  .ledger-sheet-scroll {
    max-height: calc(100vh - 292px);
  }
}

/* Backend responsive adaptation: keep driver端 untouched. */
@media (max-width: 1180px) and (min-width: 861px) {
  .admin-body .topbar-inner {
    align-items: flex-start;
    gap: 12px;
  }

  .admin-body .topbar .button-row {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-body .topbar .button-row .btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .ledger-body .topbar .button-row .btn {
    width: auto;
    min-height: 30px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .admin-body .admin-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px;
  }

  .admin-body .admin-sidebar-card {
    max-height: calc(100vh - 104px);
  }

  .admin-body .admin-sidebar-action {
    padding: 10px;
  }

  .admin-body .submission-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-body .submission-action-primary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-body .submission-action-primary .btn,
  .admin-body .submission-action-primary .toolbar-menu {
    width: 100%;
  }

  .admin-body .submission-action-primary .toolbar-menu > summary {
    width: 100%;
    justify-content: center;
  }

  .admin-body .compact-actions .btn,
  .admin-body .row-action-summary {
    min-height: 30px;
    padding: 5px 7px;
    font-size: 12px;
  }

  .admin-body #submissionPanel .table-wrap table {
    min-width: max(1080px, 100%);
  }

  .ops-manual-grid,
  .ops-command-grid {
    grid-template-columns: 1fr;
  }

  .ledger-body .ledger-topbar-inner {
    display: grid;
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
    align-items: start;
    gap: 6px 10px;
  }

  .ledger-body .ledger-page-nav-row {
    grid-column: 2;
    grid-row: 1;
  }

  .ledger-body .ledger-topbar-inner > .brand-block {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .ledger-body .ledger-topbar-inner .button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    grid-column: 2;
  }

  .customer-billing-body .customer-billing-toolbar {
    grid-column: 1 / -1;
  }

  .ledger-body .ledger-cell-tools,
  .ledger-body .ledger-row-tools {
    grid-column: 1 / -1;
  }

  .ledger-body .ledger-sheet-scroll {
    max-height: calc(100vh - 218px);
  }
}

@media (max-width: 860px) {
  .admin-body .topbar {
    position: sticky;
    top: 0;
    z-index: 45;
  }

  .admin-body .data-source-status {
    grid-template-columns: 1fr;
    margin: 0 10px 10px;
    padding: 8px 10px;
  }

  .admin-body .data-source-status-detail {
    justify-content: flex-start;
  }

  .admin-body .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }

  .admin-body .brand-block {
    gap: 8px;
    min-width: 0;
  }

  .admin-body .brand-logo {
    width: 96px;
    height: 42px;
    object-fit: contain;
  }

  .admin-body .brand-title strong {
    font-size: 15px;
    line-height: 1.2;
  }

  .admin-body .brand-title span {
    font-size: 11px;
    line-height: 1.35;
  }

  .admin-body .topbar .button-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 7px;
    margin: 0 -10px;
    padding: 0 10px 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .admin-body .topbar .button-row .btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 13px;
    white-space: nowrap;
  }

  .ops-manual-hero h1 {
    font-size: 28px;
  }

  .ops-manual-hero p,
  .ops-manual-list,
  .ops-manual-steps {
    font-size: 15px;
  }

  .admin-body .admin-page {
    padding: 8px;
  }

  .admin-body .admin-shell {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-body .admin-sidebar {
    position: static;
  }

  .admin-body .admin-sidebar-card {
    max-height: none;
    padding: 8px;
    gap: 8px;
  }

  .admin-body .admin-sidebar-header {
    gap: 8px;
  }

  .admin-body .admin-sidebar-header .hint {
    display: none;
  }

  .admin-body .admin-sidebar-action,
  .admin-body .activity-item {
    padding: 8px 9px;
    border-radius: 7px;
  }

  .admin-body .activity-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(168px, 70vw);
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .admin-body .admin-tabs {
    position: static;
    z-index: 1;
    gap: 6px;
    margin: 0 -8px 8px;
    padding: 6px 8px;
    border-radius: 0;
    background: var(--bg);
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-body .admin-tab {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 13px;
    white-space: nowrap;
  }

  .admin-body .panel-header,
  .admin-body .panel-body {
    padding: 12px;
  }

  .admin-body .toolbar,
  .admin-body .submission-action-bar {
    gap: 8px;
  }

  .admin-body .submission-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-body .submission-filter-grid input,
  .admin-body .submission-filter-grid select {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .admin-body .submission-action-primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .admin-body .submission-action-primary .btn,
  .admin-body .submission-action-primary .toolbar-menu,
  .admin-body .submission-action-primary .toolbar-menu > summary {
    width: 100%;
  }

  .admin-body .submission-action-primary .btn,
  .admin-body .submission-action-primary .toolbar-menu > summary,
  .admin-body .page-size-control select,
  .admin-body .pager .btn {
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 13px;
  }

  .admin-body .summary-pills {
    max-height: 96px;
    overflow: auto;
  }

  .admin-body .summary-pill {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 12px;
  }

  .admin-body #submissionPanel .table-wrap {
    overflow: visible;
    height: auto;
    max-height: none;
    border: 0;
    background: transparent;
  }

  .admin-body #submissionPanel .table-scrollbar-proxy {
    display: none !important;
  }

  .admin-body #submissionPanel .table-wrap table {
    display: block;
    width: 100%;
    min-width: 0;
    background: transparent;
  }

  .admin-body #submissionPanel thead,
  .admin-body #submissionPanel tbody,
  .admin-body #submissionPanel tr {
    display: block;
  }

  .admin-body #submissionPanel #submissionTableHead > tr:first-child {
    display: none;
  }

  .admin-body #submissionPanel .column-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .admin-body #submissionPanel .column-filter-row th {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .admin-body #submissionPanel .column-filter-row input,
  .admin-body #submissionPanel .column-filter-row select {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .admin-body #submissionPanel tbody {
    display: grid;
    gap: 10px;
  }

  .admin-body #submissionPanel tbody tr {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  }

  .admin-body #submissionPanel tbody tr.row-selected {
    border-color: var(--primary);
    background: #f2fffb;
  }

  .admin-body #submissionPanel tbody td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    min-height: 0;
    padding: 3px 0;
    border: 0;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
  }

  .admin-body #submissionPanel tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
  }

  .admin-body #submissionPanel tbody td.status-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
  }

  .admin-body #submissionPanel tbody td.status-cell::before {
    flex: 0 0 86px;
  }

  .admin-body #submissionPanel tbody td.empty-cell {
    display: block;
    padding: 16px 10px;
    text-align: center;
  }

  .admin-body #submissionPanel tbody td.empty-cell::before {
    display: none;
  }

  .admin-body #submissionPanel tbody td.submission-actions-cell {
    display: block;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
  }

  .admin-body #submissionPanel tbody td.submission-actions-cell::before {
    display: block;
    margin-bottom: 7px;
  }

  .admin-body #submissionPanel .compact-check {
    justify-content: flex-start;
    margin: 0 0 8px;
  }

  .admin-body #submissionPanel .compact-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .admin-body #submissionPanel .compact-actions .btn,
  .admin-body #submissionPanel .row-action-menu,
  .admin-body #submissionPanel .row-action-summary {
    width: 100%;
  }

  .admin-body #submissionPanel .compact-actions .btn,
  .admin-body #submissionPanel .row-action-summary {
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 13px;
  }

  .admin-body #submissionPanel .row-action-menu-panel {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-top: 6px;
    padding: 6px;
    box-shadow: none;
  }

  .ledger-body .ledger-topbar-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ledger-body .ledger-topbar-inner .button-row {
    margin: 0 -10px;
    padding: 0 10px 2px;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .ledger-body .ledger-page-nav-row {
    grid-row: 1;
    grid-column: 1;
    margin: 0 -10px;
    padding: 0 10px 2px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ledger-body .ledger-page-switcher {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: visible;
  }

  .ledger-body .ledger-topbar-inner > .brand-block {
    grid-row: 2;
  }

  .ledger-body .ledger-page-nav-row > .btn,
  .ledger-body .ledger-page-switcher .btn {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
  }

  .ledger-body .brand-logo {
    width: 150px;
    max-width: 42vw;
  }

  .ledger-body .brand-title span {
    display: none;
  }

  .customer-billing-compact-topbar {
    padding-block: 8px;
  }

  .customer-billing-brand-block {
    min-width: 0;
  }

  .customer-billing-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .customer-billing-actions {
    flex: 0 0 auto;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .customer-billing-actions .btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .customer-billing-group-select {
    flex: 0 0 240px;
    width: 240px;
    max-width: none;
  }

  .customer-billing-notice {
    flex: 0 0 auto;
    max-width: 220px;
    justify-self: auto;
  }

  .ledger-body .ledger-cell-tools,
  .ledger-body .ledger-row-tools {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
  }

  .ledger-body .ledger-cell-tools span,
  .ledger-body .ledger-row-tools span {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ledger-body .ledger-row-tool-buttons {
    flex-wrap: nowrap;
  }

  .ledger-body .ledger-cell-tools button,
  .ledger-body .ledger-row-tool-buttons button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .ledger-body .ledger-page {
    padding: 6px;
  }

  .ledger-body .ledger-status-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 7px 8px;
  }

  .ledger-body .ledger-sheet-scroll {
    max-height: calc(100dvh - 232px);
    border-radius: 7px;
  }

  .ledger-body .ledger-sheet {
    font-size: 12px;
  }

  .ledger-body .ledger-sheet th {
    min-height: 42px;
    padding: 4px 5px;
    font-size: 12px;
  }

  .ledger-body .ledger-input,
  .ledger-body .route-ledger-cell,
  .ledger-body .driver-billing-cell,
  .ledger-body .customer-billing-cell,
  .ledger-body .route-ledger-edit-input,
  .ledger-body .driver-billing-edit-input,
  .ledger-body .customer-billing-edit-input {
    min-height: 30px;
    padding: 5px 6px;
    font-size: 12px;
  }

  .customer-billing-body .customer-billing-layout {
    gap: 8px;
  }

}

@media (max-width: 430px) {
  .admin-body .submission-filter-grid,
  .admin-body #submissionPanel .column-filter-row {
    grid-template-columns: 1fr;
  }

  .admin-body .submission-action-primary {
    grid-template-columns: 1fr 1fr;
  }

  .admin-body #submissionPanel .compact-actions {
    grid-template-columns: 1fr 1fr;
  }

  .admin-body #submissionPanel tbody td {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .admin-body #submissionPanel tbody td.status-cell::before {
    flex-basis: 78px;
  }

  .ledger-body .ledger-sheet-scroll {
    max-height: calc(100dvh - 250px);
  }
}

.driver-billing-body .ledger-sheet-scroll,
.route-ledger-body .ledger-sheet-scroll,
.ledger-main-view .ledger-sheet-scroll,
.ledger-project-preview-scroll,
.ledger-legacy-preview-scroll {
  height: var(--ledger-fit-scroll-height, calc(100dvh - 220px));
  max-height: none !important;
  overflow: auto;
  scrollbar-gutter: stable;
}

/* Online tables: center normal cell content; keep long itinerary text readable. */
body.admin-body :where(.table-wrap, .meal-table-wrap, .ledger-sheet) :where(th, td),
body.ledger-body :where(.ledger-sheet) :where(th, td) {
  text-align: center !important;
  vertical-align: middle !important;
}

body.admin-body :where(.table-wrap, .meal-table-wrap, .ledger-sheet) :where(input:not([type="checkbox"]), select),
body.ledger-body :where(.ledger-sheet) :where(input:not([type="checkbox"]), select) {
  text-align: center;
}

body.admin-body :where(.ledger-sheet) td:is(
  [data-field="itinerary"],
  [data-field="itineraryStops"],
  [data-field="route"],
  [data-field="routeText"],
  [data-field="routeDetail"],
  [data-field="routeSummary"]
),
body.ledger-body :where(.ledger-sheet) td:is(
  [data-field="itinerary"],
  [data-field="itineraryStops"],
  [data-field="route"],
  [data-field="routeText"],
  [data-field="routeDetail"],
  [data-field="routeSummary"]
),
body.admin-body :where(.ledger-sheet) .route-ledger-edit-textarea[aria-label*="具体行程"],
body.admin-body :where(.ledger-sheet) .route-ledger-edit-textarea[aria-label*="司机行程"],
body.ledger-body :where(.ledger-sheet) .route-ledger-edit-textarea[aria-label*="具体行程"],
body.ledger-body :where(.ledger-sheet) .route-ledger-edit-textarea[aria-label*="司机行程"] {
  text-align: left !important;
}

.admin-device-card {
  max-width: min(960px, calc(100vw - 28px));
}

.admin-device-body {
  display: grid;
  gap: 10px;
}

.admin-device-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-device-main {
  min-width: 0;
}

.admin-device-main strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
}

.admin-device-name-control {
  display: grid;
  grid-template-columns: auto minmax(180px, 360px);
  gap: 8px;
  align-items: center;
  margin: 10px 0 4px;
  font-weight: 800;
  color: var(--text);
}

.admin-device-name-control input {
  width: 100%;
}

.admin-device-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.admin-device-status-approved {
  color: #065f46;
  background: #d1fae5;
}

.admin-device-status-pending {
  color: #92400e;
  background: #fef3c7;
}

.admin-device-status-blocked,
.admin-device-status-disabled {
  color: #991b1b;
  background: #fee2e2;
}

.admin-device-actions {
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .admin-device-item {
    grid-template-columns: 1fr;
  }

  .admin-device-actions {
    justify-content: flex-start;
  }

  .admin-device-name-control {
    grid-template-columns: 1fr;
  }
}

.admin-ai-body {
  min-height: 100vh;
}

.admin-ai-page {
  min-height: calc(100vh - 112px);
  padding-top: 14px;
}

.admin-ai-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(280px, 1fr) auto;
  min-height: calc(100vh - 150px);
}

.admin-ai-panel-header {
  align-items: flex-start;
  gap: 16px;
}

.admin-ai-panel-header h2 {
  margin: 0 0 4px;
}

.admin-ai-status {
  min-width: 180px;
  text-align: center;
}

.admin-ai-safe-note {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft, #e6f5f1) 60%, #fff);
  color: var(--muted);
  font-weight: 700;
}

.admin-ai-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}

.admin-ai-quick-row .btn {
  min-height: 34px;
  padding: 6px 12px;
}

.admin-ai-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  max-height: 54vh;
  margin: 0 16px 14px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--accent-soft, #e6f5f1));
}

.admin-ai-message {
  display: grid;
  gap: 6px;
  max-width: min(880px, 92%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  white-space: normal;
}

.admin-ai-message strong {
  color: var(--text);
}

.admin-ai-message div {
  color: var(--text);
  line-height: 1.65;
}

.admin-ai-message small {
  color: var(--muted);
}

.admin-ai-sources {
  margin-top: 10px;
  color: var(--muted);
}

.admin-ai-sources summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-ai-sources ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.admin-ai-sources a {
  color: inherit;
  text-decoration: underline;
}

.admin-ai-message-assistant {
  align-self: flex-start;
  background: #fff;
}

.admin-ai-message-user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent-soft, #e6f5f1) 72%, #fff);
}

.admin-ai-input-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 0 16px 16px;
}

.admin-ai-input-field {
  margin: 0;
}

.admin-ai-input-field textarea {
  min-height: 108px;
  resize: vertical;
}

.admin-ai-actions {
  align-content: end;
  justify-content: flex-end;
}

body[data-admin-theme-kind="dark"] .admin-ai-safe-note,
body[data-admin-theme-kind="dark"] .admin-ai-chat,
body[data-admin-theme-kind="dark"] .admin-ai-message-assistant,
body[data-admin-theme-kind="dark"] .admin-ai-message-user {
  background: var(--panel, #111827);
}

@media (max-width: 820px) {
  .admin-ai-page {
    padding: 10px;
  }

  .admin-ai-panel {
    min-height: calc(100vh - 120px);
  }

  .admin-ai-panel-header {
    display: grid;
  }

  .admin-ai-status {
    min-width: 0;
    text-align: left;
  }

  .admin-ai-chat {
    max-height: 50vh;
    margin-inline: 10px;
  }

  .admin-ai-input-area {
    grid-template-columns: 1fr;
    padding-inline: 10px;
  }

  .admin-ai-message {
    max-width: 100%;
  }
}

/* Driver simplified UI local preview 20260728 */
.driver-body.driver-simplified-ui {
  --driver-simple-max: 980px;
  --driver-simple-radius: 16px;
  --driver-simple-line: rgba(15, 118, 110, 0.22);
  --driver-simple-soft: rgba(236, 253, 245, 0.74);
  --driver-simple-card: rgba(255, 255, 255, 0.92);
  --driver-simple-ink: #0f2f2a;
  --driver-simple-muted: #62736d;
}

.driver-body.driver-simplified-ui.driver-theme-night {
  --driver-simple-line: rgba(148, 163, 184, 0.24);
  --driver-simple-soft: rgba(15, 35, 61, 0.74);
  --driver-simple-card: rgba(8, 26, 47, 0.92);
  --driver-simple-ink: #eef6ff;
  --driver-simple-muted: #a9bbca;
}

.driver-body.driver-simplified-ui .driver-page,
.driver-body.driver-simplified-ui.driver-form-locked .topbar-inner,
.driver-body.driver-simplified-ui.driver-form-locked .driver-section-tabs {
  max-width: min(var(--driver-simple-max), calc(100vw - 24px));
}

.driver-body.driver-simplified-ui .topbar-inner {
  gap: 12px;
}

.driver-body.driver-simplified-ui .brand-block {
  min-width: 0;
}

.driver-body.driver-simplified-ui .brand-logo {
  max-width: 180px;
}

.driver-body.driver-simplified-ui .brand-title strong,
.driver-body.driver-simplified-ui .time-card strong {
  color: var(--driver-simple-ink);
}

.driver-body.driver-simplified-ui .driver-section-tabs {
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--driver-simple-line);
  border-radius: var(--driver-simple-radius);
  background: color-mix(in srgb, var(--driver-simple-card) 82%, transparent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.driver-body.driver-simplified-ui .driver-section-tab {
  min-height: 46px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--driver-simple-line);
}

.driver-body.driver-simplified-ui .driver-section-tab.active {
  background: linear-gradient(180deg, #0f8f7f, #067467);
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.22);
}

.driver-body.driver-simplified-ui.driver-theme-night .driver-section-tab {
  background: rgba(15, 35, 61, 0.9);
  color: var(--driver-simple-ink);
}

.driver-body.driver-simplified-ui.driver-theme-night .driver-section-tab.active {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

.driver-body.driver-simplified-ui .panel,
.driver-body.driver-simplified-ui .driver-login-panel,
.driver-body.driver-simplified-ui .driver-returned-reminder,
.driver-body.driver-simplified-ui .project-gate-card {
  border: 1px solid var(--driver-simple-line);
  border-radius: var(--driver-simple-radius);
  background: var(--driver-simple-card);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.driver-body.driver-simplified-ui .panel-header {
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--driver-simple-line);
}

.driver-body.driver-simplified-ui .panel-header h2,
.driver-body.driver-simplified-ui .activity-address-driver-panel h2,
.driver-body.driver-simplified-ui .meal-driver-panel h2 {
  margin: 0;
  color: var(--driver-simple-ink);
  font-size: 24px;
  line-height: 1.15;
}

.driver-body.driver-simplified-ui .panel-header .hint,
.driver-body.driver-simplified-ui .hint {
  color: var(--driver-simple-muted);
  font-size: 14px;
  line-height: 1.5;
}

.driver-body.driver-simplified-ui .panel-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.driver-body.driver-simplified-ui #tripForm .grid {
  gap: 12px;
}

.driver-body.driver-simplified-ui #tripForm .grid.two,
.driver-body.driver-simplified-ui #tripForm .grid.three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.driver-body.driver-simplified-ui .field {
  gap: 8px;
  min-width: 0;
}

.driver-body.driver-simplified-ui .field label,
.driver-body.driver-simplified-ui .field-label,
.driver-body.driver-simplified-ui .fixed-shuttle-extra summary,
.driver-body.driver-simplified-ui .invoice-info-toggle strong {
  color: var(--driver-simple-ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.25;
}

.driver-body.driver-simplified-ui input,
.driver-body.driver-simplified-ui select,
.driver-body.driver-simplified-ui textarea,
.driver-body.driver-simplified-ui .calendar-input,
.driver-body.driver-simplified-ui .addable-row,
.driver-body.driver-simplified-ui .driver-kind-option,
.driver-body.driver-simplified-ui .fixed-shuttle-panel,
.driver-body.driver-simplified-ui .invoice-info-card,
.driver-body.driver-simplified-ui .image-upload-field,
.driver-body.driver-simplified-ui .itinerary-field,
.driver-body.driver-simplified-ui .other-fee-section,
.driver-body.driver-simplified-ui .time-safety,
.driver-body.driver-simplified-ui .fee-total-box {
  border-color: var(--driver-simple-line);
  border-radius: 13px;
}

.driver-body.driver-simplified-ui input,
.driver-body.driver-simplified-ui select,
.driver-body.driver-simplified-ui textarea,
.driver-body.driver-simplified-ui .calendar-input {
  min-height: 50px;
  padding: 12px 14px;
  color: var(--driver-simple-ink);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.driver-body.driver-simplified-ui.driver-theme-night input,
.driver-body.driver-simplified-ui.driver-theme-night select,
.driver-body.driver-simplified-ui.driver-theme-night textarea,
.driver-body.driver-simplified-ui.driver-theme-night .calendar-input {
  color: var(--driver-simple-ink);
  background: rgba(3, 18, 38, 0.88);
}

.driver-body.driver-simplified-ui .time-row,
.driver-body.driver-simplified-ui .plate-row {
  gap: 8px;
}

.driver-body.driver-simplified-ui .time-row select {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.driver-body.driver-simplified-ui .date-quick-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.driver-body.driver-simplified-ui .quick-date-btn,
.driver-body.driver-simplified-ui .file-picker-label,
.driver-body.driver-simplified-ui .add-row-btn {
  border-radius: 12px;
  font-weight: 850;
}

.driver-body.driver-simplified-ui .quick-date-btn {
  min-height: 44px;
  background: #effaf7;
  border-color: var(--driver-simple-line);
  color: #116157;
}

.driver-body.driver-simplified-ui.driver-theme-night .quick-date-btn {
  background: rgba(30, 64, 104, 0.78);
  color: #eaf4ff;
}

.driver-body.driver-simplified-ui .itinerary-field,
.driver-body.driver-simplified-ui .image-upload-field,
.driver-body.driver-simplified-ui .other-fee-section,
.driver-body.driver-simplified-ui .invoice-info-card,
.driver-body.driver-simplified-ui .time-safety {
  padding: 14px;
  background: var(--driver-simple-soft);
}

.driver-body.driver-simplified-ui .stops.addable-list {
  display: grid;
  gap: 10px;
}

.driver-body.driver-simplified-ui .addable-row {
  padding: 12px;
  background: rgba(255, 255, 255, 0.88);
}

.driver-body.driver-simplified-ui.driver-theme-night .addable-row {
  background: rgba(3, 18, 38, 0.72);
}

.driver-body.driver-simplified-ui .other-fee-row {
  grid-template-columns: minmax(58px, auto) minmax(120px, 0.8fr) minmax(160px, 1.2fr) minmax(140px, 1fr) auto;
  align-items: center;
}

.driver-body.driver-simplified-ui .fee-total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(255, 247, 237, 0.98), rgba(236, 253, 245, 0.98));
}

.driver-body.driver-simplified-ui .fee-total-box strong {
  font-size: 26px;
  color: #b45309;
}

.driver-body.driver-simplified-ui .button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 10px;
  align-items: stretch;
}

.driver-body.driver-simplified-ui .btn {
  min-height: 50px;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 900;
}

.driver-body.driver-simplified-ui #submitBtn {
  min-height: 56px;
  font-size: 18px;
  background: linear-gradient(180deg, #0f8f7f, #057165);
}

.driver-body.driver-simplified-ui .notice,
.driver-body.driver-simplified-ui .errors {
  border-radius: 12px;
}

.driver-body.driver-simplified-ui .preview-grid {
  gap: 10px;
}

.driver-body.driver-simplified-ui .activity-address-driver-list,
.driver-body.driver-simplified-ui .meal-driver-list {
  display: grid;
  gap: 12px;
}

@media (max-width: 860px) {
  .driver-body.driver-simplified-ui {
    --driver-simple-max: 100%;
  }

  .driver-body.driver-simplified-ui .driver-page,
  .driver-body.driver-simplified-ui.driver-form-locked .topbar-inner,
  .driver-body.driver-simplified-ui.driver-form-locked .driver-section-tabs {
    max-width: calc(100vw - 14px);
  }

  .driver-body.driver-simplified-ui .topbar-inner {
    padding-inline: 8px;
  }

  .driver-body.driver-simplified-ui .brand-logo {
    max-width: 138px;
  }

  .driver-body.driver-simplified-ui .driver-section-tabs {
    gap: 6px;
    padding: 6px;
  }

  .driver-body.driver-simplified-ui .driver-section-tab {
    min-height: 44px;
    padding: 8px 6px;
    font-size: 15px;
  }

  .driver-body.driver-simplified-ui .panel-header,
  .driver-body.driver-simplified-ui .panel-body {
    padding-inline: 12px;
  }

  .driver-body.driver-simplified-ui .panel-header h2 {
    font-size: 22px;
  }

  .driver-body.driver-simplified-ui #tripForm .grid.two,
  .driver-body.driver-simplified-ui #tripForm .grid.three {
    grid-template-columns: 1fr;
  }

  .driver-body.driver-simplified-ui .date-quick-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .driver-body.driver-simplified-ui .other-fee-row {
    grid-template-columns: 1fr;
  }

  .driver-body.driver-simplified-ui .button-row {
    grid-template-columns: 1fr 1fr;
  }

  .driver-body.driver-simplified-ui #submitBtn {
    grid-column: 1 / -1;
    order: -1;
  }
}

/* driver-locked-trip-gap-20260806f: unify adjacent boxes in the driver trip form. */
.driver-body.driver-form-locked #tripForm > .panel-body > :not([hidden]) {
  margin-top: 0 !important;
  margin-bottom: 8px !important;
}

.driver-body.driver-form-locked #tripForm .panel-body,
.driver-body.driver-form-locked #tripForm .field,
.driver-body.driver-form-locked #tripForm .grid,
.driver-body.driver-form-locked #tripForm .grid.two,
.driver-body.driver-form-locked #tripForm .grid.three,
.driver-body.driver-form-locked #tripForm .trip-time-grid,
.driver-body.driver-form-locked #tripForm .trip-time-selects,
.driver-body.driver-form-locked #tripForm .time-row,
.driver-body.driver-form-locked #tripForm .plate-row,
.driver-body.driver-form-locked #tripForm .stops.addable-list,
.driver-body.driver-form-locked #tripForm .other-fee-list,
.driver-body.driver-form-locked #tripForm .other-fee-row {
  gap: 8px !important;
}

.driver-body.driver-form-locked #tripForm .trip-time-grid,
.driver-body.driver-form-locked #tripForm .metric-odometer-grid,
.driver-body.driver-form-locked #tripForm .metric-fee-grid,
.driver-body.driver-form-locked #tripForm .other-fee-section,
.driver-body.driver-form-locked #tripForm .fee-total-box,
.driver-body.driver-form-locked #tripForm .itinerary-field,
.driver-body.driver-form-locked #tripForm .image-upload-field {
  margin-bottom: 8px !important;
}

.driver-body.driver-form-locked #tripForm .trip-time-card {
  padding: 8px 12px !important;
}

.driver-body.driver-form-locked #tripForm .trip-time-selects {
  margin-top: 0 !important;
}

.driver-body.driver-form-locked #tripForm .dispatcher-service-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: start;
  gap: 8px !important;
  margin-bottom: 8px !important;
}

.driver-body.driver-form-locked #tripForm .dispatcher-service-row .field {
  min-width: 0;
}

.driver-body.driver-form-locked #tripForm .route-date-service-grid {
  display: none !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

.driver-body.driver-form-locked #tripForm .image-upload-field {
  padding: 8px 12px !important;
}

.driver-body.driver-form-locked #tripForm .image-upload-field .preview-grid:empty {
  display: none !important;
}
