﻿:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #dde2ea;
  --text: #1f2937;
  --muted: #667085;
  --blue: #2563eb;
  --green: #0f9f6e;
  --orange: #d97706;
  --red: #dc2626;
}

.factory-catalog-review {
  border-left: 4px solid #d88924;
}

.factory-catalog-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.factory-catalog-actions-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line, #d9dee7);
  border-radius: 10px;
  background: var(--panel, #fff);
}

.factory-catalog-actions-grid select,
.factory-catalog-actions-grid input,
.factory-catalog-actions-grid button {
  width: 100%;
  margin-top: 8px;
}

.factory-identity-alerts {
  border-color: #b45309;
  background: #fff7ed;
}

.factory-identity-alert-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.factory-identity-alert-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #ffffff;
}

.factory-identity-alert-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px 12px;
  align-items: start;
  margin-bottom: 10px;
}

.factory-identity-alert-head strong,
.factory-identity-alert-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.factory-identity-candidate-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.factory-identity-candidate-row select,
.factory-identity-reason-row input {
  width: 100%;
  min-width: 0;
}

.factory-identity-reason-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.danger-text {
  color: #b91c1c;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .factory-catalog-actions-grid {
    grid-template-columns: 1fr;
  }

  .factory-catalog-review {
    box-sizing: border-box;
    width: calc(100vw - 54px);
    max-width: calc(100vw - 54px);
  }

  .factory-identity-alert-list,
  .factory-identity-alert-head,
  .factory-identity-candidate-row,
  .factory-identity-reason-row {
    grid-template-columns: 1fr;
  }

  .quick-stock-row {
    grid-template-columns: 1fr;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: #172033;
  padding: 22px 14px;
  color: white;
  overflow-y: auto;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  margin: 2px 10px 22px;
  white-space: nowrap;
}
.nav {
  display: block;
  width: 100%;
  min-height: 46px;
  margin: 5px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d7deea;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.nav.active, .nav:hover { background: #26354f; color: white; }

main { margin-left: 250px; min-height: 100vh; min-width: 980px; }
header {
  min-height: 82px;
  height: auto;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
}
h1 { margin: 0 0 6px; font-size: 22px; }
p { margin: 0; color: var(--muted); }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; align-items: center; }
.boss-mode-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid #d9e2ef;
  border-radius: 6px;
  background: #f8fafc;
}
.boss-mode-panel select,
.boss-mode-panel input {
  min-height: 32px;
  height: 32px;
  padding: 0 8px;
}
.boss-mode-panel input {
  width: 136px;
}
.boss-mode-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.boss-mode-status.view {
  color: #1d4ed8;
  background: #dbeafe;
}
.boss-mode-status.acting {
  color: #9a3412;
  background: #ffedd5;
}
.user-label {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.date-picker-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.header-actions .date-text {
  width: 142px;
  padding-right: 36px;
}
.date-native {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 30px;
  min-height: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
.date-sep { color: var(--muted); }

button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
}
button.primary { background: var(--blue); color: white; border-color: var(--blue); }
button.important-action {
  background: #fff7ed;
  color: #9a3412;
  border-color: #f59e0b;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .14);
}
button.danger { color: var(--red); }
button.good { color: var(--green); }
button.warn { color: var(--orange); }
.danger { color: var(--red); }
.good { color: var(--green); }
button:disabled { opacity: .5; cursor: not-allowed; }

.view {
  display: none;
  padding: 22px 24px 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}
.view.active { display: block; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(620px, 1fr)); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.panel h2 { margin: 0 0 14px; font-size: 17px; }

body.yiwu-receipt-view-active main { min-width: 0; }
body.yiwu-receipt-view-active #yiwuWarehouse { overflow-x: hidden; }
.yiwu-receipt-panel {
  width: 100%;
  min-width: 0;
  margin-top: 16px;
  overflow: hidden;
}
.yiwu-receipt-table { table-layout: fixed; }
.yiwu-receipt-table th:nth-child(1) { width: 25%; }
.yiwu-receipt-table th:nth-child(2) { width: 18%; }
.yiwu-receipt-table th:nth-child(3) { width: 27%; }
.yiwu-receipt-table th:nth-child(4) { width: 30%; }
.yiwu-receipt-table th,
.yiwu-receipt-table td {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.form-row.yiwu-receipt-line { grid-template-columns: minmax(0, 1fr); }
.yiwu-receipt-line input { width: 100%; min-width: 0; }
.yiwu-receipt-actions { margin-top: 10px; }

@media (max-width: 1180px) {
  .yiwu-receipt-table,
  .yiwu-receipt-table tbody {
    display: block;
    width: 100%;
  }
  .yiwu-receipt-table thead { display: none; }
  .yiwu-receipt-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
  }
  .yiwu-receipt-table tbody td {
    display: block;
    min-width: 0;
    white-space: normal;
    border-bottom: 1px solid var(--line);
  }
  .yiwu-receipt-table tbody td:nth-child(4) { grid-column: 1 / -1; }
  .yiwu-receipt-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-weight: 700;
  }
}

@media (max-width: 720px) {
  .yiwu-receipt-table tbody tr { grid-template-columns: minmax(0, 1fr); }
  .yiwu-receipt-table tbody td:nth-child(4) { grid-column: auto; }
  .yiwu-receipt-actions button { flex: 1 1 140px; }
}

.delivery-item-list {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}
.delivery-item-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}
.delivery-item-card:focus-within {
  position: relative;
  z-index: 120;
}
.delivery-print-fields {
  grid-column: span 3;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}
.delivery-item-head,
.delivery-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.delivery-action-row {
  justify-content: flex-start;
  margin-top: 12px;
}
.delivery-rule-hint {
  margin: 8px 0 10px;
}
.delivery-consumption-editor {
  overflow: visible;
  position: relative;
  z-index: 20;
}
.delivery-consumption-editor:focus-within {
  z-index: 220;
}
.delivery-consumption-row {
  display: grid;
  grid-template-columns: 150px minmax(360px, 1fr) 120px 56px;
  gap: 8px;
  align-items: start;
  width: 100%;
  margin: 8px 0;
}
.delivery-consumption-row .consumption-kind,
.delivery-consumption-row .consumption-qty,
.delivery-consumption-row button {
  width: 100%;
  min-width: 0;
}
.delivery-consumption-row .dynamic-name-picker {
  width: 100%;
  min-width: 0;
}
.delivery-consumption-row .consumption-name {
  width: 100%;
  min-width: 0;
}
.delivery-consumption-row .consumption-qty {
  text-align: right;
}
.line-inventory-pick-status,
.consumption-identity-status {
  grid-column: 1 / -1;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}
.line-inventory-pick-status.ok,
.consumption-identity-status.ok {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.line-inventory-pick-status.warn,
.consumption-identity-status.warn {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.delivery-consumption-editor .dynamic-name-options {
  max-height: 220px;
}
.dynamic-name-picker {
  position: relative;
  width: min(520px, 100%);
}
.dynamic-name-picker:focus-within {
  z-index: 140;
}
.dynamic-name-picker > input {
  width: 100%;
}
.dynamic-name-options {
  position: absolute;
  z-index: 160;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
  pointer-events: auto;
  touch-action: pan-y;
}
.dynamic-name-options[hidden] {
  display: none;
}
.dynamic-name-options button {
  display: block;
  width: 100%;
  height: auto;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-radius: 4px;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: rgba(37, 99, 235, .12);
}
.dynamic-name-options button:hover,
.dynamic-name-options button.active {
  color: #1746a2;
  background: #eaf1ff;
}
.dynamic-name-hint {
  padding: 10px 12px;
  border-radius: 4px;
  line-height: 1.45;
  color: #475569;
}
.dynamic-name-hint.blocked {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.finish-allocation-editor {
  display: grid;
  gap: 8px;
  min-width: 440px;
}
.finish-allocation-row {
  display: grid;
  grid-template-columns: 150px 90px 120px minmax(160px, 1fr) 56px;
  gap: 8px;
  align-items: center;
}
.finish-transfer-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(280px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 6px;
}
.finish-customer-temp-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 100px minmax(220px, 320px) minmax(260px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  border-radius: 6px;
}
.customer-temp-panel {
  border: 2px solid #a7f3d0;
  background: linear-gradient(180deg, #f0fdf9 0, #fff 180px);
}
.customer-temp-operation {
  margin: 12px 0 16px;
  border-color: #6ee7b7;
}
.simple-customer-inventory-toolbar {
  margin: 4px 0 14px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.simple-customer-inventory-toolbar .section-head {
  margin-bottom: 10px;
}
.simple-customer-inventory-toolbar h3 {
  margin: 0 0 4px;
}
.simple-customer-search-row {
  width: 100%;
}
.simple-customer-search-row .search-control {
  max-width: 680px;
}
.simple-customer-search-input {
  min-width: 0;
  width: 100%;
}
.simple-customer-inventory-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: #475569;
  font-size: 13px;
}
.simple-customer-inventory-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #fff;
  line-height: 1.3;
}
.simple-customer-group-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.simple-customer-group-card {
  margin: 0;
}
.simple-customer-group-card > summary {
  align-items: flex-start;
  padding-top: 11px;
  padding-bottom: 11px;
}
.simple-customer-group-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.simple-customer-group-name {
  display: inline-block;
  max-width: 100%;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.simple-customer-group-card .fold-panel-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 55%;
  line-height: 1.45;
  text-align: right;
  white-space: normal;
}
.simple-customer-group-subline {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}
.simple-customer-empty-warning {
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
  font-weight: 800;
  line-height: 1.45;
}
.blank-customer-group {
  border-color: #fca5a5;
  background: #fffafa;
}
.simple-customer-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.simple-customer-inventory-table {
  min-width: 1080px;
  table-layout: fixed;
}
.simple-customer-inventory-table th:nth-child(1) { width: 130px; }
.simple-customer-inventory-table th:nth-child(2) { width: 220px; }
.simple-customer-inventory-table th:nth-child(3) { width: 170px; }
.simple-customer-inventory-table th:nth-child(4) { width: 130px; }
.simple-customer-inventory-table th:nth-child(5) { width: 230px; }
.simple-customer-inventory-table th:nth-child(6) { width: 260px; }
.simple-customer-inventory-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.simple-customer-inventory-actions button {
  min-height: 34px;
  white-space: normal;
  line-height: 1.25;
}
.finish-target-link {
  display: grid;
  gap: 6px;
}
.finish-link-notice {
  color: #9a3412;
  font-weight: 700;
}
.finish-allocation-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qty-mismatch-box {
  border: 1px solid #f59e0b;
  background: #fff7ed;
  border-radius: 8px;
  padding: 12px;
}
.qty-mismatch-box strong {
  display: block;
  color: #9a3412;
  margin-bottom: 6px;
}
.qty-mismatch-box p {
  margin: 6px 0;
}
.qty-mismatch-box select {
  width: 100%;
  height: 40px;
  margin-top: 6px;
}
.qty-mismatch-box.blocked {
  border-color: #fca5a5;
  background: #fff1f2;
}

.barcode-library-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 16px;
}
.barcode-library-list .search-input {
  width: 100%;
  margin-bottom: 12px;
}
.barcode-result-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 4px;
}
.barcode-result-item {
  height: auto;
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border-color: #d9e2ef;
  background: #fff;
  padding: 10px 12px;
}
.barcode-result-item.active {
  border-color: var(--blue);
  background: #eef4ff;
  box-shadow: inset 4px 0 0 var(--blue);
}
.barcode-result-name {
  font-weight: 700;
  line-height: 1.35;
}
.barcode-result-sku {
  color: var(--muted);
  font-family: Arial, sans-serif;
  white-space: nowrap;
}
.barcode-empty,
.barcode-preview-empty {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.barcode-preview-wrap {
  display: grid;
  gap: 14px;
}
.barcode-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.single-barcode-card {
  background: white;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 28px;
  min-height: 320px;
  display: grid;
  align-content: center;
  gap: 14px;
}
.single-barcode-name {
  color: #111827;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
}
.single-barcode-sku {
  color: #475569;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
}
.single-barcode-card .barcode-svg {
  width: 100%;
  height: 118px;
  fill: #111;
}
.fold-panel {
  padding: 0;
  overflow: hidden;
}
.fold-panel + .fold-panel {
  margin-top: 12px;
}
.grid + .fold-panel { margin-top: 16px; }
.fold-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
}
.fold-panel > summary::-webkit-details-marker {
  display: none;
}
.fold-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.fold-arrow::before {
  content: ">";
  color: var(--muted);
  font-weight: 900;
}
.fold-panel[open] .fold-arrow::before {
  content: "v";
}
.fold-panel-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.todo-attention,
.todo-attention .tag {
  color: #b91c1c !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  line-height: 1.25;
}
.todo-attention .tag {
  border-color: #fecaca !important;
  background: #fff1f2 !important;
}
.fold-panel-meta.todo-watch-only,
.fold-panel-meta.todo-watch-only .tag {
  color: var(--muted) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  background: transparent !important;
  border-color: transparent !important;
}
.metric-card.todo-card-attention {
  border-color: #fca5a5;
  background: #fff7f7;
}
.metric-card.todo-card-attention .metric {
  color: #b91c1c;
  font-size: 38px;
  font-weight: 900;
}
.metric-card.todo-card-watch-only {
  border-color: var(--border);
  background: #fff;
}
.metric-card.todo-card-watch-only .metric {
  color: var(--muted);
  font-size: 24px;
  font-weight: 600;
}
.business-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.business-card-title {
  display: block;
  flex: 1 1 220px;
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.business-task-action {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid #fdba74;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.business-task-action.red {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
}
.business-task-action.green {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}
.business-secondary-info {
  display: inline-block;
  max-width: 100%;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.business-destination {
  display: inline-block;
  margin-top: 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.business-document-reference {
  display: inline-block;
  max-width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
.fold-panel-body {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}
.operation-history-panel {
  margin-top: 16px;
}
.operation-history-table-wrap {
  overflow-x: auto;
}
.operation-history-table-wrap table {
  min-width: 980px;
}
.operation-history-table-wrap td:nth-child(4) {
  min-width: 360px;
  line-height: 1.65;
}
.metric { font-size: 28px; font-weight: 700; margin-top: 8px; }
.metric-card {
  text-align: left;
  color: inherit;
  min-height: 116px;
}
.metric-card:hover {
  border-color: var(--blue);
  box-shadow: 0 8px 22px rgba(37, 99, 235, .12);
}
.metric-card span {
  display: inline-block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 13px;
}
.section-jump-highlight {
  scroll-margin-top: 18px;
  animation: sectionJumpHighlight 1.8s ease;
}
@keyframes sectionJumpHighlight {
  0% {
    outline: 3px solid rgba(37, 99, 235, .35);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, .12);
  }
  100% {
    outline: 0 solid rgba(37, 99, 235, 0);
    box-shadow: none;
  }
}

.form-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.form-row.two { grid-template-columns: repeat(2, 1fr); }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { margin: 0; }
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-edit {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr) minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 680px;
}
.empty-line {
  padding: 18px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.tracking-list {
  display: grid;
  gap: 20px;
}
.tracking-customer-filter {
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}
.tracking-customer-filter-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tracking-customer-filter-head > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}
.tracking-customer-search {
  width: min(380px, 100%);
  min-width: 220px;
}
.tracking-customer-filter-results {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}
.tracking-customer-filter button {
  flex: 0 0 auto;
  min-height: 34px;
  white-space: nowrap;
}
.tracking-customer-filter button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.tracking-customer-filter-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.tracking-customer-filter-empty {
  color: var(--muted);
  font-size: 13px;
}
.tracking-create-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
}
.tracking-create-items-head span { margin-left: 10px; }
.tracking-create-items {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.tracking-create-item {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) 130px minmax(180px, 1fr) minmax(210px, 1.2fr) minmax(210px, 1.2fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
}
.tracking-create-remove { white-space: nowrap; }
.tracking-card {
  display: grid;
  grid-template-columns: minmax(300px, 1.25fr) minmax(260px, 1fr) 260px 230px;
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.tracking-card.urgent {
  border-color: #f5c2c2;
  background: #fffafa;
}
.tracking-card.tracking-alert-orange {
  border-left: 5px solid #f59e0b;
}
.tracking-card.tracking-alert-red {
  border-left: 5px solid #dc2626;
  background: #fff7f7;
}
.tracking-deadline-alert {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}
.tracking-deadline-alert.orange {
  color: #9a5800;
  background: #fff1d6;
}
.tracking-deadline-alert.red {
  color: #b91c1c;
  background: #fee2e2;
}
.tracking-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tracking-id {
  font-size: 15px;
}
.tracking-customer-name {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}
button.tracking-customer-name {
  cursor: pointer;
}
button.tracking-customer-name:hover {
  color: var(--blue);
  text-decoration: underline;
}
.tracking-customer-empty {
  color: var(--muted);
  font-size: 17px;
}
.tracking-product {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}
.tracking-item-list {
  display: grid;
  gap: 8px;
}
.tracking-item-view {
  padding: 9px;
  border: 1px solid #dbe5f3;
  border-radius: 6px;
  background: #f8fbff;
}
.tracking-item-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.tracking-item-text {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.tracking-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.tracking-meta span {
  background: #f6f8fb;
  border: 1px solid #e8edf4;
  border-radius: 999px;
  padding: 2px 8px;
}
.tracking-image-upload {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}
.tracking-attachment-fold {
  margin-top: 10px;
}
.tracking-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tracking-thumb {
  position: relative;
  display: block;
  width: 84px;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f6f8fb;
}
.tracking-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tracking-thumb button {
  position: absolute;
  right: 4px;
  top: 4px;
  min-width: 0;
  height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(220, 38, 38, .92);
  color: white;
  border-color: transparent;
}
.tracking-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.tracking-progress div {
  border: 1px solid #e8edf4;
  border-radius: 6px;
  background: #fbfcff;
  padding: 7px 9px;
}
.tracking-progress span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.tracking-progress strong {
  font-size: 18px;
}
.board-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.board-toolbar select {
  width: auto;
  min-width: 150px;
}
.production-alert {
  border: 1px solid #f5c2c2;
  background: #fffafa;
  color: var(--red);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.production-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 12px;
}
.production-grid.compact {
  grid-template-columns: repeat(3, minmax(280px, 1fr));
}
.production-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.production-card.problem {
  border-color: #f5c2c2;
  background: #fffafa;
}
.production-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.production-card-head strong {
  font-size: 16px;
}
.production-product {
  font-size: 20px;
  font-weight: 700;
  margin: 10px 0;
}
.production-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.production-numbers div {
  border: 1px solid #e8edf4;
  background: #fbfcff;
  border-radius: 6px;
  padding: 8px 10px;
}
.production-numbers span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.production-numbers strong {
  font-size: 20px;
}
.progress-line {
  height: 8px;
  background: #edf1f7;
  border-radius: 99px;
  margin: 12px 0 8px;
  overflow: hidden;
}
.progress-line span {
  display: block;
  height: 100%;
  background: var(--blue);
}
.production-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.production-note {
  margin-top: 8px;
  color: var(--text);
}
.production-edit {
  display: grid;
  grid-template-columns: 110px 120px auto;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.production-line-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 140px 150px 44px;
  gap: 8px;
  margin-bottom: 8px;
}
.production-lines {
  margin-top: 10px;
}
.production-lines summary {
  cursor: pointer;
  color: var(--blue);
  margin-bottom: 8px;
}
.production-line-view {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 120px 120px;
  gap: 8px;
  align-items: center;
  border: 1px solid #e8edf4;
  background: #fbfcff;
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 6px;
}
.production-line-view em {
  font-style: normal;
  color: var(--muted);
}
.production-line-view b {
  color: var(--orange);
}
.shipment-details {
  margin: 8px 0;
  font-size: 13px;
}
.shipment-details summary {
  color: var(--blue);
  cursor: pointer;
}
.shipment-list {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}
.shipment-list div {
  display: grid;
  grid-template-columns: 90px 150px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid #e8edf4;
  border-radius: 6px;
  background: #fbfcff;
}
.shipment-list span {
  color: var(--muted);
}
.shipment-list em {
  color: var(--muted);
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qty-pill {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 700;
}
.tracking-problem {
  border-left: 3px solid #e5e7eb;
  padding-left: 12px;
}
.tracking-problem label {
  margin: 0 0 3px;
}
.tracking-problem p {
  color: var(--text);
  line-height: 1.45;
  margin: 0 0 10px;
}
.tracking-log-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e8edf4;
}
.tracking-log-head,
.tracking-log-item > div {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.tracking-log-head {
  justify-content: space-between;
  margin-bottom: 7px;
}
.tracking-log-head label { margin: 0; }
.tracking-log-item {
  padding: 8px 9px;
  border: 1px solid #dbe5f3;
  border-radius: 6px;
  background: #f8fbff;
}
.tracking-log-item + .tracking-log-item { margin-top: 6px; }
.tracking-log-item > div span,
.tracking-log-item > div em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.tracking-log-item p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tracking-log-empty {
  padding: 8px 9px;
  color: var(--muted) !important;
  background: #f8fafc;
  border-radius: 6px;
}
.tracking-log-history { margin-top: 7px; }
.tracking-log-history summary {
  color: var(--blue);
  cursor: pointer;
  margin-bottom: 6px;
}
.tracking-plan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tracking-plan div {
  padding: 7px 9px;
  border: 1px solid #e8edf4;
  border-radius: 6px;
  background: #fbfcff;
}
.tracking-plan span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}
.tracking-plan strong {
  font-size: 13px;
}
.tracking-operate {
  display: flex;
  align-items: stretch;
}
.tracking-edit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}
.tracking-edit textarea {
  width: 100%;
  min-height: 66px;
  resize: vertical;
}
.tracking-item-actions {
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.tracking-item-action {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #dbe5f3;
  border-radius: 6px;
  background: #f8fbff;
}
.tracking-progress-save {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}
.tracking-quantity-adjust {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.tracking-quantity-history {
  margin-top: 7px;
}
.tracking-quantity-history summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
}
.tracking-quantity-history > div {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}
.tracking-quantity-history-row {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid #dbe5f3;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}
.tracking-quantity-history-row span {
  color: var(--text);
}
.tracking-quantity-history-row em {
  color: var(--muted);
  font-style: normal;
}
.tracking-add-item {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
}
.tracking-add-item summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
}
.tracking-add-item[open] {
  display: grid;
  gap: 6px;
}
.tracking-add-item[open] summary {
  margin-bottom: 2px;
}
.mini-label {
  margin: 2px 0 -4px;
  color: var(--muted);
  font-size: 12px;
}
.ship-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.tracking-list-compact .tracking-card {
  grid-template-columns: minmax(280px, 1.3fr) minmax(220px, 1fr) 230px;
}
.tracking-list-compact .tracking-operate {
  display: none;
}
.inline-actions input[type="date"] { width: 150px; }
.search-input { width: min(360px, 100%); }
.inventory-actions {
  flex: 1;
  justify-content: flex-end;
}
.inventory-actions .search-input {
  flex: 1;
  max-width: 520px;
}
.stock-warning-row td {
  background: #fff1f2;
}
.stock-qty-td {
  min-width: 128px;
}
.stock-qty-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 104px;
  padding: 5px 8px;
  border: 1px solid #d7e1ea;
  border-radius: 6px;
  background: #f8fafc;
  white-space: nowrap;
}
.stock-qty-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
}
.stock-qty-value,
.stock-qty-zero {
  display: block;
  line-height: 1.2;
}
.stock-qty-zero {
  color: #b91c1c;
}
.stock-qty-empty {
  border-color: #fecdd3;
  background: #fff7f7;
}
.stock-warning-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 130px;
}
.stock-warning-control input {
  width: 82px;
  height: 34px;
  text-align: right;
}
.warning-filter-active {
  border-color: #dc2626;
  background: #fee2e2;
  color: #b91c1c !important;
  font-weight: 800;
}
.part-warehouse-stock-panel {
  min-height: 260px;
}
.part-stock-name {
  font-weight: 700;
  color: #0f172a;
}
.part-note-input {
  width: min(360px, 100%);
  height: 28px;
  margin-top: 5px;
  padding: 3px 6px;
  border: 1px solid #dbe4f0;
  border-radius: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
  background: rgba(255, 255, 255, .72);
}
.part-note-input:focus {
  border-color: var(--blue);
  background: #fff;
}
.part-row-action-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.stock-row-mini-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.stock-row-mini-actions button {
  min-width: 72px;
  padding: 7px 10px;
}
.inventory-binding-details {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.inventory-binding-details > summary {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.inventory-binding-details > summary::-webkit-details-marker {
  display: none;
}
.inventory-binding-details > summary::before {
  content: ">";
  margin-right: 5px;
  color: #64748b;
  font-weight: 900;
}
.inventory-binding-details[open] > summary::before {
  content: "v";
}
.inventory-binding-details > div {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  line-height: 1.45;
}
.inventory-binding-details .tag {
  justify-self: start;
}
.quick-stock-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(120px, .8fr) minmax(120px, .6fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 10px 0 14px;
}
.quick-stock-row input {
  min-width: 0;
}
.inline-save-btn {
  display: none;
  border-color: #fb923c;
  background: #fff7ed;
  color: #c2410c !important;
  font-weight: 800;
}
.part-row-form {
  margin: 8px 0;
}
.part-usage-mini {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}
details.part-usage-mini > summary {
  cursor: pointer;
  list-style: none;
}
details.part-usage-mini > summary::-webkit-details-marker {
  display: none;
}
details.part-usage-mini > summary::after {
  content: " 查看";
  color: #2563eb;
  font-weight: 700;
}
details.part-usage-mini[open] > summary::after {
  content: " 收起";
}
details.part-usage-mini > div {
  margin-top: 4px;
  color: #475569;
}
.stock-group-row td {
  background: #f8fafc;
  border-top: 1px solid #dbe4f0;
  cursor: pointer;
  padding-top: 10px;
  padding-bottom: 10px;
}
.stock-group-row:hover td {
  background: #eef4ff;
}
.stock-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #0f172a;
}
.stock-group-arrow {
  width: 18px;
  color: var(--muted);
  font-weight: 900;
}

.inventory-display-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 10px;
}

.inventory-display-toolbar.editing {
  display: block;
  padding: 10px 12px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
}

.inventory-display-toolbar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-display-toolbar-main select {
  width: auto;
  min-width: 160px;
}

.inventory-display-toolbar p {
  margin: 7px 0 0;
}

.inventory-display-blocked {
  color: #b45309;
  font-weight: 700;
}

.inventory-display-item-tools,
.inventory-display-group-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 7px;
  vertical-align: middle;
}

.inventory-display-item-tools input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.inventory-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #93c5fd;
  border-radius: 5px;
  background: #fff;
  color: #1d4ed8;
  cursor: grab;
  font-size: 18px;
  line-height: 1;
  user-select: none;
  touch-action: none;
}

.inventory-drag-handle:active { cursor: grabbing; }
.inventory-drag-handle.disabled {
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  background: #f8fafc;
}

.inventory-display-kind {
  font-weight: 600;
}

.stock-group-row[dragover] td,
[data-inventory-display-item-row="true"][dragover] td {
  box-shadow: inset 0 2px #2563eb;
}

@media (max-width: 720px) {
  .inventory-display-toolbar { justify-content: stretch; }
  .inventory-display-toolbar > button { width: 100%; }
  .inventory-display-toolbar-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .inventory-display-toolbar-main strong,
  .inventory-display-toolbar-main .tag,
  .inventory-display-toolbar-main select {
    grid-column: 1 / -1;
  }
  .inventory-display-toolbar-main select,
  .inventory-display-toolbar-main button { width: 100%; }
  .inventory-display-item-tools,
  .inventory-display-group-tools { gap: 4px; margin-right: 4px; }
  .inventory-drag-handle { width: 32px; height: 32px; }
  .inventory-display-kind { display: none; }
}

.quantity-display {
  white-space: nowrap;
}

.quantity-input-hint {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}
.stock-child-row td:first-child {
  padding-left: 30px;
  color: #334155;
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  font: inherit;
  background: white;
}
.date-picker-wrap .date-native {
  width: 30px !important;
  min-width: 30px !important;
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 !important;
  border: 0 !important;
  color: transparent !important;
}
.date-native::-webkit-datetime-edit,
.date-native::-webkit-date-and-time-value {
  display: none;
}
.date-native::-webkit-calendar-picker-indicator {
  cursor: pointer;
}
textarea { min-height: 68px; resize: vertical; }

table { width: 100%; border-collapse: collapse; background: white; table-layout: auto; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; word-break: keep-all; overflow-wrap: normal; }
th { color: var(--muted); font-weight: 600; background: #f8fafc; }
.compact td, .compact th { padding: 7px 8px; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #edf2ff;
  color: #274690;
  font-size: 12px;
  margin: 0 4px 4px 0;
}
.part-list {
  display: grid;
  gap: 6px;
  min-width: 260px;
}
.part-line {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(104px, auto);
  align-items: center;
  gap: 12px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #e7ebf2;
  border-radius: 6px;
  background: #fbfcff;
}
.part-line-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.part-line-name small {
  display: block;
  margin-top: 2px;
  white-space: normal;
}
.line-note {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
}
.note-chain {
  margin-top: 8px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #f8fafc;
}
.note-chain > summary {
  cursor: pointer;
  padding: 8px 10px;
  color: #334155;
  font-weight: 700;
}
.note-chain-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}
.note-chain-event {
  border-left: 3px solid #94a3b8;
  background: #fff;
  padding: 10px 12px;
  border-radius: 8px;
}
.note-chain-system {
  border-left-color: #f59e0b;
}
.note-chain-role {
  display: inline-flex;
  align-items: center;
  min-width: 52px;
  color: #1e3a8a;
  font-weight: 800;
}
.note-chain-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}
.note-chain-text {
  margin-top: 4px;
  color: #1e293b;
  line-height: 1.65;
  word-break: break-word;
}
.note-chain-stage {
  color: #64748b;
}
.issue-source-note {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border: 1px solid #f6c76b;
  border-radius: 8px;
  background: #fff8e6;
  color: #8a4b0b;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.issue-source-note strong {
  color: #7a3a00;
  font-weight: 900;
}
.retail-summary-table .retail-product-name {
  display: block;
  max-width: min(680px, 62vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.retail-summary-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.retail-summary-foot button {
  padding: 6px 12px;
  border-radius: 8px;
}
.part-line-qty {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 96px;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.part-pill {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(108px, auto);
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 520px;
  margin: 0 0 6px;
  padding: 5px 8px;
  border: 1px solid #e7ebf2;
  border-radius: 6px;
  background: #fbfcff;
}
.part-pill strong {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 96px;
  color: #1d4ed8;
  background: #eef4ff;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tag.green { background: #e9f8f1; color: var(--green); }
.tag.orange { background: #fff3df; color: var(--orange); }
.tag.red { background: #feecec; color: var(--red); }
.muted { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.workflow-withdraw-action {
  min-height: 38px;
  white-space: normal;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .actions .workflow-withdraw-action,
  .history-item .workflow-withdraw-action {
    width: 100%;
    margin-top: 8px;
  }
}
.line-editor { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfcfe; overflow-x: auto; }
.line-editor.delivery-consumption-editor {
  overflow: visible;
  position: relative;
  z-index: 20;
}
.line-editor.delivery-consumption-editor:focus-within {
  z-index: 220;
}
.scan-box {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  margin: 0 0 12px;
}
.scan-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 86px;
  gap: 8px;
  margin-top: 6px;
}
.line-row {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) minmax(360px, 1fr) 120px 44px;
  gap: 8px;
  margin-bottom: 8px;
}
.line-row.delivery-line-row {
  grid-template-columns: minmax(260px, 1.1fr) minmax(260px, 1fr) 100px 120px minmax(180px, .8fr) 44px;
}
.issue-line-row {
  display: grid;
  grid-template-columns: 112px minmax(280px, 1.4fr) 90px minmax(180px, .8fr) minmax(150px, .7fr) minmax(170px, .8fr) minmax(150px, .65fr) 44px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  min-width: 1320px;
}
.issue-line-row input,
.issue-line-row select {
  min-width: 0;
}
.assembly-line-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 140px 44px;
  gap: 8px;
  margin-bottom: 8px;
}
.outbound-line-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) 100px 150px 105px 135px minmax(180px, .8fr) minmax(160px, .7fr) minmax(150px, .65fr) 44px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
  min-width: 1480px;
}
.outbound-line-row input,
.outbound-line-row select {
  min-width: 0;
}
.part-available-hint {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}
.generated-name-preview {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px dashed #9db7ea;
  border-radius: 7px;
  background: #f4f8ff;
  color: #1d4ed8;
  font-weight: 700;
}
.part-profile-editor select[multiple] {
  width: 100%;
  min-height: 172px;
}
.part-profile-spec-grid {
  margin-top: 10px;
}
.bulk-picker-options small {
  display: block;
  margin-top: 2px;
}
.factory-return-line {
  grid-template-columns: minmax(360px, 1fr) 140px 44px;
}
.factory-part-report-line {
  grid-template-columns: 96px minmax(360px, 1.5fr) 100px 70px minmax(170px, .7fr) minmax(150px, .65fr) 44px;
  align-items: center;
}
.factory-part-report-line select,
.factory-part-report-line input,
.factory-part-report-line button {
  min-width: 0;
}
.factory-report-type {
  font-weight: 700;
  padding-left: 8px;
  padding-right: 6px;
}
.factory-report-owner {
  display: none;
}
.factory-part-report-line .factory-report-type[value="temporary"] ~ .factory-report-owner,
.factory-part-report-line:has(.factory-report-type option[value="temporary"]:checked) .factory-report-owner {
  display: block;
}
.factory-report-review-line {
  grid-template-columns: minmax(180px, .9fr) 96px minmax(220px, 1.1fr) minmax(190px, .85fr) minmax(170px, .75fr) minmax(150px, .7fr);
  align-items: start;
}
.factory-report-review-qty-field {
  min-width: 0;
}
.factory-report-review-qty-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}
.factory-report-review-unit-label {
  min-width: max-content;
  padding: 6px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  white-space: nowrap;
}
.factory-report-review-qty-hint {
  display: block;
  width: 100%;
  min-height: 0;
  margin-top: 5px;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
.factory-report-quantity-total {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-variant-numeric: tabular-nums;
}
.arrival-line-head,
.arrival-line-row {
  display: grid;
  grid-template-columns: minmax(300px, 1.3fr) repeat(6, minmax(86px, .45fr)) 44px;
  gap: 8px;
  align-items: center;
}
.arrival-line-head {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
  padding: 0 4px;
}
.arrival-line-row {
  margin-bottom: 8px;
}
.split-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.split-line span {
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 700;
}
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.doc-card {
  min-width: 220px;
  display: grid;
  gap: 6px;
}
.doc-id {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.doc-meta {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 4px 8px;
  font-size: 14px;
}
.doc-label { color: var(--muted); }
.doc-value { color: var(--text); font-weight: 600; }
.pending-box {
  border: 2px solid #f59e0b;
  background: #fffbeb;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}
.pending-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  align-items: flex-start;
  font-weight: 800;
  margin-bottom: 10px;
}
.pending-title > div {
  min-width: 0;
}
.pending-title > div:first-child {
  flex: 1 1 320px;
}
.pending-title > div:not(:first-child) {
  flex: 0 0 auto;
}
.pending-meta {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}
.history-fold {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.history-fold summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}
.panel-history {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
.panel-history summary {
  color: var(--text);
  font-size: 17px;
}
.history-fold:not([open]) > :not(summary) {
  display: none;
}
.history-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.history-item {
  display: grid;
  grid-template-columns: 190px 1fr 110px;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}
.history-item.wide {
  grid-template-columns: 220px 260px 1fr;
}
.time-list {
  display: grid;
  gap: 6px;
}
.time-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.time-row strong {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.time-operator {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: normal;
}
.issue-order-table {
  min-width: 1320px;
}
.issue-order-table .part-line-qty {
  min-width: 110px;
}
.issue-pending-list {
  display: grid;
  gap: 12px;
}

.issue-pending-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.issue-pending-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.issue-pending-id {
  color: #0f172a;
  font-size: 18px;
}

.issue-pending-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 6px;
}

.issue-pending-status {
  flex: 0 0 auto;
  text-align: right;
}

.issue-pending-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.issue-pending-meta-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.issue-pending-meta-grid span,
.issue-pending-detail > span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.issue-pending-meta-grid strong,
.issue-pending-meta-grid small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.issue-pending-meta-grid small {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.issue-pending-detail {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}

.issue-pending-detail .part-line {
  grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
}

.issue-pending-detail .part-line-name {
  overflow-wrap: anywhere;
}

.issue-pending-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1180px) {
  .issue-pending-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .issue-pending-top,
  .issue-pending-actions {
    display: grid;
    justify-content: stretch;
  }
  .issue-pending-status {
    text-align: left;
  }
  .issue-pending-meta-grid,
  .issue-pending-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dispute-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  border-radius: 8px;
}
.dispute-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 120px 120px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.review-box {
  border: 2px solid #f59e0b;
  background: #fffbeb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.review-box table.compact {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.external-arrival-receipt-table {
  min-width: 1180px;
}
.external-arrival-receipt-table select {
  min-width: 260px;
}
.external-arrival-receipt-table input {
  min-width: 108px;
}
.external-arrival-resubmit-line {
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 1fr) 150px;
}
.external-arrival-resubmit-item-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.external-arrival-resubmit-item-picker input,
.external-arrival-resubmit-item-picker select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .external-arrival-resubmit-line {
    grid-template-columns: minmax(0, 1fr);
  }
  .external-arrival-resubmit-line select,
  .external-arrival-resubmit-line input {
    width: 100%;
    min-width: 0;
  }
}
.audit-card-list {
  display: grid;
  gap: 18px;
}
.audit-card {
  border: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 8px;
  padding: 14px;
}
.audit-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.audit-card-head > div {
  flex: 1 1 320px;
  min-width: 0;
}
.audit-card-head > span {
  flex: 0 0 auto;
  min-width: 0;
}
.audit-card-head strong {
  font-size: 18px;
  margin-right: 8px;
}
.audit-card-head span {
  color: var(--muted);
  font-weight: 400;
  text-align: right;
}
.audit-card-head .business-card-heading {
  color: inherit;
  text-align: left;
}
.audit-card-head .business-task-action {
  color: #c2410c;
  font-weight: 800;
  text-align: left;
}
.audit-card-head .business-task-action.red { color: #b91c1c; }
.audit-card-head .business-task-action.green { color: #15803d; }
.retail-source-trace,
.retail-source-trace strong,
.fee-document-number,
.fee-document-number strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.audit-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}
.audit-meta-grid div {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 8px;
}
.audit-meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.audit-meta-grid strong {
  color: var(--text);
  font-size: 14px;
}
.audit-card-body {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(260px, 1fr);
  gap: 12px;
  align-items: start;
}
.audit-document-lines {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}
.audit-document-line {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 12px;
}
.audit-document-line-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px 12px;
  align-items: start;
  margin-bottom: 12px;
}
.audit-document-line-head strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.warehouse-delivery-select,
.finance-delivery-select {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
  line-height: 1.45;
}
.warehouse-delivery-select input,
.finance-delivery-select input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  flex: 0 0 18px;
  margin-top: 4px;
}
.warehouse-delivery-select > strong,
.finance-delivery-select > strong,
.warehouse-delivery-title,
.finance-delivery-title {
  display: block;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
#finance .audit-document-line-head strong,
#finance .finance-delivery-select > strong {
  font-size: 17px;
  line-height: 1.48;
}
#finance .finance-delivery-select input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
}
.warehouse-selection-meta {
  margin-top: 8px;
  color: #92400e;
  font-weight: 800;
}
.delivery-print-meta,
.delivery-important-meta {
  overflow-wrap: anywhere;
}
.delivery-product-info.delivery-product-summary {
  display: grid;
  gap: 12px;
  margin: 10px 0 14px;
  padding: 0 12px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  line-height: 1.45;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.delivery-product-info.delivery-product-info-compact {
  gap: 8px;
  margin: 6px 0;
  padding: 0 10px 10px;
  border-radius: 8px;
}
.delivery-product-info-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
  margin: 0 -12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 10px 10px 0 0;
  background: #f8fafc;
}
.delivery-product-info-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8 !important;
  font-size: 13px;
  font-weight: 800;
}
.delivery-product-info-head strong {
  min-width: 0;
  color: #0f172a;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.delivery-product-info-head input {
  min-width: 220px;
  flex: 1 1 260px;
  font-size: 18px;
  font-weight: 800;
}
.delivery-product-info-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.delivery-product-info-meta span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.delivery-product-info-meta span.delivery-product-info-meta-customer {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.delivery-product-info-meta span.delivery-product-info-meta-qty {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.delivery-product-info-meta span.delivery-product-info-meta-note {
  grid-column: 1 / -1;
  border-color: #fed7aa;
  background: #fff7ed;
}
.delivery-product-info-meta strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.delivery-product-info-meta-customer strong,
.delivery-product-info-meta-customer em {
  color: #1e3a8a;
}
.delivery-product-info-meta-qty strong,
.delivery-product-info-meta-qty em {
  color: #166534;
}
.delivery-product-info-meta-note strong,
.delivery-product-info-meta-note em {
  color: #9a3412;
}
.delivery-product-info-meta em {
  color: #0f172a;
  font-style: normal;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.delivery-product-info-compact .delivery-product-info-head {
  margin: 0 -10px;
  padding: 8px 10px;
  border-radius: 8px 8px 0 0;
}
.delivery-product-info-compact .delivery-product-info-head strong {
  font-size: 15px;
}
.delivery-product-info-compact .delivery-product-info-meta {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}
.delivery-product-info-compact .delivery-product-info-meta span {
  padding: 6px 8px;
}
.delivery-product-info-compact .delivery-product-info-meta em {
  font-size: 13px;
}
.audit-document-line-head > span {
  justify-self: end;
  text-align: right;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.document-line-summary {
  min-height: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.document-line-summary:last-child { border-bottom: 0; }
.audit-field {
  display: grid;
  gap: 6px;
}
.audit-field.wide {
  grid-column: span 2;
}
.audit-field label {
  color: var(--muted);
  font-weight: 700;
}
.audit-field input,
.audit-field textarea {
  width: 100%;
}
.inventory-truth-guide {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 2px solid #0f766e;
  border-radius: 12px;
  color: #134e4a;
  background: #f0fdfa;
}
.inventory-truth-guide > strong {
  display: block;
  margin-bottom: 9px;
  font-size: 17px;
}
.inventory-truth-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 18px;
  line-height: 1.55;
}
.inventory-truth-guide-grid span {
  min-width: 0;
}
.inventory-truth-status {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #94a3b8;
  border-left-width: 5px;
  border-radius: 9px;
  background: #f8fafc;
  line-height: 1.5;
}
.inventory-truth-status strong,
.inventory-truth-status span,
.inventory-truth-status small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.inventory-truth-status small {
  color: #475569;
  font-weight: 700;
}
.inventory-truth-blue {
  border-left-color: #2563eb;
  background: #eff6ff;
}
.inventory-truth-orange {
  border-left-color: #ea580c;
  background: #fff7ed;
}
.inventory-truth-green {
  border-left-color: #16a34a;
  background: #f0fdf4;
}
.inventory-truth-red {
  border-left-color: #dc2626;
  background: #fef2f2;
}
.inventory-truth-compact {
  margin: 7px 0 0;
  padding: 7px 9px;
  font-size: 12px;
}
.inventory-truth-compact span {
  color: #475569;
}
.finance-card .audit-card-body {
  grid-template-columns: minmax(260px, 1.1fr) minmax(220px, .9fr);
}
#finance .audit-card-list {
  gap: 30px;
}
#finance .audit-card-list > .finance-card {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
  border-width: 3px;
  border-style: solid;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .09);
  box-sizing: border-box;
}
#finance .audit-card-list > .finance-card:nth-child(odd) {
  border-color: #2563eb;
  background: #f5f9ff;
}
#finance .audit-card-list > .finance-card:nth-child(even) {
  border-color: #7c3aed;
  background: #faf7ff;
}
.finance-document-scope-banner {
  display: grid;
  gap: 5px;
  margin: -18px -18px 16px;
  padding: 13px 18px;
  color: #0f172a;
  border-bottom: 2px solid currentColor;
  min-width: 0;
  overflow-wrap: anywhere;
}
#finance .audit-card-list > .finance-card:nth-child(odd) .finance-document-scope-banner {
  color: #1d4ed8;
  background: #dbeafe;
}
#finance .audit-card-list > .finance-card:nth-child(even) .finance-document-scope-banner {
  color: #6d28d9;
  background: #ede9fe;
}
.finance-document-scope-banner strong {
  font-size: 18px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.finance-document-scope-banner span {
  color: #334155;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.finance-batch-approve-button {
  min-width: min(100%, 300px);
  font-weight: 800;
}
.finance-batch-approve-button:disabled {
  cursor: wait;
  opacity: .68;
}
.historical-repair-pending-count {
  color: #b91c1c;
  font-size: 15px;
  font-weight: 900;
}
.historical-repair-complete-count {
  color: #15803d;
  font-weight: 800;
}
.historical-repair-intro {
  display: grid;
  gap: 9px;
}
.historical-repair-intro p {
  margin: 0;
}
.historical-repair-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}
.historical-repair-toolbar > div {
  display: grid;
  gap: 4px;
}
.historical-repair-toolbar span {
  color: #475569;
}
.historical-repair-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f0fdf4;
  color: #166534;
  font-weight: 700;
}
.historical-repair-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.historical-repair-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}
.historical-repair-card.historical-repair-recoverable {
  border-color: #f59e0b;
  background: #fffbeb;
}
.historical-repair-card.historical-repair-restored {
  border-color: #22c55e;
  background: #f0fdf4;
}
.historical-repair-card.historical-repair-blocked {
  border-color: #f87171;
  background: #fef2f2;
}
.historical-repair-card-head,
.historical-repair-facts,
.historical-repair-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.historical-repair-card-head > div {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.historical-repair-card-head > div > strong {
  font-size: 18px;
}
.historical-repair-card-head > span {
  color: #475569;
  font-weight: 700;
}
.historical-repair-facts {
  justify-content: flex-start;
}
.historical-repair-facts span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: #475569;
}
.historical-repair-facts b {
  color: #0f172a;
}
.historical-repair-reason,
.historical-repair-blocker,
.historical-repair-mixed-warning {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 9px;
}
.historical-repair-reason {
  background: rgba(255, 255, 255, .9);
}
.historical-repair-reason span,
.historical-repair-blocker span {
  color: #64748b;
  font-size: 12px;
}
.historical-repair-blocker {
  background: #fee2e2;
  color: #991b1b;
}
.historical-repair-mixed-warning {
  background: #ede9fe;
  color: #5b21b6;
}
#finance,
#finance * {
  box-sizing: border-box;
}
#finance .audit-card,
#finance .review-box,
#finance .history-item,
#finance .audit-document-line,
#finance .audit-field,
#finance .pending-title,
#finance .pending-meta,
#finance .business-card-heading,
#finance .business-card-title,
#finance .business-secondary-info,
#finance .business-document-reference,
#finance .part-list,
#finance .part-line,
#finance .part-line-name,
#finance .part-pill,
#finance .note-box,
#finance .qty-mismatch-box,
#finance .finance-rejected-line,
#finance .finance-warehouse-review-note-important {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#finance .audit-card-head,
#finance .pending-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  align-items: flex-start;
}
#finance .audit-card-head > div:first-child,
#finance .pending-title > div:first-child {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}
#finance .audit-card-head > span,
#finance .pending-title > div:not(:first-child) {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  text-align: right;
}
#finance .business-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 8px;
  width: 100%;
  min-width: 0;
}
#finance .business-card-title {
  display: block;
  flex: 1 1 220px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
#finance .business-task-action,
#finance .tag,
#finance button {
  flex: 0 0 auto;
}
#finance input,
#finance select,
#finance textarea {
  min-width: 0;
  max-width: 100%;
}
#finance textarea {
  min-height: 72px;
  resize: vertical;
}
.finance-whole-order-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .86fr);
  gap: 12px;
  align-items: start;
  margin: 12px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.finance-whole-order-actions-top {
  margin-top: 4px;
}
.finance-whole-order-actions-bottom {
  margin-bottom: 0;
}
.finance-whole-order-summary,
.finance-whole-order-controls {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.finance-whole-order-summary strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}
.finance-whole-order-summary span {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.finance-product-fee-preview {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.finance-fee-input-line {
  display: grid;
  grid-template-columns: minmax(96px, 150px) minmax(150px, 1fr);
  gap: 8px;
  align-items: start;
}
.finance-whole-order-controls label {
  color: var(--muted);
  font-weight: 700;
}
.finance-whole-order-controls textarea {
  min-height: 64px;
}
.finance-whole-order-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.finance-whole-order-buttons button {
  min-width: 0;
}
#finance .audit-meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
#finance .history-item,
#finance .history-item.wide {
  grid-template-columns: minmax(170px, .8fr) minmax(190px, .9fr) minmax(0, 1.2fr);
}
#finance .factory-report-review-line {
  grid-template-columns: minmax(180px, 1fr) minmax(92px, 120px) minmax(180px, 1fr);
}
#finance .factory-report-review-line > * {
  min-width: 0;
}
.finance-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.finance-module-grid > * {
  min-width: 0;
  margin: 0;
}
#finance .finance-module-grid > .fold-panel[open],
#finance .finance-paired-review-grid > .fold-panel[open] {
  grid-column: 1 / -1;
}
#finance .finance-module-grid > .fold-panel[open] > .fold-panel-body,
#finance .finance-paired-review-grid > .fold-panel[open] > .fold-panel-body {
  padding: 18px 22px 22px;
}
.finance-module-span {
  grid-column: 1 / -1;
}
.finance-paired-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.finance-paired-review-grid > * {
  min-width: 0;
  margin: 0;
}
.finance-consumption-editor {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.finance-consumption-block {
  padding: 8px 10px;
  border: 1px solid var(--red);
  border-radius: 6px;
  background: #fff1f2;
  color: #b91c1c;
  font-weight: 700;
}
.finance-consumption-row {
  display: grid;
  grid-template-columns: minmax(104px, 118px) minmax(140px, 1fr) minmax(92px, 130px) 52px;
  gap: 8px;
  align-items: start;
}
.finance-consumption-row .dynamic-name-picker,
.finance-consumption-row .dynamic-name-picker input {
  min-width: 0;
  width: 100%;
}
.finance-add-line {
  justify-self: start;
}
.finance-correction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.finance-rejected-line {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #b91c1c;
  background: #fff1f2;
  font-weight: 700;
}
@media (max-width: 1180px) {
  #finance .finance-paired-review-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 980px) {
  #finance .finance-module-grid,
  #finance .history-item,
  #finance .history-item.wide,
  #finance .factory-report-review-line {
    grid-template-columns: 1fr;
  }
  #finance .finance-module-span {
    grid-column: auto;
  }
  #finance .finance-consumption-row {
    grid-template-columns: minmax(0, 1fr) minmax(92px, 130px);
  }
  #finance .finance-consumption-row .dynamic-name-picker,
  #finance .finance-consumption-row button {
    grid-column: 1 / -1;
  }
}
.labor-price-pending-note {
  margin-top: 6px;
  color: #b91c1c;
  font-size: 15px;
  font-weight: 800;
}
.billing-line-head,
.billing-line-row {
  display: grid;
  grid-template-columns: 118px 140px 105px minmax(230px, 1fr) 150px 70px 76px 86px 96px 105px minmax(150px, 1fr) 48px;
  gap: 8px;
  align-items: center;
  min-width: 1380px;
}
.billing-line-head {
  color: var(--muted);
  font-weight: 700;
  padding: 4px 0;
}
.line-editor {
  overflow-x: auto;
}
.bill-list {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}
.bill-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
}
.bill-company {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 2px 0 12px;
  color: #172033;
}
.correction-reason-row {
  align-items: end;
}
.correction-note {
  padding: 10px 0;
}
.correction-history-line {
  display: inline-block;
  margin-top: 6px;
  color: #7c4a03;
  font-size: 13px;
  line-height: 1.5;
}
.bill-card-head,
.bill-customer,
.bill-total,
.bill-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.bill-card-head {
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 28px;
}
.bill-merge-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: #2457a6;
  cursor: pointer;
}
.bill-merge-select input {
  width: 18px;
  height: 18px;
}
.bill-card-head strong {
  font-size: 20px;
}
.bill-customer {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.bill-customer strong {
  font-size: 22px;
}
.bill-total {
  justify-content: flex-end;
  padding-top: 10px;
  font-size: 16px;
}
.bill-total strong {
  font-size: 18px;
}
.bill-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.bill-footer-code {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: right;
  font-size: 14px;
}
.bill-edit select,
.bill-edit input {
  max-width: 220px;
}

.monthly-customer-summary table,
.admin-cleanup-table {
  margin-top: 10px;
}
.monthly-customer-summary .section-head > .dynamic-name-picker {
  width: min(440px, 100%);
  min-width: min(320px, 100%);
}
.monthly-customer-summary-totals {
  margin-top: 10px;
}
.statement-month-input {
  width: 150px;
}
.bill-filter-actions {
  margin-top: 10px;
}
.right-actions {
  justify-content: flex-end;
}
.bill-settled-fold .bill-list {
  margin-top: 10px;
}
.customer-summary-table td:first-child,
.admin-cleanup-table td:nth-child(2) {
  max-width: 520px;
}
.admin-cleanup-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.admin-cleanup-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: min(520px, 100%);
}
.admin-cleanup-search input {
  flex: 1;
  min-width: 260px;
}
.admin-cleanup-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}
.admin-cleanup-group summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  background: #f8fafc;
}
.admin-cleanup-group[open] summary {
  border-bottom: 1px solid var(--line);
}
.admin-raw-row pre {
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
}
#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 220px;
  background: #111827;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  display: none;
}

.bulk-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .48);
}
.bulk-picker-backdrop[hidden] { display: none; }
.bulk-picker-dialog {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(120px, 1fr) auto;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}
.bulk-picker-head,
.bulk-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bulk-picker-head strong { font-size: 18px; }
.bulk-picker-head button { width: 36px; min-width: 36px; font-size: 22px; }
.bulk-picker-selected { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.bulk-picker-options { overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.bulk-picker-options label {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.bulk-picker-options label:last-child { border-bottom: 0; }
.bulk-picker-options label:hover { background: #f5f8ff; }
.bulk-picker-options input { width: 18px; min-width: 18px; height: 18px; }
.bulk-picker-options > .muted { padding: 20px; }
.bulk-picker-actions { justify-content: flex-end; }
.fee-summary-grid { margin: 14px 0; }
.fee-summary { border: 1px solid var(--line); border-radius: 6px; padding: 14px; background: #f8fafc; }
.fee-summary span { display: block; color: var(--muted); margin-bottom: 6px; }
.fee-summary strong { font-size: 20px; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef3ff, #f7f9fc);
}
.login-screen.active { display: flex; }
.login-card {
  width: min(420px, calc(100vw - 32px));
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}
.login-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}
.login-card p { margin: 0 0 22px; }
.login-card label {
  display: block;
  margin: 14px 0 8px;
  color: var(--muted);
  font-weight: 600;
}
.login-card input {
  width: 100%;
  height: 44px;
  font-size: 16px;
}
.login-card button {
  width: 100%;
  height: 44px;
  margin-top: 22px;
  font-size: 16px;
}

@media (max-width: 900px) {
  .tracking-card .quantity-display {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .sidebar { position: static; width: 100%; display: flex; overflow-x: auto; gap: 6px; }
  .brand { display: none; }
  .nav { min-width: 130px; text-align: center; }
  main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  header {
    width: 100%;
    height: auto;
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .header-actions {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }
  .boss-mode-panel {
    width: 100%;
    flex-wrap: wrap;
  }
  .boss-mode-panel input {
    flex: 1 1 140px;
    width: auto;
  }
  .operation-boss-audit {
    grid-template-columns: 1fr;
  }
  .header-actions > * {
    flex: 0 0 auto;
  }
  .header-actions .date-picker-wrap {
    flex: 1 1 136px;
    min-width: 128px;
  }
  .header-actions .date-text {
    width: 100%;
    min-width: 0;
  }
  .view {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px 12px 28px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }
  .view table:not(.yiwu-receipt-table):not(.draft-conflict-table) {
    min-width: 720px;
  }
  .view .review-box table.compact {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }
  #warehouseExternalReview .review-box .audit-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    max-width: 100%;
  }
  .panel,
  .audit-card,
  .repair-case-card {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }
  .line-editor,
  .fold-panel-body,
  .history-fold,
  .operation-history-table-wrap,
  .simple-customer-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }
  .panel .actions,
  .audit-card .actions,
  .repair-case-card .actions,
  .line-editor,
  .line-editor .actions {
    position: relative;
    z-index: 2;
  }
  .grid.two, .grid.three, .grid.four, .form-row, .form-row.two { grid-template-columns: 1fr; }
  .section-head { align-items: stretch; flex-direction: column; }
  .inline-actions { width: 100%; }
  .audit-card-head { flex-direction: column; }
  .audit-card-head span { text-align: left; }
  .audit-meta-grid,
  .audit-card-body,
  .finance-card .audit-card-body {
    grid-template-columns: 1fr;
  }
  .inventory-truth-guide {
    padding: 12px;
  }
  .inventory-truth-guide-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .inventory-truth-status {
    padding: 9px 10px;
  }
  #finance .audit-card-list {
    gap: 24px;
  }
  #finance .audit-card-list > .finance-card {
    padding: 14px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  #finance .audit-card-list > .finance-card *,
  #finance .audit-card-list > .finance-card *::before,
  #finance .audit-card-list > .finance-card *::after {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  #finance .audit-card-list > .finance-card table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  #finance .audit-card-list > .finance-card th,
  #finance .audit-card-list > .finance-card td,
  #finance .audit-card-list > .finance-card strong,
  #finance .audit-card-list > .finance-card span,
  #finance .audit-card-list > .finance-card button,
  #finance .audit-card-list > .finance-card input,
  #finance .audit-card-list > .finance-card textarea {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .finance-document-scope-banner {
    margin: -14px -14px 14px;
    padding: 12px 14px;
  }
  .finance-document-scope-banner strong {
    font-size: 16px;
  }
  .finance-batch-approve-button {
    width: 100%;
  }
  .finance-module-grid,
  .finance-paired-review-grid {
    grid-template-columns: 1fr;
  }
  .finance-module-span {
    grid-column: auto;
  }
  .finance-consumption-row {
    grid-template-columns: 1fr;
  }
  .finance-whole-order-actions {
    grid-template-columns: 1fr;
  }
  .finance-whole-order-buttons {
    justify-content: stretch;
  }
  .finance-whole-order-buttons button {
    flex: 1 1 150px;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .finance-fee-input-line {
    grid-template-columns: 1fr;
  }
  .audit-field.wide { grid-column: auto; }
  .finish-allocation-editor { min-width: 0; }
  .finish-allocation-row,
  .finish-transfer-fields,
  .finish-customer-temp-fields { grid-template-columns: 1fr; }
  .finish-transfer-fields,
  .finish-customer-temp-fields { grid-column: auto; }
  .audit-document-line-head { grid-template-columns: 1fr; }
  .audit-document-line-head > span {
    justify-self: start;
    text-align: left;
  }
  .tracking-card,
  .tracking-list-compact .tracking-card {
    grid-template-columns: 1fr;
  }
  .tracking-customer-filter {
    margin-right: -4px;
    padding-right: 14px;
  }
  .tracking-customer-filter-head {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }
  .tracking-customer-search {
    width: 100%;
    min-width: 0;
  }
  .tracking-customer-filter-results {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  .tracking-customer-filter-meta {
    margin-left: 2px;
    flex: 0 0 auto;
  }
  .simple-customer-inventory-toolbar {
    margin-right: -4px;
    margin-left: -4px;
    padding: 10px;
  }
  .simple-customer-search-row .search-control {
    max-width: none;
  }
  .simple-customer-inventory-summary span {
    flex: 1 1 142px;
    justify-content: flex-start;
    border-radius: 8px;
  }
  .simple-customer-group-card > summary {
    align-items: stretch;
    flex-direction: column;
  }
  .simple-customer-group-card .fold-panel-title {
    align-items: flex-start;
  }
  .simple-customer-group-card .fold-panel-meta {
    justify-content: flex-start;
    max-width: 100%;
    text-align: left;
  }
  .simple-customer-inventory-table {
    min-width: 900px;
  }
  .tracking-customer-name { font-size: 21px; }
  .tracking-quantity-adjust { grid-template-columns: 1fr; }
  .tracking-create-item { grid-template-columns: 1fr; }
  .tracking-create-items-head { align-items: flex-start; }
  .delivery-print-fields { grid-column: auto; grid-template-columns: 1fr; }
  .scan-row,
  .line-row,
  .line-row.delivery-line-row,
  .assembly-line-row,
  .outbound-line-row,
  .arrival-line-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }
}
.search-control {
  display: inline-grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.search-control > input {
  min-width: 0;
  width: 100%;
}

.search-action {
  min-width: 58px;
  white-space: nowrap;
}

.search-action.primary {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.order-card,
.tracking-order-card,
.finance-order-card,
.warehouse-order-card,
.delivery-card,
.receipt-card {
  margin-bottom: 18px;
}

.order-card + .order-card,
.tracking-order-card + .tracking-order-card,
.finance-order-card + .finance-order-card,
.warehouse-order-card + .warehouse-order-card,
.delivery-card + .delivery-card,
.receipt-card + .receipt-card {
  margin-top: 18px;
}

.first-review-warning {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  border: 2px solid #dc2626;
  border-radius: 6px;
  color: #b91c1c;
  background: #fff1f2;
  font-size: 20px;
  font-weight: 800;
}

.finance-warehouse-review-note-important {
  display: block;
  max-width: 100%;
  margin: 12px 0;
  padding: 10px 12px;
  border: 2px solid #dc2626;
  border-radius: 8px;
  color: #b91c1c;
  background: #fff1f2;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 900;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.finance-warehouse-review-note-important strong,
.finance-warehouse-review-note-important span {
  font: inherit;
  color: inherit;
}

.repair-inventory-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f97316;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 14px;
  line-height: 1.45;
}
.repair-inventory-notice strong {
  color: #7c2d12;
  font-weight: 900;
}
.repair-inventory-notice span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.repair-hidden-lines-notice {
  display: block;
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.repair-hidden-lines-notice strong {
  color: #1d4ed8;
  font-weight: 900;
}

.repair-reason-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  background: #fff7f7;
  color: #991b1b;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.repair-reason-note strong {
  font-size: 17px;
  font-weight: 900;
}

.repair-reason-note span {
  min-width: 0;
  font-weight: 800;
}

.retired-finance-entry p {
  max-width: 780px;
  overflow-wrap: anywhere;
}

.repair-case-card {
  margin: 12px 0;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.repair-case-card.repair-current-todo {
  border: 2px solid #dc2626;
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .08);
}

.repair-case-card.repair-tracking-only { background: #f8fafc; }
.repair-document-lines { display: grid; gap: 12px; margin: 14px 0; }

.repair-document-line {
  padding: 12px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #fff;
}

.repair-document-line.repair-target-line { border-color: #f87171; }

.repair-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.repair-field-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.repair-field-grid > .wide { grid-column: 1 / -1; }

.repair-product-summary {
  display: grid;
  gap: 10px;
}
.repair-product-summary .repair-product-name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 0 8px;
  border-bottom: 1px solid #e2e8f0;
}
.repair-product-summary .repair-product-name strong {
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
}
.repair-product-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.repair-product-meta-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.repair-product-meta-grid strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.repair-product-meta-grid em {
  color: #0f172a;
  font-style: normal;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.repair-field-grid label,
.repair-location-title {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.repair-inline-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(90px, 140px) minmax(70px, auto);
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  overflow-wrap: anywhere;
}

.repair-consumption-row {
  grid-template-columns: 150px minmax(360px, 1fr) 120px 54px 56px;
}

.repair-consumption-row select,
.repair-consumption-row input,
.repair-consumption-row .dynamic-name-picker,
.repair-consumption-row .dynamic-name-picker input {
  min-width: 0;
  width: 100%;
}

.repair-consumption-invalid {
  grid-column: 2 / -1;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
}

.repair-change {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.repair-change > div,
.repair-history-item {
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow-wrap: anywhere;
}

.repair-history-fold { margin-top: 12px; }
.repair-history-list { display: grid; gap: 8px; margin-top: 8px; }

.finance-repair-location {
  padding: 12px;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  background: #fff7f7;
}

.finance-repair-location > label {
  display: block;
  margin: 8px 0;
  color: #991b1b;
  font-weight: 800;
}

.repair-field-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 6px 0 12px 24px;
}

.repair-field-choice { color: #334155 !important; font-weight: 600 !important; }
.repair-finance-review .audit-card { margin: 14px 0 0; }
.repair-finance-audit-list {
  gap: 18px;
}
#finance .repair-finance-audit-card {
  border-width: 1px;
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: none;
  padding: 16px 18px 18px;
}
#finance .repair-finance-audit-card .finance-document-scope-banner {
  margin: -16px -18px 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
}
#finance .repair-finance-audit-card .audit-card-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}
#finance .repair-finance-audit-card .audit-meta-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin: 10px 0;
}
#finance .repair-finance-audit-card .audit-document-line {
  padding: 16px;
  border-color: #dbe4ef;
  border-radius: 10px;
  background: #fbfdff;
}
#finance .repair-finance-audit-card .audit-document-line-head {
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}
#finance .repair-finance-audit-card .audit-document-line-head > span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 15px;
  font-weight: 800;
}
#finance .repair-finance-audit-card .delivery-product-info-repair-finance {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}
#finance .repair-finance-audit-card .delivery-product-info-repair-finance > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: baseline;
}
#finance .repair-finance-audit-card .delivery-product-info-repair-finance .muted {
  font-size: 15px !important;
  font-weight: 800 !important;
}
#finance .repair-finance-audit-card .delivery-product-info-repair-finance strong {
  font-size: 20px !important;
}
#finance .repair-finance-audit-card .delivery-product-info-meta {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 8px 12px !important;
  margin-top: 12px !important;
}
#finance .repair-finance-audit-card .delivery-product-info-meta span {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}
#finance .repair-finance-audit-card .audit-card-body {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
#finance .repair-finance-audit-card .audit-field {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
}
#finance .repair-finance-audit-card .audit-field.wide {
  grid-column: auto;
}
#finance .repair-finance-audit-card .audit-field > label {
  padding-bottom: 6px;
  border-bottom: 1px solid #eef2f7;
  color: #334155;
  font-size: 16px !important;
}
#finance .repair-finance-audit-card .part-list {
  margin-top: 8px;
}
.repair-factory-submit,
.repair-finance-return {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #fdba74;
  border-radius: 10px;
  background: #fff7ed;
}
.repair-factory-submit > label,
.repair-finance-return > label {
  color: #9a3412;
  font-weight: 800;
}
.repair-factory-submit textarea,
.repair-finance-return textarea {
  min-height: 72px;
}

@media (max-width: 760px) {
  .repair-field-grid,
  .repair-change { grid-template-columns: 1fr; }
  .repair-inline-row { grid-template-columns: minmax(0, 1fr) minmax(88px, 110px); }
  .repair-consumption-row { grid-template-columns: minmax(0, 1fr) minmax(88px, 110px); }
  .repair-consumption-row [data-repair-kind],
  .repair-consumption-row .dynamic-name-picker,
  .repair-consumption-row button { grid-column: 1 / -1; }
  .repair-inline-row > :last-child { grid-column: 1 / -1; }
  .repair-field-choices { display: grid; margin-left: 0; }
}

.labor-price-editor {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, auto);
  align-items: end;
  gap: 10px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  white-space: nowrap;
}

.inline-check input {
  width: 18px;
  height: 18px;
}

.labor-price-pending-note {
  margin-top: 8px;
}

.fee-summary-alert {
  border-color: #fecaca;
  background: #fff1f2;
}

.fee-summary-alert span,
.fee-summary-alert strong {
  color: #b91c1c;
}

.factory-fee-readonly-notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
}

.factory-fee-readonly-notice strong {
  color: #1e3a8a;
  font-size: 17px;
}

.factory-fee-readonly-notice p {
  margin: 4px 0 0;
  color: #475569;
}

.factory-fee-readonly-notice span,
.fee-readonly-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
  white-space: nowrap;
}

.factory-fee-reconcile {
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  background: #fff;
}

.factory-fee-reconcile > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #eff6ff;
  color: #1e3a8a;
  cursor: pointer;
  font-weight: 900;
}

.factory-fee-reconcile > summary span {
  color: #64748b;
  font-weight: 700;
}

.factory-fee-table-wrap {
  overflow-x: auto;
}

.factory-fee-table th,
.factory-fee-table td {
  white-space: nowrap;
}

.factory-fee-table td:nth-child(4),
.factory-fee-table td:nth-child(9) {
  min-width: 180px;
  white-space: normal;
}

.fee-document-list {
  display: grid;
  gap: 18px;
}

.fee-document-list .section-heading-row {
  margin-bottom: 0;
}

.fee-document-card {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.fee-document-summary {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(420px, auto);
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 13px 16px;
  background: #f8fafc;
  cursor: pointer;
}

.fee-document-summary::marker {
  color: #64748b;
}

.fee-document-summary > div,
.fee-document-summary-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fee-document-summary-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.fee-document-factory {
  color: #0f172a;
  font-size: 18px;
}

.fee-document-date {
  color: #64748b;
  white-space: nowrap;
}

.fee-document-amount {
  min-width: 105px;
  color: #0f172a;
  text-align: right;
}

.fee-document-body {
  padding: 0 16px 14px;
}

.fee-document-number {
  padding: 11px 0;
  color: #64748b;
  font-size: 13px;
}

.fee-detail-head,
.fee-detail-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(125px, .8fr) minmax(120px, .75fr) minmax(145px, .85fr) minmax(120px, .75fr) minmax(92px, auto);
  align-items: center;
  gap: 10px 16px;
}

.fee-detail-head {
  padding: 9px 12px;
  background: #eef2f7;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.fee-detail-row {
  min-height: 62px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.fee-detail-row > div {
  min-width: 0;
}

.fee-detail-row small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  line-height: 1.4;
}

.fee-detail-price {
  display: grid;
  gap: 2px;
}

.fee-correction-history {
  grid-column: 1 / -1;
  padding: 7px 10px;
  border-left: 3px solid #60a5fa;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
}

.fee-document-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 12px 0;
}

.fee-document-footer > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.fee-document-footer > div:first-child strong {
  font-size: 20px;
}

.document-line-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(120px, .8fr) minmax(170px, 1fr) minmax(190px, 1.15fr) minmax(105px, auto) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.document-line-summary:last-child {
  border-bottom: 0;
}

.document-line-summary > span {
  min-width: 0;
  line-height: 1.55;
}

.document-line-summary > button {
  justify-self: end;
  white-space: nowrap;
}

.document-line-summary .correction-history-line {
  grid-column: 1 / -1;
}

.doc-title {
  margin-bottom: 3px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
}

.doc-title + .doc-id {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.part-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
  align-items: center;
  gap: 12px;
}

.part-line-name {
  min-width: 0;
}

.part-line-qty {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 104px;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.operation-log-list {
  display: grid;
  gap: 8px;
}

.operation-log-row {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.operation-log-row summary {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(84px, 100px) minmax(160px, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 14px;
  cursor: pointer;
}

.operation-log-row summary:hover {
  background: #f8fafc;
}

.operation-log-row summary time,
.operation-log-row summary strong,
.operation-log-row summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-log-row summary em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-log-body {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.operation-boss-audit {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff7ed;
}

.operation-boss-audit strong,
.operation-boss-audit span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.operation-boss-audit strong {
  color: #9a3412;
}

.operation-change {
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #fff;
}

.operation-change-head {
  display: grid;
  grid-template-columns: 150px minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid #e5eaf2;
  background: #eef4ff;
}

.operation-change-head > strong {
  color: #174ea6;
}

.operation-change-head > span {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.operation-change-head > small {
  color: var(--muted);
  font-size: 12px;
}

.operation-change-fields {
  display: grid;
}

.operation-field {
  display: grid;
  grid-template-columns: 130px minmax(120px, 1fr) 24px minmax(120px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 12px;
  border-top: 1px solid #eef2f7;
}

.operation-change-fields .operation-field:first-child {
  border-top: 0;
}

.operation-field-label {
  color: #475569;
}

.operation-value-old,
.operation-value-new {
  overflow-wrap: anywhere;
  padding: 6px 9px;
  border-radius: 4px;
}

.operation-value-old {
  color: #7c2d12;
  background: #fff7ed;
}

.operation-value-new {
  color: #166534;
  background: #f0fdf4;
  font-weight: 700;
}

.operation-field-arrow {
  color: #64748b;
  text-align: center;
}

.operation-field-note {
  display: block;
  color: var(--muted);
  line-height: 1.6;
}

.operation-log-more {
  padding: 10px 12px;
  color: var(--muted);
  text-align: center;
}

.operation-log-empty {
  padding: 18px;
}

.courier-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.courier-create-wide {
  grid-column: 1 / -1;
}

.courier-tracking-editor {
  display: grid;
  grid-column: 1 / -1;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.courier-tracking-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.courier-tracking-editor-head > div {
  display: grid;
  gap: 3px;
}

.courier-tracking-editor-head span {
  color: var(--muted);
  font-size: 13px;
}

#courierTrackingNoList {
  display: grid;
  gap: 8px;
}

.courier-tracking-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.courier-tracking-nos {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.courier-tracking-nos > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.courier-tracking-nos span {
  padding: 4px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  overflow-wrap: anywhere;
}

.courier-list-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 180px;
  gap: 10px;
  margin-bottom: 14px;
}

.courier-card-list {
  display: grid;
  gap: 18px;
}

.courier-case-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
  background: #fff;
}

.courier-case-card.is-finished {
  border-left-color: #16a34a;
  background: #f8fafc;
}

.courier-case-head,
.courier-case-head > div,
.courier-case-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.courier-case-head {
  justify-content: space-between;
}

.courier-case-head strong {
  font-size: 20px;
}

.courier-case-head-meta,
.courier-result span {
  color: var(--muted);
}

.courier-case-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.courier-case-summary > div {
  display: grid;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.courier-case-summary span {
  color: var(--muted);
  font-size: 13px;
}

.courier-case-summary > div:last-child strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.courier-case-description,
.courier-result {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  line-height: 1.65;
}

.courier-result {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.courier-case-controls {
  display: grid;
  grid-template-columns: 160px minmax(140px, 1fr) 180px auto;
  gap: 9px;
  margin-top: 12px;
}

.courier-log-history {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.courier-log-history summary {
  padding: 11px 0;
  cursor: pointer;
  font-weight: 700;
}

.courier-log-row {
  display: grid;
  grid-template-columns: 165px 90px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.courier-log-row p {
  margin: 0;
}

@media (max-width: 720px) {
  .search-control {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-control .search-action:last-child {
    display: none;
  }

  .operation-log-row summary {
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
  }

  .operation-log-row summary span,
  .operation-log-row summary em {
    grid-column: 1 / -1;
  }

  .operation-change {
    display: block;
  }

  .operation-change-head {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .operation-change-head > small {
    overflow-wrap: anywhere;
  }

  .operation-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .operation-field-arrow {
    display: none;
  }

  .labor-price-editor {
    grid-template-columns: 1fr;
  }

  .document-line-summary {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .document-line-summary > button {
    justify-self: start;
  }

  .fee-document-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fee-document-summary-right {
    justify-content: flex-start;
  }

  .fee-document-amount {
    min-width: 0;
    text-align: left;
  }

  .fee-detail-head {
    display: none;
  }

  .fee-detail-row {
    grid-template-columns: 1fr 1fr;
  }

  .fee-detail-product,
  .fee-correction-history {
    grid-column: 1 / -1;
  }

  .fee-document-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .courier-create-grid,
  .courier-list-toolbar,
  .courier-case-summary,
  .courier-case-controls,
  .courier-log-row {
    grid-template-columns: 1fr;
  }

  .courier-case-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .courier-case-head-meta {
    overflow-wrap: anywhere;
  }

  .courier-tracking-editor-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
.account-permissions-intro {
  border-left: 4px solid #2563eb;
}

.account-user-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.account-user-card {
  margin-top: 12px;
  border: 1px solid #d9e2ef;
  border-radius: 6px;
  background: #fff;
}

.account-user-card > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  cursor: pointer;
  list-style-position: inside;
}

.account-user-card > summary strong {
  font-size: 18px;
}

.account-user-body {
  padding: 16px;
  border-top: 1px solid #e6edf6;
}

.account-basic-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.account-active-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding-top: 24px;
  font-weight: 700;
}

.account-active-toggle input,
.account-operation-permission input {
  width: 18px;
  height: 18px;
}

.account-permission-section {
  margin-top: 18px;
}

.account-permission-section h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.account-page-permission-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 8px;
}

.account-page-permission {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #dfe7f2;
  border-radius: 6px;
  background: #f8fafc;
}

.account-page-permission select {
  min-width: 0;
}

.account-operation-grid {
  display: grid;
  gap: 12px;
}

.account-operation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-operation-groups {
  display: grid;
  gap: 12px;
}

.account-operation-group {
  padding: 12px;
  border: 1px solid #dfe7f2;
  border-radius: 6px;
  background: #f8fafc;
}

.account-operation-group-head {
  margin-bottom: 10px;
}

.account-operation-group-head h4 {
  margin: 0;
  font-size: 16px;
}

.account-operation-group-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-operation-permission {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid #dfe7f2;
  border-radius: 6px;
  background: #fff8e8;
  font-weight: 700;
}

.account-operation-permission.medium-risk {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.account-operation-permission.high-risk {
  border-color: #fdba74;
  background: #fff7ed;
}

.account-operation-permission.critical-risk {
  border-color: #fca5a5;
  background: #fff1f2;
}

.account-operation-copy {
  display: grid;
  flex: 1 1 220px;
  gap: 2px;
  min-width: 0;
}

.account-operation-copy strong {
  font-size: 14px;
}

.account-operation-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.account-operation-permission em {
  padding: 2px 6px;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.account-operation-permission.critical-risk em {
  background: #fee2e2;
  color: #b91c1c;
}

.warehouse-page-permission-grid .account-page-permission {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.account-audit-snapshots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.account-audit-snapshot {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #dfe7f2;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account-save-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e6edf6;
}

@media (max-width: 1180px) {
  .account-page-permission-grid {
    grid-template-columns: repeat(2, minmax(210px, 1fr));
  }
}

@media (max-width: 720px) {
  .delivery-consumption-row {
    grid-template-columns: 1fr;
  }

  .delivery-consumption-row .consumption-qty {
    text-align: left;
  }

  .account-basic-grid,
  .account-page-permission-grid,
  .account-save-row {
    grid-template-columns: 1fr;
  }

  .account-active-toggle {
    padding-top: 4px;
  }

  .account-user-card > summary {
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .account-audit-snapshots {
    grid-template-columns: 1fr;
  }

  .fold-panel > summary {
    align-items: flex-start;
    padding: 10px 12px;
  }

  .fold-panel-title { min-width: 0; }
  .fold-panel-meta {
    flex: 0 0 auto;
    text-align: right;
  }

  .pending-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .pending-title .pending-meta {
    width: 100%;
    text-align: left;
  }

  .business-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .business-card-title { font-size: 17px; }
  .business-task-action { font-size: 14px; }
}

.draft-conflict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 0 12px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  border-radius: 6px;
}

.draft-conflict-backdrop {
  position: fixed;
  inset: 0;
  z-index: 380;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .58);
}

.draft-conflict-backdrop[hidden] { display: none; }

.draft-conflict-dialog {
  width: min(980px, 100%);
  max-height: min(880px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #f4c46b;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .3);
}

.draft-conflict-dialog-head,
.draft-conflict-dialog-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #fffbeb;
  border-bottom: 1px solid #fde3a7;
}

.draft-conflict-dialog-head h2 { margin: 0 0 4px; }
.draft-conflict-dialog-head p { margin: 0; color: #92400e; }
.draft-conflict-dialog-foot { justify-content: flex-end; border-top: 1px solid #e5e7eb; border-bottom: 0; background: #fff; }
.draft-conflict-close { min-width: 40px; width: 40px; height: 40px; padding: 0; font-size: 25px; line-height: 1; }
.draft-conflict-details-body { overflow: auto; padding: 16px 18px; background: #f8fafc; }

.draft-conflict-item {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #f59e0b;
  border-radius: 8px;
  background: #fff;
}

.draft-conflict-item + .draft-conflict-item { margin-top: 14px; }
.draft-conflict-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.draft-conflict-item-head h3 { margin: 6px 0 0; font-size: 17px; }
.draft-conflict-item-head time { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.draft-conflict-index { display: inline-grid; place-items: center; min-width: 25px; height: 25px; margin-right: 8px; border-radius: 999px; background: #f59e0b; color: #fff; font-weight: 700; }
.draft-conflict-warning, .draft-conflict-note { margin: 12px 0 0; padding: 8px 10px; border-radius: 5px; background: #fff1f2; color: #9f1239; }
.draft-conflict-note { background: #eff6ff; color: #1e40af; }
.draft-conflict-fields-title { margin: 13px 0 0; font-weight: 700; color: #334155; }
.draft-conflict-table-wrap { margin-top: 12px; overflow-x: auto; }
.draft-conflict-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.draft-conflict-table th, .draft-conflict-table td { padding: 9px 10px; border: 1px solid #e2e8f0; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.draft-conflict-table thead th { background: #f8fafc; }
.draft-conflict-table tbody th { width: 26%; color: #334155; }
.draft-conflict-table td { width: 37%; }
.draft-value-label { display: none; color: var(--muted); font-size: 12px; }
.draft-conflict-item-actions { margin-top: 14px; }

@media (max-width: 720px) {
  .draft-conflict-banner { align-items: stretch; flex-direction: column; }
  .draft-conflict-banner .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .draft-conflict-backdrop { padding: 0; place-items: stretch; }
  .draft-conflict-dialog { width: 100%; max-height: 100vh; height: 100vh; border: 0; border-radius: 0; }
  .draft-conflict-dialog-head, .draft-conflict-dialog-foot, .draft-conflict-details-body { padding: 13px; }
  .draft-conflict-item { padding: 13px; }
  .draft-conflict-item-head { flex-direction: column; gap: 6px; }
  .draft-conflict-table { min-width: 0; }
  .draft-conflict-table thead { display: none; }
  .draft-conflict-table, .draft-conflict-table tbody, .draft-conflict-table tr, .draft-conflict-table th, .draft-conflict-table td { display: block; width: 100%; }
  .draft-conflict-table tr { border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; }
  .draft-conflict-table tr + tr { margin-top: 8px; }
  .draft-conflict-table th, .draft-conflict-table td { border: 0; }
  .draft-conflict-table th { background: #f8fafc; }
  .draft-value-label { display: block; margin-bottom: 3px; }
  .draft-conflict-item-actions { display: grid; grid-template-columns: 1fr; }
  .draft-conflict-item-actions button { width: 100%; }
}

.line-editor.delivery-consumption-editor,
.line-editor.delivery-consumption-editor:focus-within {
  overflow: visible !important;
  padding-bottom: 12px;
  scrollbar-gutter: auto !important;
}

.line-editor.delivery-consumption-editor .dynamic-name-picker {
  z-index: 500;
}

.line-editor.delivery-consumption-editor .dynamic-name-options {
  position: static;
  width: 100%;
  margin-top: 6px;
  z-index: 900;
  max-height: 260px;
  overflow-y: auto;
}

.delivery-item-card:has(.delivery-consumption-editor:focus-within),
.fold-panel:has(.delivery-consumption-editor:focus-within),
.fold-panel-body:has(.delivery-consumption-editor:focus-within),
.panel:has(.delivery-consumption-editor:focus-within) {
  overflow: visible !important;
  scrollbar-gutter: auto !important;
}
