:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --text: #1f2933;
  --muted: #667784;
  --line: #dce4e8;
  --primary: #136b78;
  --primary-dark: #0d535e;
  --primary-soft: #e4f2f4;
  --success: #24764f;
  --success-soft: #e5f4ec;
  --warning: #9a6500;
  --warning-soft: #fff3d6;
  --danger: #b23a3a;
  --danger-soft: #fbe9e9;
  --shadow: 0 1px 3px rgba(31, 41, 51, 0.08);
  --radius: 8px;
}

.customer-pool-filter-panel {
  margin-bottom: 16px;
}

.customer-pool-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  margin: -4px 0 18px;
  padding: 13px 18px;
  color: var(--text);
  background: #fffaf0;
  border: 1px solid #e6cf91;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.customer-pool-entry:hover {
  color: var(--text);
  border-color: #cda84b;
  background: #fff7e3;
}

.customer-pool-entry > span:first-child {
  display: grid;
  gap: 2px;
}

.customer-pool-entry strong {
  font-size: 17px;
}

.customer-pool-entry small {
  color: var(--muted);
}

.customer-pool-entry-count {
  flex: 0 0 auto;
  color: #7d5608;
  font-weight: 750;
}

.customer-pool-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
}

.customer-pool-filter label {
  display: grid;
  gap: 6px;
}

.customer-pool-table {
  min-width: 1380px;
}

.customer-pool-table th,
.customer-pool-table td {
  vertical-align: middle;
}

.customer-pool-contact {
  display: grid;
  gap: 2px;
}

.customer-pool-contact span,
.customer-pool-footnote {
  color: var(--muted);
  font-size: 12px;
}

.customer-pool-footnote {
  margin: 12px 0 0;
}

.status-chip.status-chip-pool {
  color: #8a5a0a;
  background: #fff4cf;
  border-color: #e7c96d;
}

.customer-pool-notice,
.selection-preview.customer-pool-selection {
  color: #6e4808;
  background: #fff6d9;
  border: 1px solid #e7c96d;
}

.customer-pool-notice {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  margin: -4px 0 16px;
  border-radius: 8px;
}

.selection-preview.customer-pool-selection {
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: 600;
}

@media (max-width: 780px) {
  .customer-pool-entry {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .customer-pool-filter {
    grid-template-columns: 1fr;
  }

  .customer-pool-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

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

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.25;
  white-space: nowrap;
}

.app-version {
  margin-left: 3px;
  color: #89959d;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.main-nav a {
  min-width: 68px;
  padding: 0 16px;
  display: grid;
  place-items: center;
  border-bottom: 3px solid transparent;
  color: #45545f;
  font-weight: 600;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--surface-muted);
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.system-menu {
  position: relative;
  align-self: stretch;
  display: flex;
}

.system-menu > summary {
  min-width: 68px;
  padding: 0 16px;
  display: grid;
  place-items: center;
  border-bottom: 3px solid transparent;
  color: #45545f;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.system-menu > summary:hover,
.system-menu > summary.active,
.system-menu[open] > summary {
  background: var(--surface-muted);
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.system-menu-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% - 1px);
  right: 0;
  min-width: 126px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 0 0 7px 7px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(31, 41, 51, 0.14);
}

.main-nav .system-menu-panel a {
  min-width: 0;
  padding: 8px 12px;
  display: block;
  border: 0;
  border-radius: 5px;
  white-space: nowrap;
}

.payment-status-link {
  text-decoration: none;
}

.payment-page-header p {
  margin-bottom: 0;
}

.payment-summary-strip {
  margin-bottom: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.payment-summary-strip > div {
  display: grid;
  gap: 3px;
}

.payment-summary-strip small,
.audit-table small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.legacy-payment-note {
  margin: -5px 2px 14px;
  color: var(--warning);
  font-size: 12px;
}

.payment-add-panel,
.payment-list-panel,
.audit-filter-panel,
.audit-log-panel {
  padding: 14px;
}

.payment-entry-form {
  display: grid;
  grid-template-columns: 170px minmax(210px, 1fr) 180px auto;
  align-items: end;
  gap: 12px;
}

.payment-entry-form label,
.audit-filter-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.payment-amount-control {
  display: flex;
  align-items: center;
}

.payment-amount-control span {
  align-self: stretch;
  min-width: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.payment-amount-control input {
  min-width: 110px;
  border-radius: 0 6px 6px 0;
}

.payment-list-table {
  min-width: 680px;
}

.payment-list-table select,
.payment-list-table input {
  min-height: 36px;
}

.audit-count {
  color: var(--muted);
  font-size: 13px;
}

.audit-filter-form {
  display: grid;
  grid-template-columns: 150px 150px 150px 130px minmax(190px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.audit-filter-form .filter-actions {
  display: flex;
  gap: 6px;
}

.audit-table {
  min-width: 1040px;
}

.audit-time {
  width: 178px;
  white-space: nowrap;
}

.audit-diff-cell {
  min-width: 130px;
}

.audit-diff-cell summary {
  color: var(--primary);
  cursor: pointer;
  font-weight: 650;
}

.audit-json-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 8px;
}

.audit-json-grid section {
  min-width: 0;
}

.audit-json-grid h3 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
}

.audit-json-grid pre {
  max-height: 260px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-muted);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.pagination {
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.page-content {
  flex: 1;
  padding-top: 28px;
  padding-bottom: 44px;
}

.site-footer {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.page-header {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-header h1,
.page-header h2,
.section-header h2 {
  margin: 0;
  line-height: 1.3;
}

.page-header h1 {
  font-size: 26px;
}

.page-header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.page-actions,
.row-actions,
.form-actions,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  min-height: 38px;
  padding: 8px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  border-color: #bdc9cf;
  background: var(--surface);
  color: #34444f;
}

.btn-secondary:hover {
  border-color: #95a6af;
  background: var(--surface-muted);
  color: var(--text);
}

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

.btn-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: #8d2929;
}

.btn-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.button-form {
  margin: 0;
  display: inline-flex;
}

.panel,
.stat-card,
.detail-card,
.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  margin-bottom: 22px;
}

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

.section-header h2 {
  font-size: 18px;
}

.section-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stats-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
}

.stat-card .label {
  color: var(--muted);
  font-size: 13px;
}

.stat-card .value {
  margin-top: 7px;
  display: block;
  color: var(--text);
  font-size: 28px;
  font-weight: 750;
  line-height: 1.2;
}

.stat-card .hint {
  margin-top: 5px;
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.amount-grid {
  padding: 16px 18px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.amount-item {
  min-width: 160px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: var(--surface-muted);
}

.amount-item .currency {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.amount-item .amount {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: var(--surface-muted);
  color: #53636e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.table-sort-link:hover,
.table-sort-link.is-active {
  color: var(--primary-dark);
}

.table-sort-indicator {
  min-width: 12px;
  color: #83929a;
  font-size: 11px;
  text-align: center;
}

.table-sort-link.is-active .table-sort-indicator {
  color: var(--primary-dark);
}

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

tbody tr:hover {
  background: #fbfcfd;
}

.row-cancelled,
.row-cancelled:hover {
  background: #faf7f7;
  color: #7d858a;
}

.row-cancelled a:not(.btn) {
  color: #68777f;
}

.strong-link {
  color: var(--text);
  font-weight: 650;
}

.strong-link:hover {
  color: var(--primary);
}

.secondary-text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.text-right {
  text-align: right;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f4;
  color: #52616b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-in_progress,
.status-deposit,
.status-pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-balance,
.status-confirmed,
.status-production,
.status-processing,
.status-in-progress,
.status-进行中 {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.status-ready_to_ship,
.status-shipped {
  background: #e8eefb;
  color: #315a9d;
}

.status-invoice_pending {
  background: #f0eafb;
  color: #6c4894;
}

.status-completed,
.status-active,
.status-已完成 {
  background: var(--success-soft);
  color: var(--success);
}

.status-cancelled,
.status-left,
.status-已取消 {
  background: var(--danger-soft);
  color: var(--danger);
  text-decoration: none;
}

.order-list-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.order-list-table {
  width: 100%;
  min-width: 1160px;
  table-layout: fixed;
  font-size: 13px;
}

.order-list-table th,
.order-list-table td {
  padding: 9px 8px;
}

.order-list-table tbody td {
  font-size: 14px;
}

.order-col-date { width: 8%; }
.order-col-customer { width: 18%; }
.order-col-salesperson { width: 7%; }
.order-col-product { width: 12%; }
.order-col-amount { width: 10%; }
.order-col-received { width: 10%; }
.order-col-status { width: 28%; }
.order-col-actions { width: 7%; }

.order-centered-heading,
.order-centered-cell {
  text-align: center;
}

.order-centered-cell .strong-link,
.order-centered-cell .secondary-text {
  text-align: center;
}

.order-received-cell {
  color: var(--success);
  font-weight: 700;
}

.received-amount-unknown {
  color: var(--muted);
  font-weight: 500;
}

.inline-payment-row > td {
  padding: 0;
  border-bottom-color: #c8d7dc;
  background: #f7fafb;
}

.inline-payment-panel {
  padding: 7px 14px;
  border-top: 1px solid #d4e0e4;
  box-shadow: inset 3px 0 0 var(--primary);
}

.inline-payment-header,
.inline-payment-header-actions,
.inline-payment-summary,
.inline-payment-record,
.inline-payment-form,
.inline-payment-amount {
  display: flex;
  align-items: center;
}

.inline-payment-header {
  min-height: 34px;
  justify-content: space-between;
  gap: 16px;
  white-space: nowrap;
}

.inline-payment-header-actions {
  flex: 0 0 auto;
  gap: 12px;
}

.inline-payment-summary {
  flex: 0 0 auto;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 12px;
}

.inline-payment-summary strong {
  color: var(--text);
  font-size: 13px;
}

.inline-payment-summary b {
  color: var(--success);
}

.inline-payment-close {
  flex: 0 0 auto;
  padding: 3px 1px;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.inline-payment-close:hover {
  text-decoration: underline;
}

.inline-payment-note,
.inline-payment-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.inline-payment-body {
  display: grid;
  gap: 7px;
  padding-top: 5px;
}

.inline-payment-records {
  display: grid;
  gap: 5px;
}

.inline-payment-record {
  display: grid;
  grid-template-columns: 60px 120px 160px 170px minmax(150px, 1fr) 70px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 5px 9px;
  column-gap: 12px;
  border-radius: 4px;
  background: #edf3f5;
  color: var(--muted);
  font-size: 12px;
}

.inline-payment-index {
  color: var(--muted);
}

.inline-payment-record strong {
  color: var(--text);
  font-size: 12px;
}

.inline-payment-record time {
  grid-column: 4;
}

.inline-payment-type {
  color: var(--primary);
  font-weight: 700;
}

.inline-payment-form {
  width: 100%;
  gap: 7px;
}

.inline-payment-add-form select,
.inline-payment-add-form input[type="number"],
.inline-payment-add-form input[type="date"] {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  height: 32px;
  padding: 5px 8px;
  border-color: #c6d5da;
  background: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}

.inline-payment-amount {
  width: 100%;
  min-width: 0;
  gap: 5px;
}

.inline-payment-amount input {
  flex: 1 1 auto;
}

.inline-payment-amount i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.inline-payment-form .btn-small {
  min-height: 32px;
  height: 32px;
}

.inline-payment-add-form {
  display: grid;
  grid-template-columns: 60px 120px 160px 170px minmax(150px, 1fr) 70px;
  align-items: center;
  min-height: 42px;
  padding: 5px 9px;
  column-gap: 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #edf3f5;
}

.inline-payment-new-index {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.inline-payment-date-shortcuts {
  display: flex;
  align-items: center;
  gap: 5px;
}

.inline-payment-date-shortcut {
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #c6d5da;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.inline-payment-date-shortcut:hover,
.inline-payment-date-shortcut.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.inline-payment-add-form > .btn {
  justify-self: end;
  width: 60px;
}

.inline-payment-delete-form {
  grid-column: 6;
  justify-self: end;
  width: auto;
}

.inline-payment-delete {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 11px;
}

.inline-payment-delete:hover {
  text-decoration: underline;
}

.inline-payment-form.is-submitting {
  opacity: 0.66;
  pointer-events: none;
}

.inline-payment-feedback {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.inline-payment-feedback.is-success {
  color: var(--success);
}

.inline-payment-feedback.is-error {
  color: var(--danger);
}

.order-customer-cell,
.order-product-cell,
.order-salesperson-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-customer-cell .strong-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-section + .order-section {
  margin-top: 18px;
}

.order-section-unfinished {
  border-top: 3px solid #d19a36;
}

.order-section-unfinished .section-header {
  background: #fffaf0;
}

.order-section .section-count {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.order-section-unfinished h2 {
  color: #765018;
}

.order-section-pending {
  border-top: 3px solid #d27b19;
  box-shadow: 0 5px 18px rgba(166, 91, 12, 0.13);
}

.order-section-pending .section-header {
  background: #fff4dc;
}

.order-section-pending h2 {
  color: #944f0b;
}

.order-section-completed {
  border-top: 3px solid #3e9063;
}

.order-section-completed .section-header {
  background: #f2faf5;
}

.order-section-cancelled {
  border-top: 3px solid #b96262;
}

.row-completion-pending td {
  background: #fffaf0;
}

.compact-empty {
  padding-block: 22px;
}

.order-salesperson-cell {
  font-weight: 650;
}

.order-status-cell {
  position: relative;
  vertical-align: middle;
}

.status-control-bar,
.status-column-heading {
  --status-control-width: 74px;
  --status-control-gap: 4px;
}

.status-control-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--status-control-gap);
  min-width: max-content;
}

.status-column-heading {
  width: max-content;
  display: grid;
  grid-template-columns: repeat(4, var(--status-control-width));
  align-items: center;
  gap: var(--status-control-gap);
}

.status-column-heading span {
  text-align: center;
  white-space: nowrap;
}

.status-control-bar.is-submitting {
  pointer-events: none;
  opacity: 0.72;
}

.status-control-form {
  display: inline-flex;
  flex: 0 0 auto;
  margin: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 5px;
  color: #46545b;
  background: #e8edef;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.status-chip-completed,
.status-chip-paid,
.status-chip-shipped,
.status-chip-invoiced,
.status-chip-not_required {
  color: #286644;
  background: #dff0e6;
}

.status-chip-unfinished,
.status-chip-in_progress {
  color: #855614;
  background: #f7ead1;
}

.status-chip-pending {
  color: #9b4d08;
  background: #ffe0ad;
  box-shadow: inset 0 0 0 1px rgba(155, 77, 8, 0.15);
}

.status-chip-deposit_received,
.status-chip-partial_paid,
.status-chip-partial_shipped,
.status-chip-partial_invoiced {
  color: #855614;
  background: #f7ead1;
}

.status-chip-unpaid,
.status-chip-not_shipped,
.status-chip-not_invoiced {
  color: #4f5e65;
  background: #e8edef;
}

.status-chip-cancelled {
  color: #983c3c;
  background: #f7dddd;
}

.status-control {
  width: var(--status-control-width, 74px);
  min-width: var(--status-control-width, 74px);
  min-height: 26px;
  height: 26px;
  padding: 2px 3px;
  justify-content: center;
  border: 1px solid rgba(70, 84, 91, 0.14);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.status-control-form .status-control-select {
  padding: 2px 16px 2px 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2352636a' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 8px 5px;
  text-align: center;
  text-align-last: center;
}

.status-control-select option {
  background: #fff;
  color: var(--text);
}

button.status-control:hover {
  filter: brightness(0.97);
  box-shadow: 0 2px 5px rgba(31, 41, 51, 0.13);
  transform: translateY(-1px);
}

.status-control-select:hover {
  filter: brightness(0.97);
  box-shadow: 0 2px 5px rgba(31, 41, 51, 0.13);
}

button.status-control:active {
  box-shadow: none;
  transform: translateY(0);
}

.status-control.is-readonly {
  cursor: default;
  opacity: 0.82;
}

.completion-state-readonly {
  min-height: 40px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  border: 1px solid #cbd6da;
  border-radius: 5px;
  background: #f7f9fa;
}

.order-list-table .row-actions {
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
}

@media (max-width: 1050px) {
  .status-control-bar,
  .status-column-heading {
    --status-control-width: 72px;
    --status-control-gap: 3px;
  }

  .status-chip {
    padding-inline: 4px;
    font-size: 10px;
  }

  .status-control {
    padding-inline: 2px;
  }

  .status-control-form .status-control-select {
    padding-right: 14px;
  }

  .order-salesperson-cell {
    font-size: 12px;
  }

  .inline-payment-header {
    gap: 7px;
  }

  .inline-payment-summary {
    gap: 5px 7px;
  }

  .inline-payment-add-form {
    grid-template-columns: 52px 110px 140px 160px minmax(135px, 1fr) 64px;
    column-gap: 8px;
  }

  .inline-payment-record {
    grid-template-columns: 52px 110px 140px 160px minmax(135px, 1fr) 64px;
    column-gap: 8px;
  }
}

@media (max-width: 640px) {
  .status-control-bar,
  .status-column-heading {
    --status-control-width: 70px;
    --status-control-gap: 2px;
  }

  .status-control {
    height: 24px;
    min-height: 24px;
    font-size: 10px;
  }
}

.order-list-table .btn-small {
  padding-right: 8px;
  padding-left: 8px;
}

.search-bar {
  margin-bottom: 18px;
  padding: 14px;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-field {
  min-width: 220px;
  flex: 1;
}

.search-bar label,
.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #394954;
  font-size: 13px;
  font-weight: 650;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #b9c6cc;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(19, 107, 120, 0.14);
  border-color: var(--primary);
}

.required {
  color: var(--danger);
}

.help-text {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.form-card {
  padding: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 20px;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 16px;
}

.detail-card {
  padding: 18px;
}

.detail-card h2 {
  margin: 0 0 14px;
  font-size: 17px;
}

.detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.detail-list div {
  min-width: 0;
}

.detail-list .full {
  grid-column: 1 / -1;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.notes-box {
  white-space: pre-wrap;
}

.summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  padding: 9px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.summary-list li:last-child {
  border-bottom: 0;
}

.summary-list span {
  color: var(--muted);
}

.empty-state {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0 0 14px;
}

.flash-stack {
  margin-bottom: 18px;
  display: grid;
  gap: 8px;
}

.flash {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.flash-success {
  border-color: #b8dcca;
  background: var(--success-soft);
  color: #185f3e;
}

.flash-error,
.flash-danger {
  border-color: #e5bcbc;
  background: var(--danger-soft);
  color: #8e2b2b;
}

.flash-warning {
  border-color: #ead49c;
  background: var(--warning-soft);
  color: #795100;
}

.filter-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(210px, 2fr) minmax(130px, 1fr) minmax(110px, 0.8fr) minmax(190px, 1.4fr) auto;
  align-items: end;
  gap: 10px;
}

.order-filter-row {
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(130px, 1fr)) auto;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stacked-amounts {
  display: grid;
  gap: 2px;
}

.detail-amounts {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.detail-amount-row {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-note-preview {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon {
  width: 22px;
  height: 22px;
  display: block;
}

.btn-icon {
  width: 17px;
  height: 17px;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid rgba(19, 107, 120, 0.28);
  outline-offset: 3px;
}

.report-page-actions .btn-icon {
  flex: 0 0 auto;
}

.report-filter {
  align-items: stretch;
}

.report-filter-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(145px, 0.9fr) minmax(145px, 0.9fr) minmax(170px, 1.1fr) minmax(170px, 1.1fr) auto;
  align-items: end;
  gap: 10px;
}

.report-filter-actions,
.empty-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.report-filter-errors ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.report-summary-grid {
  margin-top: 4px;
}

.metric-card {
  min-width: 0;
}

.metric-card-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-icon,
.section-icon,
.status-legend-icon,
.empty-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.metric-icon .icon {
  width: 20px;
  height: 20px;
}

.metric-icon-success {
  background: var(--success-soft);
  color: var(--success);
}

.metric-icon-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.metric-icon-blue {
  background: #e8eefb;
  color: #315a9d;
}

.metric-card .value.amount-value {
  font-size: clamp(19px, 2vw, 26px);
  overflow-wrap: anywhere;
}

.amount-code {
  color: var(--muted);
  font-size: 0.58em;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.report-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.section-icon .icon {
  width: 18px;
  height: 18px;
}

.currency-report-header {
  background: linear-gradient(90deg, var(--primary-soft), var(--surface) 45%);
}

.currency-badge {
  min-width: 58px;
  padding: 5px 10px;
  border: 1px solid #b8d8dc;
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
}

.currency-report-body {
  padding: 18px;
}

.currency-metrics {
  margin-bottom: 18px;
}

.report-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.report-chart-card,
.report-detail-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.report-detail-card {
  margin-top: 16px;
}

.report-card-header {
  min-height: 68px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.report-card-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.report-card-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.salesperson-bar-list {
  margin: 0;
  padding: 4px 16px 10px;
  list-style: none;
}

.salesperson-bar-list li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.salesperson-bar-list li:last-child {
  border-bottom: 0;
}

.salesperson-bar-heading {
  margin-bottom: 7px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.salesperson-bar-heading strong:last-child {
  color: var(--primary-dark);
  font-size: 13px;
  text-align: right;
}

.salesperson-progress {
  width: 100%;
  height: 12px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e8edef;
  color: var(--primary);
  appearance: none;
  -webkit-appearance: none;
}

.salesperson-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e8edef;
}

.salesperson-progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #2e92a1);
}

.salesperson-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--primary);
}

.bar-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 12px;
}

.month-chart-wrap {
  max-width: 100%;
  padding: 16px;
  overflow: hidden;
}

.month-chart {
  width: 100%;
  min-width: 0;
  height: 252px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: flex-end;
  gap: 9px;
}

.month-column {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
}

.month-value {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.month-bar-area {
  width: 44px;
  height: 166px;
  padding: 0 4px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #aebbc2;
  background: linear-gradient(to top, rgba(220, 228, 232, 0.42) 1px, transparent 1px);
  background-size: 100% 33px;
}

.month-bar-fill {
  width: 100%;
  min-height: 0;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #2e92a1, var(--primary));
}

.month-label {
  font-size: 11px;
}

.month-order-count {
  color: var(--muted);
  font-size: 10px;
}

.status-report-layout {
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(320px, 1.4fr);
  align-items: center;
  gap: 30px;
}

.status-donut-wrap {
  display: grid;
  place-items: center;
}

.status-donut {
  width: 190px;
  height: 190px;
  padding: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8edef;
}

.status-donut-center {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(31, 41, 51, 0.06);
  text-align: center;
}

.status-donut-center strong,
.status-donut-center span {
  display: block;
}

.status-donut-center strong {
  font-size: 28px;
  line-height: 1.2;
}

.status-donut-center span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-legend {
  margin: 0;
  padding: 0;
  display: grid;
  list-style: none;
}

.status-legend li {
  min-height: 47px;
  display: grid;
  grid-template-columns: 32px minmax(90px, 1fr) auto 58px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.status-legend li:last-child {
  border-bottom: 0;
}

.status-legend-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--status-color) 12%, white);
  color: var(--status-color);
}

.status-legend-icon .icon {
  width: 17px;
  height: 17px;
}

.status-legend-label {
  font-weight: 650;
}

.status-legend-percent {
  color: var(--muted);
  text-align: right;
}

.status-legend-note {
  grid-column: 2 / -1;
  margin-top: -8px;
  padding-bottom: 5px;
  color: var(--danger);
  font-size: 11px;
}

.report-table-wrap {
  outline-offset: -2px;
}

.report-table {
  min-width: 780px;
}

.report-table tbody th {
  background: transparent;
  color: var(--text);
  font-size: inherit;
  letter-spacing: 0;
}

.salesperson-detail-table {
  min-width: 860px;
}

.order-report-table {
  min-width: 1040px;
}

.report-row-cancelled td:first-child {
  box-shadow: inset 4px 0 0 var(--danger);
}

.cancelled-amount-note {
  display: block;
  margin-top: 2px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}

.report-empty-state .empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: var(--surface-muted);
  color: #82919a;
}

.report-empty-state .empty-icon .icon {
  width: 27px;
  height: 27px;
}

.report-empty-state .empty-actions {
  justify-content: center;
}

.report-no-sales {
  border-style: dashed;
}

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

.customer-filter-bar {
  flex-wrap: wrap;
}

.customer-filter-bar .search-field:first-child {
  min-width: 260px;
  flex: 1 1 320px;
}

.customer-filter-bar .search-field:not(:first-child) {
  min-width: 150px;
}

.pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}

.ranking-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.ranking-period-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-period-switch label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ranking-period-switch select {
  min-width: 138px;
  min-height: 36px;
  padding-block: 4px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .ranking-period-switch {
    width: 100%;
  }

  .ranking-period-switch select {
    flex: 1;
  }
}

/* 登录、会话与账号管理 */
.session-user {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.session-user > span,
.session-user strong,
.session-user small {
  display: block;
}

.session-user strong {
  font-size: 13px;
}

.session-user small {
  color: var(--muted);
  font-size: 11px;
}

.session-user form {
  margin: 0;
}

.login-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(31, 41, 51, 0.1);
}

.login-heading {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-heading h1,
.access-denied h1 {
  margin: 0;
  font-size: 24px;
}

.login-heading p,
.login-help,
.access-denied p {
  margin: 4px 0 0;
  color: var(--muted);
}

.login-card .form-group + .form-group {
  margin-top: 16px;
}

.login-submit {
  width: 100%;
  margin-top: 22px;
}

.login-help {
  font-size: 12px;
  text-align: center;
}

.access-denied {
  max-width: 620px;
  margin: 60px auto;
  padding: 32px;
  text-align: center;
}

.access-denied .btn {
  margin-top: 18px;
}

.checkbox-group {
  justify-content: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input {
  width: auto;
}

@media (max-width: 1100px) {
  .session-user > span {
    display: none;
  }
}

@media (max-width: 900px) {
  .session-user {
    margin-left: auto;
  }
}

.ranking-card {
  min-width: 0;
  border-radius: 10px;
  background: var(--surface);
}

.ranking-currency-heading {
  padding: 0 2px 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ranking-currency-heading strong {
  color: var(--primary-dark);
  font-size: 17px;
}

.ranking-currency-heading span {
  color: var(--muted);
  font-size: 12px;
}

.customer-ranking-table {
  min-width: 680px;
  border: 1px solid var(--line);
  border-radius: 9px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.customer-ranking-table th {
  padding-top: 9px;
  padding-bottom: 9px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
}

.customer-ranking-table td {
  padding-top: 11px;
  padding-bottom: 11px;
}

.ranking-number-column {
  width: 64px;
}

.ranking-number {
  color: #819098;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.ranking-row-1 .ranking-number {
  color: #a87312;
}

.ranking-row-2 .ranking-number {
  color: #6d7c85;
}

.ranking-row-3 .ranking-number {
  color: #9a6745;
}

.ranking-salesperson,
.ranking-orders {
  color: #52616a;
}

.ranking-amount {
  color: var(--primary-dark);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .ranking-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .customer-ranking-table {
    min-width: 620px;
  }
}

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

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

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

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

  .report-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .header-inner {
    min-height: auto;
    padding-top: 10px;
    display: block;
  }

  .brand {
    margin-bottom: 8px;
  }

  .main-nav {
    width: 100%;
    height: 46px;
  }

  .main-nav a {
    min-width: 0;
    flex: 1;
    padding: 0 7px;
    font-size: 14px;
  }

  .page-content {
    padding-top: 20px;
  }

  .page-header {
    display: block;
  }

  .page-actions {
    margin-top: 12px;
  }

  .page-actions .btn {
    flex: 1;
  }

  .stats-grid,
  .form-grid,
  .detail-list,
  .filter-row,
  .report-filter-grid,
  .status-report-layout {
    grid-template-columns: 1fr;
  }

  .stat-card .value {
    font-size: 24px;
  }

  .form-card {
    padding: 16px;
  }

  .search-bar .btn {
    flex: 1;
  }

  .row-actions {
    min-width: 150px;
  }

  .currency-report-body {
    padding: 12px;
  }

  .currency-report-header {
    align-items: center;
  }

  .report-filter-actions .btn,
  .empty-actions .btn {
    flex: 1;
  }

  .status-report-layout {
    padding: 18px 14px;
    gap: 18px;
  }

  .status-donut {
    width: 164px;
    height: 164px;
    padding: 26px;
  }

  .status-legend li {
    grid-template-columns: 32px minmax(80px, 1fr) auto 50px;
  }

  .salesperson-bar-heading {
    align-items: flex-start;
  }

  .month-chart-wrap {
    padding: 12px;
  }

  .month-chart {
    gap: 3px;
  }

  .month-bar-area {
    width: min(32px, 100%);
    padding: 0 2px;
  }

  .month-label {
    font-size: 9px;
    overflow-wrap: anywhere;
  }

  .month-value,
  .month-order-count {
    font-size: 8px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .page-actions,
  .row-actions,
  .search-bar,
  .flash-stack {
    display: none !important;
  }

  body,
  .page-content {
    background: #fff;
  }

  .container {
    width: 100%;
  }

  .panel,
  .detail-card,
  .stat-card {
    box-shadow: none;
  }

  .sales-report-page,
  .sales-report-page * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sales-report-page .panel,
  .sales-report-page .stat-card,
  .report-chart-card,
  .report-detail-card {
    break-inside: avoid;
  }

  .sales-report-page .table-wrap {
    overflow: visible;
  }

  .sales-report-page .report-table {
    min-width: 0;
    font-size: 10px;
  }

  .sales-report-page th,
  .sales-report-page td {
    padding: 7px 6px;
  }

  .sales-report-page .month-chart-wrap {
    overflow: visible;
  }

  .sales-report-page .month-chart {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* 订单工作台与全局搜索 */
.global-search {
  position: relative;
  width: min(330px, 31vw);
  display: flex;
  align-items: stretch;
}

.global-search input,
.workbench-search input,
.search-page-form input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #b9c6cc;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.global-search input {
  padding-right: 58px;
}

.global-search-submit {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  padding: 0 11px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 5px 5px 0;
  background: var(--surface-muted);
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.global-search-results {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(70vh, 620px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(28, 53, 60, 0.2);
}

.global-search-results section + section {
  border-top: 1px solid var(--line);
}

.global-search-results h3 {
  margin: 0;
  padding: 8px 11px 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.global-search-results section a {
  padding: 8px 11px;
  display: block;
  color: var(--text);
}

.global-search-results section a:hover {
  background: var(--primary-soft);
}

.global-search-results strong,
.global-search-results small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-results small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.global-search-empty {
  margin: 0;
  padding: 18px 12px;
  color: var(--muted);
  text-align: center;
}

.global-search-all {
  padding: 10px 12px;
  display: block;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.btn-large {
  min-height: 44px;
  padding-inline: 19px;
}

.workbench-search {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #b8d8dc;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--primary-soft), #f4fafb);
}

.workbench-search > label {
  display: block;
  margin-bottom: 7px;
  color: var(--primary-dark);
  font-weight: 750;
}

.workbench-search > div {
  display: flex;
  gap: 8px;
}

.workbench-search > span {
  margin-top: 5px;
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.work-queue-grid {
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.work-queue-card {
  min-width: 0;
  padding: 15px 17px;
  display: grid;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
}

.work-queue-card:hover {
  border-color: #aac8cd;
  background: #fbfefe;
  color: var(--text);
  transform: translateY(-1px);
}

.work-queue-card span {
  font-weight: 700;
}

.work-queue-card strong {
  margin: 5px 0 2px;
  color: var(--primary-dark);
  font-size: 29px;
  line-height: 1.15;
}

.work-queue-card small {
  color: var(--muted);
}

.queue-payment { border-left-color: #c98a20; }
.queue-shipping { border-left-color: #4777b8; }
.queue-invoice { border-left-color: #7a5aa3; }
.queue-completion {
  border-left-color: #d27b19;
  background: #fffaf0;
}

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

.compact-list a {
  padding: 11px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.compact-list a:last-child {
  border-bottom: 0;
}

.compact-list a:hover {
  background: var(--surface-muted);
}

.compact-list strong,
.compact-list small {
  display: block;
}

.compact-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.compact-list-meta {
  flex: 0 0 auto;
  text-align: right;
}

.workbench-foot-stats {
  padding: 4px 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 13px;
}

/* 快速录单 */
.quick-order-form {
  max-width: 900px;
  margin-inline: auto;
}

.quick-order-core {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 20px;
}

.selection-preview {
  min-height: 20px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.amount-input-row {
  display: flex;
  align-items: stretch;
}

.amount-input-row input {
  border-radius: 5px 0 0 5px;
}

.amount-input-row strong {
  min-width: 58px;
  padding: 8px 10px;
  display: grid;
  place-items: center;
  border: 1px solid #b9c6cc;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background: var(--surface-muted);
  color: var(--primary-dark);
}

.more-information {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}

.more-information > summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 750;
}

.more-information > summary span {
  margin-left: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.order-information-grid {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  align-items: start;
}

.order-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 20px;
}

.order-status-field {
  min-width: 0;
}

.copy-notice {
  max-width: 900px;
  margin: 0 auto 14px;
  padding: 11px 14px;
  display: grid;
  border: 1px solid #b8d8dc;
  border-radius: 7px;
  background: var(--primary-soft);
}

.copy-notice span {
  margin-top: 2px;
  color: #45616a;
  font-size: 12px;
}

.keyboard-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: wait;
  opacity: 0.62;
}

/* 客户订单优先详情 */
.customer-command-bar {
  margin-bottom: 14px;
  padding: 17px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.customer-command-main {
  min-width: 0;
}

.customer-command-main > div:first-child {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-command-main h1 {
  margin: 0;
  font-size: 24px;
}

.customer-short-name {
  color: var(--muted);
}

.customer-command-main dl {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.customer-command-main dl div {
  display: flex;
  gap: 5px;
}

.customer-command-main dt {
  color: var(--muted);
  font-size: 12px;
}

.customer-command-main dd {
  margin: 0;
  font-size: 13px;
}

.detail-tabs {
  margin-bottom: 16px;
  padding: 0 10px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.detail-tabs a {
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  color: #4c5b65;
  font-weight: 650;
}

.detail-tabs a:hover,
.detail-tabs a.active {
  border-bottom-color: var(--primary);
  color: var(--primary-dark);
}

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

.customer-order-filter {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 140px auto;
  align-items: end;
}

.customer-order-table {
  min-width: 870px;
}

.status-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.customer-profile-grid .section-header {
  margin: -18px -18px 16px;
}

.danger-zone {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e8caca;
  border-radius: var(--radius);
  background: #fffafa;
  color: var(--muted);
  font-size: 13px;
}

.customer-notes-panel .notes-box {
  padding: 18px;
}

.note-highlight {
  margin: 16px 18px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
}

.note-highlight span,
.note-highlight strong {
  display: block;
}

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

/* 全部搜索结果 */
.search-page-form {
  max-width: 780px;
}

.search-result-list a {
  padding: 11px 16px;
  display: block;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.search-result-list a:last-child {
  border-bottom: 0;
}

.search-result-list a:hover {
  background: var(--surface-muted);
}

.search-result-list strong,
.search-result-list span {
  display: block;
}

.search-result-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .header-inner {
    gap: 12px;
  }
  .brand small {
    display: none;
  }
  .main-nav a {
    min-width: 55px;
    padding-inline: 10px;
  }
}

@media (max-width: 900px) {
  .header-inner {
    padding-block: 9px;
    flex-wrap: wrap;
  }
  .global-search {
    order: 3;
    width: 100%;
  }
  .work-queue-grid,
  .workbench-columns,
  .search-result-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .customer-command-bar {
    align-items: flex-start;
  }
  .customer-order-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .payment-entry-form,
  .audit-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .audit-keyword {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .header-inner {
    display: flex;
  }
  .brand {
    margin-bottom: 0;
  }
  .main-nav {
    order: 2;
    overflow-x: auto;
  }
  .global-search {
    order: 3;
  }
  .work-queue-grid,
  .workbench-columns,
  .search-result-columns,
  .quick-order-core,
  .order-status-grid,
  .customer-order-filter {
    grid-template-columns: 1fr;
  }
  .customer-command-bar {
    display: block;
  }
  .customer-command-actions {
    margin-top: 14px;
  }
  .detail-tabs {
    padding-inline: 0;
    overflow-x: auto;
  }
  .detail-tabs a {
    flex: 0 0 auto;
    padding-inline: 10px;
  }
  .compact-list a {
    display: block;
  }
  .compact-list-meta {
    margin-top: 5px;
    text-align: left;
  }
  .quick-order-actions .btn,
  .quick-order-actions > a {
    width: 100%;
  }
  .keyboard-hint {
    width: 100%;
    margin-left: 0;
  }
  .system-menu > summary {
    min-width: 55px;
    padding-inline: 10px;
  }
  .payment-entry-form,
  .audit-filter-form,
  .audit-json-grid {
    grid-template-columns: 1fr;
  }
  .audit-keyword {
    grid-column: auto;
  }
}

/* 2026-07 手机端 QA：触摸尺寸、卡片列表与横屏可用性 */
input[type="password"],
input[type="search"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #b9c6cc;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

.mobile-sort-bar {
  display: none;
}

.status-control-item {
  display: contents;
}

.status-control-item > span {
  display: none;
}

@media (max-width: 900px), (max-height: 500px) and (orientation: landscape) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
    scroll-margin-block: 120px;
  }

  .btn,
  .btn-small,
  .global-search-submit,
  .inline-payment-close,
  .inline-payment-delete,
  .inline-payment-date-shortcut,
  .audit-diff-cell summary,
  .detail-tabs a,
  .table-sort-link {
    min-height: 44px;
  }

  .btn-small {
    padding: 9px 12px;
    font-size: 14px;
  }

  .global-search input {
    min-height: 44px;
    padding-right: 62px;
  }

  .global-search-submit {
    width: 56px;
    padding-inline: 8px;
    font-size: 13px;
  }

  .checkbox-group {
    justify-content: flex-start;
  }

  .checkbox-group label {
    min-height: 44px;
    cursor: pointer;
  }

  .checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    flex: 0 0 22px;
  }

  .flash-stack {
    position: sticky;
    z-index: 70;
    top: 8px;
  }

  .flash {
    box-shadow: 0 8px 24px rgba(31, 41, 51, 0.14);
  }

  .pagination {
    flex-wrap: wrap;
  }
}

@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) {
  .page-content {
    padding-top: 16px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .site-footer {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .main-nav {
    overflow: visible;
  }

  .system-menu-panel {
    z-index: 100;
  }

  .page-header {
    margin-bottom: 16px;
  }

  .page-header h1,
  .customer-command-main h1 {
    font-size: 24px;
  }

  .page-actions .btn,
  .page-actions .button-form,
  .page-actions .button-form .btn {
    min-width: 0;
  }

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

  .form-actions .btn,
  .form-actions .button-form,
  .form-actions .button-form .btn {
    width: 100%;
  }

  .login-shell {
    min-height: auto;
    padding-block: 24px;
  }

  .login-card {
    padding: 22px;
  }

  .login-submit {
    min-height: 48px;
  }

  .customer-pool-filter-panel {
    padding: 14px;
  }

  .filter-actions .btn,
  .filter-actions > a {
    flex: 1 1 0;
  }

  .section-header {
    align-items: flex-start;
  }

  .mobile-sort-bar {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-muted);
  }

  .mobile-sort-bar > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-sort-bar a {
    min-height: 40px;
    padding: 8px 11px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd6da;
    border-radius: 999px;
    background: #fff;
    color: #45545f;
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-sort-bar a.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
  }

  .table-wrap:has(> .mobile-card-table) {
    overflow: visible;
  }

  .mobile-card-table,
  .mobile-card-table tbody {
    width: 100%;
    min-width: 0 !important;
    display: block;
  }

  .mobile-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .mobile-card-table tbody {
    padding: 12px;
    display: grid;
    gap: 12px;
  }

  .mobile-card-table tbody tr {
    padding: 12px 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .mobile-card-table tbody td,
  .mobile-card-table tbody th[scope="row"] {
    min-width: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: minmax(82px, 0.75fr) minmax(0, 1.25fr);
    align-items: start;
    gap: 8px;
    border-bottom: 1px dashed #dfe6e9;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    letter-spacing: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mobile-card-table tbody td::before,
  .mobile-card-table tbody th[scope="row"]::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.55;
  }

  .mobile-card-table tbody td:last-child,
  .mobile-card-table tbody th[scope="row"]:last-child {
    border-bottom: 0;
  }

  .mobile-card-table .row-actions {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-card-table .row-actions .btn,
  .mobile-card-table .row-actions .button-form,
  .mobile-card-table .row-actions .button-form .btn,
  .mobile-card-table .row-actions form,
  .mobile-card-table .row-actions form .btn {
    width: 100%;
  }

  .customer-list-table td:nth-child(1),
  .customer-list-table td:nth-child(4),
  .customer-list-table td:nth-child(5),
  .customer-list-table td:nth-child(6),
  .customer-pool-table td:nth-child(1),
  .customer-pool-table td:nth-child(4),
  .customer-pool-table td:nth-child(6),
  .customer-pool-table td:nth-child(8),
  .customer-pool-table td:nth-child(10),
  .employee-list-table td:nth-child(2),
  .employee-list-table td:nth-child(8),
  .user-list-table td:nth-child(1),
  .user-list-table td:nth-child(7),
  .audit-table td,
  .payment-list-table td,
  .customer-order-table td,
  .contact-list-table td:nth-child(1),
  .contact-list-table td:nth-child(4),
  .contact-list-table td:nth-child(5),
  .contact-list-table td:nth-child(6),
  .contact-list-table td:nth-child(7),
  .customer-ranking-table td:nth-child(2),
  .customer-ranking-table td:nth-child(5),
  .salesperson-detail-table tbody th,
  .salesperson-detail-table td:nth-of-type(4) {
    grid-column: 1 / -1;
  }

  .customer-list-table td:nth-child(1)::before { content: "公司"; }
  .customer-list-table td:nth-child(2)::before { content: "销售员"; }
  .customer-list-table td:nth-child(3)::before { content: "有效订单"; }
  .customer-list-table td:nth-child(4)::before { content: "最近 / 首次"; }
  .customer-list-table td:nth-child(5)::before { content: "订单金额"; }
  .customer-list-table td:nth-child(6)::before { content: "操作"; }

  .customer-list-table td:nth-child(4) > * {
    grid-column: 2;
  }

  .customer-pool-table td:nth-child(1)::before { content: "客户名称"; }
  .customer-pool-table td:nth-child(2)::before { content: "国家或地区"; }
  .customer-pool-table td:nth-child(3)::before { content: "联系人"; }
  .customer-pool-table td:nth-child(4)::before { content: "联系方式"; }
  .customer-pool-table td:nth-child(5)::before { content: "原销售员"; }
  .customer-pool-table td:nth-child(6)::before { content: "最近订单"; }
  .customer-pool-table td:nth-child(7)::before { content: "历史订单"; }
  .customer-pool-table td:nth-child(8)::before { content: "最近跟进"; }
  .customer-pool-table td:nth-child(9)::before { content: "状态"; }
  .customer-pool-table td:nth-child(10)::before { content: "操作"; }

  .employee-list-table td:nth-child(1)::before { content: "编号"; }
  .employee-list-table td:nth-child(2)::before { content: "姓名"; }
  .employee-list-table td:nth-child(3)::before { content: "职务"; }
  .employee-list-table td:nth-child(4)::before { content: "状态"; }
  .employee-list-table td:nth-child(5)::before { content: "电话"; }
  .employee-list-table td:nth-child(6)::before { content: "身份证"; }
  .employee-list-table td:nth-child(7)::before { content: "入职时间"; }
  .employee-list-table td:nth-child(8)::before { content: "操作"; }

  .user-list-table td:nth-child(1)::before { content: "用户名"; }
  .user-list-table td:nth-child(2)::before { content: "关联员工"; }
  .user-list-table td:nth-child(3)::before { content: "角色"; }
  .user-list-table td:nth-child(4)::before { content: "状态"; }
  .user-list-table td:nth-child(5)::before { content: "最后登录"; }
  .user-list-table td:nth-child(6)::before { content: "创建时间"; }
  .user-list-table td:nth-child(7)::before { content: "操作"; }

  .audit-table td:nth-child(1)::before { content: "时间"; }
  .audit-table td:nth-child(2)::before { content: "操作人 / IP"; }
  .audit-table td:nth-child(3)::before { content: "模块"; }
  .audit-table td:nth-child(4)::before { content: "操作"; }
  .audit-table td:nth-child(5)::before { content: "对象编号"; }
  .audit-table td:nth-child(6)::before { content: "修改差异"; }

  .payment-list-table td:nth-child(1)::before { content: "收款类型"; }
  .payment-list-table td:nth-child(2)::before { content: "收款金额"; }
  .payment-list-table td:nth-child(3)::before { content: "收款日期"; }
  .payment-list-table td:nth-child(4)::before { content: "操作"; }

  .customer-order-table td:nth-child(1)::before { content: "日期 / 订单号"; }
  .customer-order-table td:nth-child(2)::before { content: "产品概要"; }
  .customer-order-table td:nth-child(3)::before { content: "金额"; }
  .customer-order-table td:nth-child(4)::before { content: "订单进度"; }
  .customer-order-table td:nth-child(5)::before { content: "操作"; }

  .contact-list-table td:nth-child(1)::before { content: "姓名"; }
  .contact-list-table td:nth-child(2)::before { content: "职位 / 角色"; }
  .contact-list-table td:nth-child(3)::before { content: "电话"; }
  .contact-list-table td:nth-child(4)::before { content: "邮箱"; }
  .contact-list-table td:nth-child(5)::before { content: "微信 / WhatsApp"; }
  .contact-list-table td:nth-child(6)::before { content: "备注"; }
  .contact-list-table td:nth-child(7)::before { content: "操作"; }

  .customer-ranking-table td:nth-child(1)::before { content: "排名"; }
  .customer-ranking-table td:nth-child(2)::before { content: "客户名称"; }
  .customer-ranking-table td:nth-child(3)::before { content: "销售员"; }
  .customer-ranking-table td:nth-child(4)::before { content: "订单"; }
  .customer-ranking-table td:nth-child(5)::before { content: "成交金额"; }

  .salesperson-detail-table tbody th::before { content: "销售员"; }
  .salesperson-detail-table td:nth-of-type(1)::before { content: "有效订单"; }
  .salesperson-detail-table td:nth-of-type(2)::before { content: "成交客户"; }
  .salesperson-detail-table td:nth-of-type(3)::before { content: "复购客户"; }
  .salesperson-detail-table td:nth-of-type(4)::before { content: "销售金额"; }
  .salesperson-detail-table td:nth-of-type(5)::before { content: "最近订单"; }

  .order-list-table-wrap {
    overflow: visible;
  }

  .order-list-table,
  .order-list-table tbody {
    width: 100%;
    min-width: 0;
    display: block;
  }

  .order-list-table colgroup,
  .order-list-table thead {
    display: none;
  }

  .order-list-table tbody {
    padding: 12px;
    display: grid;
    gap: 12px;
  }

  .order-list-table tr.order-main-row {
    padding: 13px 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .order-list-table tr.order-main-row > td {
    min-width: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: minmax(76px, 0.7fr) minmax(0, 1.3fr);
    align-items: start;
    gap: 8px;
    border: 0;
    border-bottom: 1px dashed #dfe6e9;
    background: transparent;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .order-list-table tr.order-main-row > td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .order-list-table tr.order-main-row > td:nth-child(1)::before { content: "订单日期"; }
  .order-list-table tr.order-main-row > td:nth-child(2)::before { content: "客户"; }
  .order-list-table tr.order-main-row > td:nth-child(3)::before { content: "销售员"; }
  .order-list-table tr.order-main-row > td:nth-child(4)::before { content: "产品概要"; }
  .order-list-table tr.order-main-row > td:nth-child(5)::before { content: "订单金额"; }
  .order-list-table tr.order-main-row > td:nth-child(6)::before { content: "到账金额"; }
  .order-list-table tr.order-main-row > td:nth-child(8)::before { content: "操作"; }

  .order-list-table tr.order-main-row > td:nth-child(2),
  .order-list-table tr.order-main-row > td:nth-child(1),
  .order-list-table tr.order-main-row > td:nth-child(4),
  .order-list-table tr.order-main-row > td:nth-child(7),
  .order-list-table tr.order-main-row > td:nth-child(8) {
    grid-column: 1 / -1;
  }

  .order-customer-cell .strong-link,
  .order-product-cell,
  .order-salesperson-cell {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .order-status-cell {
    padding-top: 12px !important;
    display: block !important;
  }

  .status-control-bar {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .status-control-item {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .status-control-item > span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
  }

  .status-control-item .status-control-form,
  .status-control-item .status-control {
    width: 100%;
    min-width: 0;
  }

  .status-control,
  .status-control-form .status-control-select {
    height: 44px;
    min-height: 44px;
    padding-inline: 4px;
    font-size: 12px;
  }

  .order-list-table tr.order-main-row > td:nth-child(8) {
    border-bottom: 0;
  }

  .order-list-table tr.order-main-row > td:nth-child(8) .row-actions,
  .order-list-table tr.order-main-row > td:nth-child(8) .btn {
    width: 100%;
    min-width: 0;
  }

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

  .inline-payment-row:not([hidden]) {
    display: block;
  }

  .inline-payment-row > td {
    padding: 0 !important;
    display: block !important;
  }

  .inline-payment-panel {
    padding: 12px;
    border: 1px solid #c8d7dc;
    border-radius: 9px;
    box-shadow: inset 3px 0 0 var(--primary), var(--shadow);
  }

  .inline-payment-header {
    align-items: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  .inline-payment-summary {
    flex-wrap: wrap;
  }

  .inline-payment-record {
    min-height: 0;
    padding: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  .inline-payment-record time {
    grid-column: auto;
  }

  .inline-payment-delete-form {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .inline-payment-delete {
    width: 100%;
  }

  .inline-payment-add-form {
    min-height: 0;
    padding: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .inline-payment-new-index,
  .inline-payment-date-shortcuts,
  .inline-payment-add-form > .btn {
    grid-column: 1 / -1;
  }

  .inline-payment-add-form select,
  .inline-payment-add-form input[type="number"],
  .inline-payment-add-form input[type="date"],
  .inline-payment-form .btn-small {
    height: 44px;
    min-height: 44px;
    font-size: 14px;
  }

  .inline-payment-date-shortcut,
  .inline-payment-add-form > .btn {
    width: 100%;
  }

  .month-chart-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .month-chart {
    min-width: 600px;
  }

  .month-value,
  .month-order-count,
  .month-label {
    font-size: 10px;
  }

  .audit-table tbody {
    padding: 0;
  }

  .audit-table tbody tr {
    grid-template-columns: 1fr;
  }

  .audit-time {
    width: auto;
  }

  .audit-diff-cell summary {
    padding: 8px 0;
    display: flex;
    align-items: center;
  }

  .audit-json-grid pre {
    max-height: 220px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .header-inner {
    min-height: auto;
    padding-block: 6px;
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    display: none;
  }

  .main-nav {
    order: 2;
    height: 44px;
    flex: 1 1 auto;
  }

  .main-nav a,
  .system-menu > summary {
    min-width: 48px;
    padding-inline: 8px;
  }

  .global-search {
    order: 3;
    width: 100%;
  }

  .session-user {
    margin-left: auto;
  }
}

/* 2026-07 Boss Mode：手机端只保留老板查看订单与收款的核心路径 */
.boss-only,
.boss-mobile-nav,
.boss-mobile-logout,
.boss-brand-mode {
  display: none;
}

.boss-detail-topbar,
.boss-order-detail-card {
  width: min(760px, 100%);
  margin-inline: auto;
}

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

.boss-back-link {
  min-height: 44px;
  padding: 9px 0;
  display: inline-flex;
  align-items: center;
  color: var(--primary-dark);
  font-weight: 750;
}

.boss-order-detail-card {
  padding: 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(31, 41, 51, 0.08);
}

.boss-order-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.boss-order-detail-header > div {
  min-width: 0;
}

.boss-order-detail-header > div > span,
.boss-order-amount > span,
.boss-order-received > span,
.boss-order-notes h2,
.boss-customer-detail article > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.boss-order-detail-header h1 {
  margin: 4px 0;
  font-size: 26px;
  line-height: 1.3;
}

.boss-order-detail-header h1 a {
  color: var(--text);
}

.boss-order-detail-header p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.boss-status-badge {
  min-height: 40px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
}

.boss-status-badge.is-unfinished {
  background: #fff0de;
  color: #94500a;
}

.boss-status-badge.is-pending {
  background: #fff6d6;
  color: #775c00;
}

.boss-status-badge.is-completed {
  background: #e1f2e8;
  color: #266946;
}

.boss-status-badge.is-cancelled {
  background: #d96565;
  color: #fff;
}

.boss-order-money-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.boss-order-amount,
.boss-order-received {
  padding: 20px;
  border-radius: 12px;
}

.boss-order-amount {
  background: var(--primary-soft);
}

.boss-order-received {
  background: #edf5ee;
}

.boss-order-amount span,
.boss-order-amount strong,
.boss-order-received span,
.boss-order-received strong {
  display: block;
}

.boss-order-amount strong,
.boss-order-received strong {
  margin-top: 3px;
  font-size: 32px;
  line-height: 1.2;
}

.boss-order-amount strong {
  color: var(--primary-dark);
}

.boss-order-received strong {
  color: #267247;
}

.boss-order-key-fields {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.boss-order-key-fields div {
  padding: 14px;
  border-radius: 10px;
  background: #f6f8f9;
}

.boss-order-key-fields dt,
.boss-order-more dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.boss-order-key-fields dd,
.boss-order-more dd {
  margin: 5px 0 0;
  font-size: 16px;
  font-weight: 750;
}

.boss-simple-status {
  min-height: 34px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
}

.boss-simple-status.status-chip-paid,
.boss-simple-status.status-chip-shipped,
.boss-simple-status.status-chip-invoiced,
.boss-simple-status.status-chip-not_required {
  background: #e1f2e8;
  color: #266946;
}

.boss-simple-status.status-chip-deposit_received,
.boss-simple-status.status-chip-partial_paid,
.boss-simple-status.status-chip-partial_shipped,
.boss-simple-status.status-chip-partial_invoiced {
  background: #fff6d6;
  color: #775c00;
}

.boss-simple-status.status-chip-unpaid,
.boss-simple-status.status-chip-not_shipped,
.boss-simple-status.status-chip-not_invoiced {
  background: #fff0de;
  color: #94500a;
}

.boss-order-notes {
  margin-top: 18px;
  padding: 18px;
  border-radius: 10px;
  background: #f8fafb;
}

.boss-order-notes h2,
.boss-order-notes p {
  margin: 0;
}

.boss-order-notes p {
  margin-top: 6px;
  font-size: 16px;
  white-space: pre-wrap;
}

.boss-order-more {
  margin-top: 14px;
  border-radius: 10px;
  background: #f6f8f9;
}

.boss-order-more summary {
  min-height: 48px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 750;
}

.boss-order-more dl {
  margin: 0;
  padding: 0 16px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) {
  html {
    background: #f2f5f6;
  }

  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    background: #f2f5f6;
    font-size: 16px;
  }

  .container {
    width: min(100% - 24px, 680px);
  }

  .site-header {
    position: sticky;
    z-index: 60;
    top: 0;
    border: 0;
    box-shadow: 0 4px 18px rgba(31, 41, 51, 0.07);
  }

  .header-inner {
    min-height: 64px;
    padding-block: 8px;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

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

  .brand-company,
  .app-version,
  .main-nav,
  .global-search,
  .session-user,
  .desktop-dashboard,
  .desktop-order-controls,
  .desktop-customer-controls,
  .desktop-customer-detail,
  .desktop-sales-report,
  .customer-pool-entry,
  .mobile-sort-bar,
  .customer-list-table,
  .order-list-table,
  .site-footer,
  .boss-desktop-action {
    display: none !important;
  }

  .boss-brand-mode {
    margin-top: 0;
    display: block;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
  }

  .boss-mobile-logout {
    margin-left: auto;
    display: block;
  }

  .boss-mobile-logout button {
    min-width: 56px;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: #eef2f3;
    color: #45545f;
    font-size: 16px;
    font-weight: 750;
  }

  .boss-mobile-nav {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding: 6px 10px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    border-top: 1px solid rgba(31, 41, 51, 0.08);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -5px 22px rgba(31, 41, 51, 0.08);
  }

  .boss-mobile-nav a {
    min-height: 50px;
    padding: 6px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #66747c;
    font-size: 16px;
    font-weight: 750;
  }

  .boss-mobile-nav a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
  }

  .page-content {
    padding-top: 20px;
    padding-bottom: 26px;
  }

  .boss-only {
    display: block;
  }

  .boss-page-heading,
  .boss-dashboard-heading {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
  }

  .boss-page-heading span,
  .boss-dashboard-heading > div:first-child span {
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
  }

  .boss-page-heading h1,
  .boss-dashboard-heading h1 {
    margin: 2px 0 0;
    font-size: 30px;
    line-height: 1.15;
  }

  .boss-today-count {
    min-width: 108px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    text-align: right;
  }

  .boss-today-count span {
    display: block;
    font-size: 14px;
    font-weight: 700;
    opacity: 0.84;
  }

  .boss-today-count strong {
    font-size: 36px;
    line-height: 1;
  }

  .boss-today-count small {
    margin-left: 3px;
    font-weight: 750;
  }

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

  .boss-status-card {
    min-height: 124px;
    padding: 17px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    align-content: center;
    gap: 1px 4px;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(31, 41, 51, 0.08);
    text-align: center;
  }

  .boss-status-card span {
    width: 100%;
    font-size: 18px;
    font-weight: 800;
  }

  .boss-status-card strong {
    font-size: 40px;
    line-height: 1.15;
  }

  .boss-status-card small {
    align-self: flex-end;
    margin-bottom: 7px;
    font-weight: 750;
  }

  .boss-status-card.is-unfinished {
    background: #e98f32;
  }

  .boss-status-card.is-pending {
    background: #dfb72c;
    color: #443500;
  }

  .boss-status-card.is-completed {
    background: #43a36b;
  }

  .boss-finance-grid {
    margin-top: 16px;
    display: grid;
    gap: 9px;
  }

  .boss-finance-card {
    min-height: 86px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(31, 41, 51, 0.05);
  }

  .boss-finance-card > span {
    color: #66747c;
    font-size: 18px;
    font-weight: 750;
  }

  .boss-finance-card > strong,
  .boss-money-lines strong {
    display: block;
    color: var(--text);
    font-size: 28px;
    line-height: 1.25;
    text-align: right;
  }

  .boss-money-lines {
    display: grid;
    gap: 2px;
  }

  .boss-quick-search {
    min-height: 64px;
    margin-top: 16px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-radius: 15px;
    background: #1f3038;
    color: #fff;
  }

  .boss-quick-search:hover {
    color: #fff;
  }

  .boss-quick-search span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
  }

  .boss-quick-search strong {
    font-size: 16px;
  }

  .boss-search {
    min-height: 54px;
    padding: 5px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 5px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(31, 41, 51, 0.06);
  }

  .boss-search input[type="search"] {
    min-width: 0;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    font-size: 16px;
  }

  .boss-search button {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
  }

  .boss-filter-tabs {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .boss-filter-tabs a {
    min-height: 44px;
    padding: 8px 4px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #e7edef;
    color: #53636b;
    font-size: 15px;
    font-weight: 750;
  }

  .boss-filter-tabs a.active {
    background: #1f3038;
    color: #fff;
  }

  .boss-order-controls,
  .boss-customer-controls {
    margin-bottom: 18px;
  }

  .order-section,
  .customer-list-panel {
    margin-bottom: 18px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .order-section > .section-header,
  .customer-list-panel > .section-header {
    min-height: 0;
    padding: 0 2px 10px;
    border: 0;
    background: transparent;
  }

  .order-section > .section-header h2,
  .customer-list-panel > .section-header h2 {
    font-size: 21px;
  }

  .order-section > .section-header p,
  .customer-list-panel > .section-header p {
    display: none;
  }

  .boss-order-card-list,
  .boss-customer-card-list {
    padding: 0;
    display: grid;
    gap: 12px;
  }

  .boss-order-card,
  .boss-customer-card {
    padding: 18px;
    display: block;
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 4px 14px rgba(31, 41, 51, 0.06);
  }

  .boss-order-card:hover,
  .boss-customer-card:hover {
    color: var(--text);
  }

  .boss-order-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .boss-order-card header strong {
    min-width: 0;
    font-size: 20px;
    line-height: 1.35;
  }

  .boss-order-card > p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 16px;
    font-weight: 700;
  }

  .boss-order-card-money {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 13px;
    background: #f2f5f5;
  }

  .boss-order-card-amount {
    margin: 0;
    padding: 14px 12px;
    display: block;
    border-radius: 0;
    background: transparent;
  }

  .boss-order-card-amount span,
  .boss-order-card footer span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
  }

  .boss-order-card-amount strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
    line-height: 1.2;
    text-align: left;
  }

  .boss-order-received-summary {
    margin: 0;
    padding: 14px 12px;
    display: block;
    border-radius: 0;
    background: transparent;
  }

  .boss-order-received-summary span {
    color: #5f7166;
    font-size: 14px;
    font-weight: 750;
  }

  .boss-order-received-summary strong {
    display: block;
    margin-top: 4px;
    color: #267247;
    font-size: 22px;
    line-height: 1.2;
    text-align: left;
  }

  .boss-operational-status-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .boss-operational-state {
    min-width: 0;
    min-height: 64px;
    padding: 9px 6px;
    display: grid;
    place-content: center;
    gap: 3px;
    border-radius: 11px;
    background: #e9edef;
    color: #4f5e65;
    text-align: center;
  }

  .boss-operational-state small,
  .boss-operational-state strong {
    display: block;
    min-width: 0;
  }

  .boss-operational-state small {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.76;
  }

  .boss-operational-state strong {
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .boss-operational-state.is-paid,
  .boss-operational-state.is-shipped,
  .boss-operational-state.is-invoiced,
  .boss-operational-state.is-not_required {
    background: #e1f2e8;
    color: #266946;
  }

  .boss-operational-state.is-deposit_received,
  .boss-operational-state.is-partial_paid,
  .boss-operational-state.is-partial_shipped,
  .boss-operational-state.is-partial_invoiced {
    background: #fff6d6;
    color: #775c00;
  }

  .boss-operational-state.is-unpaid,
  .boss-operational-state.is-not_shipped,
  .boss-operational-state.is-not_invoiced {
    background: #fff0de;
    color: #94500a;
  }

  .boss-order-card footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .boss-order-card footer strong {
    font-size: 16px;
  }

  .boss-customer-card > strong {
    display: block;
    font-size: 20px;
    line-height: 1.35;
  }

  .boss-customer-card dl {
    margin: 14px 0 0;
    display: grid;
    gap: 9px;
  }

  .boss-customer-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
  }

  .boss-customer-card dt {
    color: var(--muted);
    font-size: 14px;
  }

  .boss-customer-card dd {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .pagination {
    justify-content: center;
  }

  .boss-customer-detail > article,
  .boss-latest-order {
    padding: 20px;
    display: block;
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 6px 20px rgba(31, 41, 51, 0.07);
  }

  .boss-customer-detail h1 {
    margin: 4px 0 18px;
    font-size: 26px;
    line-height: 1.3;
  }

  .boss-customer-detail dl {
    margin: 0;
    display: grid;
    gap: 12px;
  }

  .boss-customer-detail dl div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
  }

  .boss-customer-detail dt {
    color: var(--muted);
  }

  .boss-customer-detail dd {
    margin: 0;
    font-weight: 750;
    text-align: right;
  }

  .boss-latest-order {
    min-height: 104px;
    margin-top: 14px;
    background: var(--primary-soft);
  }

  .boss-latest-order span,
  .boss-latest-order strong,
  .boss-latest-order small {
    display: block;
  }

  .boss-latest-order span {
    color: var(--muted);
    font-size: 13px;
  }

  .boss-latest-order strong {
    margin-top: 5px;
    font-size: 18px;
  }

  .boss-latest-order small {
    margin-top: 3px;
    color: var(--primary-dark);
    font-size: 20px;
    font-weight: 850;
  }

  .boss-report-metrics {
    display: grid;
    gap: 10px;
  }

  .boss-report-metrics article {
    min-height: 108px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 4px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(31, 41, 51, 0.06);
  }

  .boss-report-metrics article:first-child {
    background: var(--primary);
    color: #fff;
  }

  .boss-report-metrics article > span {
    color: var(--muted);
    font-size: 17px;
    font-weight: 750;
  }

  .boss-report-metrics article:first-child > span {
    color: rgba(255, 255, 255, 0.76);
  }

  .boss-report-metrics article > strong {
    font-size: 38px;
  }

  .boss-report-metrics article > small {
    align-self: end;
    margin-bottom: 9px;
    font-weight: 750;
  }

  .boss-report-metrics article > div {
    display: grid;
    gap: 3px;
    text-align: right;
  }

  .boss-report-metrics article > div strong {
    display: block;
    font-size: 26px;
    line-height: 1.25;
  }

  .boss-ranking-section {
    margin-top: 22px;
  }

  .boss-ranking-section > h2 {
    margin: 0 0 12px;
    font-size: 22px;
  }

  .boss-ranking-group {
    margin-bottom: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(31, 41, 51, 0.06);
  }

  .boss-ranking-group > span {
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 850;
  }

  .boss-ranking-group ol {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
  }

  .boss-ranking-group li {
    min-height: 56px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 8px;
  }

  .boss-ranking-group li + li {
    border-top: 1px solid #edf1f2;
  }

  .boss-ranking-group li b {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    grid-row: 1 / span 2;
    border-radius: 50%;
    background: #e7edef;
    color: #52636a;
    font-size: 12px;
  }

  .boss-ranking-group li strong {
    min-width: 0;
    font-size: 17px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .boss-ranking-group li span {
    color: var(--muted);
    font-size: 14px;
  }

  .boss-ranking-group li em {
    grid-column: 3;
    grid-row: 1 / span 2;
    font-size: 17px;
    font-style: normal;
    font-weight: 850;
    text-align: right;
  }

  .boss-empty-state {
    padding: 32px 18px;
    border-radius: 16px;
    background: #fff;
    color: var(--muted);
    text-align: center;
  }

  .boss-detail-topbar,
  .boss-order-detail-card {
    width: 100%;
  }

  .boss-detail-topbar {
    margin-bottom: 8px;
  }

  .boss-back-link {
    font-size: 17px;
  }

  .boss-order-detail-card {
    padding: 18px;
    border-radius: 16px;
  }

  .boss-order-detail-header {
    gap: 12px;
  }

  .boss-order-detail-header h1 {
    font-size: 24px;
  }

  .boss-order-money-grid {
    margin-top: 16px;
    gap: 8px;
  }

  .boss-order-amount,
  .boss-order-received {
    padding: 16px;
  }

  .boss-order-amount strong,
  .boss-order-received strong {
    font-size: 26px;
  }

  .boss-order-key-fields,
  .boss-order-more dl {
    grid-template-columns: 1fr;
  }

  .boss-order-key-fields {
    margin-top: 12px;
    gap: 6px;
  }

  .boss-order-key-fields div {
    min-height: 54px;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .boss-order-key-fields dd {
    margin-top: 0;
    text-align: right;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .boss-finance-grid,
  .boss-report-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .boss-finance-card,
  .boss-report-metrics article {
    min-height: 96px;
    padding: 14px;
  }

  .boss-finance-card {
    display: grid;
    gap: 5px;
  }

  .boss-finance-card > strong,
  .boss-money-lines strong,
  .boss-report-metrics article > div strong {
    font-size: 19px;
    text-align: left;
  }
}
