.emergency-screen { align-items: start; }
.emergency-screen .emergency-card { width: min(100%, 680px); min-width: 0; min-height: 0; margin-inline: auto; grid-template-columns: minmax(0, 1fr); padding: clamp(18px, 4vw, 36px); gap: 18px; }
.emergency-form { display: grid; gap: 16px; min-width: 0; }
.emergency-form[hidden] { display: none; }
.emergency-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.emergency-actions .button { flex: 1 1 180px; min-height: 44px; white-space: normal; }
.emergency-details { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; min-width: 0; }
.emergency-details p, .emergency-card .notice { overflow-wrap: anywhere; }
.emergency-card input { min-width: 0; width: 100%; }

:root {
  color-scheme: light;
  --forest-950: #0b251e;
  --forest-900: #10352a;
  --forest-800: #164c3a;
  --forest-700: #1d684c;
  --forest-600: #237c59;
  --forest-100: #deeee6;
  --forest-50: #eff7f2;
  --paper: #ffffff;
  --canvas: #f3f5f2;
  --cream: #fbf8ef;
  --ink: #17211d;
  --ink-soft: #53625b;
  --muted: #7b8983;
  --line: #dbe2dd;
  --line-strong: #c9d3cd;
  --amber: #b96c16;
  --amber-bg: #fff1dc;
  --red: #c94738;
  --red-bg: #ffebe7;
  --danger: #b92d23;
  --blue: #2e68a6;
  --blue-bg: #e9f2fc;
  --shadow-sm: 0 1px 2px rgb(12 35 28 / 5%), 0 4px 14px rgb(12 35 28 / 5%);
  --shadow-lg: 0 24px 80px rgb(5 25 18 / 24%);
  --fixed-feedback-offset: 0px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% 0%, rgb(29 104 76 / 6%), transparent 28rem),
    var(--canvas);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid rgb(46 104 166 / 28%);
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  color: white;
  background: var(--forest-900);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--ink-soft);
}

.brand-seal {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--forest-700), var(--forest-950));
  border-radius: 19px 7px 19px 7px;
  box-shadow: 0 12px 30px rgb(16 53 42 / 24%);
  font-family: SimSun, serif;
  font-size: 33px;
  font-weight: 700;
}

.brand-seal-small {
  width: 42px;
  height: 42px;
  border-radius: 13px 5px 13px 5px;
  font-size: 22px;
  box-shadow: none;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  padding: 32px;
  place-items: center;
  background:
    linear-gradient(110deg, rgb(11 37 30 / 96%) 0 46%, rgb(11 37 30 / 7%) 46% 100%),
    radial-gradient(circle at 80% 20%, #f5e9c8, #e6eee7 52%, #d8e4dc);
}

.acceptance-banner {
  position: sticky;
  inset-block-start: 0;
  z-index: 120;
  padding: 10px 16px;
  color: #5d3500;
  background: #fff2cc;
  border-bottom: 1px solid #e3b34c;
  font-weight: 700;
  text-align: center;
}

.acceptance-login-help {
  padding: 12px 14px;
  color: #5d3500;
  background: #fff8e5;
  border: 1px solid #e7c56d;
  border-radius: 10px;
}

.acceptance-login-help p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.login-card {
  display: grid;
  width: min(100%, 940px);
  min-height: 570px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 18px 62px;
  padding: 48px 56px;
  overflow: hidden;
  background: rgb(255 255 255 / 96%);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 16px;
  align-self: start;
}

.login-brand h1,
.login-brand p,
.login-intro h2,
.login-intro p {
  margin: 0;
}

.login-brand h1 {
  font-size: 24px;
}

.login-brand p {
  color: var(--muted);
}

.login-intro {
  grid-row: span 5;
  padding: 54px 42px 42px 0;
}

.login-intro h2 {
  max-width: 7em;
  margin-top: 14px;
  font-family: SimSun, "Songti SC", serif;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.1;
}

.login-intro p {
  max-width: 28em;
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 16px;
}

.eyebrow {
  color: var(--forest-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

.field-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.field-hint,
.search-help,
.security-note {
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9aaba2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--forest-600);
  box-shadow: 0 0 0 3px rgb(35 124 89 / 11%);
  outline: none;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.security-note {
  margin: 0;
}

.form-error {
  margin: 8px 0;
  color: var(--red);
  font-weight: 700;
}

.modal-dialog .form-error:not([hidden]) {
  position: fixed;
  z-index: 160;
  top: calc(var(--fixed-feedback-offset) + max(16px, env(safe-area-inset-top)));
  left: 50%;
  width: min(560px, calc(100vw - 28px));
  margin: 0;
  padding: 12px 16px;
  color: #fff;
  text-align: center;
  background: #b73329;
  border: 1px solid rgb(255 255 255 / 42%);
  border-radius: 11px;
  box-shadow: 0 10px 32px rgb(74 18 13 / 34%);
  transform: translateX(-50%);
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) {
  background: var(--forest-50);
  border-color: #a7b9ae;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.button-primary {
  color: #fff;
  background: var(--forest-700);
  border-color: var(--forest-700);
}

.button-primary:hover:not(:disabled) {
  color: #fff;
  background: var(--forest-800);
  border-color: var(--forest-800);
}

.button-accent {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.button-accent:hover:not(:disabled),
.button-accent:focus-visible:not(:disabled) {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.button-danger {
  color: var(--red);
  background: #fff;
  border-color: #edb2aa;
}

.button-small {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 13px;
}

.button-ghost {
  color: #cdded5;
  background: transparent;
  border-color: rgb(255 255 255 / 22%);
}

.icon-button {
  width: 40px;
  height: 40px;
  overflow: hidden;
  color: transparent;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.icon-button::after {
  content: "×";
  color: var(--ink-soft);
  font-size: 28px;
  line-height: 1;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: 236px;
  flex-direction: column;
  color: #e7f0eb;
  background:
    linear-gradient(180deg, rgb(23 76 58 / 18%), transparent 34%),
    var(--forest-950);
  border-right: 1px solid rgb(255 255 255 / 6%);
}

.sidebar-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 24px 22px 20px;
}

.sidebar-brand div:last-child {
  display: grid;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 18px;
}

.sidebar-brand span {
  color: #9fb7ab;
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  gap: 5px;
  padding: 10px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgb(134 166 151 / 32%) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgb(134 166 151 / 32%);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgb(165 194 180 / 50%);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 45px;
  padding: 8px 12px;
  color: #bed0c7;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 9px;
}

.nav-item:hover,
.nav-item-active {
  color: #fff;
  background: rgb(44 139 99 / 42%);
}

.sidebar-account {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  margin-top: auto;
  padding: 20px;
  color: #9fb7ab;
  border-top: 1px solid rgb(255 255 255 / 8%);
}

.sidebar-account strong {
  color: #fff;
}

.app-stage {
  min-height: 100vh;
  margin-left: 236px;
}

.app-header {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  background: rgb(255 255 255 / 88%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-context {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-trigger {
  white-space: nowrap;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.notification-item.notification-unread {
  border-left: 4px solid var(--forest-600);
  background: var(--forest-50);
}

.notification-copy,
.notification-copy p {
  min-width: 0;
  margin: 0;
}

.notification-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.notification-heading time {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.notification-copy p {
  color: var(--ink-soft);
  line-height: 1.55;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .notification-item {
    grid-template-columns: 1fr;
  }

  .notification-actions {
    justify-content: flex-end;
  }
}

.header-user {
  font-weight: 700;
}

.role-pill,
.type-pill,
.line-kind {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  color: var(--forest-700);
  background: var(--forest-50);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.mobile-brand,
.mobile-nav {
  display: none;
}

.main-content {
  min-height: calc(100vh - 64px);
}

.route-content {
  display: contents;
}

.page {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 30px 28px 64px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 5px 0 5px;
  font-family: SimSun, "Songti SC", serif;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.2;
}

.page-heading p {
  max-width: 780px;
  margin: 0;
  color: var(--ink-soft);
}

.toolbar,
.order-search-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.toolbar-wrap {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-input {
  flex: 1 1 420px;
  min-width: 180px;
  min-height: 48px;
  padding-left: 16px;
  border-color: var(--line);
}

.order-search-panel {
  display: grid;
  gap: 3px;
}

.order-search-panel .search-input {
  border: 0;
  box-shadow: none;
}

.search-help {
  margin: 0 12px 5px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  min-height: 38px;
  padding: 7px 13px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.chip:hover,
.chip-active {
  color: #fff;
  background: var(--forest-700);
  border-color: var(--forest-700);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}

.result-hint,
.muted {
  color: var(--muted);
}

.nav-badge {
  padding: 2px 7px;
  color: var(--forest-900);
  background: #dbece4;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.nav-badge-alert {
  color: #fff;
  background: #bd342b;
}

.mobile-section-nav {
  display: none;
}

.order-group-chip {
  display: grid;
  min-width: 96px;
  min-height: 58px;
  place-content: center;
  gap: 1px;
  border-radius: 12px;
}

.order-group-chip strong {
  font-size: 21px;
  line-height: 1;
}

.order-group-chip span {
  font-size: 15px;
}

.nav-section-label {
  display: block;
  padding: 16px 14px 5px;
  color: rgb(255 255 255 / 48%);
  font-size: 12px;
  letter-spacing: .08em;
}

.order-sort-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: -4px 0 16px;
}

.order-sort-controls select {
  width: auto;
  min-width: 170px;
}

.notice {
  padding: 13px 15px;
  border-left: 4px solid;
  border-radius: 6px 10px 10px 6px;
}

.notice-blue {
  color: #244e76;
  background: var(--blue-bg);
  border-color: var(--blue);
}

.notice-amber {
  color: #85500e;
  background: var(--amber-bg);
  border-color: var(--amber);
}

.order-list {
  display: grid;
  gap: 16px;
}

.production-workspace {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 92%, var(--surface));
}

.production-workspace-finished {
  border-top: 4px solid var(--forest-600);
}

.production-workspace-component {
  border-top: 4px solid #b8873b;
}

.production-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7faf7;
}

.production-workspace-component .production-workspace-header {
  background: #fffaf0;
}

.production-workspace-header > div:first-child {
  display: grid;
  gap: 3px;
}

.production-workspace-header h2,
.production-workspace-header p {
  margin: 0;
}

.production-workspace-header h2 {
  font-size: 21px;
}

.production-workspace-header p {
  color: var(--ink-soft);
  font-size: 13px;
}

.production-workspace-counts {
  display: grid;
  min-width: 112px;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-align: right;
  white-space: nowrap;
}

.production-workspace-counts span {
  color: var(--ink-soft);
  font-size: 12px;
}

.production-workspace-list {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.production-workspace-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 30px 18px;
  color: var(--ink-soft);
  text-align: center;
}

.production-workspace-empty strong {
  color: var(--ink);
}

.mixed-order-pill {
  white-space: nowrap;
}

.order-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.order-card-partial {
  border-color: #e58b7e;
  box-shadow: 0 0 0 1px rgb(201 71 56 / 11%), var(--shadow-sm);
}

.order-card-header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.order-identity,
.order-header-actions,
.footer-actions,
.logistics-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.order-number {
  font-size: 17px;
}

.customer-name {
  color: var(--forest-700);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.status-green,
.status-active {
  color: #116342;
  background: #e3f3eb;
}

.status-amber,
.status-lead {
  color: #9a590d;
  background: var(--amber-bg);
}

.status-danger {
  color: #b13b30;
  background: var(--red-bg);
}

.status-neutral,
.status-inactive {
  color: #55615b;
  background: #edf0ee;
}

.order-total {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  min-width: max-content;
  white-space: nowrap;
}

.order-total span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.order-total strong {
  min-width: max-content;
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 18px;
}

.order-line {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(88px, .62fr) minmax(112px, .82fr) minmax(112px, .72fr) minmax(108px, .68fr);
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.order-line.with-price {
  grid-template-columns: minmax(210px, 1.75fr) minmax(82px, .56fr) minmax(104px, .7fr) minmax(110px, .76fr) minmax(108px, .7fr) minmax(112px, .72fr);
}

.order-line-head {
  min-height: 42px;
  color: var(--ink-soft);
  background: #f8faf8;
  font-size: 12px;
  font-weight: 800;
}

.order-line-product {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.order-line-product > div:last-child,
.catalog-title-row > div {
  display: grid;
  min-width: 0;
}

.order-line-product strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image,
.catalog-image,
.batch-product-image,
.bill-product-image,
.product-image-placeholder {
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  object-fit: contain;
  color: var(--muted);
  background: #f4f6f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
}

.order-line-cell {
  display: grid;
  gap: 2px;
}

.order-line-cell small,
.progress-copy {
  font-size: 12px;
}

.mobile-label {
  display: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.danger-text {
  color: var(--red);
}

.order-card-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--cream);
}

.order-lines-mobile-compact {
  display: none;
}

.order-receiver-details {
  min-width: 0;
  flex: 1 1 auto;
}

.order-receiver-details > summary {
  display: none;
}

.order-receiver-body {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.order-receiver-text {
  min-width: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.truck-mark {
  padding: 3px 8px;
  color: var(--forest-700);
  background: var(--forest-100);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.customer-reference {
  color: var(--ink-soft);
}

.load-more {
  display: flex;
  margin: 22px auto 0;
}

.shipment-record-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.shipment-record-controls input {
  width: auto;
  min-width: 158px;
}

.shipment-record-privacy-note {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 13px;
}

.shipment-day-list,
.shipment-day-batches {
  display: grid;
  gap: 13px;
}

.shipment-day-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.shipment-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  background: var(--forest-50);
  border-bottom: 1px solid var(--line);
}

.shipment-day-header h2,
.shipment-day-header p {
  margin: 0;
}

.shipment-day-header h2 {
  font-size: 20px;
}

.shipment-day-header p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 13px;
}

.shipment-day-header > strong {
  white-space: nowrap;
}

.shipment-day-totals {
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
  white-space: nowrap;
}

.shipment-day-totals span {
  color: var(--forest-700);
  font-size: 13px;
  font-weight: 700;
}

.shipment-day-totals span.is-missing {
  color: var(--muted);
  font-weight: 600;
}

.shipment-day-batches {
  padding: 13px;
}

.daily-shipment-batch {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.daily-shipment-batch-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #fbfcfb;
  border-bottom: 1px solid var(--line);
}

.daily-shipment-photos {
  display: flex;
  align-items: flex-start;
  max-width: 196px;
  gap: 6px;
  overflow-x: auto;
}

.daily-shipment-photo {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.daily-shipment-batch-summary,
.daily-shipment-product {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.daily-shipment-title-row,
.daily-shipment-logistics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.daily-shipment-packaging {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.daily-shipment-packaging > span,
.batch-packaging-summary > span {
  padding: 3px 8px;
  color: var(--forest-700);
  background: var(--forest-100);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.daily-shipment-packaging.is-missing > span,
.batch-packaging-summary.is-missing > span {
  color: var(--muted);
  background: #eef1ef;
  font-weight: 700;
}

.daily-shipment-lines {
  display: grid;
}

.daily-shipment-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 74px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}

.daily-shipment-line:first-child {
  border-top: 0;
}

.daily-shipment-product-image {
  width: 50px;
  height: 50px;
}

.daily-shipment-product strong,
.daily-shipment-product .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-shipment-quantity {
  display: grid;
  justify-items: end;
  gap: 3px;
  white-space: nowrap;
}

.daily-shipment-quantity span {
  color: var(--muted);
  font-size: 12px;
}

.loading-card,
.empty-state,
.error-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.error-state {
  color: var(--red);
  background: var(--red-bg);
  border-color: #f3c0ba;
}

.page-loading,
.page-error {
  margin: 30px;
}

.catalog-list {
  display: grid;
  gap: 0;
}

.order-line-product-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.order-line-progress-mobile {
  display: none;
  flex: 0 0 auto;
}

.order-line-sales-mobile-summary,
.order-line-mobile-due {
  display: none;
}

.catalog-list-frame {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.catalog-table-head {
  display: grid;
  grid-template-columns: 76px minmax(220px, 1fr) minmax(150px, 200px) 184px;
  gap: 16px;
  padding: 11px 16px;
  color: var(--ink-soft);
  font-weight: 700;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.catalog-table-head > :nth-child(3),
.catalog-price {
  padding-left: 18px;
}

.catalog-table-head > :last-child {
  text-align: center;
}

.catalog-card {
  display: grid;
  grid-template-columns: 76px minmax(220px, 1fr) minmax(150px, 200px) 184px;
  gap: 16px;
  align-items: center;
  min-height: 88px;
  padding: 9px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.catalog-card:first-child {
  border-top: 0;
}

.catalog-card-draft {
  background: #fffaf1;
  box-shadow: inset 4px 0 #d9952f;
}

.catalog-image {
  width: 68px;
  height: 68px;
}

.catalog-title-row,
.customer-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalog-details {
  margin: 7px 0 0;
  color: var(--ink-soft);
}

.catalog-quality-notice {
  margin: 0;
}

.catalog-quality-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.catalog-quality-badge {
  padding: 3px 8px;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
  background: #fff1e7;
  border: 1px solid #fdba8c;
  border-radius: 999px;
}

.catalog-price {
  display: grid;
  min-width: 120px;
  justify-items: start;
}

.catalog-price strong {
  font-size: 20px;
}

.catalog-price-main {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.catalog-price-main small {
  color: inherit;
  font-size: 14px;
  font-weight: 500;
}

.catalog-price small {
  color: var(--muted);
}

.catalog-price-empty {
  color: var(--muted);
}

.catalog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.catalog-editor-layout {
  display: grid;
  grid-template-columns: minmax(230px, .68fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
}

.catalog-editor-image-pane,
.catalog-editor-fields {
  display: grid;
  gap: 12px;
}

.catalog-editor-color-field {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

.catalog-editor-is-3d {
  width: fit-content;
}

.catalog-main,
.catalog-identity {
  min-width: 0;
}

.catalog-identity {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
}

.catalog-product-name,
.catalog-product-sku {
  display: block;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.catalog-product-sku {
  font-variant-numeric: tabular-nums;
}

.catalog-title-row > .order-header-actions {
  flex: 0 0 auto;
}

.catalog-editor-image-preview {
  display: grid;
  min-height: 270px;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: copy;
}

.catalog-editor-image-preview:focus-visible {
  outline: 3px solid var(--forest-300);
  outline-offset: 2px;
}

.catalog-editor-image-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 16px;
  text-align: center;
}

.catalog-editor-image-empty small {
  color: var(--forest-700);
}

.catalog-editor-image-preview img,
.catalog-editor-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.catalog-editor-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.costing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr);
  gap: 18px;
  align-items: start;
}

.costing-editor-pane,
.costing-summary-pane {
  display: grid;
  gap: 12px;
}

.costing-summary-pane {
  position: sticky;
  top: 0;
  padding: 16px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.costing-product-image {
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  object-fit: contain;
}

.costing-product-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.costing-product-header > div {
  display: grid;
  gap: 4px;
}

.costing-product-name {
  font-size: 19px;
}

.costing-component-image {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.costing-breakdown {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.costing-breakdown-heading {
  display: grid;
  gap: 3px;
}

.costing-breakdown-list {
  display: grid;
  gap: 8px;
}

.costing-breakdown-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) max-content;
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.costing-breakdown-image {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.costing-breakdown-copy,
.costing-breakdown-name {
  min-width: 0;
}

.costing-breakdown-copy {
  display: grid;
  gap: 2px;
}

.costing-breakdown-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.costing-breakdown-name strong {
  overflow-wrap: anywhere;
}

.costing-breakdown-subtotal {
  font-variant-numeric: tabular-nums;
}

.costing-breakdown-error {
  color: var(--danger);
}

.costing-summary-values {
  display: grid;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.costing-summary-values > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.costing-suggested-price {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.costing-suggested-price strong {
  font-size: 21px;
}

.costing-price-confirmation {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--green-border);
  border-radius: 10px;
}

.costing-price-confirmation .button {
  width: 100%;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.customer-card {
  display: flex;
  gap: 14px;
  padding: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.customer-monogram {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--forest-700);
  border-radius: 13px 5px 13px 5px;
  font-family: SimSun, serif;
  font-size: 19px;
}

.customer-card-main {
  display: grid;
  flex: 1;
  gap: 2px;
}

.customer-card p {
  margin: 5px 0 0;
  color: var(--ink-soft);
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.selection-summary {
  flex: 0 0 auto;
  white-space: nowrap;
}

.quote-product-table {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.quote-product-row {
  display: grid;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 8px 13px;
  border-top: 1px solid var(--line);
}

.quote-component-row {
  min-width: 800px;
  grid-template-columns: 54px minmax(220px, 1.5fr) 68px 92px 70px 94px 92px;
}

.quote-mobile-list {
  display: none;
}

.quote-finished-row {
  min-width: 800px;
  grid-template-columns: 54px minmax(180px, 1.2fr) 68px 92px 70px 94px minmax(140px, 1fr);
}

.quote-catalog-section {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.quote-catalog-section h2 {
  margin: 0;
  padding-left: 18px;
  font-size: 19px;
}

.catalog-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 7px;
}

.costing-picker-results {
  display: grid;
  height: 290px;
  max-height: 290px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.costing-picker-option {
  display: grid;
  grid-template-columns: 24px 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.costing-picker-option:hover {
  background: var(--forest-50);
}

.quote-product-selectable {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.quote-product-selectable:hover {
  background: var(--forest-50);
}

.quote-product-selectable:has(input[type="checkbox"]:checked) {
  background: var(--forest-100);
}

.quote-product-unavailable {
  cursor: not-allowed;
  opacity: .58;
}

.quote-product-unavailable:hover {
  background: inherit;
}

.costing-picker-option:first-child {
  border-top: 0;
}

.costing-picker-option:has(input:checked) {
  background: var(--green-soft);
}

.costing-picker-option > input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin: 0;
}

.costing-picker-image {
  width: 52px;
  height: 52px;
}

.costing-picker-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.costing-picker-name {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  border: 0;
}

.costing-picker-price {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.costing-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finished-copy-color-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.finished-copy-mapping-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.finished-copy-preview-title {
  margin-top: 4px;
  font-size: 16px;
}

.finished-copy-mapping-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.finished-copy-mapping-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.costing-component-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 20px;
}

.costing-component-row {
  display: grid;
  grid-template-columns: 48px minmax(150px, 1fr) minmax(92px, .55fr) minmax(92px, .45fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

@media (min-width: 821px) {
  .order-card-header {
    align-items: flex-start;
  }

  .order-identity {
    flex: 1 1 320px;
  }

  .order-header-actions {
    flex: 1 1 560px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

.quote-product-row:first-child {
  border-top: 0;
}

.quote-product-head {
  min-height: 46px;
  color: var(--ink-soft);
  background: #f8faf8;
  font-size: 12px;
}

.quote-product-row > input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin: auto;
}

.quote-product-row > div {
  display: grid;
  min-width: 0;
}

.quote-line-image {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  object-fit: contain;
  color: var(--muted);
  background: #f4f6f4;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9px;
}

.quotation-history-section {
  margin-top: 28px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.quotation-history-list {
  display: grid;
  gap: 9px;
}

.quotation-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.quotation-history-card > div {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 2px 14px;
}

.quotation-history-card small {
  grid-column: 1 / -1;
}

.quote-selected-lines {
  display: grid;
  gap: 8px;
}

.quote-selected-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(140px, 190px);
  gap: 13px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.quote-selected-line > div {
  display: grid;
}

.check-field {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}

.check-field input {
  width: 19px;
  min-height: 19px;
}

.quote-new-customer {
  grid-column: 1 / -1;
}

.quotation-document {
  min-width: 900px;
  color: #19211e;
  background: #fff;
}

.quotation-document-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--forest-900);
}

.quotation-document-head h3 {
  margin: 4px 0 0;
  font-size: 26px;
}

.quotation-meta {
  display: grid;
  min-width: 260px;
  gap: 3px;
  color: var(--ink-soft);
}

.quotation-preview-table {
  overflow: hidden;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.quotation-preview-section {
  margin-top: 18px;
}

.quotation-preview-section h4 {
  margin: 0;
  padding: 9px 12px;
  color: var(--forest-900);
  background: #edf6f0;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
}

.quotation-preview-row {
  display: grid;
  align-items: center;
}

.quotation-preview-components {
  grid-template-columns: 52px minmax(180px, .75fr) minmax(140px, .8fr) minmax(90px, .55fr) 60px minmax(100px, .65fr) minmax(110px, .65fr);
}

.quotation-preview-finished {
  grid-template-columns: 52px minmax(210px, 1.4fr) 140px 90px 60px 100px 110px;
}

/* 已出具单据保留生成时的列集合；旧快照仍按原列数正常对齐。 */
.quotation-preview-components.quotation-columns-8 {
  grid-template-columns: 52px 150px 220px 140px 86px 60px 84px 84px;
}

.quotation-preview-finished.quotation-columns-6 {
  grid-template-columns: 180px 136px 86px 60px 88px minmax(120px, 1fr);
}

.quotation-preview-row > * {
  min-height: 58px;
  padding: 8px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.quotation-preview-row > .quote-line-image {
  width: 100%;
  height: 58px;
  border-radius: 0;
}

.quotation-preview-head > * {
  min-height: 42px;
  color: #fff;
  background: var(--forest-800);
  font-size: 12px;
}

.quotation-notes {
  padding: 10px 12px;
  background: var(--cream);
  border-left: 3px solid var(--amber);
}

.pooling-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 13px;
  margin-top: 16px;
}

.pooling-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.pooling-card-overdue {
  border-color: #e58b7e;
}

.pooling-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pooling-card-head > div {
  display: grid;
}

.pooling-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pooling-metrics > div {
  display: grid;
  gap: 3px;
  padding: 9px;
  background: var(--forest-50);
  border-radius: 8px;
}

.pooling-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.pooling-progress {
  height: 7px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.pooling-progress > div {
  height: 100%;
  background: var(--forest-600);
  border-radius: inherit;
}

.schedule-controls {
  display: grid;
  grid-template-columns: 160px max-content;
  align-items: end;
  justify-content: end;
  gap: 12px;
}

.pooling-confirm-lines {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.pooling-confirm-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  background: var(--surface-soft);
  border-radius: 8px;
}

.pooling-customer-confirm-check {
  align-items: flex-start;
  padding: 10px 0;
}

.schedule-product-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.schedule-product-copy strong,
.schedule-product-copy span {
  display: block;
  min-width: 0;
}

.schedule-product-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-pooling {
  min-height: 44px;
  align-items: flex-end;
  align-self: end;
  padding: 0 4px 10px;
  white-space: nowrap;
}

.schedule-unified {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 12px;
  background: var(--forest-50);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.schedule-unified-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.schedule-unified-controls > input,
.schedule-unified-controls > .button {
  min-height: 48px;
}

.schedule-component-requirements,
.order-component-requirements-panel {
  display: grid;
  gap: 10px;
}

.order-component-requirements-section,
.order-interference-panel,
.order-interference-groups,
.order-interference-sources {
  display: grid;
  gap: 8px;
}

.order-component-requirements-section {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.order-component-requirements-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  cursor: pointer;
}

.order-component-requirements-section[open] > .order-component-requirements-toggle {
  border-bottom: 1px solid var(--line);
  background: #f7fbf8;
}

.order-component-requirements-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.schedule-component-requirements {
  padding: 13px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.schedule-component-requirements > h3 {
  margin: 0;
  font-size: 16px;
}

.order-component-requirement-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.order-component-requirements-list {
  display: grid;
  gap: 8px;
}

.order-component-requirement {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.order-component-requirement-image {
  width: 54px;
  height: 54px;
}

.order-component-requirement-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.order-component-requirement-copy > strong {
  overflow-wrap: anywhere;
}

.order-component-requirement-total {
  color: var(--forest-800);
  font-size: 18px;
  white-space: nowrap;
}

.order-component-requirement-sources {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.order-component-requirement-sources summary {
  width: fit-content;
  cursor: pointer;
}

.order-component-requirement-sources > div {
  margin-top: 5px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.order-interference-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.order-interference-heading > h3 {
  margin: 0;
  font-size: 17px;
}

.order-interference-group {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.order-interference-group > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 14px;
  padding: 11px 13px;
  cursor: pointer;
}

.order-interference-group[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f7fbf8;
}

.order-interference-count.warn {
  color: #a54825;
}

.order-interference-sources {
  gap: 0;
}

.order-interference-source {
  display: grid;
  gap: 3px;
  padding: 10px 13px;
  border-top: 1px solid #edf2ef;
}

.order-interference-source:first-child {
  border-top: 0;
}

.order-interference-source.current {
  box-shadow: inset 3px 0 var(--forest-600);
}

.order-interference-source-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.order-interference-source-meta {
  font-size: 12px;
}

@media (max-width: 820px) {
  .order-component-requirement-summary {
    display: grid;
    gap: 3px;
  }

  .order-component-requirement {
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: start;
  }

  .order-component-requirement-total {
    grid-column: 2;
    font-size: 17px;
  }

  .order-interference-group > summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
  }

  .order-interference-group > summary > :last-child {
    grid-column: 1 / -1;
  }

  .order-interference-source {
    padding: 9px 11px;
  }
}

.reminder-section {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.reminder-rule-list,
.reminder-preview-list {
  display: grid;
  gap: 8px;
}

.reminder-rule-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(180px, 1.4fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--forest-50);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.reminder-actions,
.reminder-role-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reminder-preview-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.reminder-preview-card > div {
  display: grid;
  gap: 4px;
}

.price-review-list {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.price-review-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.price-review-head,
.price-review-actions,
.price-review-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price-review-head > div {
  display: grid;
  gap: 3px;
}

.price-review-head h2 {
  margin: 0;
  font-size: 20px;
}

.price-review-prices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.price-review-prices > div {
  display: grid;
  gap: 4px;
  padding: 11px;
  background: var(--forest-50);
  border-radius: 9px;
}

.price-review-prices span,
.price-review-costs {
  color: var(--muted);
  font-size: 12px;
}

.price-review-prices strong {
  font-size: 18px;
}

.price-review-costs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.price-review-summary {
  padding: 13px;
  background: var(--forest-50);
  border-radius: 10px;
}

.analytics-filter label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.analytics-filter input {
  min-height: 42px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.analytics-content {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.analytics-range {
  margin: 0;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.analytics-card {
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.analytics-card-green {
  border-top-color: var(--forest-500);
}

.analytics-card-amber {
  border-top-color: var(--amber);
}

.analytics-card-danger {
  border-top-color: var(--danger);
}

.analytics-card span,
.analytics-card small {
  color: var(--muted);
}

.analytics-card strong {
  align-self: center;
  font-family: Georgia, serif;
  font-size: 25px;
}

.analytics-card-action {
  cursor: pointer;
}

.analytics-card-action:hover,
.analytics-card-action:focus-visible {
  border-color: var(--forest-500);
  outline: 3px solid rgb(36 119 82 / 12%);
}

.modal-open {
  overflow: hidden;
}

.identity-admin-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.identity-admin-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.identity-admin-summary,
.identity-admin-actions,
.identity-admin-meta,
.identity-role-choices {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.catalog-pending-import-section {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.catalog-pending-import-section .section-heading,
.catalog-pending-import-row,
.catalog-pending-import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-pending-import-section .section-heading {
  justify-content: space-between;
}

.catalog-pending-import-section h2,
.catalog-pending-import-section p {
  margin: 0;
}

.catalog-pending-imports {
  display: grid;
  gap: 8px;
}

.catalog-pending-import-row {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.catalog-pending-import-row > div:first-child {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.catalog-import-workspace {
  min-width: 0;
  margin-bottom: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.catalog-import-workspace-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.catalog-import-workspace-summary::-webkit-details-marker {
  display: none;
}

.catalog-import-workspace-summary > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.catalog-import-workspace-toggle::before {
  color: var(--forest-700);
  font-weight: 800;
  content: '展开';
}

.catalog-import-workspace[open] .catalog-import-workspace-toggle::before {
  content: '收起';
}

.catalog-import-workspace:not([open]) > .catalog-import-workspace-body {
  display: none;
}

.catalog-import-workspace-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.catalog-import-workspace-body > :first-child {
  margin-top: 14px;
}

.catalog-import-workspace .section-heading {
  align-items: flex-start;
}

.catalog-import-workspace .section-heading > div,
.catalog-import-resolution-heading {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.catalog-import-workspace h2,
.catalog-import-workspace h3,
.catalog-import-workspace p,
.catalog-import-resolution h3,
.catalog-import-resolution p {
  margin: 0;
}

.catalog-import-template-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.catalog-import-template-group {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding: 13px;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.catalog-import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.catalog-import-acceptance-controls {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin-top: 3px;
  padding: 10px;
  background: var(--canvas);
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
}

.catalog-import-acceptance-controls > strong {
  color: var(--ink-soft);
  font-size: 13px;
}

.catalog-import-mapping-selector {
  display: grid;
  width: min(100%, 860px);
  min-width: 0;
  gap: 4px;
}

.catalog-import-mapping-selector .field,
.catalog-import-mapping-selector select {
  width: 100%;
  min-width: 0;
}

.catalog-mapping-history,
.catalog-mapping-batches,
.catalog-import-resolution,
.catalog-import-error-list {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.catalog-mapping-batch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.catalog-mapping-batch.is-latest {
  background: var(--forest-50);
  border-color: var(--forest-500);
}

.catalog-mapping-batch > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.catalog-mapping-batch > .catalog-mapping-batch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.catalog-import-auxiliary-error {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.catalog-import-auxiliary-error > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.catalog-import-workspace *,
.catalog-import-error-row *,
.catalog-import-component-preview-row *,
.catalog-import-finished-item * {
  overflow-wrap: anywhere;
}

.catalog-import-error-list {
  max-height: min(60vh, 620px);
  margin-top: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.catalog-import-error-row {
  display: grid;
  grid-template-columns: 88px minmax(120px, 180px) minmax(0, 1fr);
  min-width: 0;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.catalog-import-error-field {
  color: var(--danger);
  font-weight: 800;
}

.catalog-import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.catalog-import-summary > div,
.catalog-import-cost-summary > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 10px;
  background: var(--canvas);
  border-radius: 9px;
}

.catalog-import-summary strong,
.catalog-import-cost-summary strong {
  color: var(--forest-800);
  font-size: 18px;
}

.catalog-import-summary span,
.catalog-import-cost-summary span {
  color: var(--muted);
  font-size: 12px;
}

.catalog-import-warnings {
  margin: 12px 0;
  padding-left: 22px;
  color: var(--ink-soft);
}

.catalog-import-resolution {
  margin: 14px 0;
}

.catalog-import-resolution-heading {
  margin-bottom: 3px;
}

.catalog-import-finished-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.catalog-import-component-preview-list,
.catalog-import-finished-list,
.catalog-import-finished-body {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.catalog-import-component-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(150px, .8fr) minmax(150px, auto);
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.catalog-import-component-preview-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.catalog-import-component-preview-row > div:last-child {
  justify-items: end;
  text-align: right;
}

.catalog-import-missing-price {
  color: var(--amber);
}

.catalog-import-finished-body {
  gap: 0;
}

.catalog-import-finished-item > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  align-items: center;
  gap: 7px 12px;
  padding: 11px 12px;
  background: #f8faf8;
  cursor: pointer;
  list-style: none;
}

.catalog-import-finished-item > summary::-webkit-details-marker {
  display: none;
}

.catalog-import-finished-item > summary::before {
  content: '▸';
  color: var(--forest-700);
  font-size: 18px;
  transition: transform .15s ease;
}

.catalog-import-finished-item[open] > summary {
  border-bottom: 1px solid var(--line);
}

.catalog-import-finished-item[open] > summary::before {
  transform: rotate(90deg);
}

.catalog-import-finished-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.catalog-import-finished-costs {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.catalog-import-finished-costs strong {
  color: var(--forest-800);
}

.catalog-import-expand-label {
  color: var(--forest-700);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.catalog-import-load-more {
  justify-self: center;
  margin-top: 4px;
}

.catalog-import-component-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(150px, .8fr) minmax(150px, auto);
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.catalog-import-component-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.catalog-import-component-row > div:last-child {
  justify-items: end;
  text-align: right;
}

.catalog-import-cost-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 11px 12px;
  background: #fbfcfb;
}

.catalog-import-cost-summary > small {
  grid-column: 1 / -1;
}

@media (max-width: 820px) {
  .catalog-import-workspace {
    padding: 0;
  }

  .catalog-import-template-groups,
  .catalog-import-component-preview-row,
  .catalog-import-component-row,
  .catalog-import-cost-summary,
  .catalog-import-error-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-import-actions .button,
  .catalog-mapping-batch .button {
    width: 100%;
    white-space: normal;
  }

  .catalog-mapping-batch {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .catalog-mapping-batch > .catalog-mapping-batch-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-import-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-import-component-preview-row > div:last-child,
  .catalog-import-component-row > div:last-child {
    justify-items: start;
    text-align: left;
  }

  .catalog-import-auxiliary-error {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-import-auxiliary-error .button {
    width: 100%;
  }

  .catalog-import-finished-item > summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .catalog-import-finished-costs,
  .catalog-import-expand-label {
    grid-column: 2;
    justify-content: flex-start;
  }

  .catalog-import-expand-label {
    white-space: normal;
  }

  .catalog-import-cost-summary > small {
    grid-column: 1;
  }

  .catalog-pending-import-row {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-pending-import-actions .button {
    flex: 1;
    white-space: normal;
  }
}

.identity-admin-summary {
  justify-content: space-between;
}

.identity-admin-summary > div {
  display: grid;
  gap: 3px;
}

.identity-admin-meta {
  color: var(--ink-soft);
  font-size: 13px;
}

.identity-admin-actions {
  justify-content: flex-end;
}

.identity-role-choices {
  align-items: flex-start;
  flex-direction: column;
}

.wecom-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.search-with-clear {
  position: relative;
  flex: 1 1 18rem;
}

.search-with-clear .search-input {
  width: 100%;
  padding-right: 3rem;
}

.search-with-clear .search-input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  translate: 0 -50%;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
}

.finance-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.finance-settings-card {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--forest-50);
  border: 1px solid rgb(36 119 82 / 20%);
  border-radius: 12px;
}

.finance-settings-card > div {
  display: grid;
  gap: 4px;
  margin-right: auto;
}

.finance-settings-card select {
  width: auto;
  min-width: 130px;
}

.finance-tabs .button {
  min-height: 58px;
}

.finance-body,
.finance-customer-list,
.finance-order-list,
.finance-monthly-statement,
.finance-detail,
.finance-record-list {
  display: grid;
  gap: 12px;
}

.finance-section-head,
.finance-customer-title,
.finance-order-title,
.finance-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.finance-section-head {
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.finance-section-head h2,
.finance-section-head p {
  margin: 0;
}

.finance-section-head p {
  margin-top: 4px;
  color: var(--muted);
}

.finance-section-head .search-input {
  width: min(440px, 100%);
}

.finance-customer-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(140px, auto) minmax(150px, auto);
  gap: 8px;
  width: min(760px, 100%);
}

.finance-order-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(140px, auto) minmax(150px, auto);
  gap: 8px;
  width: min(760px, 100%);
}

.finance-order-filters .search-input {
  width: 100%;
}

.finance-customer-filters .search-input {
  width: 100%;
}

.finance-balance-due {
  color: var(--red);
  background: var(--red-bg);
}

.finance-customer-card,
.finance-order-card {
  display: grid;
  gap: 13px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.finance-order-card-outstanding {
  border: 2px solid var(--danger);
  box-shadow: 0 0 0 2px rgb(185 45 35 / 8%);
}

.finance-link,
.finance-suggestion {
  color: var(--forest-700);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.finance-customer-title select {
  width: auto;
  min-width: 90px;
}

.finance-card-metrics,
.finance-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.finance-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px;
  background: var(--canvas);
  border-radius: 9px;
}

.finance-metric strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.finance-metric span {
  color: var(--muted);
  font-size: 12px;
}

.finance-metric-alert strong {
  color: var(--danger);
}

.finance-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.finance-monthly-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px);
  gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.finance-customer-suggestions {
  display: grid;
  max-height: 280px;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.finance-suggestion {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgb(12 24 19 / 52%);
  backdrop-filter: blur(3px);
}

.modal-dialog {
  display: grid;
  width: min(100%, 720px);
  max-height: min(90vh, 900px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 17px;
  box-shadow: var(--shadow-lg);
}

.modal-wide {
  width: min(100%, 1120px);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: #fff;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 19px;
}

.modal-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.shipment-line-list,
.schedule-list,
.order-entry-lines,
.batch-list {
  display: grid;
  gap: 10px;
}

.shipment-line,
.schedule-row,
.order-entry-line {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) minmax(230px, .8fr);
  gap: 13px;
  align-items: center;
  padding: 12px;
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.schedule-row {
  grid-template-columns: 54px minmax(190px, .8fr) minmax(430px, 1.5fr);
  padding: 8px 10px;
}

.order-entry-line {
  grid-template-columns: auto minmax(180px, 1fr) minmax(290px, .9fr) auto;
}

.order-entry-pricing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.shipment-line-product {
  display: grid;
}

.shipment-quantity-field {
  display: grid;
  gap: 5px;
}

.overage-hint {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.overage-confirmation {
  display: grid;
  gap: 9px;
  padding: 15px;
  color: #8f3027;
  background: var(--red-bg);
  border: 1px solid #f0b7b0;
  border-radius: 10px;
}

.overage-confirmation[hidden] {
  display: none;
}

.overage-confirmation p {
  margin: 0;
}

.receiver-copy-preview {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px 14px;
  padding: 16px;
  background: var(--forest-50);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.receiver-copy-preview span {
  color: var(--muted);
}

.cancel-order-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cancel-order-list,
.delivery-note-entry-list {
  display: grid;
  gap: 8px;
}

.cancel-order-line {
  display: grid;
  grid-template-columns: 24px 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cancel-order-line > span,
.delivery-note-product > span {
  display: grid;
}

.delivery-note-entry-head {
  display: grid;
  gap: 3px;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: #f8faf8;
  border-radius: 8px;
  font-size: 12px;
}

.delivery-note-entry-head strong {
  color: var(--ink);
  font-size: 14px;
}

.delivery-note-entry-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.delivery-note-entry-product {
  grid-column: 1 / -1;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.delivery-note-entry-field {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.delivery-note-entry-field input,
.delivery-note-entry-field select {
  width: 100%;
}

@media (max-width: 820px) {
  .delivery-note-entry-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-line-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 5px;
  }
}

.delivery-note-product {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: 19px;
  min-height: 19px;
  height: 19px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.receipt-balance-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin-bottom: 12px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: var(--forest-50);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 400;
}

.customer-choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.customer-choice-row .button {
  min-height: 44px;
  white-space: nowrap;
}

.customer-choice-field {
  position: relative;
}

.order-customer-results {
  position: absolute;
  z-index: 30;
  top: 67px;
  right: 0;
  left: 0;
  display: grid;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.order-customer-results[hidden] {
  display: none;
}

.order-customer-option,
.order-customer-create {
  display: grid;
  width: 100%;
  min-height: 58px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}

.order-customer-option {
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.order-customer-option:hover,
.order-customer-option:focus-visible,
.order-customer-create:hover,
.order-customer-create:focus-visible {
  background: var(--forest-50);
}

.order-customer-option-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: #f2f5f3;
  border-radius: 8px;
}

.order-customer-option-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.order-customer-option-main small {
  color: var(--muted);
}

.order-customer-create {
  place-items: center start;
  color: var(--forest-700);
  font-weight: 800;
}

.receiver-grid .field:nth-child(3) {
  grid-column: span 2;
}

.section-title {
  margin: 8px 0 -5px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 16px;
}

.picker-results {
  display: flex;
  min-height: 42px;
  max-height: 164px;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  overflow: auto;
}

.picker-results:empty {
  display: none;
}

.picker-option {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.picker-option:hover {
  color: var(--forest-700);
  border-color: var(--forest-600);
}

.order-product-picker {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.order-product-picker-one-row {
  min-height: 134px;
}

.order-product-picker-two-rows {
  min-height: 208px;
}

.order-product-picker-three-rows {
  min-height: 282px;
}

.order-change-product-picker {
  min-width: 0;
  align-self: start;
}

.order-change-product-picker .order-product-options {
  grid-auto-rows: minmax(84px, auto);
  max-height: 288px;
}

.clipboard-copy-helper {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.customer-schedule-copy-note {
  margin: 0;
}

.customer-schedule-copy-preview {
  min-height: clamp(220px, 36vh, 360px);
  line-height: 1.7;
}

.order-product-options {
  display: grid;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
}

.order-create-product-search {
  width: min(680px, 100%);
}

.order-create-product-picker {
  width: min(680px, 100%);
}

.order-create-product-picker .order-product-options {
  max-height: 222px;
}

.order-product-option {
  display: grid;
  grid-template-columns: 22px 54px minmax(0, 1fr) minmax(100px, auto);
  align-items: center;
  gap: 11px;
  min-height: 74px;
  padding: 9px 13px;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  text-align: left;
}

.order-product-option:hover,
.order-product-option:focus-visible,
.order-product-option.is-selected {
  background: var(--forest-50);
}

.order-product-check {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: #fff;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 900;
}

.order-product-option.is-selected .order-product-check {
  background: var(--forest-700);
  border-color: var(--forest-700);
}

.order-product-option-main,
.order-product-option-price {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.order-product-option-main small,
.order-product-option-price small {
  color: var(--muted);
  font-size: 12px;
}

.order-product-option-price {
  justify-items: end;
  white-space: nowrap;
}

.order-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  background: #fafbf9;
}

.order-entry-choice {
  padding: 12px;
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.order-entry-terms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.order-entry-terms .order-payment-choice {
  margin-top: 0;
}

.order-entry-choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.receiver-grid .order-entry-choice {
  grid-column: span 2;
}

.order-payment-choice {
  margin-top: -2px;
}

.selected-product-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-product-box:empty {
  display: none;
}

.selected-product-box > div:last-child {
  display: grid;
}

.selected-product-box:has(.selected-product-details) {
  flex-wrap: wrap;
}

.selected-product-details {
  display: grid;
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.quote-preview {
  display: grid;
  justify-items: end;
}

.quote-preview small {
  color: var(--muted);
}

.empty-inline {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #f8faf8;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
}

.selection-bar {
  position: sticky;
  z-index: 2;
  top: -18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: rgb(255 255 255 / 94%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.selection-count {
  margin-left: auto;
  color: var(--ink-soft);
}

.batch-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.batch-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  background: var(--forest-50);
}

.batch-header > div:nth-child(2),
.batch-header > div:first-child {
  display: grid;
}

.batch-header input {
  width: 19px;
  min-height: 19px;
  height: 19px;
}

.batch-packaging-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: #fbfcfb;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.batch-packaging-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.shipment-manifest-create-hint {
  margin: -3px 0 0;
  padding: 9px 11px;
  color: var(--blue);
  background: var(--blue-bg);
  border-radius: 8px;
}

.shipment-manifest-empty,
.shipment-manifest-view {
  color: var(--ink-soft);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.batch-card > .shipment-manifest-empty,
.batch-card > .shipment-manifest-view,
.daily-shipment-batch > .shipment-manifest-empty,
.daily-shipment-batch > .shipment-manifest-view {
  margin: 11px 12px 4px;
}

.shipment-manifest-empty {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 9px 11px;
  font-size: 12px;
}

.shipment-manifest-empty strong {
  color: var(--muted);
}

.shipment-manifest-view {
  overflow: hidden;
}

.shipment-manifest-view-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 9px 11px;
  color: var(--forest-800);
  background: var(--forest-50);
  border-bottom: 1px solid var(--line);
}

.shipment-manifest-view-header span {
  color: var(--muted);
  font-size: 12px;
}

.shipment-manifest-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
  gap: 8px;
  padding: 8px;
}

.shipment-manifest-group {
  min-width: 0;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shipment-manifest-group > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px 8px;
  margin-bottom: 7px;
}

.shipment-manifest-group > header strong {
  color: var(--forest-800);
}

.shipment-manifest-group > header span {
  color: var(--muted);
  font-size: 12px;
}

.shipment-manifest-allocation-list {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.shipment-manifest-allocation-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 5px 7px;
  background: #f6f8f6;
  border-radius: 6px;
  font-size: 12px;
}

.shipment-manifest-allocation-chip strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.shipment-manifest-allocation-chip small {
  color: var(--forest-700);
  font-weight: 700;
  white-space: nowrap;
}

.shipment-manifest-more summary {
  padding: 4px 7px;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.shipment-manifest-more[open] > summary {
  margin-bottom: 5px;
}

.shipment-manifest-editor {
  display: grid;
  gap: 13px;
  min-width: 0;
}

.shipment-manifest-editor-status {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  color: var(--ink-soft);
  background: var(--amber-bg);
  border: 1px solid #e7c795;
  border-radius: 11px;
}

.shipment-manifest-editor-status.is-exact {
  color: var(--forest-800);
  background: var(--forest-50);
  border-color: #bad5c6;
}

.shipment-manifest-editor-status.has-overage {
  color: var(--red);
  background: var(--red-bg);
  border-color: #efbdb6;
}

.shipment-manifest-editor-status p {
  margin: 0;
  font-size: 13px;
}

.shipment-manifest-editor-metrics,
.shipment-manifest-editor-toolbar,
.shipment-manifest-group-editor > header,
.shipment-manifest-group-actions,
.shipment-manifest-group-count,
.shipment-manifest-picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shipment-manifest-editor-metrics,
.shipment-manifest-editor-toolbar,
.shipment-manifest-group-editor > header {
  justify-content: space-between;
}

.shipment-manifest-editor-metrics span,
.shipment-manifest-editor-toolbar span,
.shipment-manifest-group-editor > header span {
  color: var(--muted);
  font-size: 12px;
}

.shipment-manifest-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.shipment-manifest-issues span {
  padding: 3px 7px;
  background: rgb(255 255 255 / 72%);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.shipment-manifest-issues .is-over {
  color: var(--red);
}

.shipment-manifest-issues .is-missing {
  color: var(--amber);
}

.shipment-manifest-editor-toolbar > div,
.shipment-manifest-group-editor > header > div:first-child {
  min-width: 0;
}

.shipment-manifest-editor-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
  background: #f8faf8;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
}

.shipment-manifest-group-editor {
  display: grid;
  gap: 11px;
  min-width: 0;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.shipment-manifest-group-editor > header {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.shipment-manifest-group-editor > header strong {
  color: var(--forest-800);
}

.shipment-manifest-group-count {
  justify-content: space-between;
  padding: 10px 11px;
  background: var(--forest-50);
  border-radius: 9px;
}

.shipment-manifest-group-count .field {
  width: min(240px, 100%);
}

.shipment-manifest-group-count > span {
  color: var(--forest-700);
  font-size: 13px;
  font-weight: 800;
}

.shipment-manifest-selected-lines {
  display: grid;
  gap: 7px;
}

.shipment-manifest-allocation-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 230px) auto;
  align-items: end;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.shipment-manifest-product {
  display: grid;
  min-width: 0;
  gap: 2px;
  overflow-wrap: anywhere;
}

.shipment-manifest-product span {
  color: var(--muted);
  font-size: 12px;
}

.shipment-manifest-fill-remaining {
  justify-self: start;
  color: var(--blue);
  border-color: #b7cce2;
}

.shipment-manifest-picker-toggle,
.shipment-manifest-clear {
  justify-self: start;
}

.shipment-manifest-picker {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.shipment-manifest-picker-actions {
  padding: 8px;
  background: #f8faf8;
  border-bottom: 1px solid var(--line);
}

.shipment-manifest-picker-actions input {
  min-width: 0;
}

.shipment-manifest-picker-list {
  display: grid;
  max-height: 290px;
  overflow-y: auto;
}

.shipment-manifest-picker-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.shipment-manifest-picker-option:last-child {
  border-bottom: 0;
}

.shipment-manifest-picker-option > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  overflow-wrap: anywhere;
}

.shipment-manifest-picker-option small {
  color: var(--muted);
}

.batch-freight {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.batch-photos {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
  overflow-x: auto;
}

.shipment-photo {
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  object-fit: cover;
  background: #f3f4f3;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.batch-lines {
  display: grid;
  padding: 8px 12px 12px;
}

.batch-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.batch-line:last-child {
  border-bottom: 0;
}

.batch-line-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.correction-product {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  background: #fafbf9;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.correction-product > span {
  display: grid;
  gap: 3px;
}

.correction-product .product-image {
  width: 58px;
  height: 58px;
}

.batch-product-image,
.bill-product-image {
  width: 42px;
  height: 42px;
}

.batch-notes {
  margin: 0;
  padding: 9px 12px;
  color: var(--ink-soft);
  background: var(--cream);
  border-top: 1px solid var(--line);
}

.bill-preview {
  min-height: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.bill-batch-header {
  display: grid;
  min-width: 660px;
  gap: 3px;
  padding: 11px 13px;
  background: var(--forest-50);
  border-top: 1px solid var(--line);
}

.bill-batch-header:first-child {
  border-top: 0;
}

.bill-line {
  display: grid;
  grid-template-columns: 44px minmax(160px, 1fr) minmax(90px, auto) minmax(90px, auto) minmax(100px, auto);
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

.billing-preview-modal-body {
  display: block;
  min-height: 0;
  overflow-y: auto;
}

.billing-preview-modal-body > * + * {
  margin-top: 16px;
}

.bill-subtotal,
.bill-totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 18px;
  padding: 12px;
  text-align: right;
  border-top: 1px solid var(--line);
}

.bill-totals {
  margin-top: 14px;
  padding-top: 18px;
}

.grand-label,
.grand-value {
  padding-top: 8px;
  border-top: 2px solid var(--ink);
  font-size: 17px;
}

.image-preview {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  padding: 42px;
  place-items: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  background: rgb(6 17 13 / 72%);
  transition: opacity 120ms ease, visibility 120ms ease;
}

.image-preview-visible {
  visibility: visible;
  opacity: 1;
}

.image-preview-visible.image-preview-interactive {
  pointer-events: auto;
}

.image-preview img {
  width: auto;
  max-width: min(84vw, 1000px);
  height: auto;
  max-height: 84vh;
  object-fit: contain;
  background: #fff;
  border: 8px solid #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

.zoomable-image {
  cursor: zoom-in;
}

.toast-region {
  position: fixed;
  z-index: 400;
  top: calc(var(--fixed-feedback-offset) + max(18px, env(safe-area-inset-top)));
  right: 18px;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  padding: 12px 14px;
  color: #fff;
  background: var(--forest-800);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
  animation: toast-enter 160ms ease both;
}

.toast-warning {
  background: #9b5a0d;
}

.toast-error {
  background: #a9362c;
}

.toast-leaving {
  opacity: 0;
  transform: translateY(-5px);
  transition: 180ms ease;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (max-width: 1100px) {
  .order-line,
  .order-line.with-price {
    grid-template-columns: minmax(220px, 1.7fr) minmax(85px, .6fr) minmax(115px, .76fr) minmax(110px, .72fr) minmax(82px, auto);
  }

  .order-line.with-price .price-cell,
  .order-line-head.with-price span:nth-child(3) {
    display: none;
  }

  .line-ship-button {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    font-size: 14px;
  }

  .sidebar {
    display: none;
  }

  .app-stage {
    margin-left: 0;
  }

  .app-header {
    min-height: 56px;
    justify-content: space-between;
    padding: 0 14px;
  }

  .mobile-brand {
    display: block;
    color: var(--forest-900);
    background: transparent;
    border: 0;
    font-family: SimSun, serif;
    font-size: 18px;
    font-weight: 800;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    inset: auto 0 0;
    display: flex;
    overflow-x: auto;
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    background: rgb(255 255 255 / 96%);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 30px rgb(10 37 28 / 8%);
    backdrop-filter: blur(12px);
  }

  .mobile-nav .nav-item {
    display: grid;
    flex: 1 0 68px;
    min-height: 48px;
    place-items: center;
    padding: 4px;
    color: var(--ink-soft);
    text-align: center;
    border-radius: 9px;
    font-size: 13px;
  }

  .mobile-nav .nav-item-active {
    color: var(--forest-700);
    background: var(--forest-50);
    font-weight: 800;
  }

  .mobile-section-nav {
    position: sticky;
    z-index: 14;
    top: 56px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 12px;
    background: rgb(255 255 255 / 94%);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }

  .mobile-section-nav .nav-item {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 6px 12px;
    color: var(--ink-soft);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
  }

  .mobile-section-nav .nav-item-active {
    color: #fff;
    background: var(--forest-700);
  }

  .page {
    padding: 20px 12px 32px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .page-heading > .button {
    width: 100%;
  }

  .order-search-panel {
    padding: 8px;
  }

  .search-help {
    display: none;
  }

  .filter-row {
    display: grid;
  }

  .order-group-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .order-group-chips .order-group-chip {
    width: 100%;
    min-width: 0;
    min-height: 64px;
    padding: 7px 3px;
    white-space: normal;
  }

  .order-group-chips .order-group-chip span {
    font-size: 13px;
    line-height: 1.15;
  }

  .chip {
    flex: 0 0 auto;
  }

  .result-hint {
    justify-self: end;
  }

  .order-sort-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: 2px;
  }

  .order-sort-controls select {
    width: 100%;
    min-width: 0;
  }

  .order-sort-controls select {
    padding-right: 28px;
    font-size: 14px;
  }

  .production-workspace {
    border-radius: 14px;
  }

  .production-workspace-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 13px;
  }

  .production-workspace-header h2 {
    font-size: 19px;
  }

  .production-workspace-counts {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .production-workspace-list {
    gap: 10px;
    padding: 8px;
  }

  .order-card-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 13px;
  }

  .order-header-actions {
    width: 100%;
  }

  .order-header-actions .button {
    flex: 1 1 auto;
  }

  .order-total {
    width: 100%;
    justify-content: space-between;
    padding-bottom: 7px;
    border-bottom: 1px dashed var(--line);
  }

  .order-line-head {
    display: none;
  }

  .order-line,
  .order-line.with-price {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    min-height: 0;
    padding: 10px 13px;
  }

  .order-line-product {
    grid-column: 1 / -1;
    gap: 9px;
  }

  .order-line-product .product-image,
  .order-line-product .product-image-placeholder {
    width: 50px;
    height: 50px;
  }

  .order-line-progress-mobile {
    display: inline-flex;
  }

  .shipping-progress-cell {
    display: none;
  }

  .order-line.with-price .price-cell {
    display: grid;
  }

  .mobile-label {
    display: block;
  }

  .line-ship-button {
    display: none;
  }

  .app-shell-workshop .promised-ship-cell {
    align-content: start;
  }

  .app-shell-workshop .promised-ship-cell .mobile-label {
    order: 1;
  }

  .app-shell-workshop .promised-ship-cell small {
    order: 2;
    color: var(--ink);
    font-size: 17px;
    font-weight: 750;
    line-height: 1.15;
  }

  .app-shell-workshop .promised-ship-cell small.danger-text {
    color: var(--red);
  }

  .app-shell-workshop .promised-ship-cell > strong {
    order: 3;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 500;
  }

  .app-shell-workshop .order-line,
  .app-shell-workshop .order-line.with-price {
    grid-template-columns: 76px minmax(66px, 0.8fr) minmax(104px, 1.2fr);
    gap: 6px 8px;
    padding: 9px 11px;
  }

  .app-shell-workshop .order-line-product {
    display: contents;
  }

  .app-shell-workshop .order-line-product > div:last-child {
    grid-column: 1 / -1;
    grid-row: 1;
    gap: 1px;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--line);
  }

  .app-shell-workshop .order-line-product strong {
    font-size: 15px;
    line-height: 1.25;
  }

  .app-shell-workshop .order-line-product small,
  .app-shell-workshop .order-line-product .status-pill {
    font-size: 11px;
  }

  .app-shell-workshop .order-line-product .product-image,
  .app-shell-workshop .order-line-product .product-image-placeholder {
    grid-column: 1;
    grid-row: 2;
    width: 76px;
    height: 76px;
  }

  .app-shell-workshop .quantity-cell {
    grid-column: 2;
    grid-row: 2;
    align-content: center;
    gap: 2px;
    min-width: 0;
  }

  .app-shell-workshop .quantity-cell > strong {
    font-size: 16px;
  }

  .app-shell-workshop .quantity-cell small,
  .app-shell-workshop .quantity-cell .mobile-label,
  .app-shell-workshop .promised-ship-cell .mobile-label {
    font-size: 11px;
    line-height: 1.2;
  }

  .app-shell-workshop .promised-ship-cell {
    grid-column: 3;
    grid-row: 2;
    align-content: center;
    gap: 2px;
    min-width: 0;
  }

  .order-card-many-lines .order-lines-mobile-compact {
    display: grid;
    gap: 9px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }

  .order-lines-mobile-compact-list {
    display: grid;
    gap: 5px;
  }

  .order-lines-mobile-compact-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 4px 2px;
  }

  .order-lines-mobile-compact-line > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .order-lines-mobile-compact-line > span:last-child {
    flex: 0 0 auto;
    color: var(--ink-soft);
    font-size: 12px;
  }

  .order-lines-mobile-toggle {
    width: 100%;
  }

  .order-card-many-lines:not(.mobile-lines-expanded) > .order-line {
    display: none;
  }

  .order-card-many-lines.mobile-lines-expanded .order-lines-mobile-compact-list {
    display: none;
  }

  .order-card-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .order-receiver-details,
  .footer-actions {
    width: 100%;
  }

  .order-receiver-details > summary {
    display: block;
    padding: 8px 10px;
    color: var(--forest-700);
    background: var(--forest-50);
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
  }

  .order-receiver-details[open] > summary {
    margin-bottom: 8px;
  }

  .order-receiver-body {
    padding: 2px 2px 4px;
  }

  .footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-actions .button {
    width: 100%;
  }

  .shipment-record-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .shipment-record-controls input,
  .shipment-record-controls .button {
    width: 100%;
    min-width: 0;
  }

  .shipment-day-header {
    align-items: stretch;
    flex-direction: column;
    padding: 13px;
  }

  .shipment-day-header > strong {
    font-size: 13px;
  }

  .shipment-day-totals {
    justify-items: start;
    text-align: left;
    white-space: normal;
  }

  .shipment-day-batches {
    gap: 10px;
    padding: 9px;
  }

  .daily-shipment-batch-header {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px;
  }

  .daily-shipment-photos {
    max-width: 100%;
  }

  .daily-shipment-photo {
    width: 62px;
    height: 62px;
  }

  .daily-shipment-line {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    min-height: 64px;
    gap: 9px;
    padding: 8px 10px;
  }

  .daily-shipment-product-image {
    width: 42px;
    height: 42px;
  }

  .daily-shipment-packaging {
    align-items: flex-start;
  }

  /* 老板/销售手机端沿用 Build 72 的紧凑行：商品、数量/金额、交期同屏。 */
  .app-shell-sales-compact .order-card-header {
    align-items: center;
    flex-direction: row;
    min-height: 0;
    padding: 9px 11px;
    gap: 9px;
  }

  .app-shell-sales-compact .order-identity {
    min-width: 0;
    gap: 5px 7px;
  }

  .app-shell-sales-compact .order-number {
    font-size: 14px;
  }

  .app-shell-sales-compact .customer-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell-sales-compact .order-header-actions {
    width: auto;
    justify-content: flex-end;
    gap: 6px;
  }

  .app-shell-sales-compact .order-header-actions .button {
    flex: 0 1 auto;
    min-height: 34px;
    padding: 6px 9px;
  }

  .app-shell-sales-compact .order-total {
    width: auto;
    gap: 3px;
    padding: 0;
    border: 0;
  }

  .app-shell-sales-compact .order-total strong {
    font-size: 15px;
  }

  .app-shell-sales-compact .order-line,
  .app-shell-sales-compact .order-line.with-price {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 9px;
    padding: 8px 11px;
  }

  .app-shell-sales-compact .order-line-product {
    grid-column: auto;
    align-self: start;
    gap: 8px;
  }

  .app-shell-sales-compact .order-line-product .product-image,
  .app-shell-sales-compact .order-line-product .product-image-placeholder {
    width: 62px;
    height: 62px;
  }

  .app-shell-sales-compact .order-line-product strong {
    font-size: 14px;
  }

  .app-shell-sales-compact .order-line-product-heading .order-line-progress-mobile {
    display: none;
  }

  .app-shell-sales-compact .order-line > .order-line-cell:not(.shipping-progress-cell),
  .app-shell-sales-compact .order-line.with-price .price-cell {
    display: none;
  }

  .app-shell-sales-compact .order-line-sales-mobile-summary {
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 2px;
    text-align: right;
    white-space: nowrap;
  }

  .app-shell-sales-compact .order-line-sales-mobile-summary small {
    color: var(--muted);
    font-size: 11px;
  }

  .app-shell-sales-compact .order-line-sales-mobile-summary strong {
    font-size: 15px;
  }

  .app-shell-sales-compact .order-line-mobile-due {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    min-height: 24px;
    padding-left: 70px;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
  }

  .app-shell-sales-compact .order-line-sales-progress {
    display: inline-flex;
  }

  .quotation-page .quote-product-table {
    overflow-x: visible;
  }

  .quotation-page .quote-product-head,
  .quotation-page .quote-catalog-section > .quote-product-table {
    display: none;
  }

  .quotation-page .quote-mobile-list {
    display: grid;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
  }

  .quotation-page .quote-mobile-card {
    display: grid;
    grid-template-columns: 30px 88px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 160px;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
  }

  .quotation-page .quote-mobile-card:last-child {
    border-bottom: 0;
  }

  .quotation-page .quote-mobile-select {
    display: grid;
    place-items: center;
  }

  .quotation-page .quote-mobile-select input {
    width: 20px;
    min-height: 20px;
    margin: 0;
  }

  .quotation-page .quote-mobile-card > .quote-line-image {
    width: 88px;
    height: 88px;
  }

  .quotation-page .quote-mobile-main,
  .quotation-page .quote-mobile-title,
  .quotation-page .quote-mobile-field {
    display: grid;
    min-width: 0;
  }

  .quotation-page .quote-mobile-main {
    gap: 10px;
  }

  .quotation-page .quote-mobile-title {
    gap: 3px;
    overflow-wrap: anywhere;
  }

  .quotation-page .quote-mobile-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .quotation-page .quote-mobile-field {
    gap: 2px;
    overflow-wrap: anywhere;
  }

  .app-shell-sales-compact .line-ship-button {
    min-height: 40px;
    margin-top: 1px;
  }

  .app-shell-sales-compact .order-card-footer {
    gap: 8px;
    padding: 9px 11px;
  }

  .app-shell-sales-compact .order-receiver-body {
    gap: 6px;
    font-size: 12px;
  }

  .catalog-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px 12px;
    align-items: start;
    min-height: auto;
    padding: 11px;
    border-radius: 0;
  }

  .finished-copy-color-row,
  .finished-copy-mapping-row {
    grid-template-columns: 1fr;
  }

  .catalog-table-head {
    display: none;
  }

  .catalog-image {
    grid-row: 1 / span 2;
    width: 92px;
    height: 92px;
  }

  .catalog-title-row {
    display: grid;
    gap: 6px;
  }

  .catalog-title-row > .order-header-actions {
    display: flex;
    width: fit-content;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .catalog-title-row > .order-header-actions > .status-pill,
  .catalog-title-row > .order-header-actions > .type-pill {
    width: fit-content;
    flex: 0 0 auto;
  }

  .catalog-price {
    display: flex;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    justify-content: space-between;
    padding-left: 0;
  }

  .catalog-price > small {
    white-space: nowrap;
  }

  .catalog-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 8px;
    white-space: normal;
  }

  .catalog-actions .button {
    width: 100%;
    min-height: 44px;
  }

  .catalog-editor-layout,
  .costing-layout {
    grid-template-columns: 1fr;
  }

  .catalog-editor-image-preview {
    min-height: 210px;
  }

  .costing-summary-pane {
    position: static;
  }

  .costing-product-image {
    width: 106px;
    height: 106px;
    flex-basis: 106px;
  }

  .costing-picker-option {
    grid-template-columns: 22px 48px minmax(0, 1fr);
  }

  .costing-picker-image {
    width: 44px;
    height: 44px;
  }

  .costing-picker-price {
    grid-column: 3;
  }

  .costing-component-row {
    grid-template-columns: 44px minmax(0, 1fr) minmax(88px, .7fr);
  }

  .costing-component-row > select,
  .costing-component-row > .button {
    grid-column: 2 / -1;
  }

  .selection-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-actions .button {
    width: 100%;
  }

  .quotation-history-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .quotation-history-card > .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .quote-selected-line {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .quote-selected-line .field {
    grid-column: 1 / -1;
  }

  .pooling-grid {
    grid-template-columns: 1fr;
  }

  .pooling-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-pooling {
    padding-left: 0;
  }

  .schedule-controls,
  .schedule-unified {
    grid-template-columns: 1fr;
  }

  .schedule-unified-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .schedule-controls {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .schedule-controls .field {
    width: 100%;
  }

  .schedule-pooling {
    min-height: 36px;
    align-items: center;
    padding-bottom: 0;
    white-space: normal;
  }

  .reminder-rule-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .reminder-rule-row > :nth-child(3),
  .reminder-rule-row > .reminder-actions {
    grid-column: 1 / -1;
  }

  .reminder-rule-row > .reminder-actions .button {
    flex: 1;
  }

  .price-review-head,
  .price-review-actions,
  .price-review-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .price-review-prices {
    grid-template-columns: 1fr;
  }

  .price-review-actions .button {
    width: 100%;
  }

  .analytics-filter label,
  .analytics-filter .button {
    width: 100%;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-card {
    min-height: 118px;
    padding: 12px;
  }

  .analytics-card strong {
    font-size: 21px;
  }

  .wecom-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-tabs,
  .finance-card-metrics,
  .finance-metrics,
  .finance-monthly-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-tabs .button:last-child,
  .finance-monthly-controls .field:first-child {
    grid-column: 1 / -1;
  }

  .finance-section-head,
  .finance-settings-card,
  .finance-customer-title,
  .finance-order-title,
  .finance-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-section-head .search-input,
  .finance-customer-filters,
  .finance-order-filters,
  .finance-customer-title select,
  .finance-detail-actions .button {
    width: 100%;
  }

  .finance-customer-filters {
    grid-template-columns: 1fr;
  }

  .finance-order-filters {
    grid-template-columns: 1fr;
  }

  .finance-record {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    padding: 0;
    place-items: end center;
  }

  .modal-dialog,
  .modal-wide {
    width: 100%;
    max-height: 94vh;
    border-radius: 17px 17px 0 0;
  }

  .modal-header,
  .modal-footer {
    padding-right: 13px;
    padding-left: 13px;
  }

  .modal-header {
    min-height: 62px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .modal-header h2 {
    min-width: 0;
    font-size: clamp(18px, 5.6vw, 23px);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .modal-header .icon-button {
    flex: 0 0 42px;
    align-self: center;
    margin: 0;
  }

  .modal-body {
    padding: 13px;
  }

  .modal-footer .button {
    flex: 1;
  }

  .shipment-line,
  .schedule-row,
  .order-entry-line {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .shipment-quantity-field,
  .schedule-row .field,
  .order-entry-pricing,
  .order-entry-line .quote-preview,
  .order-entry-line > .button {
    grid-column: 1 / -1;
  }

  .order-entry-pricing {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-entry-pricing .field-label {
    min-height: 32px;
  }

  .order-entry-line .quote-preview {
    justify-items: start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .customer-choice-row {
    grid-template-columns: 1fr;
  }

  .customer-choice-row .button {
    width: 100%;
  }

  .order-customer-results {
    max-height: min(54vh, 420px);
  }

  .order-product-option {
    grid-template-columns: 20px 50px minmax(0, 1fr);
    gap: 9px;
    padding: 9px;
  }

  .order-product-option-price {
    grid-column: 3;
    justify-items: start;
  }

  .order-picker-actions {
    align-items: stretch;
  }

  .order-picker-actions .button {
    min-width: 0;
  }

  .receiver-grid .order-entry-choice {
    grid-column: auto;
  }

  .receiver-grid .field:nth-child(3) {
    grid-column: auto;
  }

  .order-entry-terms {
    grid-template-columns: 1fr;
  }

  .batch-header {
    flex-wrap: wrap;
  }

  .batch-packaging-summary {
    flex-wrap: wrap;
  }

  .batch-packaging-actions {
    width: 100%;
  }

  .batch-packaging-actions .button {
    flex: 1;
  }

  .batch-card > .shipment-manifest-empty,
  .batch-card > .shipment-manifest-view,
  .daily-shipment-batch > .shipment-manifest-empty,
  .daily-shipment-batch > .shipment-manifest-view {
    margin-right: 9px;
    margin-left: 9px;
  }

  .shipment-manifest-editor-toolbar,
  .shipment-manifest-editor-metrics,
  .shipment-manifest-group-editor > header,
  .shipment-manifest-group-count,
  .shipment-manifest-picker-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .shipment-manifest-group-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shipment-manifest-group-actions .button,
  .shipment-manifest-editor-toolbar > .button,
  .shipment-manifest-picker-actions .button,
  .shipment-manifest-fill-remaining,
  .shipment-manifest-picker-toggle,
  .shipment-manifest-clear {
    width: 100%;
  }

  .shipment-manifest-group-count .field {
    width: 100%;
  }

  .shipment-manifest-allocation-edit {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .shipment-manifest-allocation-edit > .button {
    width: 100%;
  }

  .shipment-manifest-allocation-chip {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .shipment-manifest-allocation-chip small {
    white-space: normal;
  }

  .batch-freight {
    width: 100%;
    margin-left: 30px;
  }

  .bill-line {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .bill-line > span:nth-child(4),
  .bill-line > strong {
    display: none;
  }

  .image-preview {
    padding: 16px;
  }

  .image-preview img {
    max-width: 94vw;
    max-height: 88vh;
  }
}

@media (max-width: 620px) {
  .login-screen {
    padding: 0;
    place-items: stretch;
    background: #fff;
  }

  .login-card {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 28px 22px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-brand {
    grid-column: 1;
  }

  .login-intro {
    grid-row: auto;
    padding: 35px 0 20px;
  }

  .login-intro h2 {
    font-size: 42px;
  }

  .header-user {
    display: none;
  }

  .header-logout {
    padding-right: 8px;
    padding-left: 8px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .search-with-clear {
    flex: 0 0 auto;
    width: 100%;
  }

  .toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .search-input {
    flex-basis: auto;
  }

  .customer-grid {
    grid-template-columns: 1fr;
  }

  .shipment-photo {
    width: 76px;
    height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-shell,
  .toast-region,
  .modal-header,
  .modal-footer {
    display: none !important;
  }

  body.modal-open .modal-overlay {
    position: static;
    display: block;
    padding: 0;
    background: #fff;
  }

  body.modal-open .modal-dialog {
    display: block;
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  body.modal-open .modal-body {
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .quotation-document {
    min-width: 0;
  }

  .quotation-preview-row {
    font-size: 9px;
  }

  .quotation-preview-components {
    grid-template-columns: 34px minmax(120px, 1.2fr) 84px 60px 42px 64px 74px;
  }

  .quotation-preview-finished {
    grid-template-columns: 34px minmax(120px, 1.2fr) 84px 60px 42px 64px 74px;
  }

  .quotation-preview-components.quotation-columns-8 {
    grid-template-columns: 34px 88px minmax(100px, 1fr) 78px 52px 42px 54px 54px;
  }

  .quotation-preview-finished.quotation-columns-6 {
    grid-template-columns: 112px 82px 52px 42px 56px minmax(74px, 1fr);
  }

  .quotation-preview-row > * {
    min-height: 44px;
    padding: 5px;
  }

  .zoomable-image {
    cursor: default;
  }
}

.pooling-flow,
.pooling-stage-section,
.pooling-line-list,
.pooling-batch-lines {
  display: grid;
  gap: 12px;
}

.pooling-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.pooling-summary > * {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.pooling-stage-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.pooling-stage-heading h2,
.pooling-stage-heading p {
  margin: 0;
}

.pooling-stage-heading p {
  margin-top: 4px;
  color: var(--muted);
}

.pooling-line-card,
.pooling-batch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pooling-line-main,
.pooling-batch-line > span {
  display: grid;
  gap: 3px;
}

.pooling-line-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pooling-card-ready {
  border-color: #c53d34;
  box-shadow: 0 0 0 2px rgb(197 61 52 / 10%);
}

.pooling-lines-details {
  margin-top: 12px;
}

.pooling-lines-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}

.pooling-batch-lines {
  margin: 10px 0;
}

.pooling-batch-line {
  justify-content: flex-start;
}

.pooling-batch-line input {
  width: 20px;
  height: 20px;
}

.customer-record-panel,
.customer-record-form,
.customer-record-form section,
.price-exception-list,
.price-exception-editor {
  display: grid;
  gap: 12px;
}

.customer-record-form section,
.price-exception-editor {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.customer-record-form h3,
.price-exception-editor h3,
.price-exception-editor p {
  margin: 0;
}

.price-exception-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.price-exception-card > div {
  display: grid;
  gap: 3px;
}

.price-exception-card.is-retired {
  opacity: .64;
  background: var(--surface-soft);
}

.store-spot-toolbar {
  margin-bottom: 16px;
}

.store-spot-toolbar .result-hint {
  flex: 0 0 auto;
  white-space: nowrap;
}

.store-spot-list {
  display: grid;
  gap: 14px;
}

.store-spot-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.store-spot-card-header,
.store-spot-title-row,
.store-spot-card-actions,
.store-spot-notes {
  display: flex;
  align-items: center;
  gap: 9px;
}

.store-spot-card-header {
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
}

.store-spot-card-header > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.store-spot-title-row strong {
  font-size: 18px;
}

.store-spot-metrics {
  padding: 12px 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.store-spot-lines,
.store-spot-edit-lines {
  display: grid;
}

.store-spot-line {
  display: grid;
  grid-template-columns: 56px minmax(220px, 1fr) minmax(90px, auto) minmax(190px, auto);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
}

.store-spot-line-image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.store-spot-line-product,
.store-spot-notes {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.store-spot-line-product strong {
  overflow-wrap: anywhere;
}

.store-spot-line-quantity,
.store-spot-line-price {
  white-space: nowrap;
  text-align: right;
}

.store-spot-lock-note,
.store-spot-cash-note {
  margin: 0 16px 10px;
  padding: 8px 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: 13px;
}

.store-spot-cash-note {
  color: var(--red);
  background: var(--red-bg);
}

.store-spot-notes {
  align-items: start;
  padding: 10px 16px;
  color: var(--ink-soft);
  background: var(--canvas);
  border-top: 1px dashed var(--line);
  font-size: 13px;
}

.store-spot-edit-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.store-spot-edit-line {
  display: grid;
  grid-template-columns: 56px minmax(180px, 1fr) minmax(120px, 170px) minmax(120px, 170px) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.store-spot-product-results {
  max-height: 246px;
  overflow-y: auto;
}

.store-spot-product-option {
  grid-template-columns: 54px minmax(0, 1fr);
}

.store-spot-line-remove {
  align-self: end;
  margin-bottom: 1px;
}

.store-spot-edit-product {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.store-spot-edit-line .field-label {
  font-size: 12px;
}

.store-spot-cash-metrics {
  grid-template-columns: 1fr;
}

@media (max-width: 720px) {
  .pooling-line-card {
    align-items: stretch;
    flex-direction: column;
  }

  .pooling-line-actions {
    justify-content: stretch;
  }

  .pooling-line-actions .button {
    flex: 1 1 140px;
  }

  .store-spot-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .store-spot-toolbar .search-input {
    grid-column: 1 / -1;
    width: 100%;
  }

  .store-spot-card-header {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .store-spot-card-actions,
  .store-spot-card-actions .button {
    width: 100%;
  }

  .store-spot-card-actions .button {
    flex: 1;
  }

  .store-spot-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 12px;
  }

  .store-spot-line {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 12px;
  }

  .store-spot-line-image {
    width: 52px;
    height: 52px;
  }

  .store-spot-line-price {
    grid-column: 2 / -1;
    text-align: left;
    color: var(--ink-soft);
    font-size: 13px;
  }

  .store-spot-lock-note,
  .store-spot-cash-note {
    margin-right: 12px;
    margin-left: 12px;
  }

  .store-spot-edit-line {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px 10px;
  }

  .store-spot-edit-line > .field {
    min-width: 0;
  }

  .store-spot-edit-line > .field:nth-last-child(-n + 2) {
    grid-column: auto;
  }

  .store-spot-line-remove {
    grid-column: 1 / -1;
    width: 100%;
  }

  .store-spot-product-option {
    grid-template-columns: 50px minmax(0, 1fr);
  }
}
