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

.mobile-dashboard {
  display: none;
}

/* V1.24.0 首页经营摘要与交货排期 */
.dashboard-summary-grid {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-summary-card {
  min-width: 0;
  min-height: 132px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-summary-card.is-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.dashboard-summary-card > span:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.dashboard-summary-card.is-primary > span:first-child,
.dashboard-summary-card.is-primary > small {
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-summary-card > small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.dashboard-summary-number {
  margin-top: 6px;
  color: var(--primary-dark);
  font-size: 32px;
  line-height: 1.15;
}

.dashboard-money-lines {
  margin-top: 6px;
  display: grid;
  gap: 2px;
}

.dashboard-money-lines strong {
  min-width: 0;
  display: block;
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.dashboard-money-lines strong small {
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.dashboard-delivery-panel {
  margin-bottom: 16px;
}

.upcoming-delivery-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upcoming-delivery-row {
  min-width: 0;
  min-height: 56px;
  padding: 9px 16px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.upcoming-delivery-row:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.upcoming-delivery-row:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.upcoming-delivery-row time {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.upcoming-delivery-row > span,
.upcoming-delivery-row strong,
.upcoming-delivery-row small {
  min-width: 0;
  display: block;
}

.upcoming-delivery-row strong,
.upcoming-delivery-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.upcoming-delivery-row.is-overdue {
  box-shadow: inset 4px 0 0 #c84d4d;
  background: #fff8f7;
}

.upcoming-delivery-row.is-overdue time {
  color: var(--danger);
}

.upcoming-delivery-row.is-soon:not(.is-overdue) {
  box-shadow: inset 4px 0 0 #dda033;
}

.dashboard-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.dashboard-ranking-groups,
.dashboard-trend-groups {
  padding: 12px 16px 14px;
  display: grid;
  gap: 12px;
}

.dashboard-ranking-groups {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.dashboard-currency-label {
  color: var(--primary-dark);
  font-size: 12px;
  letter-spacing: 0.06em;
}

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

.dashboard-ranking-group li {
  position: relative;
  min-height: 42px;
  padding: 5px 0 8px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.dashboard-ranking-group li + li {
  border-top: 1px solid var(--line);
}

.dashboard-ranking-group li b {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.dashboard-ranking-group li a {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-ranking-group li span {
  color: var(--primary-dark);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.dashboard-ranking-group li i {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 29px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edef;
}

.dashboard-ranking-group li i::after {
  width: var(--ranking-width);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--primary);
  content: "";
}

.dashboard-trend-group + .dashboard-trend-group {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dashboard-trend-chart {
  height: 184px;
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 7px;
}

.dashboard-trend-column {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 30px minmax(70px, 1fr) 20px;
  justify-items: center;
  gap: 3px;
}

.dashboard-trend-column > span {
  width: 100%;
  align-self: end;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-trend-column > i {
  width: min(34px, 76%);
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #aebbc2;
  background: linear-gradient(to top, rgba(220, 228, 232, 0.52) 1px, transparent 1px);
  background-size: 100% 28px;
}

.dashboard-trend-column > i > b {
  width: 100%;
  display: block;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
}

.dashboard-trend-column > small {
  color: var(--muted);
  font-size: 11px;
}

.dashboard-recent-grid {
  margin-top: 0;
}

.delivery-page-header {
  margin-bottom: 14px;
}

.delivery-view-switch,
.delivery-calendar-nav,
.delivery-calendar-legend {
  display: flex;
  align-items: center;
  gap: 6px;
}

.delivery-layout {
  display: grid;
  grid-template-columns: minmax(270px, 310px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.delivery-unscheduled,
.delivery-calendar-panel {
  min-width: 0;
  margin-bottom: 0;
}

.delivery-unscheduled {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 118px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.delivery-unscheduled.is-drop-target {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px rgba(15, 117, 130, 0.28);
}

.delivery-panel-heading {
  padding: 14px 16px 8px;
}

.delivery-panel-heading h2,
.delivery-panel-heading p {
  margin: 0;
}

.delivery-panel-heading h2 {
  font-size: 18px;
}

.delivery-panel-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.delivery-search {
  padding: 8px 12px 12px;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
}

.delivery-search input {
  min-width: 0;
}

.delivery-unschedule-return {
  margin: 0 12px 2px;
  padding: 8px 10px;
  display: grid;
  gap: 1px;
  border: 1px dashed #9dbcc1;
  border-radius: 6px;
  background: #f4f9fa;
  color: var(--primary-dark);
  font-size: 10px;
  line-height: 1.4;
}

.delivery-unschedule-return strong {
  font-size: 11px;
}

.delivery-unschedule-return span {
  color: var(--muted);
}

.delivery-unscheduled.is-drop-target .delivery-unschedule-return {
  border-color: var(--primary);
  background: #e5f4f5;
}

.delivery-unscheduled-list {
  padding: 10px;
  overflow-y: auto;
}

.delivery-order-card {
  position: relative;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid #cad5da;
  border-radius: 7px;
  background: #fff;
  cursor: grab;
}

.delivery-order-card:hover {
  border-color: #91b8be;
  background: #fbfefe;
}

.delivery-order-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.delivery-order-main a {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-order-main > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.delivery-order-card > p {
  margin: 6px 0 8px;
  overflow: hidden;
  color: #52636a;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-order-card dl {
  margin: 0;
  display: grid;
  gap: 3px;
}

.delivery-order-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.delivery-order-card dd {
  margin: 0;
  color: #3e4e57;
  text-align: right;
}

.delivery-drag-hint {
  margin-top: 8px;
  display: block;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 750;
  text-align: right;
}

.delivery-calendar-toolbar {
  min-height: 64px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.delivery-calendar-toolbar h2 {
  margin: 0;
  font-size: 19px;
  text-align: center;
}

.delivery-calendar-legend {
  justify-content: flex-end;
  color: var(--muted);
  font-size: 11px;
}

.delivery-calendar-legend span::before {
  width: 7px;
  height: 7px;
  margin-right: 4px;
  display: inline-block;
  border-radius: 50%;
  background: #dda033;
  content: "";
}

.delivery-calendar-legend .is-overdue::before {
  background: #c84d4d;
}

.delivery-month-colors {
  min-height: 31px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.delivery-month-colors span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.delivery-month-colors i {
  width: 13px;
  height: 13px;
  border: 1px solid #d2dce0;
  border-radius: 3px;
  background: #fff;
}

.delivery-month-colors .is-month-before i {
  background: #f0f3f6;
}

.delivery-month-colors .is-month-after i {
  border-color: #c5dedd;
  background: #edf7f6;
}

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

.delivery-weekdays {
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.delivery-weekdays span {
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.delivery-day {
  position: relative;
  min-width: 0;
  min-height: 128px;
  padding: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.delivery-day:nth-child(7n) {
  border-right: 0;
}

.delivery-day.is-outside {
  background: #f8fafb;
}

.delivery-day.is-month-before {
  background: #f0f3f6;
}

.delivery-day.is-month-current {
  background: #fff;
}

.delivery-day.is-month-after {
  background: #edf7f6;
}

.delivery-day.is-outside > header,
.delivery-day.is-outside .delivery-calendar-order {
  opacity: 0.58;
}

.delivery-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(15, 117, 130, 0.6);
}

.delivery-day.is-drop-target {
  background: #eaf6f7;
  box-shadow: inset 0 0 0 3px var(--primary);
}

.delivery-day.is-saved,
.delivery-unscheduled.is-saved {
  animation: delivery-target-saved 420ms ease-out;
}

.delivery-day > header {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.delivery-day > header time {
  width: auto;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #42545d;
  font-size: 12px;
  font-weight: 800;
}

.delivery-day.is-today > header time {
  background: var(--primary);
  color: #fff;
}

.delivery-day > header span {
  color: var(--primary-dark);
  font-size: 9px;
  font-weight: 800;
}

.delivery-day-orders {
  margin-top: 4px;
  display: grid;
  gap: 4px;
}

.delivery-calendar-order {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 5px 6px;
  display: block;
  border: 1px solid #c8d7db;
  border-left: 3px solid var(--primary);
  border-radius: 5px;
  background: #f7fbfb;
  color: var(--text);
  cursor: grab;
  outline: 0;
}

.delivery-calendar-order[hidden] {
  display: none;
}

.delivery-calendar-order:hover {
  z-index: 12;
  border-color: #84aeb5;
  color: var(--text);
}

.delivery-calendar-order:focus-visible {
  z-index: 12;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 117, 130, 0.2);
}

.delivery-calendar-order.is-soon {
  border-left-color: #dda033;
  background: #fffaf0;
}

.delivery-calendar-order.is-overdue {
  border-left-color: #c84d4d;
  background: #fff5f4;
}

.delivery-calendar-order > strong,
.delivery-calendar-order > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-calendar-order > strong {
  font-size: 11px;
}

.delivery-calendar-order > span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.delivery-calendar-order-preview {
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  left: -3px;
  width: min(270px, calc(100vw - 48px));
  padding: 10px 11px;
  border: 1px solid #bfd0d5;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.2);
  color: var(--text);
  cursor: default;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  visibility: hidden;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.delivery-day:nth-child(7n - 1) .delivery-calendar-order-preview,
.delivery-day:nth-child(7n) .delivery-calendar-order-preview {
  right: -3px;
  left: auto;
}

.delivery-calendar-order-preview dl {
  margin: 0;
  display: grid;
  gap: 7px;
}

.delivery-calendar-order-preview dl > div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.delivery-calendar-order-preview dt,
.delivery-calendar-order-preview dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

.delivery-calendar-order-preview dt {
  color: var(--muted);
  font-weight: 700;
}

.delivery-calendar-order-preview dd {
  overflow-wrap: anywhere;
  color: #32474f;
  font-weight: 650;
  white-space: normal;
}

@media (hover: hover) and (pointer: fine) {
  .delivery-calendar-order:hover .delivery-calendar-order-preview,
  .delivery-calendar-order:focus-visible .delivery-calendar-order-preview {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

.delivery-calendar-order.is-preview-open .delivery-calendar-order-preview {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.delivery-more {
  min-height: 25px;
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
}

.delivery-calendar-week .delivery-day {
  min-height: 430px;
}

.delivery-calendar-week {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: minmax(430px, auto);
}

.delivery-calendar-week .delivery-calendar-order {
  padding: 8px;
}

.delivery-drag-card.is-dragging {
  opacity: 0.42;
}

.delivery-drag-card {
  transition: opacity 160ms ease, transform 160ms ease, border-color 120ms ease, background 120ms ease;
}

.delivery-drag-card.is-saving {
  opacity: 0.56;
  transform: scale(0.985);
}

.delivery-drag-card.is-settling {
  opacity: 0;
  transform: translateY(4px) scale(0.98);
}

.delivery-page.is-updating .delivery-drag-card {
  cursor: wait;
}

.delivery-toast {
  position: fixed;
  z-index: 150;
  right: 24px;
  bottom: 24px;
  padding: 10px 15px;
  border-radius: 7px;
  background: #214f57;
  box-shadow: 0 8px 28px rgba(31, 41, 51, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.delivery-toast.is-error {
  background: #9d3636;
}

@keyframes delivery-target-saved {
  0% {
    box-shadow: inset 0 0 0 3px rgba(15, 117, 130, 0.48);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(15, 117, 130, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .delivery-drag-card,
  .delivery-calendar-order-preview,
  .delivery-toast {
    transition: none;
  }

  .delivery-day.is-saved,
  .delivery-unscheduled.is-saved {
    animation: none;
  }
}

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

  .dashboard-insight-grid,
  .delivery-layout {
    grid-template-columns: 1fr;
  }

  .delivery-unscheduled {
    position: static;
    max-height: none;
  }

  .delivery-unscheduled-list {
    max-height: 360px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .delivery-order-card {
    margin-bottom: 0;
  }
}

@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse) {
  .dashboard-summary-grid,
  .upcoming-delivery-list,
  .dashboard-insight-grid,
  .delivery-unscheduled-list {
    grid-template-columns: 1fr;
  }

  .upcoming-delivery-row:nth-child(odd) {
    border-right: 0;
  }

  .delivery-page-header {
    align-items: flex-start;
  }

  .delivery-calendar-panel {
    overflow-x: auto;
  }

  .delivery-calendar-toolbar,
  .delivery-weekdays,
  .delivery-calendar-grid {
    min-width: 820px;
  }

  .delivery-calendar-week {
    min-width: 1120px;
    grid-template-columns: repeat(7, minmax(160px, 1fr));
  }

  .delivery-calendar-toolbar {
    position: sticky;
    left: 0;
  }

  .delivery-day {
    min-height: 118px;
  }

  .delivery-calendar-week .delivery-day {
    min-height: 320px;
  }

  .delivery-calendar-order-preview {
    position: static;
    width: auto;
    max-height: 0;
    margin-top: 0;
    padding: 0 9px;
    overflow: hidden;
    border-width: 0;
    box-shadow: none;
    opacity: 0;
    transform: none;
    visibility: hidden;
    transition: max-height 160ms ease, margin-top 160ms ease, padding 160ms ease, opacity 120ms ease;
  }

  .delivery-calendar-order.is-preview-open .delivery-calendar-order-preview {
    max-height: 260px;
    margin-top: 7px;
    padding: 9px;
    border-width: 1px;
    opacity: 1;
    visibility: visible;
  }

  .delivery-toast {
    right: 16px;
    bottom: 78px;
    left: 16px;
    text-align: center;
  }
}

@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) {
  body.role-boss .boss-upcoming-delivery {
    margin-top: 14px;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(31, 41, 51, 0.06);
  }

  body.role-boss .boss-upcoming-delivery .section-header {
    padding: 13px 15px;
  }

  body.role-boss .boss-upcoming-delivery .section-header h2 {
    font-size: 19px;
  }

  body.role-boss .boss-upcoming-delivery .upcoming-delivery-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  body.role-boss .boss-finance-card .dashboard-money-lines strong {
    font-size: 20px;
    text-align: right;
  }
}

/* DST 客户板材订单 */
.module-tree-icon-dst {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dst-page-header {
  align-items: flex-end;
}

.dst-filter-bar {
  grid-template-columns: minmax(280px, 1fr) 180px auto;
}

.dst-order-panel,
.dst-detail-panel,
.dst-invoice-panel,
.dst-order-info {
  overflow: hidden;
}

.dst-section-header {
  gap: 18px;
}

.dst-section-header .inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.dst-wide-table-wrap {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.dst-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.dst-order-table {
  min-width: 0;
  table-layout: fixed;
}

.dst-table th,
.dst-table td {
  padding: 10px 11px;
  vertical-align: top;
  white-space: nowrap;
}

.dst-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf5f5;
}

.dst-order-table th:first-child {
  width: 25%;
}

.dst-order-table th:nth-child(2),
.dst-order-table th:nth-child(4) {
  width: 14%;
}

.dst-order-table th:nth-child(3) {
  width: 19%;
}

.dst-material,
.dst-import-items td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.dst-item-card-list {
  display: grid;
  gap: 14px;
}

.dst-item-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.04);
}

.dst-item-card-header {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.dst-item-card-title {
  min-width: 0;
}

.dst-item-card-title > span {
  display: block;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.dst-item-card-title h3 {
  margin: 3px 0 0;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.dst-item-card-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dst-item-card-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.dst-item-card-actions {
  flex-wrap: nowrap;
}

.dst-item-card-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dst-item-card-grid > div {
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid #e7edef;
  border-bottom: 1px solid #e7edef;
}

.dst-item-card-grid > div:nth-child(3n) {
  border-right: 0;
}

.dst-item-card-grid dt {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dst-item-card-grid dd {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.dst-item-card-grid .dst-item-card-total {
  border-right: 0;
  background: #eef8f7;
}

.dst-item-card-grid .dst-item-card-total dd {
  color: #15565b;
  font-size: 16px;
}

.dst-item-card-grid .dst-item-card-wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.dst-item-hole-list {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #f8fbfb;
}

.dst-item-hole-list > strong {
  display: block;
  margin-bottom: 7px;
  color: #37545a;
  font-size: 12px;
}

.dst-item-hole-row {
  padding: 7px 0;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(250px, auto) auto;
  align-items: center;
  gap: 8px 16px;
  border-top: 1px dashed #d9e4e6;
  font-size: 13px;
}

.dst-item-hole-note {
  grid-column: 1 / -1;
  color: var(--muted);
}

.dst-item-hole-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dst-item-hole-actions form,
.dst-item-hole-actions button {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  color: #9b2d2d;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.dst-item-more-actions {
  padding: 9px 16px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.dst-item-more-actions summary {
  width: max-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dst-item-more-actions form {
  margin-top: 10px;
}

.dst-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dst-summary-grid article {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.dst-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dst-summary-grid strong {
  display: block;
  margin-top: 6px;
  color: #153f43;
  font-size: 20px;
  line-height: 1.2;
}

.dst-summary-grid .dst-summary-total {
  border-color: #7bb8ba;
  background: #eef8f7;
}

.dst-status-pending,
.dst-board-status-added {
  color: #8a5a06;
  background: #fff4d8;
}

.dst-status-production,
.dst-board-status-redo {
  color: #92400e;
  background: #ffedd5;
}

.dst-status-completed,
.dst-status-delivered,
.dst-board-status-normal {
  color: #1f6a4a;
  background: #e6f5ec;
}

.dst-board-status-supplement {
  color: #4f46a5;
  background: #eeecff;
}

.dst-board-status-void {
  color: #6b7280;
  background: #eef0f2;
}

.dst-item-card.dst-item-status-void {
  color: #7a8287;
  background: #f6f7f7;
}

.dst-free-label {
  display: block;
  margin-top: 4px;
  color: #9a5f00;
  font-weight: 700;
}

.dst-hole-line {
  display: block;
  min-height: 21px;
}

.dst-item-actions .row-actions {
  margin-top: 8px;
}

.dst-hole-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #e3e9e9;
  font-size: 12px;
}

.dst-hole-actions form,
.dst-hole-actions button {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  color: #9b2d2d;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.dst-status-fields[hidden] {
  display: none;
}

.dst-live-calculation {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 18px 0 2px;
  padding: 14px 16px;
  border: 1px solid #b9d8d7;
  border-radius: 10px;
  background: #f3f9f9;
}

.dst-live-calculation span {
  color: var(--muted);
  font-size: 13px;
}

.dst-live-calculation strong {
  margin-left: 5px;
  color: #164f53;
  font-size: 16px;
}

.dst-hole-summary {
  grid-template-columns: repeat(2, minmax(180px, 280px));
}

.dst-hole-type-list {
  display: grid;
  gap: 10px;
}

.dst-hole-type-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 220px) auto auto;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dst-hole-type-row .form-group,
.dst-new-hole-type .form-group {
  margin: 0;
}

.dst-upload-card {
  max-width: 860px;
}

.notice-box.warning {
  border-color: #e8c780;
  background: #fff9eb;
}

.notice-box {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #bad4d5;
  border-radius: 10px;
  background: #f1f8f8;
  color: var(--text);
}

.notice-box p {
  margin: 6px 0 0;
}

.filter-bar {
  display: grid;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.filter-bar .form-group {
  margin: 0;
}

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

.table-total td {
  border-top: 2px solid #9fc5c5;
  background: #f1f8f8;
  font-weight: 800;
}

.notice-box ul {
  margin: 8px 0 0 20px;
}

.dst-import-order-fields {
  padding: 0;
}

.dst-import-items .dst-table {
  min-width: 2100px;
}

.dst-import-items .dst-table td {
  white-space: normal;
}

.dst-import-items .dst-table td:nth-child(2),
.dst-import-items .dst-table td:nth-child(5),
.dst-import-items .dst-table td:nth-child(11),
.dst-import-items .dst-table td:nth-child(14) {
  min-width: 170px;
  max-width: 260px;
}

.dst-import-duplicate td {
  color: #6b7378;
  background: #f3f4f5;
}

.dst-price-input {
  width: 110px;
}

.dst-default-price {
  display: flex;
  align-items: end;
  gap: 8px;
}

.dst-default-price label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dst-default-price input {
  width: 110px;
}

.checkbox-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  color: #684d13;
  font-weight: 700;
}

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

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

  .dst-item-card-grid > div,
  .dst-item-card-grid > div:nth-child(3n) {
    border-right: 1px solid #e7edef;
  }

  .dst-item-card-grid > div:nth-child(2n),
  .dst-item-card-grid .dst-item-card-wide,
  .dst-item-card-grid .dst-item-card-total {
    border-right: 0;
  }

  .dst-item-card-grid .dst-item-card-total {
    grid-column: 1 / -1;
  }

  .dst-summary-grid .dst-summary-total {
    grid-column: 1 / -1;
  }

  .dst-filter-bar,
  .dst-hole-type-row {
    grid-template-columns: 1fr;
  }

  .dst-section-header,
  .dst-default-price {
    align-items: flex-start;
    flex-direction: column;
  }

  .dst-section-header .inline-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .dst-summary-grid,
  .dst-hole-summary {
    grid-template-columns: 1fr;
  }

  .dst-item-card-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dst-item-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .dst-item-card-grid {
    grid-template-columns: 1fr;
  }

  .dst-item-card-grid > div,
  .dst-item-card-grid > div:nth-child(2n),
  .dst-item-card-grid > div:nth-child(3n),
  .dst-item-card-grid .dst-item-card-total {
    grid-column: auto;
    border-right: 0;
  }

  .dst-item-card-grid .dst-item-card-wide {
    grid-column: 1;
  }

  .dst-item-hole-row {
    grid-template-columns: 1fr;
  }

  .dst-item-hole-note {
    grid-column: 1;
  }

  .dst-item-hole-actions {
    justify-content: flex-start;
  }

  .dst-summary-grid .dst-summary-total {
    grid-column: auto;
  }

  .dst-summary-grid article {
    padding: 12px 14px;
  }

  .dst-summary-grid strong {
    font-size: 17px;
  }

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

@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) {
  .dst-order-table tbody td::before {
    content: attr(data-label);
  }

  .dst-invoice-table tbody td::before {
    content: attr(data-label);
  }

  .dst-order-table tbody td:first-child,
  .dst-order-table tbody td:nth-child(3) {
    grid-column: 1 / -1;
  }

  .dst-invoice-table tbody td:first-child,
  .dst-invoice-table tbody td:last-child {
    grid-column: 1 / -1;
  }
}

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

@media (max-width: 640px) {
  .purchase-report-filter .report-filter-grid {
    grid-template-columns: 1fr;
  }

  .purchase-payment-legend li {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .purchase-payment-legend .status-legend-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .purchase-payment-legend .status-legend-label {
    grid-column: 2;
  }

  .purchase-payment-legend strong {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .purchase-payment-legend .status-legend-percent {
    grid-column: 3;
    grid-row: 1;
  }

  .purchase-report-page .month-chart {
    min-width: max(100%, calc(var(--purchase-month-count, 12) * 76px));
  }
}

/* DST V1.22：紧凑订单表、Excel式板件表和右侧编辑抽屉 */
.dst-order-filters {
  grid-template-columns: minmax(260px, 1fr) 150px 150px auto auto;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.dst-check-filter {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.dst-order-panel,
.dst-detail-panel,
.dst-summary-panel,
.dst-event-panel,
.dst-collapsible-panel {
  margin-bottom: 12px;
}

.dst-order-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  font-size: 12px;
}

.dst-order-table th:nth-child(1) { width: 125px; }
.dst-order-table th:nth-child(2) { width: 110px; }
.dst-order-table th:nth-child(3) { width: 78px; }
.dst-order-table th:nth-child(4) { width: 50px; }
.dst-order-table th:nth-child(5) { width: 68px; }
.dst-order-table th:nth-child(6) { width: 50px; }
.dst-order-table th:nth-child(7) { width: 50px; }
.dst-order-table th:nth-child(8) { width: 76px; }
.dst-order-table th:nth-child(9) { width: 76px; }
.dst-order-table th:nth-child(10) { width: 84px; }

.dst-order-table th,
.dst-order-table td {
  height: 38px;
  padding: 6px 5px;
  vertical-align: middle;
}

.dst-order-number-cell,
.dst-order-number-cell .table-primary-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dst-order-number-cell .table-primary-link {
  display: block;
}

.dst-clickable-row,
.dst-item-row {
  cursor: pointer;
}

.dst-clickable-row:hover td,
.dst-item-row:hover td,
.dst-clickable-row:focus td,
.dst-item-row:focus td {
  background: #edf7f7;
}

.dst-money-column {
  background: #f1f8f7;
}

.dst-count-alert {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  color: #5b3d96;
  background: #efebff;
  font-weight: 800;
}

.dst-summary-panel {
  padding: 0;
  overflow: hidden;
}

.dst-summary-money {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(135px, 1fr));
}

.dst-metric {
  min-width: 0;
  padding: 14px 16px;
  border-left: 1px solid var(--line);
}

.dst-metric:first-child { border-left: 0; }
.dst-metric span,
.dst-summary-counts span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.dst-metric strong {
  display: block;
  margin-top: 4px;
  color: #23464b;
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
}

.dst-metric-primary {
  background: #e8f5f4;
}

.dst-metric-primary strong {
  color: #0d5961;
  font-size: 23px;
}

.dst-summary-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  border-top: 1px solid var(--line);
  background: #fafcfc;
}

.dst-summary-counts > div {
  padding: 9px 16px;
  border-left: 1px solid var(--line);
}

.dst-summary-counts > div:first-child { border-left: 0; }
.dst-summary-counts strong {
  display: inline-block;
  margin-top: 2px;
  color: var(--text);
  font-size: 15px;
}

.dst-order-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 18px;
  min-height: 42px;
  margin: -3px 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.dst-order-meta .dst-order-note {
  min-width: 180px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dst-order-meta a { margin-left: auto; white-space: nowrap; }

.dst-detail-panel {
  overflow: hidden;
}

.dst-item-table-wrap {
  max-height: 620px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.dst-item-table {
  width: 100%;
  min-width: 930px;
  table-layout: fixed;
  font-size: 11.5px;
}

.dst-item-table th,
.dst-item-table td {
  height: 32px;
  padding: 4px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dst-item-table th {
  top: 0;
  z-index: 3;
  box-shadow: 0 1px 0 var(--line);
}

.dst-item-table th:nth-child(1) { width: 38px; }
.dst-item-table th:nth-child(2) { width: 135px; }
.dst-item-table th:nth-child(3) { width: 88px; }
.dst-item-table th:nth-child(4) { width: 130px; }
.dst-item-table th:nth-child(5) { width: 40px; }
.dst-item-table th:nth-child(6) { width: 62px; }
.dst-item-table th:nth-child(7) { width: 62px; }
.dst-item-table th:nth-child(8) { width: 62px; }
.dst-item-table th:nth-child(9) { width: 72px; }
.dst-item-table th:nth-child(10) { width: 44px; }
.dst-item-table th:nth-child(11) { width: 62px; }
.dst-item-table th:nth-child(12) { width: 58px; }
.dst-item-table th:nth-child(13) { width: 58px; }

.dst-item-name strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dst-item-name small {
  margin-left: 5px;
  color: var(--warning);
}

.dst-item-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fafcfc;
}

.dst-item-table-actions small {
  color: var(--muted);
  font-size: 11px;
}

.dst-item-row-void td {
  color: #879097;
  background: #f5f6f7;
  text-decoration-color: #aeb5ba;
}

.dst-production-status-pending { color: #855b0d; background: #fff3d8; }
.dst-production-status-produced { color: #155e75; background: #e1f3f7; }
.dst-production-status-delivered { color: #1f6a4a; background: #e6f5ec; }
.dst-production-status-void { color: #687078; background: #eceff1; }

.dst-collapsible-panel {
  padding: 0;
  overflow: hidden;
}

.dst-collapsible-panel > summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
}

.dst-collapsible-panel > summary::-webkit-details-marker { display: none; }
.dst-collapsible-panel > summary span:first-child { min-width: 0; }
.dst-collapsible-panel > summary strong { display: block; font-size: 15px; }
.dst-collapsible-panel > summary small { display: block; margin-top: 3px; color: var(--muted); }
.dst-collapsible-panel[open] > summary { border-bottom: 1px solid var(--line); background: #fafcfc; }

.dst-hole-breakdown {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.dst-hole-breakdown > div {
  padding: 12px 14px;
  border-left: 1px solid var(--line);
}

.dst-hole-breakdown > div:first-child { border-left: 0; }
.dst-hole-breakdown span,
.dst-hole-breakdown strong,
.dst-hole-breakdown em { display: block; }
.dst-hole-breakdown span { color: var(--muted); font-size: 11px; }
.dst-hole-breakdown strong { margin-top: 3px; font-size: 15px; }
.dst-hole-breakdown em { margin-top: 2px; color: #315d62; font-size: 12px; font-style: normal; }
.dst-hole-breakdown-total { background: #edf7f6; }

.dst-collapsible-body { padding: 12px 16px 16px; }
.dst-inline-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }

.dst-event-panel { overflow: hidden; }
.dst-event-table-wrap { max-height: 360px; overflow: auto; border-top: 1px solid var(--line); }
.dst-event-table { min-width: 1080px; width: 100%; border-collapse: collapse; font-size: 12px; }
.dst-event-table th { position: sticky; top: 0; z-index: 2; padding: 7px 9px; text-align: left; background: #edf5f5; }
.dst-event-table td { padding: 7px 9px; vertical-align: top; border-top: 1px solid #e7edef; line-height: 1.45; }
.dst-event-table th:nth-child(1) { width: 150px; }
.dst-event-table th:nth-child(2) { width: 90px; }
.dst-event-table th:nth-child(3) { width: 130px; }

.dst-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(18, 33, 38, .26);
}

.dst-item-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 81;
  width: min(560px, 94vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -10px 0 35px rgba(24, 47, 52, .2);
  transform: translateX(105%);
  transition: transform .18s ease;
}

.dst-item-drawer.is-open { transform: translateX(0); }
body.dst-drawer-open { overflow: hidden; }

.dst-item-drawer > header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.dst-item-drawer > header span { color: var(--primary); font-size: 11px; font-weight: 800; }
.dst-item-drawer > header h2 { margin: 2px 0 0; font-size: 18px; }
.dst-drawer-close { width: 34px; height: 34px; border: 0; border-radius: 50%; color: #52636a; background: #eef2f3; font-size: 24px; cursor: pointer; }

.dst-item-drawer > form { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px; }
.dst-drawer-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.dst-drawer-fields .form-group { margin: 0; }
.dst-drawer-fields label { margin-bottom: 4px; font-size: 11px; }
.dst-drawer-fields input,
.dst-drawer-fields select,
.dst-drawer-fields textarea { padding: 8px 9px; font-size: 13px; }
.dst-field-wide { grid-column: 1 / -1; }
.dst-check-row { display: flex; align-items: center; gap: 16px; }
.dst-check-row label { display: flex; align-items: center; gap: 6px; margin: 0; }
.dst-drawer-timestamps { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 8px 0 2px; color: var(--muted); font-size: 11px; }
.dst-drawer-hole-records { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8fbfb; }
.dst-drawer-subheading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: 12px; }
.dst-drawer-subheading a { font-weight: 700; }
#drawer-hole-record-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px dashed #d8e3e5; font-size: 12px; }
#drawer-hole-record-list > div:first-child { border-top: 0; }
#drawer-hole-record-list a { white-space: nowrap; }

.dst-item-drawer > footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fafcfc;
}

.dst-item-drawer > footer form { margin: 0 0 0 auto; }
.dst-drawer-danger { padding: 0 18px 12px; background: #fafcfc; }
.dst-drawer-danger summary { width: max-content; color: var(--muted); font-size: 11px; cursor: pointer; }
.dst-drawer-danger form { margin-top: 7px; }
.dst-drawer-danger button { padding: 0; border: 0; color: var(--danger); background: transparent; cursor: pointer; }
.dst-order-danger { margin-top: 8px; opacity: .72; }

@media (max-width: 1100px) {
  .dst-order-filters { grid-template-columns: minmax(220px, 1fr) repeat(2, 145px); }
  .dst-check-filter, .dst-order-filters .filter-actions { align-self: end; }
  .dst-summary-money { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
  .dst-metric:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .dst-metric:nth-child(5) { border-top: 1px solid var(--line); }
  .dst-hole-breakdown { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .dst-hole-breakdown > div:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .dst-hole-breakdown > div:nth-child(n+5) { border-top: 1px solid var(--line); }
}

@media (max-width: 700px) {
  .dst-detail-header { align-items: flex-start; }
  .dst-detail-header .page-actions { width: 100%; }
  .dst-detail-header .page-actions .btn { flex: 1; }
  .dst-order-filters { grid-template-columns: 1fr 1fr; }
  .dst-order-filters .filter-search { grid-column: 1 / -1; }
  .dst-summary-money { grid-template-columns: repeat(2, minmax(145px, 1fr)); overflow-x: auto; }
  .dst-metric { border-top: 1px solid var(--line); }
  .dst-metric:nth-child(even) { border-left: 0; }
  .dst-metric-primary { grid-column: 1 / -1; border-top: 0; }
  .dst-summary-counts { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .dst-summary-counts > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .dst-summary-counts > div:nth-child(4) { border-top: 1px solid var(--line); }
  .dst-order-meta { gap: 7px 12px; }
  .dst-order-meta a { margin-left: 0; }
  .dst-section-header > .secondary-text { display: none; }
  .dst-item-table { min-width: 760px; }
  .dst-item-table th:nth-child(3), .dst-item-table td:nth-child(3),
  .dst-item-table th:nth-child(6), .dst-item-table td:nth-child(6),
  .dst-item-table th:nth-child(8), .dst-item-table td:nth-child(8),
  .dst-item-table th:nth-child(10), .dst-item-table td:nth-child(10) { display: none; }
  .dst-item-table-actions { align-items: stretch; flex-wrap: wrap; }
  .dst-item-table-actions small { width: 100%; }
  .dst-hole-breakdown { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .dst-hole-breakdown > div:nth-child(odd) { border-left: 0; }
  .dst-hole-breakdown > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .dst-event-table-wrap { overflow-x: auto; }
  .dst-item-drawer { width: 100vw; max-width: none; }
}

@media (max-width: 480px) {
  .dst-order-filters { grid-template-columns: 1fr; }
  .dst-order-filters .filter-search { grid-column: auto; }
  .dst-order-table { min-width: 580px; }
  .dst-order-table th:nth-child(4), .dst-order-table td:nth-child(4),
  .dst-order-table th:nth-child(5), .dst-order-table td:nth-child(5),
  .dst-order-table th:nth-child(6), .dst-order-table td:nth-child(6),
  .dst-order-table th:nth-child(7), .dst-order-table td:nth-child(7) { display: none; }
  .dst-drawer-fields { grid-template-columns: 1fr 1fr; gap: 9px; }
  .dst-item-drawer > header,
  .dst-item-drawer > form,
  .dst-item-drawer > footer { padding-left: 14px; padding-right: 14px; }
  .dst-item-drawer > footer .btn { padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse) {
  .purchase-supplier-detail-table tbody th,
  .purchase-supplier-detail-table td:nth-of-type(2),
  .purchase-supplier-detail-table td:nth-of-type(3) {
    grid-column: 1 / -1;
  }

  .purchase-supplier-detail-table tbody th::before { content: "供应商"; }
  .purchase-supplier-detail-table td:nth-of-type(1)::before { content: "采购记录"; }
  .purchase-supplier-detail-table td:nth-of-type(2)::before { content: "采购总额"; }
  .purchase-supplier-detail-table td:nth-of-type(3)::before { content: "平均每笔"; }
  .purchase-supplier-detail-table td:nth-of-type(4)::before { content: "最近采购"; }
}

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

.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;
  color: #394954;
  font-size: 13px;
  font-weight: 650;
}

.customer-pool-table {
  min-width: 1050px;
  table-layout: fixed;
}

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

.customer-pool-col-company { width: 18%; }
.customer-pool-col-original { width: 11%; }
.customer-pool-col-follow-up { width: 20%; }
.customer-pool-col-count { width: 8%; }
.customer-pool-col-dates { width: 14%; }
.customer-pool-col-amount { width: 14%; }
.customer-pool-col-actions { width: 15%; }

.customer-pool-original-salesperson {
  color: #43545e;
  font-weight: 600;
  white-space: nowrap;
}

.customer-pool-follow-up-form {
  width: 100%;
  min-width: 0;
  max-width: 196px;
  display: grid;
  grid-template-columns: minmax(104px, 138px) auto;
  align-items: center;
  justify-content: start;
  gap: 8px;
}

.customer-pool-follow-up-form select {
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 5px 28px 5px 10px;
  border-color: #c5d3d8;
  border-radius: 6px;
  background: #f8fbfb;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 650;
}

.customer-pool-follow-up-form .customer-pool-follow-up-submit {
  min-height: 34px;
  height: 34px;
  padding: 5px 10px;
  border-color: #b9d6da;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.customer-pool-follow-up-form .customer-pool-follow-up-submit:hover {
  border-color: #84b6bd;
  background: #d7ecef;
  color: var(--primary-dark);
}

.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: 52px;
  height: 32px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

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

.has-module-sidebar {
  padding-left: 220px;
  transition: padding-left 0.2s ease;
}

html.module-sidebar-is-collapsed .has-module-sidebar {
  padding-left: 70px;
}

.module-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: 220px;
  padding: 10px 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid #cbd8dc;
  background: #edf4f5;
  transition: width 0.2s ease, padding 0.2s ease;
}

html.module-sidebar-is-collapsed .module-sidebar {
  width: 70px;
  padding-inline: 7px;
}

.module-sidebar-heading {
  min-height: 42px;
  padding: 0 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #d5e0e3;
}

.module-sidebar-title {
  color: #62747d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.module-sidebar-toggle {
  min-width: 54px;
  min-height: 32px;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #536a73;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.module-sidebar-toggle:hover {
  background: #dce9eb;
  color: var(--primary-dark);
}

.module-sidebar-toggle-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.2s ease;
}

html.module-sidebar-is-collapsed .module-sidebar-heading {
  justify-content: center;
  padding-inline: 0;
}

html.module-sidebar-is-collapsed .module-sidebar-title,
html.module-sidebar-is-collapsed .module-sidebar-toggle-text {
  display: none;
}

html.module-sidebar-is-collapsed .module-sidebar-toggle {
  min-width: 40px;
  width: 40px;
  padding-inline: 6px;
}

.module-tree {
  display: grid;
  align-content: start;
  gap: 3px;
}

.module-tree-group {
  position: relative;
}

.module-tree-group.current::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 7px;
  bottom: 7px;
  left: -9px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--primary);
}

.module-tree-toggle {
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #40535c;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

.module-tree-toggle:hover,
.module-tree-group.current > .module-tree-toggle {
  background: #dce9eb;
  color: var(--primary-dark);
}

.module-tree-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.module-tree-label {
  min-width: 0;
  flex: 1;
}

.module-tree-chevron {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #71818a;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.16s ease;
}

.module-tree-group.is-open > .module-tree-toggle .module-tree-chevron {
  transform: rotate(90deg);
}

.module-tree-children {
  padding: 2px 5px 6px 34px;
  display: grid;
  gap: 1px;
}

.module-tree-group:not(.is-open) > .module-tree-children {
  display: none;
}

.module-tree-flyout-title {
  display: none;
}

.module-tree-children a {
  min-height: 32px;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  color: #53636c;
  font-size: 13px;
  font-weight: 500;
}

.module-tree-children a:hover {
  background: #e2ecee;
  color: var(--primary-dark);
}

.module-tree-children a.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
}

html.module-sidebar-is-collapsed .module-tree-group.current::before {
  left: -7px;
}

html.module-sidebar-is-collapsed .module-tree-toggle {
  width: 56px;
  min-height: 44px;
  padding: 8px;
  justify-content: center;
}

html.module-sidebar-is-collapsed .module-tree-label,
html.module-sidebar-is-collapsed .module-tree-chevron {
  display: none;
}

html.module-sidebar-is-collapsed .module-tree-icon {
  width: 21px;
  height: 21px;
  flex-basis: 21px;
}

html.module-sidebar-is-collapsed .module-tree-group > .module-tree-children {
  display: none;
}

.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: 150px 150px 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-locked,
.status-已取消 {
  background: var(--danger-soft);
  color: var(--danger);
  text-decoration: none;
}

.mobile-order-card-list,
.mobile-customer-quick-search,
.mobile-customer-filter-panel,
.mobile-customer-card-list {
  display: 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 {
  padding: 10px 8px;
}

.order-list-table tbody td {
  padding: 12px 8px;
  font-size: 14px;
  vertical-align: middle;
}

.order-col-number { width: 8%; }
.order-col-customer { width: 22%; }
.order-col-salesperson { width: 7%; }
.order-col-product { width: 9%; }
.order-col-amount { width: 10%; }
.order-col-received { width: 10%; }
.order-col-status { width: 27%; }
.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-number-cell {
  padding-left: 12px !important;
  text-align: left;
  white-space: nowrap;
}

.invoice-record-label {
  color: var(--muted);
  font-weight: 700;
}

.legacy-order-number-label {
  color: #a15c00;
  font-weight: 700;
}

.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 110px 110px 150px 170px minmax(135px, 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: 5;
}

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

.inline-payment-account {
  color: var(--text);
  font-weight: 700;
}

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

.inline-payment-add-form select,
.inline-payment-add-form input[name="amount"],
.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 110px 110px 150px 170px minmax(135px, 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: 7;
  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-month-group + .order-month-group {
  border-top: 1px solid var(--line);
}

.order-month-header {
  min-height: 48px;
  padding: 10px 18px 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #9fcab0;
  background: #e5f3e9;
  box-shadow: inset 5px 0 0 #2f8256;
}

.order-month-header h3 {
  margin: 0;
  color: #124d30;
  font-size: 17px;
  font-weight: 800;
}

.order-month-header span {
  padding: 3px 9px;
  border: 1px solid #9fcab0;
  border-radius: 999px;
  background: #fff;
  color: #174b31;
  font-size: 13px;
  font-weight: 750;
}

.order-history-year-header {
  padding: 9px 18px;
  border-bottom: 1px solid #cad5d9;
  background: #edf2f4;
  color: #40545e;
  font-size: 14px;
  font-weight: 800;
}

.order-history-badge {
  margin-left: 6px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #bcc9cf;
  border-radius: 999px;
  background: #eef2f4;
  color: #53666f;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.order-number-cell .order-history-badge {
  margin: 4px 0 0;
}

.row-history-order td {
  background: #fafcfc;
}

.order-history-search-results .section-header {
  align-items: center;
}

.order-history-entry {
  min-height: 82px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid #71818a;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.order-history-entry:hover {
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 7px 20px rgba(24, 57, 67, 0.13);
  transform: translateY(-1px);
}

.order-history-entry-icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #edf1f2;
  font-size: 20px;
}

.order-history-entry-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.order-history-entry-copy strong {
  font-size: 18px;
}

.order-history-entry-copy small {
  color: var(--muted);
  font-size: 13px;
}

.order-history-entry-action {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 14px;
  font-weight: 750;
}

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

.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 100px 100px 130px 150px minmax(120px, 1fr) 64px;
    column-gap: 8px;
  }

  .inline-payment-record {
    grid-template-columns: 52px 100px 100px 130px 150px minmax(120px, 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-month-header {
    padding-inline: 14px;
  }

  .order-history-entry {
    padding: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .order-history-entry-copy {
    width: calc(100% - 56px);
  }

  .order-history-entry-action {
    width: calc(100% - 56px);
    margin-left: 56px;
  }
}

.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(240px, 1.7fr) repeat(5, minmax(115px, 1fr)) auto;
}

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

.duplicate-customer-warning {
  margin-bottom: 20px;
  padding: 18px;
  border: 2px solid #d97706;
  border-radius: var(--radius);
  background: #fff7ed;
  color: #7c2d12;
}

.duplicate-customer-warning > div:first-child p {
  margin: 6px 0 0;
}

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

.duplicate-customer-list article {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #fdba74;
  border-radius: 10px;
  background: #fff;
}

.duplicate-customer-list span {
  color: #7c2d12;
  font-size: 13px;
}

.mobile-filter-toggle,
.mobile-filter-close {
  display: none;
}

.shipping-status-control-form {
  position: relative;
  width: var(--status-control-width, 74px);
  flex-direction: column;
  align-items: stretch;
}

.shipping-date-toggle {
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
}

.shipping-date-summary {
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.shipping-date-editor {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 50%;
  width: 250px;
  padding: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid #b9c6cc;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(31, 41, 51, 0.2);
  transform: translateX(-50%);
}

.shipping-date-editor[hidden] {
  display: none !important;
}

.shipping-date-editor label,
.shipping-date-editor label input {
  width: 100%;
}

.shipping-date-editor span {
  color: var(--muted);
  font-size: 11px;
}

.shipping-date-editor > div {
  display: flex;
  gap: 8px;
}

.order-danger-menu {
  position: relative;
}

.order-danger-menu > summary {
  list-style: none;
  cursor: pointer;
}

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

.order-danger-menu > div {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid #d88;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(80, 20, 20, 0.2);
}

.order-danger-menu p {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.order-danger-menu form,
.order-danger-menu label {
  display: grid;
  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(270px, 1.35fr) minmax(180px, 0.9fr) minmax(170px, 1.1fr) minmax(170px, 1.1fr) auto;
  align-items: end;
  gap: 10px;
}

.report-year-filter {
  min-width: 0;
}

.report-year-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.search-bar .report-year-heading label {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.report-period-note {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

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

.report-filter-actions .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.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-x: auto;
  -webkit-overflow-scrolling: touch;
}

.month-chart {
  width: 100%;
  min-width: max(100%, calc(var(--sales-month-count, 13) * 64px));
  height: 252px;
  display: grid;
  grid-template-columns: repeat(var(--sales-month-count, 13), minmax(64px, 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;
}

.mobile-sales-report-ranking-list,
.mobile-sales-report-detail-list,
.mobile-sales-rank-number,
.mobile-month-label {
  display: none;
}

.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: 1fr;
  gap: 16px;
}

/* 登录、会话与账号管理 */
.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;
}

.temporary-password-card h2 {
  margin-top: 0;
}

.temporary-password-output {
  width: 100%;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

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

/* V1.19 本地试做：极简采购模块 */
.purchasing-page-header {
  margin-bottom: 10px;
  align-items: center;
}

.purchase-heading-copy {
  min-width: 0;
}

.purchase-heading-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 20px;
}

.purchasing-page-header p {
  margin-top: 2px;
  font-size: 13px;
}

.purchasing-page-header .btn {
  min-height: 34px;
  padding: 6px 13px;
  font-size: 13px;
}

.purchase-inline-stats {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.purchase-inline-stats span {
  padding: 0 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border-left: 1px solid #dbe2e5;
  white-space: nowrap;
}

.purchase-inline-stats span:first-child {
  padding-left: 0;
  border-left: 0;
}

.purchase-inline-stats strong {
  color: #29464e;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

/* V1.20 采购报表 */
.purchase-report-filter .report-filter-grid {
  grid-template-columns: minmax(145px, 0.8fr) minmax(145px, 0.8fr) minmax(240px, 1.4fr) auto;
}

.purchase-report-page .month-chart {
  grid-template-columns: repeat(var(--purchase-month-count, 12), minmax(64px, 1fr));
}

.purchase-payment-legend strong {
  color: var(--primary-dark);
  white-space: nowrap;
}

.purchase-bar-list .salesperson-bar-heading strong:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.purchase-supplier-detail-table {
  min-width: 760px;
}

.demo-data-notice {
  margin-bottom: 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e6cf91;
  border-radius: var(--radius);
  background: #fffaf0;
  color: #6e5016;
}

.demo-data-notice strong {
  flex: 0 0 auto;
}

.demo-data-notice span {
  color: #7a653a;
  font-size: 13px;
}

.purchase-demo-notice {
  margin-bottom: 10px;
  padding: 6px 10px;
  gap: 8px;
  font-size: 12px;
}

.purchase-demo-notice span {
  font-size: 12px;
}

.demo-badge {
  width: max-content;
  margin-top: 4px;
  padding: 2px 6px;
  display: block;
  border: 1px solid #e1c66e;
  border-radius: 999px;
  background: #fff6d7;
  color: #805a0b;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.purchase-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.55fr) minmax(160px, 1fr) 132px 132px auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px 10px;
}

.purchase-filter-field,
.purchase-filter-date {
  min-width: 0;
}

.purchase-filter-bar input,
.purchase-filter-bar select {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 13px;
}

.purchase-filter-date input {
  padding-inline: 7px;
  font-size: 12px;
}

.purchase-filter-bar .filter-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.purchase-filter-bar .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.purchase-list-panel {
  overflow: hidden;
}

.purchase-table-header {
  min-height: 38px;
  padding: 8px 10px;
  align-items: center;
}

.purchase-table-header h2 {
  font-size: 15px;
}

.purchase-table-header > span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-list-table {
  min-width: 940px;
  table-layout: fixed;
  font-size: 13px;
}

.purchase-list-table .purchase-col-date { width: 10%; }
.purchase-list-table .purchase-col-supplier { width: 18%; }
.purchase-list-table .purchase-col-content { width: 29%; }
.purchase-list-table .purchase-col-quantity { width: 8%; }
.purchase-list-table .purchase-col-amount { width: 14%; }
.purchase-list-table .purchase-col-payment { width: 8%; }
.purchase-list-table .purchase-col-order { width: 8%; }
.purchase-list-table .purchase-col-action { width: 5%; }

.purchase-list-table th,
.purchase-list-table td {
  padding: 7px 9px;
  vertical-align: middle;
}

.purchase-list-table th {
  background: #f4f6f7;
  color: #5a6870;
  font-size: 11px;
  letter-spacing: 0;
}

.purchase-list-table .text-center {
  text-align: center;
}

.purchase-date,
.purchase-quantity,
.purchase-order,
.purchase-action {
  white-space: nowrap;
}

.purchase-supplier .strong-link {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

.purchase-item-primary {
  display: block;
  color: #273b43;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.purchase-item-detail {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.purchase-amount strong {
  color: #213f47;
  font-size: 14px;
  font-weight: 750;
}

.purchase-payment-status {
  min-height: 21px;
  padding: 2px 7px;
  font-size: 11px;
}

.purchase-status-paid {
  background: #eaf4ee;
  color: #316a4f;
}

.purchase-status-unpaid {
  background: #f8f0df;
  color: #8a611c;
}

.purchase-empty {
  color: #a1abb0;
}

.purchase-edit-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.purchase-list-table .demo-badge {
  margin: 3px 0 0;
  display: inline-flex;
}

.supplier-list-table {
  min-width: 880px;
  table-layout: fixed;
}

.supplier-list-table th:nth-child(1) { width: 20%; }
.supplier-list-table th:nth-child(2) { width: 12%; }
.supplier-list-table th:nth-child(3) { width: 14%; }
.supplier-list-table th:nth-child(4) { width: 20%; }
.supplier-list-table th:nth-child(5) { width: 16%; }
.supplier-list-table th:nth-child(6) { width: 18%; }

.supplier-list-table .row-actions {
  align-items: stretch;
}

.quick-purchase-form,
.supplier-form {
  max-width: 900px;
  margin-inline: auto;
}

.quick-purchase-core {
  padding: 2px 2px 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.quick-purchase-core .purchase-total-group {
  grid-column: 1 / -1;
  max-width: 420px;
}

.purchase-money-input {
  display: flex;
  align-items: stretch;
}

.purchase-money-input > span {
  min-width: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #b9c6cc;
  border-right: 0;
  border-radius: 5px 0 0 5px;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 700;
}

.purchase-money-input input {
  border-radius: 0 5px 5px 0;
}

.purchase-optional-heading {
  padding: 18px 2px 13px;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.purchase-optional-heading strong {
  font-size: 16px;
}

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

.purchase-optional-grid {
  gap: 15px 20px;
}

.text-action {
  min-height: 34px;
  margin-top: 5px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.text-action:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.paid-choice {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.paid-choice legend {
  margin-bottom: 6px;
  color: #394954;
  font-size: 13px;
  font-weight: 650;
}

.paid-choice label {
  min-height: 40px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #b9c6cc;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}

.paid-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
}

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

  .purchase-filter-bar .search-field,
  .purchase-filter-bar .filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) {
  .has-module-sidebar {
    padding-left: 72px;
  }

  html.module-sidebar-is-collapsed .has-module-sidebar {
    padding-left: 72px;
  }

  .module-sidebar {
    width: 72px;
    padding: 10px 7px;
    gap: 6px;
  }

  html.module-sidebar-is-collapsed .module-sidebar {
    width: 72px;
    padding-inline: 7px;
  }

  .module-sidebar-heading {
    display: none;
  }

  .module-tree {
    gap: 4px;
  }

  .module-tree-group.current::before {
    left: -7px;
  }

  .module-tree-toggle,
  html.module-sidebar-is-collapsed .module-tree-toggle {
    width: 56px;
    min-height: 46px;
    padding: 8px;
    justify-content: center;
  }

  .module-tree-label,
  .module-tree-chevron {
    display: none;
  }

  .module-tree-icon,
  html.module-sidebar-is-collapsed .module-tree-icon {
    width: 21px;
    height: 21px;
    flex-basis: 21px;
  }

  .module-sidebar .module-tree-group > .module-tree-children {
    display: none;
  }

  body.role-normal .main-nav {
    gap: 0;
  }

  body.role-normal .main-nav > a,
  body.role-normal .system-menu {
    min-width: 0;
    flex: 1 1 0;
  }

  body.role-normal .main-nav > a {
    padding-inline: 2px;
    font-size: 13px;
  }

  body.role-normal .system-menu > summary {
    width: 100%;
    min-width: 0;
    padding-inline: 2px;
    font-size: 13px;
    white-space: nowrap;
  }

  .demo-data-notice {
    align-items: flex-start;
  }

  .purchase-list-table td:nth-child(1)::before { content: "日期"; }
  .purchase-list-table td:nth-child(2)::before { content: "供应商"; }
  .purchase-list-table td:nth-child(3)::before { content: "采购内容"; }
  .purchase-list-table td:nth-child(4)::before { content: "数量"; }
  .purchase-list-table td:nth-child(5)::before { content: "金额"; }
  .purchase-list-table td:nth-child(6)::before { content: "付款"; }
  .purchase-list-table td:nth-child(7)::before { content: "对应订单"; }
  .purchase-list-table td:nth-child(8)::before { content: "操作"; }

  .supplier-list-table td:nth-child(1)::before { content: "供应商名称"; }
  .supplier-list-table td:nth-child(2)::before { content: "联系人"; }
  .supplier-list-table td:nth-child(3)::before { content: "电话"; }
  .supplier-list-table td:nth-child(4)::before { content: "主要供应产品"; }
  .supplier-list-table td:nth-child(5)::before { content: "备注"; }
  .supplier-list-table td:nth-child(6)::before { content: "操作"; }

  .purchase-list-table td:nth-child(2),
  .purchase-list-table td:nth-child(3),
  .supplier-list-table td:nth-child(1),
  .supplier-list-table td:nth-child(4),
  .supplier-list-table td:nth-child(5),
  .supplier-list-table td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .mobile-card-table.purchase-list-table tbody {
    padding: 8px;
    gap: 8px;
  }

  .mobile-card-table.purchase-list-table tbody tr {
    padding: 8px 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "date payment"
      "supplier supplier"
      "content content"
      "quantity amount"
      "order action";
    gap: 0 12px;
    border-radius: 7px;
    box-shadow: none;
  }

  .mobile-card-table.purchase-list-table tbody td {
    min-width: 0;
    padding: 6px 0;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 6px;
    font-size: 13px;
    line-height: 1.4;
  }

  .mobile-card-table.purchase-list-table tbody td:nth-child(1) { grid-area: date; }
  .mobile-card-table.purchase-list-table tbody td:nth-child(2) { grid-area: supplier; }
  .mobile-card-table.purchase-list-table tbody td:nth-child(3) { grid-area: content; }
  .mobile-card-table.purchase-list-table tbody td:nth-child(4) { grid-area: quantity; }
  .mobile-card-table.purchase-list-table tbody td:nth-child(5) { grid-area: amount; }
  .mobile-card-table.purchase-list-table tbody td:nth-child(6) { grid-area: payment; }
  .mobile-card-table.purchase-list-table tbody td:nth-child(7) { grid-area: order; }
  .mobile-card-table.purchase-list-table tbody td:nth-child(8) { grid-area: action; }

  .mobile-card-table.purchase-list-table tbody td:nth-child(1),
  .mobile-card-table.purchase-list-table tbody td:nth-child(4),
  .mobile-card-table.purchase-list-table tbody td:nth-child(5),
  .mobile-card-table.purchase-list-table tbody td:nth-child(6),
  .mobile-card-table.purchase-list-table tbody td:nth-child(7),
  .mobile-card-table.purchase-list-table tbody td:nth-child(8) {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-card-table.purchase-list-table tbody td:nth-child(1),
  .mobile-card-table.purchase-list-table tbody td:nth-child(6) {
    border-bottom: 1px dashed #dfe6e9;
  }

  .mobile-card-table.purchase-list-table tbody td:nth-child(5),
  .mobile-card-table.purchase-list-table tbody td:nth-child(6) {
    align-items: flex-end;
    text-align: right;
  }

  .mobile-card-table.purchase-list-table tbody td:nth-child(8) {
    align-items: flex-end;
    border-bottom: 0;
  }

  .mobile-card-table.purchase-list-table tbody td.number,
  .mobile-card-table.purchase-list-table tbody td.number strong {
    overflow-wrap: normal;
    white-space: nowrap;
  }

  .purchase-list-table .purchase-supplier .strong-link {
    -webkit-line-clamp: 2;
  }

  .purchase-list-table .purchase-item-primary {
    font-size: 13px;
  }

  .purchase-list-table .purchase-amount strong {
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  .quick-purchase-core,
  .purchase-optional-grid {
    grid-template-columns: 1fr;
  }

  .quick-purchase-core .purchase-total-group {
    grid-column: auto;
  }

  .purchasing-page-header {
    margin-bottom: 9px;
  }

  .purchase-heading-line {
    display: block;
  }

  .purchase-inline-stats {
    width: 100%;
    margin-top: 7px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .purchase-inline-stats span {
    min-width: 0;
    padding: 0 7px;
    display: grid;
    gap: 0;
    white-space: normal;
  }

  .purchase-inline-stats strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .purchasing-page-header .page-actions {
    margin-top: 8px;
  }

  .purchase-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
  }

  .purchase-filter-bar .search-field,
  .purchase-filter-bar .purchase-filter-field,
  .purchase-filter-bar .filter-actions {
    grid-column: 1 / -1;
  }

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

  .purchase-filter-bar .filter-actions > * {
    width: 100%;
  }

  .demo-data-notice,
  .purchase-optional-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .purchase-demo-notice {
    padding-block: 5px;
  }
}

/* 订单工作台与全局搜索 */
.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(3),
  .customer-pool-table td:nth-child(5),
  .customer-pool-table td:nth-child(6),
  .customer-pool-table td:nth-child(7),
  .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(9),
  .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),
  .salesperson-detail-table td:nth-of-type(5) {
    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(5) > * {
    grid-column: 2;
  }

  .customer-pool-table td:nth-child(2),
  .customer-pool-table td:nth-child(4) {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

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

  .customer-pool-table td:nth-child(3) {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .customer-pool-table .customer-pool-follow-up-form {
    width: 100%;
    min-width: 0;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-column: 1;
  }

  .customer-pool-table .customer-pool-follow-up-form select,
  .customer-pool-table .customer-pool-follow-up-form .customer-pool-follow-up-submit {
    min-height: 44px;
    height: 44px;
  }

  .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: "最后登录"; }
  .user-list-table td:nth-child(8)::before { content: "创建时间"; }
  .user-list-table td:nth-child(9)::before { content: "操作"; }

  .purchasing-user-list-table td:nth-child(1),
  .purchasing-user-list-table td:nth-child(5) {
    grid-column: 1 / -1;
  }

  .purchasing-user-list-table td:nth-child(1)::before { content: "用户名"; }
  .purchasing-user-list-table td:nth-child(2)::before { content: "身份"; }
  .purchasing-user-list-table td:nth-child(3)::before { content: "账号状态"; }
  .purchasing-user-list-table td:nth-child(4)::before { content: "最后登录"; }
  .purchasing-user-list-table td:nth-child(5)::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[name="amount"],
  .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: 46px;
    height: 30px;
  }

  .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,
.brand .boss-brand-mode {
  display: none;
}

.role-boss .brand .boss-brand-mode {
  display: block;
}

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

.order-detail-action-body {
  padding: 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.order-detail-action-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@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: 50px;
    height: 32px;
  }

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

  .order-detail-action-body {
    align-items: stretch;
    flex-direction: column;
  }

  .order-detail-action-body .btn {
    width: 100%;
  }
}

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

/* 管理员和销售在手机端继续使用原正常管理界面；Boss 响应式规则只影响老板角色。 */
@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) {
  body.role-normal {
    padding-bottom: 0;
    background: var(--bg);
    font-size: 15px;
  }

  body.role-normal .container {
    width: min(1180px, calc(100% - 32px));
  }

  body.role-normal .site-header {
    position: static;
    z-index: auto;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  body.role-normal .header-inner {
    min-height: 68px;
    padding-block: 9px;
    flex-wrap: wrap;
    gap: 12px;
  }

  body.role-normal .brand-mark {
    width: 52px;
    height: 32px;
  }

  body.role-normal .brand strong {
    font-size: 17px;
  }

  body.role-normal .app-version {
    display: inline !important;
  }

  body.role-normal .main-nav,
  body.role-normal .global-search,
  body.role-normal .session-user,
  body.role-normal .customer-pool-entry {
    display: flex !important;
  }

  body.role-normal .desktop-dashboard,
  body.role-normal .desktop-customer-detail,
  body.role-normal .desktop-sales-report,
body.role-normal .site-footer {
    display: block !important;
  }

  body.role-normal .desktop-order-controls.page-header,
  body.role-normal .desktop-customer-controls.page-header,
  body.role-normal .mobile-sort-bar {
    display: flex !important;
  }

  body.role-normal form.desktop-order-controls,
  body.role-normal form.desktop-customer-controls {
    display: grid !important;
  }

  body.role-normal .customer-list-table,
  body.role-normal .customer-pool-table,
  body.role-normal .order-list-table {
    display: block !important;
  }

  body.role-normal .page-content {
    padding-top: 16px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  body.role-normal .order-month-header {
    min-height: 38px;
    padding: 7px 10px 7px 13px;
  }

  body.role-normal .order-month-header h3 {
    font-size: 15px;
  }

  body.role-normal .order-month-header span {
    padding: 2px 7px;
    font-size: 11px;
  }

  body.role-normal .order-history-year-header {
    padding: 7px 10px;
    font-size: 13px;
  }

  body.role-normal .order-list-table-wrap {
    display: none !important;
  }

  body.role-normal .mobile-order-card-list {
    min-width: 0;
    padding: 7px;
    display: grid;
    gap: 7px;
  }

  body.role-normal .mobile-order-card {
    min-width: 0;
    padding: 9px 10px 8px;
    overflow: hidden;
    border: 1px solid #dce4e7;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(31, 41, 51, 0.05);
  }

  body.role-normal .mobile-order-card.is-pending {
    box-shadow: inset 3px 0 0 #d27b19, 0 1px 4px rgba(31, 41, 51, 0.05);
  }

  body.role-normal .mobile-order-card.is-cancelled {
    background: #fffafa;
  }

  body.role-normal .mobile-order-card.is-history-order {
    background: #fafcfc;
    box-shadow: inset 3px 0 0 #8798a0, 0 1px 4px rgba(31, 41, 51, 0.05);
  }

  body.role-normal .mobile-order-card-top,
  body.role-normal .mobile-order-money,
  body.role-normal .mobile-order-card-footer {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  body.role-normal .mobile-order-number {
    min-width: 0;
    overflow: hidden;
    color: #6d7b82;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-normal .mobile-order-number strong {
    color: #46555d;
    font-weight: 800;
  }

  body.role-normal .mobile-order-number .order-history-badge {
    margin-left: 5px;
    vertical-align: 1px;
  }

  body.role-normal .mobile-order-completion {
    min-height: 24px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }

  body.role-normal .mobile-order-customer {
    min-width: 0;
    margin-top: 3px;
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.32;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.role-normal .mobile-order-customer:hover {
    color: var(--primary-dark);
  }

  body.role-normal .mobile-order-meta {
    min-width: 0;
    margin-top: 3px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px;
    color: #6d7b82;
    font-size: 12px;
    line-height: 1.3;
  }

  body.role-normal .mobile-order-product {
    min-width: 0;
    overflow: hidden;
    color: #56666e;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-normal .mobile-order-salesperson {
    max-width: 7em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-normal .mobile-order-money {
    margin-top: 5px;
    align-items: baseline;
  }

  body.role-normal .mobile-order-amount {
    min-width: 0;
    color: #182b33;
    font-size: 19px;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
  }

  body.role-normal .mobile-order-received {
    color: #397356;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    white-space: nowrap;
  }

  body.role-normal .mobile-order-card-footer {
    margin-top: 5px;
    align-items: end;
  }

  body.role-normal .mobile-order-operational-status {
    min-width: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 4px;
    color: #65737a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
  }

  body.role-normal .mobile-order-operational-status i {
    color: #a1acb1;
    font-style: normal;
    font-weight: 500;
  }

  body.role-normal .mobile-order-operational-status .is-paid,
  body.role-normal .mobile-order-operational-status .is-shipped,
  body.role-normal .mobile-order-operational-status .is-invoiced,
  body.role-normal .mobile-order-operational-status .is-not_required {
    color: #397356;
  }

  body.role-normal .mobile-order-operational-status .is-deposit_received,
  body.role-normal .mobile-order-operational-status .is-partial_paid,
  body.role-normal .mobile-order-operational-status .is-partial_shipped,
  body.role-normal .mobile-order-operational-status .is-partial_invoiced {
    color: #8a5a12;
  }

  body.role-normal .mobile-order-edit {
    width: auto;
    min-width: 48px;
    min-height: 34px;
    padding: 5px 10px;
    justify-self: end;
    font-size: 12px;
  }

  body.role-normal .mobile-order-readonly {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
  }

  body.role-normal form.desktop-customer-controls.customer-filter-bar {
    display: none !important;
  }

  body.role-normal.page-customer-list .global-search {
    display: none !important;
  }

  body.role-normal .page-header.desktop-customer-controls {
    min-height: 0;
    margin-bottom: 8px;
    align-items: center;
  }

  body.role-normal .page-header.desktop-customer-controls p {
    display: none;
  }

  body.role-normal .mobile-customer-quick-search {
    min-width: 0;
    margin-bottom: 6px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.role-normal .mobile-customer-quick-search input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid #cbd6da;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    background: #fff;
    font-size: 15px;
  }

  body.role-normal .mobile-customer-quick-search button {
    min-width: 58px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--primary);
    border-radius: 0 8px 8px 0;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
  }

  body.role-normal .mobile-customer-filter-toggle {
    margin-bottom: 6px;
  }

  body.role-normal .mobile-customer-filter-panel.is-open {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
  }

  body.role-normal .mobile-customer-filter-label {
    display: block;
    margin: 0 2px 7px;
    color: #56666e;
    font-size: 12px;
    font-weight: 800;
  }

  body.role-normal .mobile-customer-filter-panel .mobile-sort-bar {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.role-normal .customer-pool-entry {
    min-height: 44px;
    margin: 0 0 6px;
    padding: 8px 11px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    border-radius: 9px;
    box-shadow: none;
  }

  body.role-normal .customer-pool-entry > span:first-child {
    display: block;
  }

  body.role-normal .customer-pool-entry strong {
    font-size: 14px;
  }

  body.role-normal .customer-pool-entry small {
    display: none;
  }

  body.role-normal .customer-pool-entry-count {
    font-size: 12px;
  }

  body.role-normal .customer-list-table-wrap {
    display: none !important;
  }

  body.role-normal .mobile-customer-card-list {
    min-width: 0;
    padding: 6px;
    display: grid;
    gap: 5px;
  }

  body.role-normal .mobile-customer-card {
    min-width: 0;
    padding: 9px 10px 8px;
    overflow: hidden;
    border: 1px solid #dce4e7;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(31, 41, 51, 0.05);
  }

  body.role-normal .mobile-customer-card.is-pool {
    box-shadow: inset 3px 0 0 #d6a53b, 0 1px 4px rgba(31, 41, 51, 0.05);
  }

  body.role-normal .mobile-customer-card-header,
  body.role-normal .mobile-customer-contact-row,
  body.role-normal .mobile-customer-business-row,
  body.role-normal .mobile-customer-card-footer {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px;
  }

  body.role-normal .mobile-customer-card-header {
    align-items: start;
  }

  body.role-normal .mobile-customer-name {
    min-width: 0;
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.32;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.role-normal .mobile-customer-name:hover,
  body.role-normal .mobile-customer-phone:hover {
    color: var(--primary-dark);
  }

  body.role-normal .mobile-customer-status {
    min-height: 24px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }

  body.role-normal .mobile-customer-contact-row,
  body.role-normal .mobile-customer-business-row {
    margin-top: 4px;
    color: #6d7b82;
    font-size: 12px;
    line-height: 1.35;
  }

  body.role-normal .mobile-customer-contact-row > *,
  body.role-normal .mobile-customer-business-row > * {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-normal .mobile-customer-contact-row strong,
  body.role-normal .mobile-customer-business-row strong {
    color: #4e5f67;
    font-weight: 750;
  }

  body.role-normal .mobile-customer-phone {
    max-width: 49vw;
    font-variant-numeric: tabular-nums;
  }

  body.role-normal .mobile-customer-card-footer {
    margin-top: 6px;
    align-items: end;
  }

  body.role-normal .mobile-customer-stats {
    min-width: 0;
    display: grid;
    gap: 2px;
    color: #56666e;
    font-size: 12px;
    line-height: 1.35;
  }

  body.role-normal .mobile-customer-stats > strong {
    color: #263940;
    font-size: 13px;
    font-weight: 800;
  }

  body.role-normal .mobile-customer-amounts {
    min-width: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 4px;
  }

  body.role-normal .mobile-customer-amounts b {
    color: #397356;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
  }

  body.role-normal .mobile-customer-amounts i {
    color: #a1acb1;
    font-style: normal;
  }

  body.role-normal .mobile-customer-actions {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  body.role-normal .mobile-customer-action {
    width: auto;
    min-width: 46px;
    min-height: 34px;
    padding: 5px 9px;
    font-size: 12px;
  }

  body.role-normal .order-section,
  body.role-normal .customer-list-panel {
    margin-bottom: 22px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  body.role-normal .order-section > .section-header,
  body.role-normal .customer-list-panel > .section-header {
    min-height: initial;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
  }

  body.role-normal .order-section > .section-header h2,
  body.role-normal .customer-list-panel > .section-header h2 {
    font-size: 18px;
  }

  body.role-normal .order-section > .section-header p,
  body.role-normal .customer-list-panel > .section-header p {
    display: block;
  }

  body.role-normal .order-section {
    margin-bottom: 14px;
  }

  body.role-normal .order-section + .order-section {
    margin-top: 12px;
  }

  body.role-normal .order-section > .section-header {
    min-height: 0;
    padding: 10px 12px;
  }

  body.role-normal .order-section > .section-header h2 {
    font-size: 17px;
  }

  body.role-normal .order-section > .section-header p {
    display: none;
  }

  body.role-normal .customer-list-panel > .section-header {
    min-height: 0;
    padding: 7px 12px;
  }

  body.role-normal .customer-list-panel > .section-header h2 {
    font-size: 17px;
  }

  body.role-normal .customer-list-panel > .section-header p {
    font-size: 12px;
  }

  /* 手机端保留页头全局搜索；页面筛选改为按需展开。 */
  .workbench-search,
  .boss-search,
  .purchase-report-filter.mobile-secondary-search {
    display: none !important;
  }

  body.role-normal .mobile-filter-toggle {
    width: 100%;
    min-height: 44px;
    margin: 0 0 12px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary);
    border-radius: 9px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 15px;
    font-weight: 800;
  }

  body.role-normal .mobile-collapsible-filter:not(.is-open) {
    display: none !important;
  }

  body.role-normal .mobile-collapsible-filter.is-open {
    width: 100%;
    margin-bottom: 16px;
    display: block !important;
  }

  body.role-normal form.desktop-customer-controls.mobile-collapsible-filter.is-open {
    display: grid !important;
  }

  body.role-normal .mobile-filter-close {
    width: 100%;
    min-height: 40px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: #edf2f3;
    color: var(--text);
    font-weight: 750;
  }

  body.role-normal .mobile-collapsible-filter .filter-row,
  body.role-normal .mobile-collapsible-filter .report-filter-grid {
    grid-template-columns: 1fr;
  }

  body.role-normal .mobile-collapsible-filter input,
  body.role-normal .mobile-collapsible-filter select,
  body.role-normal .mobile-collapsible-filter .btn {
    max-width: 100%;
  }

  .duplicate-customer-list article {
    grid-template-columns: 1fr;
  }

  .shipping-date-editor {
    width: min(270px, calc(100vw - 48px));
  }

  body.role-boss .header-inner {
    flex-wrap: wrap;
  }

  body.role-boss .global-search {
    order: 3;
    width: 100%;
    display: flex !important;
  }

  body.role-boss .boss-order-controls,
  body.role-boss .boss-customer-controls {
    margin-bottom: 10px;
  }

  body.role-boss .page-content {
    padding-top: 12px;
  }

  body.role-boss .boss-order-controls .boss-page-heading {
    margin-bottom: 7px;
  }

  body.role-boss .boss-order-controls .boss-page-heading h1 {
    font-size: 22px;
  }

  body.role-boss .boss-order-controls .boss-filter-tabs {
    margin-top: 0;
  }

  /* 老板订单卡片紧凑显示：保留关键状态，并新增产品概要。 */
  body.role-boss .boss-order-card-list {
    gap: 8px;
  }

  body.role-boss .boss-order-card {
    padding: 9px 10px;
    border-radius: 12px;
  }

  body.role-boss .boss-order-card header {
    gap: 8px;
  }

  body.role-boss .boss-order-card header strong {
    display: block;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-boss .boss-order-card .boss-status-badge {
    min-height: 27px;
    padding: 5px 8px;
    font-size: 12px;
  }

  body.role-boss .boss-order-card-meta {
    margin-top: 3px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  body.role-boss .boss-order-card-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-boss .boss-order-product {
    min-width: 0;
    margin-top: 3px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    align-items: baseline;
  }

  body.role-boss .boss-order-product span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  body.role-boss .boss-order-product strong {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-boss .boss-order-card-money {
    margin-top: 5px;
    border-radius: 9px;
  }

  body.role-boss .boss-order-card-amount,
  body.role-boss .boss-order-received-summary {
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
  }

  body.role-boss .boss-order-card-amount span,
  body.role-boss .boss-order-received-summary span {
    font-size: 11px;
  }

  body.role-boss .boss-order-card-amount strong,
  body.role-boss .boss-order-received-summary strong {
    margin-top: 0;
    font-size: 16px;
  }

  body.role-boss .boss-operational-status-grid {
    margin-top: 5px;
    gap: 5px;
  }

  body.role-boss .boss-operational-state {
    min-height: 34px;
    padding: 3px;
    gap: 1px;
    border-radius: 9px;
  }

  body.role-boss .boss-operational-state small {
    font-size: 10px;
  }

  body.role-boss .boss-operational-state strong {
    font-size: 12px;
  }
}

/* V1.26.7：销售报表手机端使用独立摘要卡，电脑端表格保持原样。 */
@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) {
  body.role-normal .sales-report-page {
    min-width: 0;
    font-size: 13px;
  }

  body.role-normal .sales-report-page .page-header {
    margin-bottom: 11px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }

  body.role-normal .sales-report-page .page-header h1 {
    font-size: 23px;
    line-height: 1.25;
  }

  body.role-normal .sales-report-page .page-header p {
    margin-top: 3px;
    font-size: 13px;
  }

  body.role-normal .sales-report-page .report-page-actions {
    margin-top: 0;
  }

  body.role-normal .sales-report-page .report-page-actions .btn {
    width: auto;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  body.role-normal .sales-report-page .panel,
  body.role-normal .sales-report-page .report-chart-card,
  body.role-normal .sales-report-page .report-detail-card {
    min-width: 0;
    max-width: 100%;
    border-radius: 10px;
  }

  body.role-normal .sales-report-page .panel {
    margin-bottom: 12px;
  }

  body.role-normal .sales-report-page .section-header,
  body.role-normal .sales-report-page .report-card-header {
    min-height: 0;
    padding: 10px 12px;
    gap: 8px;
  }

  body.role-normal .sales-report-page .section-header h2,
  body.role-normal .sales-report-page .report-card-header h3 {
    font-size: 16px;
  }

  body.role-normal .sales-report-page .section-header p,
  body.role-normal .sales-report-page .report-card-header p {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.35;
  }

  body.role-normal .sales-report-page .customer-ranking-panel > .section-header p,
  body.role-normal .sales-report-page .report-status-panel > .section-header p {
    display: none;
  }

  body.role-normal .sales-report-page .section-icon {
    width: 27px;
    height: 27px;
  }

  body.role-normal .sales-report-page .section-icon .icon {
    width: 16px;
    height: 16px;
  }

  body.role-normal .sales-report-page .report-summary-grid,
  body.role-normal .sales-report-page .currency-metrics {
    margin-bottom: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.role-normal .sales-report-page .stat-card {
    min-height: 76px;
    padding: 10px 11px;
    border-radius: 9px;
  }

  body.role-normal .sales-report-page .metric-card-heading {
    gap: 6px;
  }

  body.role-normal .sales-report-page .metric-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }

  body.role-normal .sales-report-page .metric-icon .icon {
    width: 15px;
    height: 15px;
  }

  body.role-normal .sales-report-page .stat-card .label {
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
  }

  body.role-normal .sales-report-page .stat-card .value,
  body.role-normal .sales-report-page .metric-card .value.amount-value {
    margin-top: 6px;
    font-size: clamp(18px, 5.4vw, 23px);
    line-height: 1.16;
  }

  body.role-normal .sales-report-page .stat-card .hint {
    display: none;
  }

  body.role-normal .sales-report-page .amount-code {
    font-size: 0.5em;
  }

  body.role-normal .sales-report-page .ranking-grid {
    padding: 8px;
    gap: 10px;
  }

  body.role-normal .sales-report-page .ranking-currency-heading {
    padding: 2px 3px 7px;
  }

  body.role-normal .sales-report-page .ranking-currency-heading strong {
    font-size: 15px;
  }

  body.role-normal .sales-report-page .ranking-currency-heading span {
    font-size: 13px;
  }

  body.role-normal .sales-report-page .desktop-sales-report-table-wrap {
    display: none !important;
  }

  body.role-normal .sales-report-page .mobile-sales-report-ranking-list,
  body.role-normal .sales-report-page .mobile-sales-report-detail-list {
    min-width: 0;
    display: grid;
    gap: 6px;
  }

  body.role-normal .sales-report-page .mobile-sales-report-ranking-card {
    min-width: 0;
    min-height: 72px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 3px 8px;
    border: 1px solid #dde5e8;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(31, 41, 51, 0.045);
  }

  body.role-normal .sales-report-page .mobile-report-rank-number {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    grid-row: 1 / span 2;
    border-radius: 50%;
    background: #edf1f2;
    color: #65747c;
    font-size: 12px;
    font-weight: 850;
  }

  body.role-normal .sales-report-page .ranking-row-1 .mobile-report-rank-number {
    background: #fff1c9;
    color: #8a5c00;
  }

  body.role-normal .sales-report-page .ranking-row-2 .mobile-report-rank-number {
    background: #e9eef0;
    color: #52616a;
  }

  body.role-normal .sales-report-page .ranking-row-3 .mobile-report-rank-number {
    background: #f4e5db;
    color: #835337;
  }

  body.role-normal .sales-report-page .mobile-report-ranking-main {
    min-width: 0;
    align-self: stretch;
    display: grid;
    align-content: center;
    gap: 1px;
  }

  body.role-normal .sales-report-page .mobile-report-ranking-name {
    min-width: 0;
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.role-normal .sales-report-page .mobile-report-ranking-salesperson {
    min-width: 0;
    overflow: hidden;
    color: #6b7980;
    font-size: 13px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-normal .sales-report-page .mobile-report-ranking-stats {
    min-width: 0;
    align-self: stretch;
    display: grid;
    align-content: center;
    justify-items: end;
    gap: 2px;
    text-align: right;
  }

  body.role-normal .sales-report-page .mobile-report-ranking-amount {
    color: #173f47;
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
  }

  body.role-normal .sales-report-page .mobile-report-ranking-stats > span {
    color: #6b7980;
    font-size: 13px;
  }

  body.role-normal .sales-report-page .status-report-layout {
    padding: 10px 12px;
    grid-template-columns: 102px minmax(0, 1fr);
    gap: 12px;
  }

  body.role-normal .sales-report-page .status-donut {
    width: 102px;
    height: 102px;
    padding: 18px;
  }

  body.role-normal .sales-report-page .status-donut-center strong {
    font-size: 22px;
  }

  body.role-normal .sales-report-page .status-donut-center span {
    font-size: 11px;
  }

  body.role-normal .sales-report-page .status-legend li {
    min-height: 39px;
    grid-template-columns: 25px minmax(0, 1fr) auto auto;
    gap: 6px;
    font-size: 13px;
  }

  body.role-normal .sales-report-page .status-legend-icon {
    width: 24px;
    height: 24px;
  }

  body.role-normal .sales-report-page .status-legend-icon .icon {
    width: 14px;
    height: 14px;
  }

  body.role-normal .sales-report-page .status-legend-percent {
    min-width: 39px;
  }

  body.role-normal .sales-report-page .currency-report-header {
    align-items: center;
  }

  body.role-normal .sales-report-page .currency-report-header p {
    display: none;
  }

  body.role-normal .sales-report-page .currency-badge {
    min-width: 50px;
    padding: 4px 8px;
    font-size: 12px;
  }

  body.role-normal .sales-report-page .currency-report-body {
    padding: 8px;
  }

  body.role-normal .sales-report-page .report-chart-grid {
    gap: 9px;
  }

  body.role-normal .sales-report-page .salesperson-bar-list {
    padding: 2px 10px 5px;
    counter-reset: mobile-sales-rank;
  }

  body.role-normal .sales-report-page .salesperson-bar-list li {
    min-width: 0;
    padding: 9px 0;
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    align-items: center;
    gap: 4px 8px;
  }

  body.role-normal .sales-report-page .mobile-sales-rank-number {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    grid-row: 1 / span 3;
    border-radius: 50%;
    background: #edf1f2;
    color: #65747c;
    font-size: 12px;
    font-weight: 850;
  }

  body.role-normal .sales-report-page .salesperson-bar-heading,
  body.role-normal .sales-report-page .salesperson-progress,
  body.role-normal .sales-report-page .bar-meta {
    min-width: 0;
    grid-column: 2;
  }

  body.role-normal .sales-report-page .salesperson-bar-heading {
    margin-bottom: 1px;
    gap: 8px;
  }

  body.role-normal .sales-report-page .salesperson-bar-heading strong {
    min-width: 0;
    font-size: 14px;
  }

  body.role-normal .sales-report-page .salesperson-bar-heading strong:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-normal .sales-report-page .salesperson-bar-heading strong:last-child {
    flex: 0 0 auto;
    font-size: 13px;
  }

  body.role-normal .sales-report-page .salesperson-progress {
    height: 9px;
  }

  body.role-normal .sales-report-page .bar-meta {
    margin-top: 1px;
    gap: 3px 10px;
    font-size: 13px;
  }

  body.role-normal .sales-report-page .month-chart-wrap {
    width: 100%;
    max-width: 100%;
    padding: 10px 8px 8px;
    overflow: hidden;
  }

  body.role-normal .sales-report-page .month-chart {
    width: 100%;
    min-width: 0;
    height: 158px;
    grid-template-columns: repeat(var(--sales-month-count, 13), minmax(0, 1fr));
    gap: 2px;
  }

  body.role-normal .sales-report-page .month-value,
  body.role-normal .sales-report-page .month-label,
  body.role-normal .sales-report-page .month-order-count {
    display: none;
  }

  body.role-normal .sales-report-page .mobile-month-label {
    min-width: 0;
    display: block;
    color: #64737a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
  }

  body.role-normal .sales-report-page .month-column:nth-child(even) .mobile-month-label {
    visibility: hidden;
  }

  body.role-normal .sales-report-page .month-bar-area {
    width: min(18px, 100%);
    height: 126px;
    padding: 0 2px;
    background-size: 100% 31px;
  }

  body.role-normal .sales-report-page .report-detail-card {
    margin-top: 9px;
  }

  body.role-normal .sales-report-page .mobile-sales-report-detail-list {
    padding: 7px;
  }

  body.role-normal .sales-report-page .mobile-sales-report-detail-card {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #dde5e8;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(31, 41, 51, 0.045);
  }

  body.role-normal .sales-report-page .mobile-sales-report-detail-card header {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px;
  }

  body.role-normal .sales-report-page .mobile-sales-report-detail-card header > strong:first-child {
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-normal .sales-report-page .mobile-report-detail-amount {
    color: #173f47;
    font-size: 17px;
    white-space: nowrap;
  }

  body.role-normal .sales-report-page .mobile-report-detail-metrics {
    margin-top: 7px;
    padding: 7px 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #edf1f2;
    border-bottom: 1px solid #edf1f2;
  }

  body.role-normal .sales-report-page .mobile-report-detail-metrics > div {
    min-width: 0;
    padding: 0 6px;
    display: grid;
    gap: 2px;
  }

  body.role-normal .sales-report-page .mobile-report-detail-metrics > div + div {
    border-left: 1px solid #edf1f2;
  }

  body.role-normal .sales-report-page .mobile-report-detail-metrics span,
  body.role-normal .sales-report-page .mobile-sales-report-detail-card footer span {
    color: #6b7980;
    font-size: 13px;
  }

  body.role-normal .sales-report-page .mobile-report-detail-metrics strong {
    color: #34474f;
    font-size: 14px;
  }

  body.role-normal .sales-report-page .mobile-sales-report-detail-card footer {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  body.role-normal .sales-report-page .mobile-sales-report-detail-card time {
    color: #52636a;
    font-size: 13px;
    font-weight: 750;
  }
}

/* V1.26.8：手机 Dashboard 独立信息层级；电脑版 Dashboard 不受影响。 */
@media (max-width: 780px), (max-width: 1024px) and (pointer: coarse), (max-height: 500px) and (orientation: landscape) {
  body.role-normal.page-dashboard.has-module-sidebar {
    padding-left: 0;
  }

  body.role-normal.page-dashboard .module-sidebar,
  body.role-normal.page-dashboard .desktop-dashboard,
  body.role-normal.page-dashboard .site-footer {
    display: none !important;
  }

  body.role-normal.page-dashboard .mobile-dashboard {
    min-width: 0;
    display: block;
  }

  body.role-normal.page-dashboard .container {
    width: min(100% - 24px, 680px);
  }

  body.role-normal.page-dashboard .site-header {
    border-bottom: 1px solid #d9e2e5;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 41, 51, 0.05);
  }

  body.role-normal.page-dashboard .header-inner {
    min-height: 0;
    padding-block: 7px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px 10px;
  }

  body.role-normal.page-dashboard .brand {
    min-width: 0;
    gap: 7px;
  }

  body.role-normal.page-dashboard .brand-mark {
    width: 44px;
    height: 28px;
  }

  body.role-normal.page-dashboard .brand strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
  }

  body.role-normal.page-dashboard .brand-company,
  body.role-normal.page-dashboard .app-version,
  body.role-normal.page-dashboard .session-user > a,
  body.role-normal.page-dashboard .session-user small {
    display: none !important;
  }

  body.role-normal.page-dashboard .session-user {
    min-width: 0;
    display: flex !important;
    justify-content: flex-end;
    gap: 6px;
  }

  body.role-normal.page-dashboard .session-user > span {
    min-width: 0;
    display: block;
  }

  body.role-normal.page-dashboard .session-user strong {
    max-width: 72px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.role-normal.page-dashboard .session-user .btn {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 12px;
  }

  body.role-normal.page-dashboard .global-search {
    grid-column: 1 / -1;
    width: 100%;
    display: flex !important;
  }

  body.role-normal.page-dashboard .global-search input {
    min-height: 36px;
    padding-block: 6px;
    font-size: 13px;
  }

  body.role-normal.page-dashboard .main-nav {
    width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-self: auto;
    gap: 2px;
  }

  body.role-normal.page-dashboard .main-nav > a,
  body.role-normal.page-dashboard .system-menu,
  body.role-normal.page-dashboard .system-menu > summary {
    min-width: 0;
    min-height: 32px;
  }

  body.role-normal.page-dashboard .main-nav > a,
  body.role-normal.page-dashboard .system-menu > summary {
    padding: 5px 2px;
    border: 0;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.2;
  }

  body.role-normal.page-dashboard .main-nav > a.active,
  body.role-normal.page-dashboard .system-menu > summary.active {
    background: var(--primary-soft);
  }

  body.role-normal.page-dashboard .system-menu > summary {
    width: 100%;
  }

  body.role-normal.page-dashboard .page-content {
    padding-top: 12px;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .mobile-dashboard,
  .mobile-dashboard * {
    box-sizing: border-box;
  }

  .mobile-dashboard-heading {
    min-width: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-dashboard-heading time {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-dashboard-heading h1 {
    margin: 2px 0 0;
    font-size: 23px;
    line-height: 1.15;
  }

  .mobile-dashboard-add {
    min-height: 36px;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 7px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
  }

  .mobile-dashboard-queue {
    min-width: 0;
    margin-bottom: 10px;
  }

  .mobile-dashboard-queue > h2 {
    margin: 0 0 7px;
    color: #42545c;
    font-size: 14px;
  }

  .mobile-dashboard-queue-grid {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .mobile-dashboard-queue-grid > a {
    min-width: 0;
    min-height: 64px;
    padding: 9px 11px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    overflow: hidden;
    border: 1px solid #dce5e8;
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
  }

  .mobile-dashboard-queue-grid > a.queue-completion {
    border-left-color: #d27b19;
    background: #fffaf2;
  }

  .mobile-dashboard-queue-grid > a.queue-payment {
    border-left-color: #c98a20;
  }

  .mobile-dashboard-queue-grid > a.queue-shipping {
    border-left-color: #4777b8;
  }

  .mobile-dashboard-queue-grid > a.queue-invoice {
    border-left-color: #7a5aa3;
  }

  .mobile-dashboard-queue-grid span {
    min-width: 0;
    overflow: hidden;
    color: #52636b;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dashboard-queue-grid strong {
    color: var(--primary-dark);
    font-size: 25px;
    line-height: 1;
  }

  .mobile-dashboard-section {
    min-width: 0;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(31, 41, 51, 0.06);
  }

  .mobile-dashboard-section-header {
    min-width: 0;
    min-height: 43px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e8edef;
  }

  .mobile-dashboard-section-header > div,
  .mobile-dashboard-section-header h2 {
    min-width: 0;
  }

  .mobile-dashboard-section-header h2 {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
  }

  .mobile-dashboard-section-header small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
  }

  .mobile-dashboard-section-header a {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-dashboard-sales-total {
    padding: 12px 13px 11px;
    background: var(--primary);
    color: #fff;
  }

  .mobile-dashboard-sales-total span,
  .mobile-dashboard-sales-total strong {
    display: block;
  }

  .mobile-dashboard-sales-total span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-dashboard-sales-total strong {
    margin-top: 3px;
    overflow-wrap: anywhere;
    font-size: 29px;
    line-height: 1.1;
  }

  .mobile-dashboard-sales-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-dashboard-sales-metrics > div {
    min-width: 0;
    padding: 9px 7px 10px;
    display: grid;
    gap: 3px;
  }

  .mobile-dashboard-sales-metrics > div + div {
    border-left: 1px solid #e8edef;
  }

  .mobile-dashboard-sales-metrics span,
  .mobile-dashboard-sales-metrics strong {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dashboard-sales-metrics span {
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-dashboard-sales-metrics strong {
    color: #29454c;
    font-size: 13px;
  }

  .mobile-dashboard-delivery-list > a {
    min-width: 0;
    min-height: 55px;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid #edf1f2;
    color: var(--text);
  }

  .mobile-dashboard-delivery-list > a:last-child {
    border-bottom: 0;
  }

  .mobile-dashboard-delivery-list > a.is-overdue {
    box-shadow: inset 3px 0 0 #c84d4d;
    background: #fff9f8;
  }

  .mobile-dashboard-delivery-list > a.is-soon:not(.is-overdue) {
    box-shadow: inset 3px 0 0 #dda033;
  }

  .mobile-dashboard-delivery-list time {
    color: var(--primary-dark);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
  }

  .mobile-dashboard-delivery-list > a > span,
  .mobile-dashboard-delivery-list strong,
  .mobile-dashboard-delivery-list small {
    min-width: 0;
    display: block;
  }

  .mobile-dashboard-delivery-list strong,
  .mobile-dashboard-delivery-list small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dashboard-delivery-list strong {
    font-size: 13px;
  }

  .mobile-dashboard-delivery-list small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-dashboard-delivery-list em {
    padding: 3px 5px;
    border-radius: 999px;
    background: #fff0dd;
    color: #91600a;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
  }

  .mobile-dashboard-delivery-list .is-overdue em {
    background: #fbe9e9;
    color: var(--danger);
  }

  .mobile-dashboard-ranking ol {
    margin: 0;
    padding: 4px 12px 6px;
    list-style: none;
  }

  .mobile-dashboard-ranking li {
    min-width: 0;
    min-height: 38px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid #edf1f2;
  }

  .mobile-dashboard-ranking li:last-child {
    border-bottom: 0;
  }

  .mobile-dashboard-ranking li b {
    color: #829096;
    font-size: 11px;
    text-align: center;
  }

  .mobile-dashboard-ranking li a {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dashboard-ranking li strong {
    color: var(--primary-dark);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .mobile-dashboard-trend-chart {
    height: 148px;
    padding: 10px 12px 8px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
    gap: 6px;
  }

  .mobile-dashboard-trend-column {
    min-width: 0;
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) 18px;
    justify-items: center;
    gap: 3px;
  }

  .mobile-dashboard-trend-column > i {
    width: min(28px, 72%);
    height: 100%;
    display: flex;
    align-items: flex-end;
    border-bottom: 1px solid #afbbc0;
    background: linear-gradient(to top, rgba(220, 228, 232, 0.48) 1px, transparent 1px);
    background-size: 100% 27px;
  }

  .mobile-dashboard-trend-column > i > b {
    width: 100%;
    display: block;
    border-radius: 4px 4px 0 0;
    background: var(--primary);
  }

  .mobile-dashboard-trend-column > small {
    color: #607078;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-dashboard-recent-list > a,
  .mobile-dashboard-customer-list > a {
    min-width: 0;
    padding: 9px 12px;
    display: grid;
    border-bottom: 1px solid #edf1f2;
    color: var(--text);
  }

  .mobile-dashboard-recent-list > a:last-child,
  .mobile-dashboard-customer-list > a:last-child {
    border-bottom: 0;
  }

  .mobile-dashboard-recent-list strong,
  .mobile-dashboard-customer-list strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dashboard-recent-list span,
  .mobile-dashboard-recent-list small,
  .mobile-dashboard-customer-list span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
  }

  .mobile-dashboard-recent-list small {
    color: #3e6870;
    font-weight: 700;
  }

  .mobile-dashboard-empty {
    padding: 17px 12px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }
}
