:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #63706b;
  --line: #d9e0dd;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b42318;
  --warn: #ad5b00;
  --soft: #e8f3f1;
  --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);
}

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);
}

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

.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;
}

.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;
}

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

.admin-body .topbar-inner,
.admin-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: 760px;
}

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

.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;
}

.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: #fffafa;
}

.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;
}

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;
}

.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);
}

.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: #fff;
  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: #fbfdfc;
}

.calendar-picker {
  position: relative;
}

.calendar-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  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: #fff;
  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: #fff;
  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: #fff;
  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: #a5b0ad;
}

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

.overseas-driver-field {
  margin: 0 0 14px;
  border: 1px dashed #cfe1dd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdfc;
}

.overseas-driver-field .hint {
  margin: 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(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

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

.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;
}

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

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

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

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

.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) 38px;
}

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

.add-row-btn {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

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

.add-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: #fff;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

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

.image-upload-field .file-picker-label {
  justify-content: flex-start;
  width: 100%;
}

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

.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: #fff;
  overflow: hidden;
}

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

.compact-section[open] {
  border-color: #cfe1dd;
  background: #fbfefe;
}

.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 #cfe1dd;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfefe 0%, #f3faf8 100%);
  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: #fff;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.invoice-info-card[open] .invoice-info-toggle {
  border-bottom: 1px solid #cfe1dd;
}

.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: #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.secondary {
  background: #fff;
  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: #fef3f2;
  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: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.66);
}

.submit-confirm-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);
}

.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-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-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-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;
}

.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;
}

#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;
}

.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);
  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%;
}

.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);
}

.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;
}

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

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;
}

.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;
}

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

.submission-actions-cell {
  min-width: 230px;
}

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

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

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

.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);
}

.footer {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  margin-top: 24px;
}

.mobile-only {
  display: none;
}

@media (max-width: 860px) {
  .topbar {
    position: static;
  }

  .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;
  }

  .driver-page {
    max-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;
  }

  .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) 58px 38px;
  }

  .fee-entry-row .file-picker-label {
    width: 58px;
    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 {
    justify-self: end;
  }

  .other-fee-row {
    grid-template-columns: minmax(0, 1fr) 58px 38px;
  }

  .other-fee-row strong,
  .other-fee-row input,
  .other-fee-row .fee-photo-preview {
    grid-column: 1 / -1;
  }

  .other-fee-row .file-picker-label {
    grid-column: 2;
    width: 58px;
    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;
  }

  .other-fee-row strong {
    padding-top: 9px;
  }

  .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%;
  }

  .pagination-bar {
    justify-content: flex-start;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab {
    flex: 1 1 auto;
  }

  .submit-review-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .mobile-only {
    display: block;
  }
}
