:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d8dee8;
  --line-strong: #aeb9c8;
  --ink: #172033;
  --muted: #667085;
  --accent: #1f6f68;
  --accent-strong: #15534e;
  --warn: #8a5a00;
  --disabled: #eef1f5;
  --table-row-hover-bg: #edf8f4;
  --table-row-focus-bg: #e7f4f0;
}

/* P07 报价中心：列表与完整工作台分层 */
.p07-page-head {
  flex-wrap: wrap;
}

.p07-page-head > div,
.p07-workbench-bar > div,
.dialog-head > div {
  display: grid;
  gap: 3px;
}

.p07-list-toolbar,
.p07-workbench-bar,
.p07-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}

.p07-new-quote-button {
  flex: 0 0 auto;
  padding: 11px 20px;
  font-size: 15px;
}

.p07-list-filters {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.p07-list-filters > input {
  width: min(330px, 32vw);
}

.p07-list-filters input,
.p07-list-filters select,
.p07-filter-popover input,
.p07-filter-popover select,
.p07-editable-header input,
.p07-editable-header select,
.p07-cell-input,
.p07-process-input input,
.p07-process-input select,
.p07-fee-editor input,
.p07-fee-editor select,
.p07-print-settings select,
.p07-bom-mapping select,
.p07-file-field input,
.p07-p25-search input,
#p07BomP25Customer,
.p07-column-setting-row input[type="text"] {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
}

.p07-dimension-editor {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.p07-dimension-editor > span {
  flex: 0 0 auto;
  color: #315b60;
  font-weight: 700;
  white-space: nowrap;
}

.p07-dimension-editor > input {
  min-width: 58px;
}

.p07-dimension-editor.is-disabled {
  justify-content: center;
  color: #7b8794;
}

.p07-more-filters summary {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.p07-more-filters summary::-webkit-details-marker {
  display: none;
}

.p07-filter-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 38px;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  width: min(520px, 80vw);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
  padding: 10px;
}

.p07-filter-popover label,
.quote-edit-field,
.p07-file-field,
.p07-p25-search,
.p07-bom-mapping label,
.p07-print-settings > label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.p07-payment-terms-field[hidden] {
  display: none;
}

.p07-replay-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 8px 16px;
}

.p07-replay-strip > span,
.p07-replay-strip div span,
.p07-updated-cell span,
.p07-workbench-bar span,
.p07-workflow-actions span {
  color: var(--muted);
  font-size: 12px;
}

.p07-workflow-feedback:empty {
  display: none;
}

.p07-workflow-feedback[data-tone="success"] {
  color: var(--accent-strong);
}

.p07-workflow-feedback[data-tone="warning"],
.p07-workflow-feedback[data-tone="saving"] {
  color: var(--warn);
}

.p07-workflow-feedback[data-tone="error"] {
  color: #b42318;
}

.p07-replay-strip div {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.p07-replay-strip strong {
  font-size: 18px;
}

.p07-quote-list-table {
  table-layout: fixed;
}

.p07-quote-list-table .is-pinned-left,
.p07-quote-list-table .is-pinned-right,
.p07-items-table-wrap .quote-items-table .is-pinned-left,
.p07-items-table-wrap .quote-items-table .is-pinned-right {
  position: sticky;
  z-index: 2;
  background: var(--surface);
}

.p07-quote-list-table .is-pinned-left,
.p07-items-table-wrap .quote-items-table .is-pinned-left {
  left: var(--p07-pin-offset, 0);
  box-shadow: 1px 0 0 var(--line);
}

.p07-quote-list-table .is-pinned-right,
.p07-items-table-wrap .quote-items-table .is-pinned-right {
  right: var(--p07-pin-offset, 0);
  box-shadow: -1px 0 0 var(--line);
}

.p07-quote-list-table th,
.p07-items-table-wrap .quote-items-table th {
  position: relative;
  white-space: normal;
  overflow-wrap: anywhere;
}

.p07-quote-list-table th.is-pinned-left,
.p07-quote-list-table th.is-pinned-right,
.p07-items-table-wrap .quote-items-table th.is-pinned-left,
.p07-items-table-wrap .quote-items-table th.is-pinned-right {
  z-index: 4;
  background: #eef2f6;
}

.p07-workbench-bar {
  position: sticky;
  z-index: 9;
  top: 0;
  background: #fff;
}

.p07-save-area {
  display: flex !important;
  flex-wrap: wrap;
  grid-template-columns: none !important;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.p07-save-feedback {
  max-width: 320px;
  text-align: right;
}

.p07-save-feedback[data-tone="error"] {
  color: #a33a2b;
}

.p07-save-feedback[data-tone="success"] {
  color: var(--accent);
}

.p07-save-feedback[data-tone="saving"] {
  color: var(--muted);
}

.p07-header-status {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.p07-header-status > div {
  display: grid;
  gap: 2px;
}

.p07-header-status span,
.quote-edit-field span {
  color: var(--muted);
  font-size: 12px;
}

.p07-header-status > span:last-child {
  margin-left: auto;
}

.p07-header-edit-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(135px, 1fr));
  gap: 8px;
  padding-top: 9px;
}

.p07-workbench .quote-detail-toolbar {
  flex-wrap: wrap;
}

.p07-tax-policy-field > div {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) 72px;
  gap: 5px;
}

.p07-tax-policy-field small {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--muted);
  line-height: 1.25;
}

.p07-items-table-wrap .quote-items-table th.is-process-column .p07-column-label {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.p07-items-table-wrap .quote-items-table th.is-narrow-process-column .p07-column-label {
  font-size: 11px;
}

.p07-items-table-wrap .quote-items-table th.is-compact-process-column .p07-column-label {
  font-size: 10px;
}

.p07-items-table-wrap {
  max-height: 66vh;
  overflow: auto;
}

.p07-items-table-wrap .quote-items-table {
  table-layout: fixed;
}

.p07-items-table-wrap .quote-items-table th {
  position: sticky;
  z-index: 3;
  top: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.p07-items-table-wrap .quote-items-table td {
  padding: 6px;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.p07-items-table-wrap .quote-items-table input,
.p07-items-table-wrap .quote-items-table select {
  min-width: 0;
  max-width: 100%;
}

.p07-column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.p07-column-resizer:hover,
.p07-is-resizing-column .p07-column-resizer {
  border-right: 2px solid var(--accent);
}

.p07-is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.p07-process-input,
.p07-fee-editor,
.p07-processing-fee-editor,
.p07-unit-price-editor,
.p07-updated-cell {
  display: grid;
  gap: 4px;
}

.p07-process-input small {
  color: var(--muted);
  font-size: 11px;
}

.p07-process-quantity-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.p07-external-quote-cell {
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px;
}

.p07-external-quote-cell.is-pending {
  border-color: #e8b55a;
  background: #fff4df;
}

.p07-external-quote-cell.is-priced {
  border-color: #9bcfc3;
  background: #eaf7f3;
}

.p07-external-quote-check {
  min-width: 0;
}

.p07-process-input .p07-external-quote-check[aria-pressed="true"] > span:first-child {
  color: var(--accent);
}

.p07-masked-process-amount {
  letter-spacing: 1px;
}

.p07-external-pricing-summary {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eaf7f3;
  color: var(--accent-strong);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.p07-external-pricing-summary.has-pending {
  background: #fff1d6;
  color: #8a5a00;
}

.p07-quantity-help-dialog {
  width: min(620px, 92vw);
}

.p07-quantity-help-content {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.p07-quantity-help-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.p07-quantity-help-content strong {
  color: var(--ink);
}

.p07-surface-treatment-input,
.p07-weight-process-input {
  display: flex;
  align-items: center;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.p07-surface-treatment-input > .p07-search-select {
  min-width: 0;
  flex: 1 1 112px;
}

.p07-search-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.p07-search-select-input {
  padding-right: 28px !important;
  text-overflow: ellipsis;
}

.p07-search-select-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  width: 24px;
  height: 28px;
  min-height: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.p07-search-select-toggle:hover,
.p07-search-select-toggle:focus-visible {
  background: var(--soft);
  color: var(--accent-strong);
}

.p07-search-select-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.p07-search-select-menu {
  position: fixed;
  z-index: 10000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: 330px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.p07-search-select-menu[hidden] {
  display: none;
}

.p07-search-select-hint {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.35;
}

.p07-search-select-results {
  min-height: 0;
  overflow-y: auto;
  padding: 4px;
}

.p07-search-select-group + .p07-search-select-group {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.p07-search-select-group-label {
  color: var(--muted);
  padding: 4px 7px 3px;
  font-size: 11px;
  font-weight: 700;
}

.p07-search-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
}

.p07-search-select-option > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.p07-search-select-option small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.p07-search-select-option:hover,
.p07-search-select-option.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.p07-search-select-empty {
  color: var(--muted);
  padding: 14px 10px;
  font-size: 12px;
  line-height: 1.5;
}

.p07-process-input .p07-process-amount-input {
  width: auto;
  min-width: 40px;
  max-width: 78px;
  flex: 1 1 40px;
  padding-inline: 6px;
}

.p07-process-price-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 104px;
  gap: 4px;
  min-width: 0;
}

.p07-process-price-mode {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 3px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.p07-process-price-mode.is-manual {
  background: #fff1d6;
  color: #8a5a00;
}

.p07-inline-price-action {
  flex: 0 0 auto;
  padding: 2px 0;
  font-size: 10px;
  white-space: nowrap;
}

.p07-process-price-line .p07-inline-price-action:not([hidden]) {
  flex: 1 0 100%;
  justify-content: flex-start;
}

.p07-compact-check {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.p07-compact-check > span:first-child {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}

.p07-weight-process-value {
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.p07-bom-save-first {
  display: inline-block;
  max-width: 92px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.p07-process-scan-toggle {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 6px 9px;
}

.p07-process-input .p07-process-scan-toggle input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
}

.p07-fee-editor {
  min-width: 0;
}

.p07-processing-fee-editor,
.p07-unit-price-editor {
  min-width: 0;
}

.p07-processing-fee-editor strong,
.p07-unit-price-editor strong {
  min-height: 34px;
  display: flex;
  align-items: center;
}

.p07-processing-fee-editor small,
.p07-unit-price-editor small,
.p07-process-auto-scan small {
  color: var(--muted);
  font-size: 11px;
}

.p07-processing-fee-editor .link-button,
.p07-unit-price-editor .link-button {
  justify-self: start;
  padding: 0;
  font-size: 11px;
}

.p07-workflow-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #fff;
}

.p07-workflow-buttons,
.p07-dialog-tabs,
.p07-print-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.p07-bom-dialog,
.p07-print-dialog {
  width: min(1180px, 94vw);
  max-height: 92vh;
  overflow: auto;
}

.p07-bom-dialog > .dialog-actions {
  position: sticky;
  z-index: 12;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -5px 14px rgba(15, 23, 42, 0.07);
}

.p07-column-dialog {
  width: min(1040px, 94vw);
}

.p07-dialog-tabs,
.p07-bom-source-panel,
.p07-print-settings,
.p07-print-preview {
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.p07-dialog-tabs {
  justify-content: flex-start;
}

.p07-bom-source-panel {
  display: grid;
  gap: 10px;
}

.p07-p25-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(300px, 1.3fr);
  gap: 8px;
}

.p07-p25-picker-toolbar > label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.p07-p25-breadcrumb,
.p07-p25-project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 6px 9px;
}

.p07-p25-breadcrumb span {
  color: var(--muted);
  font-size: 12px;
}

.p07-p25-project-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}

#p07BomP25Candidates {
  max-height: 42vh;
  overflow: auto;
}

#p07BomP25Candidates table {
  min-width: 760px;
}

.p07-bom-selected-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.p07-bom-feedback {
  color: var(--muted);
  font-size: 12px;
}

.p07-bom-feedback[data-tone="error"] {
  color: #a33a2b;
}

.p07-bom-source-panel[hidden] {
  display: none;
}

.p07-bom-mapping {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 8px;
}

.p07-column-settings {
  display: grid;
  gap: 7px;
  max-height: 60vh;
  overflow: auto;
  padding: 12px 14px;
}

.p07-column-setting-row {
  display: grid;
  grid-template-columns: 100px minmax(160px, 1fr) 110px 150px auto;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
}

.p07-column-setting-row > label {
  display: grid;
  gap: 4px;
}

.p07-column-setting-row > label:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
}

.p07-print-settings {
  display: grid;
  gap: 8px;
}

.p07-print-settings > label {
  max-width: 320px;
}

.p07-print-settings > div {
  display: grid;
  gap: 5px;
}

.p07-print-settings .quote-export-fields::before,
.p07-print-settings .quote-export-fields::after {
  flex: 0 0 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.p07-print-settings .quote-export-fields::before {
  content: "常用字段";
  order: 0;
}

.p07-print-settings .quote-export-fields::after {
  content: "更多字段（按需勾选）";
  order: 2;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 7px;
}

.p07-print-settings .quote-export-fields label {
  order: 3;
}

.p07-print-settings .quote-export-fields label:has([data-p07-print-field="报价单号"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="客户"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="项目/设备"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="报价日期"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="零件名"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="图号"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="数量"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="单价"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="金额"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="交期"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="付款条件"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="含税说明"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="是否含运费"]),
.p07-print-settings .quote-export-fields label:has([data-p07-print-field="报价备注"]) {
  order: 1;
}

.p07-print-settings p,
.p07-bom-source-panel p,
.p07-print-preview > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.p07-customer-quote-preview {
  min-height: 420px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 22px;
  color: #111827;
}

.p07-customer-quote-preview header,
.p07-customer-quote-preview footer,
.p07-print-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.p07-customer-quote-preview h2 {
  margin: 0;
}

.p07-customer-quote-preview table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
}

.p07-customer-quote-preview th,
.p07-customer-quote-preview td {
  border: 1px solid #cbd5e1;
  padding: 7px;
  text-align: left;
}

@media (max-width: 1500px) {
  .p07-header-edit-grid {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 1000px) {
  .p07-list-toolbar,
  .p07-workbench-bar,
  .p07-workflow-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .p07-list-filters {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .p07-list-filters > input {
    width: min(100%, 360px);
  }

  .p07-header-edit-grid,
  .p07-bom-mapping {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .p07-column-setting-row {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .p07-column-setting-row > div {
    display: flex;
    align-items: center;
    gap: 6px;
  }
}

@media print {
  body.p07-printing * {
    visibility: hidden !important;
  }

  body.p07-printing #p07PrintPreview,
  body.p07-printing #p07PrintPreview * {
    visibility: visible !important;
  }

  body.p07-printing #p07PrintPreview {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
  }

  body.p07-printing .p07-customer-quote-preview {
    border: 0;
    padding: 0;
  }

  body.p11-printing-labels {
    background: #fff;
  }

  body.p11-printing-labels > *:not(#p11LabelPrintSheet) {
    display: none !important;
  }

  body.p11-printing-labels #p11LabelPrintSheet {
    display: block !important;
  }

  body.p11-printing-labels .tpl-sheet {
    border: 0;
    break-after: page;
    page-break-after: always;
  }

  body.p11-printing-labels .tpl-sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.p11-printing-labels .p11-label-print-card,
  body.p11-printing-labels .tpl-doc-page {
    border: 0;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #172033;
  color: #f9fafb;
  padding: 16px 12px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 700;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #b8c1ce;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin-top: 16px;
}

.nav-home {
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-module-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #f3f6fa;
  padding: 10px 10px 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.nav-module-button:hover,
.nav-module-button.active {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.nav-module-chevron {
  color: #8f9bae;
  font-size: 12px;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.nav-group.is-collapsed .nav-module-chevron {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: grid;
  gap: 2px;
  margin: 0 0 5px 10px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-group-items[hidden] {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d7dde7;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.nav-home-item {
  width: 100%;
  min-height: 40px;
  color: #f3f6fa;
  padding: 10px;
  font-size: 15px;
  font-weight: 700;
}

.nav-subitem {
  min-height: 34px;
  color: #bfc8d5;
  padding: 7px 9px 7px 10px;
  font-size: 13px;
  font-weight: 400;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(46, 150, 137, 0.24);
  color: #ffffff;
}

.nav-item.active {
  box-shadow: inset 2px 0 0 #6ccdc1;
}

.nav-home-item.active {
  box-shadow: inset 3px 0 0 #6ccdc1;
}

.nav-item em {
  border: 1px solid rgba(108, 205, 193, 0.5);
  border-radius: 999px;
  padding: 1px 5px;
  color: #9fe1d9;
  font-size: 10px;
  font-style: normal;
  line-height: 1.4;
}

.sidebar-version-note {
  display: grid;
  gap: 3px;
  margin-top: 20px;
  padding: 12px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-version-note strong {
  color: #d7dde7;
  font-size: 12px;
}

.sidebar-version-note span {
  color: #8f9bae;
  font-size: 11px;
}

.disabled-box {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.section-label {
  margin-bottom: 10px;
  color: #b8c1ce;
  font-size: 12px;
}

.disabled-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.disabled-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 5px 8px;
  color: #c7ceda;
  background: rgba(255, 255, 255, 0.06);
}

button.disabled-chip {
  font: inherit;
  text-align: left;
}

.disabled-chip-button {
  cursor: pointer;
}

.disabled-chip-button:hover {
  border-color: rgba(255, 255, 255, 0.42);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.configurable-chip-active {
  border-color: rgba(108, 205, 193, 0.7);
  color: #ffffff;
  background: rgba(31, 111, 104, 0.72);
}

.configurable-chip-active:hover {
  border-color: #8bd8cf;
  background: var(--accent);
}

.finance-center-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.finance-center-tabs strong {
  margin-right: 4px;
}

.finance-center-tabs button {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--ink);
  padding: 7px 10px;
  cursor: pointer;
}

.finance-center-tabs button:hover,
.finance-center-tabs button.active {
  border-color: var(--accent);
  background: #edf8f6;
  color: var(--accent-strong);
}

.workspace {
  min-width: 0;
  padding: 18px;
  overflow: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: -18px -18px 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 252, 0.96);
  backdrop-filter: blur(8px);
}

.workspace-heading {
  min-width: 0;
}

.workspace-breadcrumb {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-heading h1 {
  margin: 0;
  font-size: 20px;
}

.workspace-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-actions[hidden] {
  display: none !important;
}

.topbar-settings-button {
  min-height: 38px;
  padding-inline: 12px;
  font-weight: 700;
}

.module-subnav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.module-subnav strong {
  margin-right: 6px;
  color: var(--ink);
}

.module-tab {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.module-tab:hover,
.module-tab.active {
  border-color: #b7d9d4;
  background: #edf8f6;
  color: var(--accent-strong);
}

.module-tab-primary {
  margin-left: auto;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.module-tab-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.workspace > [data-page][hidden],
.module-subnav[hidden],
.finance-center-tabs[hidden],
#metrics[hidden] {
  display: none !important;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

.topbar p,
.panel-head span {
  color: var(--muted);
}

.primary-button,
.writeoff-row button {
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
}

.primary-button:hover,
.writeoff-row button:hover {
  background: var(--accent-strong);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.notice-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 16px;
  padding: 12px;
  color: var(--muted);
}

.notice-strip strong {
  color: var(--ink);
}

.page-map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
}

.page-map-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.page-map-column h3 {
  margin: 0;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.page-map-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.page-map-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
}

.page-map-item.standard {
  border-left-color: var(--accent);
}

.page-map-item.advanced {
  border-left-color: #7a5af8;
}

.page-map-item.addon {
  border-left-color: var(--warn);
}

.page-map-item strong,
.page-map-item span {
  display: block;
}

.page-map-item span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.page-map-item em {
  flex: 0 0 auto;
  border-radius: 6px;
  background: #eef2f6;
  color: #243044;
  padding: 4px 7px;
  font-style: normal;
  white-space: nowrap;
}

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

.skeleton-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.skeleton-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.skeleton-title span {
  border-radius: 6px;
  background: #eef2f6;
  color: #243044;
  padding: 4px 7px;
  white-space: nowrap;
}

.skeleton-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.skeleton-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.7;
}

.skeleton-card em {
  display: block;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--warn);
  font-style: normal;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.metric b {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel h2 {
  font-size: 17px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.quote-items-table {
  min-width: 100%;
}

.order-sheet-table {
  min-width: 3400px;
}

.order-import-quotes-table {
  min-width: 1260px;
}

.order-import-p25-table {
  min-width: 1460px;
}

.order-list-table {
  min-width: 1580px;
}

.order-items-table {
  min-width: 100%;
}

.p25-intro {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  padding: 12px 16px;
}

.p25-intro strong {
  color: var(--ink);
}

.p25-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.p25-search-toolbar label {
  display: grid;
  flex: 1 1 220px;
  gap: 6px;
  min-width: 180px;
  max-width: 300px;
  color: var(--muted);
  font-size: 12px;
}

.p25-search-toolbar .p25-search-actions {
  flex: 0 0 auto;
}

.p25-search-toolbar input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.p25-action-row,
.p07-module-lock {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 10px 16px;
}

.p25-action-row span,
.p07-module-lock span {
  font-size: 13px;
}

.p07-module-lock strong {
  color: var(--ink);
}

.p25-archive-layout {
  display: grid;
  gap: 0;
}

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

.p25-archive-table {
  width: 100%;
  min-width: 944px;
  table-layout: fixed;
}

.p25-list-select {
  width: 44px;
}

.p25-list-customer {
  width: 150px;
}

.p25-list-project {
  width: 240px;
}

.p25-list-drawings {
  width: 80px;
}

.p25-list-amount {
  width: 120px;
}

.p25-list-actions {
  width: 310px;
}

.p25-archive-table th,
.p25-archive-table td {
  vertical-align: middle;
}

.p25-archive-table .p25-operation-stack {
  gap: 6px;
  justify-content: flex-start;
}

.p25-select-column {
  text-align: center;
}

.p25-select-column input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.p25-rename-project-dialog {
  width: min(680px, 100%);
}

.p25-rename-project-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.p25-rename-project-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.p25-rename-project-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.p25-rename-project-form input[readonly] {
  background: #f7f9fb;
  color: var(--muted);
}

.p25-rename-project-new-name,
.p25-rename-project-form .p25-dialog-feedback,
.p25-rename-project-form .dialog-actions {
  grid-column: 1 / -1;
}

.p25-dialog-feedback {
  min-height: 18px;
  margin: 0;
  color: #a33a2c;
  font-size: 12px;
}

.p25-rename-project-form .dialog-actions {
  margin: 2px -14px -14px;
}

.p25-detail-head {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  align-items: center;
}

.p25-detail-title {
  min-width: 0;
}

.p25-detail-title h3,
.p25-detail-title p {
  margin: 0;
}

.p25-detail-table {
  table-layout: fixed;
}

.p25-detail-table th,
.p25-detail-table td {
  white-space: nowrap;
  box-sizing: border-box;
  overflow: hidden;
  padding: 8px 6px;
  text-overflow: ellipsis;
}

.p25-material-note-cell,
.p25-process-note-cell {
  white-space: normal;
  line-height: 1.45;
}

.p25-detail-table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.p25-detail-table-wrap::-webkit-scrollbar {
  height: 0;
}

.p25-horizontal-scroll {
  height: 16px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  background: #f7f9fb;
  scrollbar-color: var(--line-strong) transparent;
}

.p25-horizontal-scroll > div {
  height: 1px;
}

.p25-process-column {
  text-align: center;
}

.p25-detail-table .is-pinned-left,
.p25-detail-table .is-pinned-right {
  position: sticky;
  z-index: 3;
  background: inherit;
}

.p25-detail-table .is-pinned-left {
  left: var(--p25-pin-offset, 0);
  box-shadow: 1px 0 0 var(--line);
}

.p25-detail-table .is-pinned-right {
  right: var(--p25-pin-offset, 0);
  box-shadow: -1px 0 0 var(--line);
}

.p25-detail-table th.is-pinned-left,
.p25-detail-table th.is-pinned-right {
  z-index: 6;
  background: #eef2f6;
}

.p25-detail-table tbody td.is-pinned-left,
.p25-detail-table tbody td.is-pinned-right {
  background: #fff;
}

.p25-detail-table th {
  position: relative;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  line-height: 1.15;
}

.p25-column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.p25-column-resizer:hover,
.p25-is-resizing-column .p25-column-resizer {
  border-right: 2px solid var(--accent);
}

.p25-is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.p25-unsaved-new-row > td,
.p25-unsaved-new-row > td.is-pinned-left,
.p25-unsaved-new-row > td.is-pinned-right {
  background: #fff9e8;
}

.p25-detail-selected-row > td,
.p25-detail-selected-row > td.is-pinned-left,
.p25-detail-selected-row > td.is-pinned-right {
  background: #edf8f5;
}

.p25-process-empty {
  color: var(--muted);
}

.p25-process-inline {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.p25-process-inline small {
  color: var(--muted);
  font-size: 11px;
}

.p25-process-route-inline,
.p25-process-scan,
.p25-process-number {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.p25-process-number input {
  width: min(86px, 100%);
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 6px 7px;
}

.p25-process-number input:disabled {
  background: #f1f3f5;
}

.p25-process-number input.is-awaiting-conversion {
  width: min(108px, 100%);
  border-style: dashed;
  background: #fffbea;
}

.p25-process-readonly-quantity {
  display: inline-flex;
  justify-content: center;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.p25-scan-enabled {
  color: var(--accent-strong);
  font-weight: 600;
}

.p25-draft-input,
.p25-current-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  padding: 7px 8px;
}

.p25-quantity-edit {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.p25-quantity-edit .p25-draft-input,
.p25-quantity-edit .p25-current-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding-inline: 4px;
}

.p25-price-cell,
.p25-unit-price-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.p25-price-cell small,
.p25-price-mode,
.p25-unit-price-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.p25-price-input,
.p25-price-reason {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 6px 7px;
}

.p25-unit-price-cell > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.p25-detail-table input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.p25-detail-table input[type="number"]::-webkit-inner-spin-button,
.p25-detail-table input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.p25-unit-price-cell .link-button,
.p25-process-inline .link-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  padding: 0;
  font-size: 11px;
}

.p25-price-warning {
  color: #b42318 !important;
  white-space: normal;
}

.p25-unit-price-cell.is-below-cost .p25-price-input {
  border-color: #d92d20;
  background: #fff5f4;
}

.is-hidden {
  display: none !important;
}

.p25-operation-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.p25-maintenance-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 16px;
}

.p25-maintenance-primary {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.p25-detail-selection-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
  padding: 8px 16px;
}

.p25-detail-selection-actions,
.p25-detail-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.p25-detail-transfer-actions {
  justify-content: flex-end;
}

.p25-detail-transfer-actions > span,
.p25-selected-part-count {
  color: var(--muted);
  font-size: 12px;
}

.p25-selected-part-count {
  min-width: 64px;
  font-weight: 600;
}

.p25-local-feedback {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.p25-search-actions,
.p25-display-toolbar,
.p25-display-group,
.p25-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.p25-display-toolbar {
  justify-content: flex-end;
}

.p25-display-select {
  display: flex;
  gap: 7px;
  align-items: center;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.p25-display-select select {
  min-width: 128px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 30px 7px 9px;
}

.p25-display-group {
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.p25-view-switch {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.p25-view-switch .table-action.is-active {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.p25-row-actions {
  min-width: 0;
}

.p25-row-action-cell {
  display: grid;
  gap: 5px;
  align-items: start;
}

.p25-row-feedback {
  display: block;
  max-width: 420px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
}

.p25-row-feedback:empty {
  display: none;
}

.p25-same-drawing-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.p25-same-drawing-body p,
.p25-same-drawing-body ul {
  margin: 0;
}

.p25-same-drawing-body ul {
  display: grid;
  gap: 6px;
  padding-left: 22px;
}

.p25-quantity-cell,
.p25-detail-table th:has(.quantity-header) {
  text-align: center;
}

.p25-detail-table th .quantity-header {
  justify-items: center;
}

.p25-stacked-header {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-width: 0;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.p25-stacked-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.p25-history-list {
  display: grid;
  gap: 8px;
  max-height: min(55vh, 520px);
  overflow-y: auto;
  padding: 14px;
}

.p25-history-list article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 10px;
}

.p25-history-list span,
.p25-history-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.p25-column-settings {
  max-height: min(55vh, 480px);
  overflow-y: auto;
  padding: 14px;
}

.p25-column-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.p25-column-add-row label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.p25-column-add-row select {
  min-width: 220px;
}

.p25-column-add-row > span {
  color: var(--muted);
  font-size: 12px;
}

.p25-column-setting-list {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.p25-column-setting-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) auto minmax(150px, 1fr) 120px 150px auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 8px 10px;
}

.p25-column-setting-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.p25-column-setting-row label:has([data-p25-column-width]) {
  grid-template-columns: 1fr auto;
}

.p25-column-setting-row label:has([data-p25-column-width]) > :first-child {
  grid-column: 1 / -1;
}

.p25-column-setting-row input,
.p25-column-setting-row select,
.p25-column-add-row select {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
}

.p25-column-setting-title {
  display: flex;
  gap: 7px;
  align-items: center;
  align-self: center;
}

.p25-column-kind {
  border-radius: 999px;
  background: #eaf4f1;
  color: var(--accent-strong);
  padding: 2px 6px;
  font-size: 10px;
}

.p25-column-order-actions {
  display: flex;
  gap: 4px;
  align-self: center;
}

.p25-pending-navigation-copy {
  padding: 18px;
  color: var(--ink);
}

.p25-transfer-candidates {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: #f4faf8;
  padding: 10px 16px;
}

.p25-transfer-candidates[hidden] {
  display: none;
}

.p25-transfer-candidates strong,
.p25-transfer-candidates span {
  display: block;
}

.p25-transfer-candidates > div > span {
  color: var(--muted);
  font-size: 12px;
}

.p25-transfer-chip-list {
  display: flex;
  flex: 1 1 320px;
  gap: 6px;
  flex-wrap: wrap;
}

.p25-transfer-chip-list span {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px;
  font-size: 12px;
}

.p25-advanced-note {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  padding: 12px 16px;
}

.p25-selected-row {
  background: #f4faf8;
}

.order-import-panel {
  border-bottom: 1px solid var(--line);
}

.order-import-panel .order-detail-head {
  background: #fbfcfe;
}

.p25-import-search {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.p25-import-search label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.p25-import-search input {
  width: 100%;
  border: 1px solid #c5d0df;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.selected-import-row {
  background: #f4faf8;
}

.order-sheet-table th,
.order-sheet-table td,
.order-list-table th,
.order-list-table td,
.order-items-table th,
.order-items-table td {
  white-space: nowrap;
}

.order-sheet-table th:nth-child(8),
.order-sheet-table td:nth-child(8),
.order-sheet-table th:nth-child(13),
.order-sheet-table td:nth-child(13),
.order-sheet-table th:nth-child(24),
.order-sheet-table td:nth-child(24) {
  min-width: 220px;
  white-space: normal;
  line-height: 1.45;
}

.p11-configurable-table th,
.p11-configurable-table td {
  position: relative;
  vertical-align: middle;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  line-height: 1.4;
}

.p11-configurable-table td > *,
.p11-configurable-table th > * {
  max-width: 100%;
}

.order-list-table th:nth-child(2),
.order-list-table td:nth-child(2),
.order-list-table th:nth-child(3),
.order-list-table td:nth-child(3),
.order-list-table th:nth-child(5),
.order-list-table td:nth-child(5),
.order-list-table th:nth-child(6),
.order-list-table td:nth-child(6),
.order-list-table th:nth-child(7),
.order-list-table td:nth-child(7) {
  min-width: 130px;
  white-space: normal;
  line-height: 1.45;
}

.order-list-table td strong,
.order-list-table td span,
.order-list-table td em,
.order-items-table td strong,
.order-items-table td span,
.order-items-table td em,
.order-items-table td small {
  display: block;
}

.order-list-table td em,
.order-items-table td em,
.order-items-table td small {
  color: var(--muted);
  font-style: normal;
}

.p11-row-replenishment-child td {
  background: #f7fbfa;
}

.p11-row-replenishment-child td:first-child {
  box-shadow: inset 4px 0 0 var(--accent);
}

.p11-child-tracking {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.15;
}

.p11-tracking-main-line {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.p11-tracking-detail-line {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.p11-tracking-value {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.p11-child-tracking strong::before {
  content: "-> ";
  color: var(--accent-strong);
}

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

th {
  background: #eef2f6;
  color: #243044;
  font-weight: 700;
}

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

/* 全站业务数据表：用同一套行定位提示，固定列与普通列保持连续。
   已选、草稿/新行、补料、汇总和说明行保留各自业务状态色。 */
table:not(
    .p07-customer-quote-preview table,
    .delivery-note-preview table,
    .receivable-statement-preview table,
    .table-row-highlight-disabled
  )
  tbody
  > tr:not(
    .p25-unsaved-new-row,
    .p25-selected-row,
    .selected-import-row,
    .p11-row-replenishment-child,
    .process-summary-row,
    .p21-summary-row,
    .document-number-rule-row.is-inactive,
    .table-row-state-preserved,
    [aria-selected="true"],
    [aria-disabled="true"]
  ):not(:has(> td[colspan])):hover
  > td {
  background: var(--table-row-hover-bg);
}

table:not(
    .p07-customer-quote-preview table,
    .delivery-note-preview table,
    .receivable-statement-preview table,
    .table-row-highlight-disabled
  )
  tbody
  > tr:not(
    .p25-unsaved-new-row,
    .p25-selected-row,
    .selected-import-row,
    .p11-row-replenishment-child,
    .process-summary-row,
    .p21-summary-row,
    .document-number-rule-row.is-inactive,
    .table-row-state-preserved,
    [aria-selected="true"],
    [aria-disabled="true"]
  ):not(:has(> td[colspan])):focus-within
  > td {
  background: var(--table-row-focus-bg);
}

.status {
  display: inline-block;
  border-radius: 6px;
  padding: 4px 7px;
  background: #e8f4f2;
  color: var(--accent-strong);
}

.status.warn {
  background: #fff4dc;
  color: var(--warn);
}

.status.warning {
  background: #fff4dc;
  color: var(--warn);
}

.status.voided {
  background: #fdeceb;
  color: #9a332d;
}

.p12-search-row,
.p12-filter-row {
  display: grid;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.p12-search-row {
  grid-template-columns: auto minmax(300px, 2fr) 140px 150px 140px auto auto auto;
}

.p12-scan-button {
  align-self: end;
  min-height: 46px;
  min-width: 92px;
  padding: 10px 20px;
  font-size: 17px;
  font-weight: 800;
}

.p12-filter-row {
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
}

.p12-search-row label,
.p12-filter-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.p12-keyword-field {
  min-width: 280px;
}

.p12-search-row input,
.p12-search-row select,
.p12-scan-dialog-preview input,
.p12-scan-dialog-preview select,
.p12-filter-row input,
.p12-filter-row select,
.p15-scan-card input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
}

.p12-search-note {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  padding: 9px 16px;
  font-size: 12px;
  line-height: 1.45;
}

.p12-scan-dialog-preview {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 16px;
}

.scan-workbench-head,
.scan-list-toolbar,
.scan-submit-bar {
  display: grid;
  gap: 8px;
}

.scan-workbench-head {
  grid-template-columns: minmax(110px, 0.28fr) repeat(3, minmax(210px, 1fr));
  align-items: center;
}

.scan-workbench-head strong,
.scan-workbench-head span,
.scan-list-toolbar span,
.scan-list-table td strong,
.scan-list-table td span,
.scan-submit-bar span,
.p12-action-note {
  display: block;
}

.scan-workbench-head span,
.scan-list-toolbar span,
.scan-list-table td span,
.scan-submit-bar span,
.p12-action-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.scan-list-toolbar,
.scan-submit-bar {
  grid-template-columns: minmax(240px, 1fr) repeat(2, auto);
  align-items: center;
}

.scan-list-toolbar {
  grid-template-columns: auto 1fr;
}

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

.scan-list-table {
  min-width: 980px;
  font-size: 13px;
}

.scan-list-table th,
.scan-list-table td {
  padding: 8px 9px;
  vertical-align: top;
}

.scan-list-table th {
  white-space: nowrap;
}

.scan-list-table input[type="checkbox"],
.scan-process-codes input[type="checkbox"],
.p15-scan-list input[type="checkbox"] {
  width: auto;
}

.inline-qty-fields {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-left: 8px;
  border-radius: 5px;
  background: #f1f5f9;
  color: var(--muted);
  padding: 3px 6px;
  white-space: nowrap;
  line-height: 1.2;
}

.inline-qty-fields span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.quantity-compact-cell {
  display: inline-flex;
  align-items: center;
  min-width: 96px;
  line-height: 1.25;
}

.quantity-compact-cell span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.quantity-header {
  display: grid;
  gap: 2px;
  line-height: 1.15;
}

.quantity-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-qty-fields input,
.quantity-compact-cell input,
.p12-scan-dialog-preview .inline-qty-fields input {
  width: 42px;
  min-width: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 2px 3px;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
}

.p11-quantity-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.p11-quantity-editor label,
.p11-quantity-value {
  display: grid;
  gap: 2px;
  align-content: center;
}

.p11-quantity-editor small {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.p11-quantity-editor input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  padding: 4px 3px;
  color: var(--ink);
  text-align: center;
  font: inherit;
  font-size: 12px;
}

.p11-quantity-editor .p11-stock-readonly,
.p11-quantity-editor .p11-processing-readonly,
.p11-quantity-editor .p11-delivery-readonly {
  border-style: dashed;
  background: var(--soft);
  color: var(--muted);
}

.p11-processing-edit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.p11-processing-edit-actions .table-action {
  min-height: 24px;
  padding: 2px 4px;
  font-size: 10px;
}

.p11-quantity-value {
  min-height: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  padding: 3px;
  text-align: center;
}

.p11-quantity-value strong {
  color: var(--ink);
}

.scan-process-codes {
  display: flex;
  min-width: 280px;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.scan-process-codes label,
.process-add-select summary,
.p15-scan-list p b {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.2;
}

.scan-process-codes label:has(input:checked) {
  border-color: var(--accent);
  background: #e8f4f2;
  color: var(--accent-strong);
}

.process-add-select {
  position: relative;
}

.process-add-select summary {
  cursor: pointer;
  list-style: none;
}

.process-add-select summary::-webkit-details-marker {
  display: none;
}

.process-add-select[open] label {
  display: flex;
  gap: 5px;
  width: max-content;
  margin-top: 5px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 5px 7px;
}

.scan-submit-bar {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.scan-row-actions {
  display: flex;
  min-width: 190px;
  flex-wrap: wrap;
  gap: 6px;
}

.p12-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px 16px;
}

.p12-summary-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.p12-summary-strip span,
.p12-summary-strip strong,
.p12-summary-strip em,
.p12-production-table td strong,
.p12-production-table td span {
  display: block;
}

.p12-summary-strip span {
  color: var(--muted);
  font-size: 12px;
}

.p12-summary-strip strong {
  margin-top: 4px;
  color: var(--ink);
}

.p12-summary-strip em {
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}

.p12-production-table {
  min-width: 2860px;
  font-size: 13px;
}

.p12-production-table th,
.p12-production-table td {
  padding: 8px 9px;
  vertical-align: top;
}

.p12-production-table th {
  white-space: nowrap;
}

.p12-production-table td {
  vertical-align: top;
}

.p12-production-table td span {
  margin-top: 3px;
  color: var(--muted);
}

.p12-due-cell strong {
  font-size: 15px;
}

.risk-chip {
  display: inline-block;
  width: max-content;
  margin-top: 5px;
  border-radius: 5px;
  background: #edf2f7;
  color: #344054;
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.2;
}

.risk-chip.risk-watch {
  background: #fff4dc;
  color: var(--warn);
}

.risk-chip.risk-overdue {
  background: #fff0ed;
  color: #b42318;
}

.risk-chip.risk-upcoming {
  background: #fff8d9;
  color: #866500;
}

.risk-chip.risk-completed {
  background: #e8f5f1;
  color: var(--accent-strong);
}

.p12-due-cell.risk-overdue strong {
  color: #b42318;
}

.p12-due-cell.risk-watch strong {
  color: #a45113;
}

.p12-due-cell.risk-upcoming strong {
  color: #866500;
}

.p12-due-cell.risk-completed strong {
  color: var(--accent-strong);
}

.p12-process-cell {
  min-width: 104px;
  border-left: 1px solid var(--line);
  background: #fff;
  text-align: center;
}

.p12-process-cell strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.p12-process-cell span {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.p12-process-cell.done {
  background: #f4fbf8;
}

.p12-process-cell.active {
  background: #fff8e8;
}

.p12-process-cell.empty {
  background: #ffffff;
}

.p12-process-cell.muted {
  background: #f7f8fa;
}

.p12-process-cell.muted span {
  color: var(--muted);
}

.p12-process-cell.highlight {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.p12-process-cell:hover {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.p12-action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 160px;
}

.p12-action-stack .p12-action-note {
  flex-basis: 100%;
}

.keyword-chip {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 5px 7px;
  font-size: 12px;
  cursor: default;
}

.p12-boundary-note,
.p15-boundary-note {
  color: var(--muted);
  line-height: 1.55;
}

.p12-boundary-note {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px 16px;
}

/* P12 第二轮：动态工序、账号列设置、统一扫码与分页。 */
.p12-panel .p12-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
}

.p12-panel .p12-search-row label {
  flex: 0 1 132px;
  min-width: 0;
  gap: 4px;
}

.p12-panel .p12-search-row .p12-keyword-field {
  flex: 1 1 300px;
  min-width: 220px;
}

.p12-panel .p12-search-row > button {
  flex: 0 0 auto;
}

.p12-panel .p12-search-row input,
.p12-panel .p12-search-row select {
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
}

.p12-panel .p12-search-note {
  padding: 7px 12px;
}

.p12-view-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 8px 12px;
}

.p12-view-tabs .table-action {
  min-width: 112px;
}

.p12-external-view {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.p12-external-view[hidden] {
  display: none;
}

.p12-external-toolbar,
.p12-external-section-head,
.p12-external-dialog-head,
.p12-external-dialog-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.p12-external-toolbar strong,
.p12-external-toolbar span,
.p12-external-section-head strong,
.p12-external-section-head span {
  display: block;
}

.p12-external-toolbar span,
.p12-external-section-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.p12-external-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.p12-external-operator {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 5px 6px 5px 9px;
  white-space: nowrap;
}

.p12-external-operator span {
  margin: 0;
  font-size: 11px;
}

.p12-external-operator strong {
  font-size: 12px;
}

.p12-external-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.p12-external-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.p12-external-metrics span,
.p12-external-metrics strong {
  display: block;
}

.p12-external-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.p12-external-metrics strong {
  margin-top: 3px;
  font-size: 18px;
}

.p12-external-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(140px, 0.6fr) minmax(160px, 0.8fr) minmax(220px, 1.4fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 9px;
}

.p12-external-filters label,
.p12-external-dialog-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.p12-external-filters input,
.p12-external-filters select,
.p12-external-dialog input,
.p12-external-dialog select,
.p12-external-dialog textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
}

.p12-external-section {
  display: grid;
  gap: 7px;
}

.p12-external-selection-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 6px 8px;
}

.p12-external-selection-bar > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.p12-external-selection-bar > strong {
  margin-left: 4px;
  color: var(--accent-strong);
  font-size: 12px;
  white-space: nowrap;
}

.p12-external-selection-feedback {
  flex: 1 1 auto;
  color: #9a5b13;
  font-size: 12px;
  text-align: right;
}

.p12-external-table {
  width: 100%;
  min-width: 1540px;
  table-layout: fixed;
  font-size: 12px;
}

.p12-external-table th,
.p12-external-table td {
  padding: 8px 9px;
  vertical-align: top;
}

.p12-external-table th {
  white-space: nowrap;
}

.p12-external-table .selection-column {
  width: 54px;
  text-align: center;
}

.p12-external-table tr.is-selected td {
  background: #edf8f4;
}

.p12-external-table .p12-primary-cell {
  gap: 2px;
}

.p12-external-status {
  display: inline-flex;
  border-radius: 5px;
  background: #edf2f7;
  color: #344054;
  padding: 3px 6px;
  font-weight: 700;
}

.p12-external-status.sent,
.p12-external-status.partial {
  background: #fff4dc;
  color: #9a5b13;
}

.p12-external-status.returned {
  background: #e8f5f1;
  color: var(--accent-strong);
}

.p12-external-status.exception {
  background: #fff0ed;
  color: #b42318;
}

.p12-external-dialog {
  width: min(96vw, 1380px);
  max-width: none;
  max-height: 92vh;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0;
  box-shadow: 0 20px 70px rgb(15 23 42 / 28%);
}

.p12-external-dialog::backdrop {
  background: rgb(15 23 42 / 48%);
}

.p12-external-dialog-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(180px, 1fr) auto;
  max-height: 92vh;
  overflow: hidden;
}

.p12-external-send-dialog-shell {
  grid-template-rows: auto auto auto auto minmax(180px, 1fr) auto;
}

.p12-external-record-dialog-shell {
  grid-template-rows: auto minmax(180px, 1fr) auto;
}

/* 可编辑的已回弹窗多一行扫码栏：表格行伸展，提示条只占自身高度。 */
.p12-external-return-dialog-shell {
  grid-template-rows: auto auto auto auto minmax(180px, 1fr) auto;
}

.p12-external-dialog-head,
.p12-external-dialog-controls,
.p12-external-dialog-feedback,
.p12-external-dialog-actions {
  padding: 10px 12px;
}

.p12-external-dialog-head,
.p12-external-dialog-controls,
.p12-external-dialog-feedback {
  border-bottom: 1px solid var(--line);
}

.p12-external-dialog-head h3 {
  margin: 0;
}

.p12-external-dialog-head span,
.p12-external-dialog-feedback {
  color: var(--muted);
  font-size: 12px;
}

/* 2026-10-26：外协弹窗的拦截提示必须醒目，不能和操作员工说明混成灰字。 */
.p12-external-dialog-feedback {
  align-self: start;
}

.p12-external-dialog-feedback[data-tone="error"] {
  background: #fff0ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 600;
}

.p12-external-dialog-feedback[data-tone="success"] {
  background: #f0f9f6;
  color: var(--accent-strong);
}

.p12-external-dialog-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 0.9fr) minmax(280px, 1.2fr) auto;
  gap: 8px;
  align-items: end;
  background: #fbfcfe;
}

.p12-external-dialog-table-wrap {
  overflow: auto;
}

.p12-external-dialog-table {
  min-width: 1040px;
  table-layout: fixed;
  font-size: 12px;
}

.p12-external-dialog-table th,
.p12-external-dialog-table td {
  padding: 7px 8px;
  vertical-align: top;
}

.p12-external-dialog-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf2f7;
}

.p12-external-dialog-actions {
  align-items: end;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.p12-external-dialog-actions .p12-external-dialog-field {
  flex: 1 1 auto;
}

.p12-external-pagination-bar {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 7px 7px;
}

.p12-external-quantity {
  display: grid;
  gap: 2px;
  text-align: center;
}

.p12-external-quantity strong {
  font-size: 14px;
}

.p12-external-quantity small,
.p12-external-assignment small {
  color: var(--muted);
}

.p12-external-assignment {
  display: grid;
  gap: 3px;
}

.p12-external-record-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  overflow: auto;
}

.p12-external-record-list article {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
}

.p12-main-table-wrap {
  max-height: min(68vh, 760px);
  overflow: auto;
  border-bottom: 1px solid var(--line);
}

.p12-panel .p12-production-table {
  width: max-content;
  table-layout: fixed;
  font-size: 13px;
}

.p12-panel .p12-production-table th,
.p12-panel .p12-production-table td {
  box-sizing: border-box;
  min-width: 0;
  padding: 7px 8px;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.p12-panel .p12-production-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #edf2f7;
  box-shadow: inset 0 -1px 0 var(--line);
  white-space: normal;
}

.p12-panel .p12-production-table .is-pinned-left,
.p12-panel .p12-production-table .is-pinned-right {
  position: sticky;
  z-index: 3;
  background: #fff;
}

.p12-panel .p12-production-table .is-pinned-left {
  left: var(--p12-pin-offset, 0);
  box-shadow: 1px 0 0 var(--line);
}

.p12-panel .p12-production-table .is-pinned-right {
  right: var(--p12-pin-offset, 0);
  box-shadow: -1px 0 0 var(--line);
}

.p12-panel .p12-production-table thead .is-pinned-left,
.p12-panel .p12-production-table thead .is-pinned-right {
  z-index: 7;
  background: #edf2f7;
}

.p12-column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.p12-column-resizer:hover,
.p12-is-resizing-column .p12-column-resizer {
  border-right: 2px solid var(--accent);
}

.p12-is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.p12-primary-cell,
.p12-quantity-cell,
.p12-scan-employee-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.p12-primary-cell strong,
.p12-primary-cell span,
.p12-primary-cell small,
.p12-quantity-cell strong,
.p12-quantity-cell small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.p12-primary-cell span,
.p12-primary-cell small,
.p12-quantity-cell small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.p12-quantity-cell strong {
  white-space: nowrap;
}

.p12-panel .p12-process-cell {
  min-width: 0;
  text-align: left;
}

.p12-panel .p12-process-cell strong,
.p12-panel .p12-process-cell span,
.p12-panel .p12-process-cell small {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.p12-panel .p12-process-cell strong {
  font-size: 12px;
}

.p12-panel .p12-process-cell span,
.p12-panel .p12-process-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.p12-empty-cell {
  color: var(--muted);
  padding: 24px !important;
  text-align: center;
}

.p12-scan-dialog {
  width: min(96vw, 1560px);
  max-width: none;
  max-height: 92vh;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0;
  box-shadow: 0 20px 70px rgb(15 23 42 / 28%);
}

.p12-scan-dialog::backdrop {
  background: rgb(15 23 42 / 48%);
}

.p12-scan-dialog-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(180px, 1fr) auto;
  max-height: 92vh;
  overflow: hidden;
}

.p12-scan-dialog-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.p12-scan-dialog-head h3 {
  margin: 0;
}

.p12-scan-dialog-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.p12-scan-identity-row {
  display: grid;
  grid-template-columns: auto minmax(260px, 0.9fr) minmax(220px, 0.7fr) minmax(300px, 1.2fr);
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 10px 14px;
}

.p12-scan-mode-switch {
  display: flex;
  gap: 6px;
}

.p12-scan-inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 6px;
  align-items: end;
}

.p12-scan-inline-form label,
.p12-scan-note-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.p12-scan-inline-form input,
.p12-scan-note-field input,
.p12-scan-quantity {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
}

.p12-scan-employee-summary {
  display: grid;
  gap: 2px;
  min-height: 54px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px 9px;
}

.p12-scan-employee-summary.ready {
  border-color: #8bc8bb;
  background: #f4fbf8;
}

.p12-scan-employee-summary span,
.p12-scan-employee-summary small {
  color: var(--muted);
  font-size: 11px;
}

.p12-scan-employee-summary .table-action {
  justify-self: start;
  margin-top: 3px;
}

.p12-scan-feedback {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  padding: 7px 14px;
  font-size: 12px;
}

.p12-scan-feedback[data-tone="success"] {
  background: #f0f9f6;
  color: var(--accent-strong);
}

.p12-scan-feedback[data-tone="error"] {
  background: #fff0ed;
  color: #9a3412;
}

.p12-scan-table-wrap {
  overflow: auto;
}

.p12-scan-table {
  min-width: 1120px;
  table-layout: fixed;
  font-size: 12px;
}

.p12-scan-table th,
.p12-scan-table td {
  padding: 7px 8px;
  vertical-align: top;
}

.p12-scan-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf2f7;
  white-space: nowrap;
}

.p12-scan-table th:nth-child(1) {
  width: 52px;
}

.p12-scan-table th:nth-child(2) {
  width: 210px;
}

.p12-scan-table th:nth-child(3) {
  width: 122px;
}

.p12-scan-table th:nth-child(4) {
  width: 90px;
}

.p12-scan-table th:nth-child(5) {
  width: 510px;
}

.p12-scan-table th:nth-child(6) {
  width: 108px;
}

.p12-scan-table th:nth-child(7) {
  width: 72px;
}

.p12-scan-table input[type="checkbox"] {
  width: auto;
}

.p12-scan-quantity {
  text-align: center;
}

.p12-scan-process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(135px, 1fr));
  gap: 5px;
}

.p12-scan-process-grid label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 5px 7px;
}

.p12-scan-process-grid label.selected {
  border-color: var(--accent);
  background: #e8f4f2;
}

.p12-scan-process-grid label small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.p12-add-process-button {
  grid-column: 1 / -1;
  justify-self: start;
}

.production-scan-exception-history {
  display: grid;
  gap: 5px;
  margin-top: 6px;
  border: 1px solid #e4c77c;
  border-radius: 6px;
  background: #fffbeb;
  padding: 5px 6px;
  color: #7a4b0d;
}

.production-scan-exception-history.has-open {
  border-color: #efb4aa;
  background: #fff7f5;
  color: #9a3412;
}

.production-scan-exception-summary {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.production-scan-exception-summary > span {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-scan-exception-summary .table-action {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 2px 7px;
}

.production-scan-exception-details {
  display: grid;
  gap: 5px;
  border-top: 1px dashed currentColor;
  padding-top: 5px;
}

.production-scan-exception-details article {
  display: grid;
  gap: 2px;
  border-radius: 5px;
  background: rgb(255 255 255 / 72%);
  padding: 5px 6px;
}

.production-scan-exception-details article > div {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  justify-content: space-between;
}

.production-scan-exception-details article strong,
.production-scan-exception-details article span,
.production-scan-exception-details article p,
.production-scan-exception-details article small {
  margin: 0;
  color: inherit;
  font-size: 10px;
  line-height: 1.35;
}

.production-scan-exception-details article > div > span {
  flex: 0 0 auto;
  font-weight: 700;
}

.p12-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 12px;
}

.p12-pagination-bar label,
.p12-pagination-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.p12-pagination-bar select {
  width: auto;
  min-width: 68px;
}

.p12-scan-no-process {
  color: #9a3412;
}

.p22-save-feedback {
  margin-right: 8px;
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

.p22-save-feedback[hidden] {
  display: none;
}

.payment-auto-allocate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 10px 0;
}

.payment-auto-allocate[hidden] {
  display: none;
}

.payment-auto-allocate small {
  color: var(--muted);
  font-size: 12px;
}

.payment-auto-allocate span {
  color: #17603f;
  font-size: 13px;
  line-height: 1.4;
}

.payment-auto-allocate span.is-error {
  color: #b42318;
}

.p21-unreconciled-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  background: #fff8e8;
  color: #8a5a00;
  font-size: 13px;
  line-height: 1.5;
}

.p21-unreconciled-strip[hidden] {
  display: none;
}

.p21-unreconciled-strip small {
  color: var(--muted);
  font-size: 12px;
}

.p21-payable-table-wrap td .p21-unreconciled-hint {
  display: block;
  margin-top: 4px;
  color: #b06b00;
  font-size: 11px;
  font-weight: 600;
}

.payment-offset-amount {
  width: 110px;
}

.p12-scan-external-hint {
  display: block;
  margin-top: 6px;
  color: #9a3412;
  line-height: 1.4;
}

/* 全局可输入下拉：框里有内容也能展开全部候选。 */
input[data-combo-list]:not([readonly]):not(:disabled) {
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b6574' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 10px 6px;
}

/* 2026-11-10 客户、供应商、外协对象下拉里的搜索框 */
.search-select-menu {
  position: fixed;
  z-index: 10001;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 380px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.search-select-menu[hidden] {
  display: none;
}

.search-select-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
}

.search-select-search span {
  flex: none;
  font-size: 13px;
  opacity: 0.7;
}

.search-select-search input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  border: 0;
  outline: none;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.search-select-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft, #e7f4f0);
}

.search-select-list {
  min-height: 0;
  overflow-y: auto;
  padding: 0 4px 4px;
}

.search-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.search-select-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.search-select-option small {
  flex: none;
  color: var(--muted);
  font-size: 11px;
}

.search-select-option:hover,
.search-select-option.is-active {
  background: var(--accent-soft, #e7f4f0);
  color: var(--accent-strong);
}

.search-select-option.is-current {
  font-weight: 600;
}

.search-select-option:disabled {
  color: var(--muted);
  cursor: not-allowed;
  background: transparent;
}

.search-select-empty {
  padding: 10px 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-select-count {
  padding: 5px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.input-combo-menu {
  position: fixed;
  z-index: 10000;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.input-combo-menu[hidden] {
  display: none;
}

.input-combo-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.input-combo-option span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.input-combo-option small {
  flex: 0 1 auto;
  max-width: 45%;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.input-combo-option:hover,
.input-combo-option.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.input-combo-option.is-current {
  font-weight: 700;
}

.p12-scan-submit-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 10px 14px;
}

.p12-scan-selection-actions,
.p12-scan-submit-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.p12-scan-submit-actions > span {
  margin-right: 6px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .p12-external-metrics {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .p12-external-filters,
  .p12-external-dialog-controls {
    grid-template-columns: 1fr;
  }

  .p12-external-toolbar,
  .p12-external-dialog-head,
  .p12-external-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .p12-external-toolbar-actions,
  .p12-external-selection-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .p12-external-operator {
    grid-template-columns: auto 1fr auto;
    width: 100%;
  }

  .p12-external-selection-feedback {
    flex-basis: 100%;
    text-align: left;
  }

  .p12-scan-identity-row,
  .p12-scan-submit-bar {
    grid-template-columns: 1fr;
  }

  .p12-scan-mode-switch,
  .p12-scan-selection-actions,
  .p12-scan-submit-actions {
    flex-wrap: wrap;
  }
}

.p15-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
  gap: 12px;
  padding: 14px 16px 16px;
}

.p15-phone-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.p15-scan-dialog {
  width: min(94vw, 620px);
  max-width: none;
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0;
}

.p15-scan-dialog::backdrop {
  background: rgb(15 23 42 / 48%);
}

.p15-scan-dialog-panel {
  grid-template-rows: auto auto auto minmax(0, auto) auto;
  align-content: stretch;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 24px);
  gap: 8px;
  overflow: hidden;
  background: #fff;
  padding: 10px;
  box-shadow: 0 20px 70px rgb(15 23 42 / 28%);
}

.p15-scan-dialog-panel .p15-phone-head {
  align-items: center;
  padding-bottom: 7px;
}

.p15-phone-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.p15-phone-head strong,
.p15-phone-head span {
  display: block;
}

.p15-phone-head span {
  color: var(--muted);
  font-size: 12px;
}

.p15-quantity-caption small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
}

.p15-home-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.p15-home-metrics div,
.p15-scan-card,
.p15-mini-list div,
.p15-scan-list > div,
.p15-batch-footer {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
}

.p15-home-metrics span,
.p15-home-metrics strong,
.p15-scan-card span,
.p15-scan-card strong,
.p15-scan-card label,
.p15-mini-list strong,
.p15-mini-list span,
.p15-scan-list label,
.p15-scan-list strong,
.p15-scan-list span {
  display: block;
}

.p15-home-metrics span,
.p15-scan-card span,
.p15-mini-list span,
.p15-scan-list span,
.p15-batch-footer span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.p15-home-metrics strong {
  margin-top: 4px;
  font-size: 18px;
}

.p15-mini-list {
  display: grid;
  gap: 8px;
}

.p15-scan-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: min(52vh, 430px);
  align-content: start;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.p15-scan-list > div {
  display: grid;
  gap: 5px;
  padding: 6px 8px;
}

.p15-scan-list label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.p15-scan-list label input {
  flex: 0 0 auto;
}

.p15-scan-list p {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  align-items: center;
}

.p15-scan-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.p15-scan-summary label {
  flex: 1 1 auto;
  min-width: 0;
}

.p15-scan-summary > label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p15-scan-summary .inline-qty-fields {
  flex: 0 0 auto;
  margin-left: 0;
}

.p15-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p15-scan-card {
  display: grid;
  gap: 10px;
}

.p15-scan-card label {
  display: grid;
  gap: 6px;
}

.p15-phone-actions,
.p15-batch-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.p15-batch-footer {
  justify-content: space-between;
}

.p15-home-record-group {
  display: grid;
  gap: 6px;
}

.p15-home-record-group h4 {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.p15-home-record {
  display: grid;
  gap: 3px;
}

.p15-mini-list .p15-home-record-main,
.p15-mini-list .p15-home-record-copy {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.p15-home-record-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.p15-home-record-checkbox {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.p15-home-record-copy {
  min-width: 0;
}

.p15-home-batch-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7fafb !important;
}

.p15-home-batch-toolbar > span {
  margin-left: auto;
  white-space: nowrap;
}

.p15-home-record.requires-attention {
  border-color: #efb4aa;
  background: #fff7f5;
}

.p15-home-record.requires-attention span {
  color: #9a3412;
}

.p15-home-record-actions {
  display: flex;
  justify-content: flex-end;
  padding: 2px 0 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.p15-empty-state {
  display: grid;
  gap: 3px;
  color: var(--muted);
}

.p15-empty-state.error {
  border-color: #efb4aa;
  background: #fff7f5;
  color: #9a3412;
}

.p15-scan-mode-switch,
.p15-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.p15-employee-form,
.p15-tracking-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 6px 7px;
}

.p15-employee-form label,
.p15-tracking-form label,
.p15-issue-dialog label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.p15-employee-form input,
.p15-tracking-form input,
.p15-current-quantity input,
.p15-issue-dialog input,
.p15-issue-dialog select,
.p15-issue-dialog textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
  font: inherit;
}

.p15-employee-summary {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 8px 9px;
}

.p15-employee-summary.ready {
  border-color: #8bc8bb;
  background: #f4fbf8;
}

.p15-employee-summary span,
.p15-employee-summary small {
  color: var(--muted);
  font-size: 11px;
}

.p15-employee-summary .table-action {
  justify-self: start;
  margin-top: 3px;
}

.p15-scan-feedback {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  min-height: 30px;
  padding: 6px 8px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p15-scan-feedback[data-tone="success"] {
  border-color: #a7d7cc;
  background: #f0f9f6;
  color: var(--accent-strong);
}

.p15-scan-feedback[data-tone="warning"] {
  border-color: #e4c77c;
  background: #fffbeb;
  color: #8a5b14;
}

.p15-scan-feedback[data-tone="error"] {
  border-color: #efb4aa;
  background: #fff0ed;
  color: #9a3412;
  white-space: normal;
}

.p15-scan-row {
  min-width: 0;
}

.p15-scan-row .production-scan-exception-history {
  margin-top: 0;
}

.p15-scan-row.is-just-scanned {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgb(15 118 110 / 22%);
}

.p15-scan-row.is-unavailable {
  background: #f8fafc;
}

.p15-quantity-line {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: end;
}

.p15-reference-quantities {
  display: grid !important;
  gap: 2px;
  min-width: 76px;
}

.p15-reference-quantities small,
.p15-current-quantity small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.p15-reference-quantities strong {
  color: var(--ink);
  font-size: 13px;
}

.p15-scan-list label.p15-current-quantity {
  display: grid;
  gap: 2px;
  width: 72px;
}

.p15-process-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: stretch;
}

.p15-scan-list .p15-process-options label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 5px;
  min-width: 82px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 4px 6px;
  color: var(--ink);
}

.p15-scan-list .p15-process-options label.selected {
  border-color: #8bc8bb;
  background: #f0f9f6;
}

.p15-scan-list .p15-process-options label.unavailable {
  opacity: 0.58;
  background: #f4f5f7;
}

.p15-process-options input {
  grid-row: 1 / span 2;
  align-self: center;
}

.p15-process-options small {
  font-size: 10px;
}

.p15-row-actions {
  border-top: 1px dashed var(--line);
  padding-top: 5px;
}

.p15-row-actions > span {
  margin-right: auto;
}

.p15-phone-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.p15-scan-dialog-panel > .p15-phone-actions {
  flex-wrap: nowrap;
  border-top: 1px solid var(--line);
  background: #fff;
  padding-top: 7px;
}

.p15-scan-boundary-note {
  display: none;
}

.p15-scan-no-process {
  color: #9a3412 !important;
}

.p15-issue-dialog {
  width: min(92vw, 520px);
  max-width: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0;
  box-shadow: 0 20px 70px rgb(15 23 42 / 28%);
}

.p15-issue-dialog::backdrop {
  background: rgb(15 23 42 / 48%);
}

.p15-issue-dialog form {
  display: grid;
  gap: 12px;
}

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

.p15-issue-dialog header h3 {
  margin: 0;
}

.p15-issue-dialog header span,
.p15-issue-note {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.p15-issue-dialog > form > label,
.p15-issue-note,
.p15-issue-feedback {
  margin-right: 14px;
  margin-left: 14px;
}

.p15-issue-feedback {
  min-height: 18px;
  margin-top: 0;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.p15-issue-feedback[data-tone="error"] {
  color: #9a3412;
}

.p15-issue-feedback[data-tone="success"] {
  color: var(--accent-strong);
}

.p15-issue-dialog textarea {
  resize: vertical;
}

.writeoff-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  padding: 16px;
}

.sub-panel {
  border-top: 1px solid var(--line);
}

.sub-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.sub-panel-head h3 {
  margin: 0 0 4px;
  padding: 0;
  font-size: 15px;
}

.sub-panel-head p {
  margin: 0;
  color: var(--muted);
}

.payment-workbench[hidden] {
  display: none;
}

#paymentRecordsPanel[hidden],
#prepaymentLinkPanel[hidden],
#paymentAllocationPanel[hidden],
#paymentAllocationSummary[hidden] {
  display: none !important;
}

.payment-step {
  border-bottom: 1px solid var(--line);
}

.payment-step-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px 0;
}

.payment-step-head span {
  color: var(--muted);
  font-size: 12px;
}

.payment-step .payment-grid {
  padding-top: 10px;
}

.payment-step-purpose .payment-type-row {
  padding-top: 10px;
}

.payment-note-grid {
  padding-top: 0;
  padding-bottom: 8px;
}

.payment-example {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.example-head {
  display: grid;
  gap: 4px;
}

.example-head span {
  color: var(--muted);
}

.compact-example-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.payment-example-table th,
.payment-example-table td {
  white-space: normal;
  line-height: 1.45;
}

.payment-example-table td:first-child {
  font-weight: 700;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px;
}

.payment-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.payment-grid input,
.payment-grid select,
.payment-allocation-amount {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.payment-grid .wide-field {
  grid-column: span 3;
}

.prepayment-hint {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.payment-type-row {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}

.payment-type-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  font-weight: 700;
  color: var(--muted);
}

.payment-type-option > span {
  display: grid;
  gap: 2px;
}

.payment-type-option small {
  color: inherit;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
}

.payment-type-option:has(input:checked) {
  border-color: var(--accent);
  background: #e8f4f2;
  color: var(--accent-strong);
}

.payment-record-allocations {
  min-width: 180px;
}

.payment-record-note {
  max-width: 260px;
}

.payment-allocation-line {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.payment-allocation-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
  color: var(--muted);
  font-size: 12px;
}

.payment-allocation-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.payment-allocation-summary strong {
  color: var(--ink);
}

.payment-workbench-footer {
  position: sticky;
  z-index: 4;
  bottom: 0;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.06);
}

.payment-workbench-footer .payment-allocation-summary {
  padding-top: 10px;
  padding-bottom: 4px;
}

.payment-workbench-footer .form-actions {
  border-top: 0;
  padding-top: 8px;
}

.payment-allocation-summary .summary-danger {
  border-color: #f2b8b5;
  background: #fff4f3;
  color: #a33b35;
  font-weight: 700;
}

.payment-allocation-result {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payment-allocation-result.success {
  background: #e8f4f2;
  color: var(--accent-strong);
}

.payment-allocation-result.warn {
  background: #fff6df;
  color: #9a6500;
}

.payment-allocation-result.danger {
  background: #fff4f3;
  color: #a33b35;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.form-actions button {
  border: 1px solid var(--accent-strong);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  cursor: pointer;
}

.form-actions button:hover {
  background: var(--accent-strong);
}

@media (max-width: 820px) {
  .payment-grid {
    grid-template-columns: 1fr;
  }

  .payment-grid .wide-field {
    grid-column: 1;
  }

  .payment-step-head {
    display: grid;
    gap: 4px;
  }
}

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

.quote-toolbar {
  display: grid;
  grid-template-columns: auto repeat(6, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.quote-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.quote-toolbar input,
.quote-toolbar select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.quote-filter-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.new-quote-panel {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px 16px;
}

.new-quote-head,
.new-quote-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.new-quote-head strong,
.new-quote-head span {
  display: block;
}

.new-quote-head span,
.new-quote-actions span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.new-quote-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.new-quote-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.new-quote-grid input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
  font: inherit;
}

.new-quote-actions {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.sub-panel h3 {
  margin: 0;
  padding: 12px 16px;
  font-size: 15px;
}

.quote-header {
  padding: 0 16px 14px;
}

.quote-header h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.quote-header > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.quote-header-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 8px;
}

.quote-header-compact {
  display: grid;
  gap: 6px;
}

.quote-workflow-bar {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(420px, 1.35fr) minmax(300px, 0.9fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}

.quote-workflow-bar strong,
.quote-workflow-bar span {
  display: block;
}

.quote-workflow-bar span {
  color: var(--muted);
  font-size: 12px;
}

.quote-workflow-steps,
.quote-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quote-workflow-actions {
  justify-content: flex-end;
}

.quote-workflow-steps span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  padding: 2px 7px;
  font-size: 12px;
  line-height: 1.2;
}

.quote-workflow-steps span.active {
  border-color: var(--accent);
  background: #e8f4f2;
  color: var(--accent-strong);
  font-weight: 700;
}

.quote-action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.quote-action-strip strong {
  margin-right: 4px;
}

.quote-action-strip span {
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
}

.quote-header-groups {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1fr 1fr 1fr;
  gap: 8px;
  align-items: start;
}

.quote-header-compact-grid {
  grid-template-columns: minmax(460px, 1.6fr) minmax(280px, 0.95fr) minmax(220px, 0.75fr) minmax(250px, 0.9fr);
}

.quote-header-lines {
  display: grid;
  gap: 5px;
}

.quote-header-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.65fr) repeat(auto-fit, minmax(82px, 1fr));
  gap: 5px 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 6px 8px;
}

.quote-header-row > strong {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 0;
}

.quote-field {
  min-width: 0;
}

.quote-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.quote-field b {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-field select {
  max-width: 100%;
  min-height: 24px;
  font-size: 12px;
}

.quote-header-line {
  display: grid;
  gap: 6px 10px;
  margin: 0;
}

.quote-header-line-main {
  grid-template-columns: repeat(9, minmax(100px, 1fr));
}

.quote-header-line-terms {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
}

.quote-header-card .quote-header-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 5px 10px;
  margin: 0;
}

.quote-header-card .quote-header-terms {
  grid-template-columns: minmax(86px, 0.65fr) repeat(auto-fit, minmax(82px, 1fr));
}

.quote-header-matrix div {
  min-width: 0;
}

.quote-header-matrix select {
  max-width: 100%;
  min-height: 26px;
}

.quote-support-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.quote-risk-strip,
.quote-fee-strip {
  display: block;
  border: 1px solid #dce7ef;
  border-radius: 7px;
  background: #f8fbfd;
  color: var(--ink);
  overflow: hidden;
}

.quote-risk-strip strong,
.quote-fee-strip strong {
  color: var(--ink);
}

.quote-risk-strip span,
.quote-fee-strip > span {
  color: var(--muted);
  font-size: 12px;
}

.quote-support-details summary {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 7px 8px;
  cursor: pointer;
  list-style: none;
}

.quote-support-details summary::-webkit-details-marker {
  display: none;
}

.quote-support-details summary::after {
  content: "展开";
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.quote-support-details[open] summary::after {
  content: "收起";
}

.quote-support-detail-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  border-top: 1px solid #dce7ef;
  padding: 7px 8px;
}

.quote-support-detail-body > span,
.quote-support-details summary span {
  color: var(--muted);
  font-size: 12px;
}

.quote-fee-strip .quote-fee-grid {
  display: grid;
  flex: 1 1 420px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.quote-fee-strip .quote-fee-grid div {
  display: inline-flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  border-color: #dce7ef;
  border-radius: 6px;
  background: #fff;
  padding: 4px 8px;
}

.quote-fee-strip .quote-fee-grid span,
.quote-fee-strip .quote-fee-grid strong {
  display: inline;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-fee-strip .quote-fee-grid span {
  max-width: 34px;
}

.quote-fee-strip .quote-fee-grid strong {
  flex: 0 0 auto;
}

.quote-fee-details {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px 8px;
}

.quote-fee-details summary {
  cursor: pointer;
  font-weight: 700;
}

.quote-fee-details summary span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.quote-header-group {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
}

.quote-header-group strong {
  display: block;
  margin-bottom: 6px;
}

.quote-header-fee small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quote-header-fee .quote-fee-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.quote-header-fee .quote-fee-grid div {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  border-radius: 6px;
  padding: 5px 7px;
}

.quote-header-fee .quote-fee-grid span,
.quote-header-fee .quote-fee-grid strong {
  display: inline;
  margin: 0;
}

.quote-detail-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  padding: 8px 16px;
}

.quote-detail-toolbar strong,
.quote-detail-toolbar span {
  display: block;
}

.quote-detail-toolbar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.quote-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.quote-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.quote-line-actions .table-action {
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.15;
}

.p07-sequence-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1;
}

.p07-sequence-add {
  width: 22px;
  height: 20px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent-strong);
  padding: 0;
  font-size: 16px;
  line-height: 18px;
  cursor: pointer;
}

.p07-sequence-add:hover,
.p07-sequence-add:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.p07-sequence-add:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.quote-header-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.quote-header-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
}

.quote-header-card dt,
.quote-header-main dt {
  color: var(--muted);
  font-size: 12px;
}

.quote-header-card dd,
.quote-header-main dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.quote-total-confirmation,
.quote-export-settings {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  padding: 10px 16px;
}

.quote-total-card,
.quote-export-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.quote-total-head,
.quote-export-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.quote-total-head span,
.quote-export-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.quote-total-compact {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(190px, 1fr) minmax(110px, 0.7fr) minmax(90px, 0.6fr) minmax(250px, 1.4fr);
  gap: 8px;
  align-items: stretch;
}

.quote-total-compact > div,
.quote-total-compact label,
.quote-profit-grid > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 8px;
}

.quote-result-section + .quote-result-section {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

.quote-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.quote-result-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quote-profit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
}

.quote-total-compact span,
.quote-profit-grid span {
  color: var(--muted);
  font-size: 12px;
}

.quote-total-compact em,
.quote-profit-grid em,
.quote-total-rule,
.quote-total-status {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.quote-total-compact input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
}

.quote-total-compact .quote-price-note {
  grid-column: auto;
}

.p07-price-allocation-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  border: 1px solid #9bc9c4;
  border-radius: 7px;
  background: #edf8f6;
  padding: 8px 10px;
}

.p07-price-allocation-entry span,
.p07-confirmed-price small,
.p07-price-allocation-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.p07-project-reprice-note {
  margin-top: 8px;
  border: 1px solid #d8c38e;
  border-radius: 7px;
  background: #fff9e9;
  color: #624f1c;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.4;
}

.p07-price-allocation-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
}

.p07-price-allocation-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.p07-price-allocation-summary > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 8px;
}

.p07-price-allocation-summary span,
.p07-price-allocation-summary p {
  color: var(--muted);
  font-size: 12px;
}

.p07-price-allocation-summary p,
.p07-price-allocation-summary .notice {
  grid-column: 1 / -1;
  margin: 0;
}

.p07-price-allocation-table-wrap {
  max-height: min(52vh, 520px);
  overflow: auto;
}

.p07-price-allocation-table {
  min-width: 760px;
}

.p07-price-allocation-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #edf1f6;
}

.p07-confirmed-price {
  display: grid;
  gap: 2px;
}

.quote-profit-details {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.quote-profit-details summary {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.quote-profit-details summary::-webkit-details-marker {
  display: none;
}

.quote-profit-details summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.quote-profit-details .quote-profit-grid {
  margin-top: 8px;
}

.quote-total-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.quote-total-rule {
  margin: 8px 0 0;
}

.quote-template-tabs,
.quote-export-actions,
.quote-output-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quote-export-body {
  display: grid;
  grid-template-columns: minmax(360px, 1.3fr) minmax(240px, 0.8fr) minmax(260px, 0.9fr);
  gap: 10px;
}

.quote-export-body section,
.quote-export-body details {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 8px;
}

.quote-export-body summary,
.quote-export-body strong {
  font-weight: 700;
}

.quote-export-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.quote-export-fields label,
.quote-output-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 5px 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.quote-export-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 8px;
}

.quote-fee-panel,
.process-time-panel,
.quote-scenario-panel {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px 16px;
}

.quote-fee-panel summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.p09-scenario-panel {
  border-top: 1px solid var(--line);
  padding: 12px 16px 16px;
}

.p09-save-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  background: #fbfcfe;
}

.p09-save-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.order-source-toolbar [data-p09-source].active {
  border-color: #2f7d68;
  background: #eaf6f2;
  color: #1f5f50;
  font-weight: 700;
}

.internal-order-view[hidden] {
  display: none !important;
}

.internal-order-page-actions,
.p11-overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.p09-source-dialog {
  width: min(680px, 100%);
}

.p09-source-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.p09-source-choice {
  display: grid;
  gap: 7px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.p09-source-choice:hover,
.p09-source-choice:focus-visible {
  border-color: #2f7d68;
  background: #eaf6f2;
  outline: none;
}

.p09-source-choice strong,
.p09-source-choice span {
  display: block;
}

.p09-source-choice span {
  color: var(--muted);
  line-height: 1.45;
}

.p11-overview-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.p11-toolbar-actions,
.p11-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: end;
}

.p11-toolbar-filters {
  justify-content: flex-end;
}

.p11-exception-custom-dates,
.p11-table-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.p11-exception-custom-dates[hidden] {
  display: none;
}

.p11-inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.p11-inline-filter select,
.p11-inline-filter input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 5px 8px;
  color: var(--ink);
}

.p11-keyword-filter input {
  width: 360px;
}

.p11-module-entry {
  border-color: var(--accent);
  background: var(--table-row-hover-bg);
  color: var(--accent-strong);
}

#p11FilterSummary {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  padding-top: 6px;
}

.p11-exception-stats {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--line);
  padding-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.p11-exception-stats summary {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.p11-exception-stats summary::-webkit-details-marker {
  display: none;
}

.p11-exception-stats summary::before {
  content: "▸";
}

.p11-exception-stats[open] summary::before {
  content: "▾";
}

.p11-exception-stats > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 5px 0 1px 18px;
}

.p11-exception-stats strong,
.p11-exception-stats.has-open-exceptions summary span {
  color: var(--ink);
}

.p11-order-identity {
  display: grid;
  gap: 1px;
  width: 100%;
  min-width: 0;
  line-height: 1.15;
}

.p11-order-main-line,
.p11-order-meta-line {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.p11-order-main-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.p11-order-main-line strong {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.p11-order-main-line .status-chip {
  flex: 0 0 auto;
}

.p11-order-identity span,
.p11-order-identity small {
  color: var(--muted);
}

.p11-order-context {
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  background: #fbfcfe;
}

.p11-order-context-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.p11-order-context-strip > div {
  display: grid;
  gap: 3px;
  align-content: start;
  border-right: 1px solid var(--line);
  padding: 8px 10px;
}

.p11-order-context-strip > div:last-child {
  border-right: 0;
}

.p11-order-context-strip span,
.p11-order-context-strip small {
  color: var(--muted);
  font-size: 11px;
}

.p11-order-context-strip strong {
  font-size: 13px;
}

.p11-order-context-note .table-action {
  justify-self: start;
}

.p11-configurable-table {
  table-layout: fixed;
}

.p11-configurable-table tbody td {
  padding: 4px 6px;
  line-height: 1.15;
}

.p11-table-scroll {
  position: relative;
  max-height: 66vh;
  overflow: auto;
}

.p11-table-scroll .p11-configurable-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef2f6;
}

.p11-table-scroll .p11-configurable-table thead th.is-pinned-left,
.p11-table-scroll .p11-configurable-table thead th.is-pinned-right {
  z-index: 4;
}

.p11-selected-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.p11-configurable-table input,
.p11-configurable-table select,
.p11-configurable-table textarea {
  min-width: 0;
  max-width: 100%;
}

.p11-compact-status {
  display: grid;
  gap: 1px;
  justify-items: center;
  line-height: 1.2;
}

.p11-compact-status strong,
.p11-compact-status small {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.p11-compact-status small {
  color: var(--muted);
  white-space: normal;
}

.p11-process-summary-line {
  display: flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.p11-process-summary-line .status-chip,
.p11-process-expand {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.p11-process-summary-line .status-chip {
  flex: 1 1 auto;
}

.p11-process-expand {
  flex: 0 0 auto;
}

.p11-process-quantity-line {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1.2;
}

.p11-delivery-main-line {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.p11-delivery-summary-line {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
  line-height: 1.15;
  letter-spacing: -0.25px;
  font-variant-numeric: tabular-nums;
}

.p11-delivery-main-line {
  display: flex;
  justify-content: center;
}

.p11-material-status .status-chip,
.p11-material-detail-line {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.p11-compact-status.is-external .status-chip,
.p11-external-process-requirement {
  color: #285b94;
}

.p11-external-process-requirement {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.p11-delivery-state {
  min-width: 64px;
  font-weight: 700;
  text-align: center;
}

.p11-delivery-status.is-pending .p11-delivery-state,
.p11-delivery-status.is-not-required .p11-delivery-state {
  background: #eef2f6;
  color: #52606d;
}

.p11-delivery-status.is-available .p11-delivery-state {
  background: #e4f4ed;
  color: #176747;
}

.p11-delivery-status.is-partial-available .p11-delivery-state,
.p11-delivery-status.is-partial-shipped .p11-delivery-state {
  background: #fff0dc;
  color: #96520e;
}

.p11-delivery-status.is-shipped .p11-delivery-state {
  background: #e6efff;
  color: #245b9e;
}

.p11-completion-status {
  display: grid;
  gap: 1px;
  justify-items: center;
  min-width: 0;
  line-height: 1.15;
}

.p11-completion-main-line {
  display: flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.p11-completion-detail-line {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.p11-completion-status strong,
.p11-completion-status small {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.p11-completion-status small {
  color: var(--muted);
  font-size: 11px;
  white-space: normal;
}

.p11-completion-status.is-not_started .status-chip {
  background: #eef2f6;
  color: #52606d;
}

.p11-completion-status.is-partial .status-chip {
  background: #fff0e8;
  color: #9a451f;
}

.p11-completion-status.is-completed .status-chip {
  background: #e8f5f1;
  color: var(--accent-strong);
}

.p11-configurable-table .is-pinned-left,
.p11-configurable-table .is-pinned-right {
  position: sticky;
  z-index: 2;
  background: var(--surface);
}

.p11-configurable-table .is-pinned-left {
  left: var(--p11-pin-offset, 0);
  box-shadow: 1px 0 0 var(--line);
}

.p11-configurable-table .is-pinned-right {
  right: var(--p11-pin-offset, 0);
  box-shadow: -1px 0 0 var(--line);
}

.p11-configurable-table th.is-pinned-left,
.p11-configurable-table th.is-pinned-right {
  z-index: 4;
  background: #eef2f6;
}

.p11-row-replenishment-child > .is-pinned-left,
.p11-row-replenishment-child > .is-pinned-right {
  background: #f7fbfa;
}

.p11-column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.p11-column-resizer:hover,
.p11-is-resizing-column .p11-column-resizer {
  border-right: 2px solid var(--accent);
}

.p11-is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.p11-note-column,
.p11-action-column {
  white-space: normal;
}

.p11-configurable-table td.p11-action-column {
  overflow: visible;
}

.p11-configurable-table td.p11-action-column:has(.p11-more-menu[open]) {
  z-index: 12;
}

.p11-estimated-hours {
  border: 1px dashed var(--line-strong);
}

.p11-delivery-risk {
  display: grid;
  gap: 3px;
  justify-items: center;
  min-width: 0;
  line-height: 1.25;
  white-space: normal;
}

.p11-delivery-risk small {
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
}

.p11-delivery-risk.is-overdue,
.p11-delivery-risk.is-overdue small {
  color: #a32626;
}

.p11-delivery-risk.is-overdue small {
  background: #fdeaea;
}

.p11-delivery-risk.is-due-soon,
.p11-delivery-risk.is-due-soon small {
  color: #9a451f;
}

.p11-delivery-risk.is-due-soon small {
  background: #fff0e8;
}

.p11-delivery-risk.is-upcoming,
.p11-delivery-risk.is-upcoming small {
  color: #7a5c00;
}

.p11-delivery-risk.is-upcoming small {
  background: #fff7d6;
}

.p11-delivery-risk.is-no-date,
.p11-delivery-risk.is-no-date small {
  color: var(--muted);
}

.p11-delivery-risk.is-no-date small {
  background: #eef2f6;
}

.p11-delivery-risk.is-delivered,
.p11-delivery-risk.is-delivered small,
.p11-delivery-risk.is-production-completed,
.p11-delivery-risk.is-production-completed small,
.p11-delivery-risk.is-completed,
.p11-delivery-risk.is-completed small {
  color: var(--accent-strong);
}

.p11-delivery-risk.is-delivered small,
.p11-delivery-risk.is-production-completed small,
.p11-delivery-risk.is-completed small {
  background: #e8f5f1;
}

.p11-row-due-overdue > td:first-child {
  box-shadow: inset 4px 0 #c83b3b;
}

.p11-row-due-due-soon > td:first-child {
  box-shadow: inset 4px 0 #d87537;
}

.p11-row-due-upcoming > td:first-child {
  box-shadow: inset 4px 0 #d2ad24;
}

.p11-row-due-no-date > td:first-child {
  box-shadow: inset 4px 0 #aab3bf;
}

.p10-order-main-row.is-paused > td,
#orderItemsTable tr.is-paused > td {
  background: #fff7ed;
}

.p10-order-main-row.is-paused > td:first-child,
#orderItemsTable tr.is-paused > td:first-child {
  box-shadow: inset 4px 0 #f59e0b;
}

.p10-order-main-row.is-completed > td {
  background: #f6fbf9;
}

.p10-order-main-row.is-completed > td:first-child {
  box-shadow: inset 4px 0 var(--accent);
}

.p10-order-number {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.p10-search-hit,
.p11-search-hit,
.p16-search-hit,
.p18-search-hit,
.p20-search-hit {
  border-radius: 3px;
  background: #ffe59a;
  color: #5f4100;
  box-shadow: 0 0 0 1px #e8c65b;
  padding: 0 2px;
}

.p16-spec-search-hint {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: #7a5600;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p18-list-search-context {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p18-list-search-context > span {
  margin-right: 4px;
}

.p10-tracking-search-hint,
.p11-search-context-hint {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  color: #7a5600;
  font-size: 10px;
  line-height: 1.2;
}

.p10-tracking-search-hint {
  border-radius: 4px;
  background: #fff7d6;
  padding: 2px 4px;
}

.p11-search-context-hint {
  margin-left: 4px;
}

.status-chip.is-paused {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.status-chip.is-completed {
  border-color: #b7dfd2;
  background: #e8f5f1;
  color: var(--accent-strong);
}

.p11-summary-row td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  border-top: 2px solid var(--line-strong);
  background: #f7f9fb;
  vertical-align: top;
  white-space: normal;
}

.p11-summary-row td > strong,
.p11-summary-row td > small {
  display: block;
}

.p11-summary-row td > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.p11-summary-row .is-pinned-left,
.p11-summary-row .is-pinned-right {
  z-index: 4;
  background: #f7f9fb;
}

.p11-summary-empty {
  color: var(--muted);
}

.p11-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 8px 16px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
}

.p11-pagination-bar label,
.p11-pagination-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.p11-pagination-bar select {
  width: auto;
  min-width: 68px;
}

.p11-exception-action-warning {
  border-color: #d87537;
  background: #fff0e8;
  color: #9a451f;
  font-weight: 700;
}

.p11-permission-masked {
  color: var(--muted);
}

.p11-exception-open {
  background: #fff0e8;
  color: #9a451f;
}

.p11-label-records {
  border-top: 1px solid var(--line);
}

.p11-label-records > summary {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  background: #fbfcfe;
}

.p11-label-records > summary span {
  color: var(--muted);
  font-size: 12px;
}

.p11-exception-dialog {
  width: min(920px, calc(100vw - 36px));
}

.p11-manual-completion-dialog {
  width: min(820px, calc(100vw - 36px));
}

.p11-manual-completion-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px;
  background: #fbfcfe;
}

.p11-manual-completion-summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
}

.p11-manual-completion-summary span,
.p11-manual-completion-summary small {
  color: var(--muted);
  font-size: 12px;
}

.p11-manual-completion-summary strong {
  overflow-wrap: anywhere;
}

.p11-manual-completion-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(160px, 0.7fr) minmax(240px, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 14px 16px;
}

.p11-manual-completion-form label,
.p11-manual-completion-operator {
  display: grid;
  gap: 5px;
  align-content: start;
  min-width: 0;
  color: var(--muted);
  font-weight: 700;
}

.p11-manual-completion-form input,
.p11-manual-completion-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
  font: inherit;
}

.p11-manual-completion-form small,
.p11-manual-completion-operator small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.p11-manual-completion-note {
  grid-row: span 2;
}

.p11-manual-completion-operator {
  grid-column: 1 / 3;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  align-self: end;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.p11-manual-completion-boundary {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  background: #f4faf8;
  color: var(--accent-strong);
  font-size: 12px;
  line-height: 1.55;
}

.p11-manual-completion-feedback {
  min-height: 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.p11-manual-completion-feedback:not(:empty) {
  border-top: 1px dashed var(--line);
  padding-top: 9px;
  padding-bottom: 9px;
}

.p11-manual-completion-feedback[data-tone="error"] {
  background: #fff4f2;
  color: #9a2f25;
}

.p11-manual-completion-feedback[data-tone="saving"] {
  background: #f4faf8;
  color: var(--accent-strong);
}

@media (max-width: 760px) {
  .p11-manual-completion-summary,
  .p11-manual-completion-form {
    grid-template-columns: 1fr;
  }

  .p11-manual-completion-note {
    grid-row: auto;
  }

  .p11-manual-completion-operator {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

.p11-exception-current-section {
  border-bottom: 1px solid var(--line);
}

.p11-exception-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 11px 16px 0;
}

.p11-exception-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.p11-exception-records {
  display: grid;
  gap: 8px;
  max-height: min(42vh, 420px);
  overflow: auto;
  padding: 12px 16px;
  background: #fbfcfe;
}

.p11-exception-record,
.p11-exception-empty {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
}

.p11-exception-record.is-open {
  border-left: 4px solid #c46b3a;
  box-shadow: 0 0 0 1px rgba(196, 107, 58, 0.08);
}

.p11-exception-record > div:first-child,
.p11-exception-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.p11-exception-record p {
  margin: 0;
  line-height: 1.45;
}

.p11-exception-record small {
  color: var(--muted);
}

.p11-exception-record label,
.p11-exception-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.p11-exception-record input,
.p11-exception-record select,
.p11-exception-form input,
.p11-exception-form select,
.p11-exception-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
  font: inherit;
}

.p11-exception-resolution-grid,
.p11-exception-secondary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.p11-exception-secondary-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.35fr);
}

.p11-exception-replenishment-panel {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px 10px;
}

.p11-exception-replenishment-panel[hidden] {
  display: none;
}

.p11-exception-replenishment-panel legend {
  padding: 0 5px;
  color: var(--ink);
  font-weight: 700;
}

.p11-exception-replenishment-panel > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.p11-exception-replenishment-panel label {
  display: inline-flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-weight: 400;
}

.p11-exception-replenishment-panel input[type="checkbox"] {
  width: auto;
  margin: 0;
  padding: 0;
}

.p11-exception-closed-summary {
  border-radius: 6px;
  background: #f2f7f5;
  padding: 7px 9px;
}

@media (max-width: 760px) {
  .p11-exception-resolution-grid,
  .p11-exception-secondary-grid {
    grid-template-columns: 1fr;
  }
}

.p11-exception-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(110px, 0.3fr) minmax(280px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 16px;
}

.p11-exception-form[hidden],
.p11-label-field-step[hidden] {
  display: none;
}

.p11-exception-register-panel {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.p11-exception-register-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 11px 16px;
}

.p11-exception-register-head span,
.p11-report-correction-boundary {
  color: var(--muted);
  font-size: 12px;
}

.p11-exception-register-head .table-action {
  margin-left: auto;
}

.p11-exception-feedback {
  min-height: 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.p11-exception-feedback:not(:empty) {
  padding-top: 9px;
  padding-bottom: 9px;
  border-top: 1px dashed var(--line);
}

.p11-exception-feedback[data-tone="error"] {
  color: #9a2f25;
  background: #fff4f2;
}

.p11-exception-feedback[data-tone="warning"] {
  color: #8a5a00;
  background: #fff9e8;
}

.p11-exception-feedback[data-tone="success"] {
  color: var(--accent-strong);
  background: var(--table-row-hover-bg);
}

.p11-report-correction-boundary {
  margin: 0;
  border-top: 1px dashed var(--line);
  padding: 9px 16px 12px;
  line-height: 1.5;
}

.p11-label-preview-dialog {
  width: min(920px, calc(100vw - 36px));
}

.p11-label-field-step,
.p11-label-step-title {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: #fbfcfe;
}

.p11-label-field-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.p11-label-field-options label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

.p11-label-more-fields {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.p11-label-more-fields summary {
  cursor: pointer;
  padding: 9px 11px;
  color: var(--accent-strong);
  font-weight: 700;
}

.p11-label-more-fields .p11-label-field-options {
  border-top: 1px solid var(--line);
  padding: 11px;
}

.p11-label-step-title {
  grid-template-columns: auto 1fr;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.p11-label-step-title span {
  color: var(--muted);
  font-size: 12px;
}

.p11-label-preview-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding: 14px 16px;
  background: #fbfcfe;
}

.p11-label-print-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: flex-end;
}

.p11-label-number {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.p11-label-number input {
  width: 96px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 8px;
}

.p11-label-print-feedback {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}

.p11-label-print-feedback.is-error {
  background: #fff4f2;
  color: #9a2f25;
}

.p18-import-dialog.p18-arrived-from-p11 {
  outline: 3px solid rgba(47, 125, 104, 0.28);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(47, 125, 104, 0.08);
}

.p11-label-print-sheet {
  display: none;
}

/* 高度少留 0.2mm，防止四舍五入后多出一张空白标签。 */
.p11-label-print-card {
  box-sizing: border-box;
  width: var(--label-width, 50mm);
  height: calc(var(--label-height, 30mm) - 0.2mm);
  overflow: hidden;
  border: 1px solid #111;
  background: #fff;
  color: #000;
  padding: 1mm;
  break-inside: avoid;
}

.label-card-body {
  --label-scale: 1;
  width: calc(100% / var(--label-scale));
  height: calc(100% / var(--label-scale));
  overflow: hidden;
  font-size: 12px;
  line-height: 1.22;
  overflow-wrap: anywhere;
  transform: scale(var(--label-scale));
  transform-origin: 0 0;
}

.label-card-qr {
  float: left;
  width: calc(var(--label-qr, 16mm) / var(--label-scale));
  height: calc(var(--label-qr, 16mm) / var(--label-scale));
}

.label-card-qr:empty {
  display: none;
}

.label-card-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.label-card-body strong,
.label-card-body span {
  display: block;
}

.label-card-body b {
  font-weight: 400;
}

.label-measure-host {
  position: fixed;
  top: 0;
  left: -10000px;
  visibility: hidden;
}

.p11-label-size-hint {
  color: var(--muted);
  font-size: 12px;
}

.p09-label-note-hint {
  display: block;
  margin-top: 3px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.p09-label-note-hint[hidden] {
  display: none;
}

.order-list-table tr.recently-created-order > td {
  background: #eaf6f2;
  box-shadow: inset 0 1px #9bd2c1, inset 0 -1px #9bd2c1;
}

.order-source-toolbar > small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.order-import-panel[hidden],
#p09CreatePricingQuoteButton[hidden] {
  display: none !important;
}

.p09-external-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.p09-external-meta label,
.p09-external-paste {
  display: grid;
  gap: 4px;
}

.p09-external-meta span,
.p09-external-paste > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.p09-external-meta input,
.p09-external-paste textarea,
.order-form .form-field input,
.order-form .form-field textarea,
.p09-order-sheet-table input,
.p09-order-sheet-table select,
.p09-order-sheet-table textarea {
  width: 100%;
  min-height: 30px;
  border: 1px solid #c5d0df;
  border-radius: 6px;
  background: #fff;
  padding: 5px 7px;
  color: var(--ink);
  font: inherit;
}

.order-form .form-field textarea,
.p09-order-sheet-table textarea,
.p09-external-paste textarea {
  resize: vertical;
}

.p09-import-dialog {
  width: min(1180px, 96vw);
  max-height: 90vh;
  overflow: auto;
}

.p09-import-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.p09-import-tabs .active {
  border-color: var(--accent);
  background: #e8f5f2;
  color: var(--accent-strong);
}

.p09-import-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.p09-import-search input {
  width: min(360px, 42vw);
}

.p09-import-table-wrap {
  max-height: 240px;
  overflow: auto;
}

.p09-import-select-column {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  text-align: center;
}

.p09-import-select-column input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.p09-import-preview {
  min-height: 70px;
  max-height: 260px;
  overflow: auto;
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 1px solid #c7d8e3;
  border-radius: 8px;
  background: #f7fbfd;
}

.p09-import-preview.is-error {
  border-color: #d98c8c;
  background: #fff2f2;
  color: #8a2525;
}

.p09-import-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.p09-import-preview ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.p09-import-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}

.p09-import-preview-actions span {
  color: var(--muted);
  font-size: 12px;
}

.p09-import-part-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.p09-import-part-choice input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
}

.p09-import-preview li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.p09-import-preview li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p09-import-preview small,
.p09-import-selection-summary {
  color: var(--muted);
  font-size: 12px;
}

.p09-import-selection-summary {
  margin-left: auto;
}

.p09-feedback {
  margin: 10px 16px 0;
  padding: 9px 12px;
  border: 1px solid #b9d4e2;
  border-radius: 7px;
  background: #f3f9fc;
  color: #26485a;
}

.p09-feedback.is-error {
  border-color: #d98c8c;
  background: #fff2f2;
  color: #8a2525;
}

.p09-feedback.is-success {
  border-color: #93c8b6;
  background: #edf8f4;
  color: #185f4e;
}

.p09-table-toolbar,
.p09-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.p09-external-import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 12px;
  padding: 10px 16px;
}

.p09-external-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.p09-external-actions small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.p09-file-picker {
  position: relative;
  cursor: pointer;
  text-align: center;
}

.p09-file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.order-form .form-field {
  display: grid;
  align-content: start;
  gap: 4px;
}

.order-form .form-field strong,
.order-form .form-field input,
.order-form .form-field textarea {
  margin-top: 0;
}

.p09-order-sheet-table {
  table-layout: fixed;
  min-width: 100%;
}

.p09-order-sheet-table th,
.p09-order-sheet-table td {
  position: relative;
  vertical-align: middle;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.p09-order-sheet-table input,
.p09-order-sheet-table select,
.p09-order-sheet-table textarea {
  min-width: 0;
  max-width: 100%;
}

.p09-order-sheet-table input,
.p09-order-sheet-table select {
  text-align: center;
}

.p09-order-sheet-table textarea {
  text-align: left;
}

.p09-order-sheet-table input:focus::placeholder,
.p09-order-sheet-table textarea:focus::placeholder {
  color: transparent;
  opacity: 0;
}

.p09-order-sheet-table .is-pinned-left,
.p09-order-sheet-table .is-pinned-right {
  position: sticky;
  z-index: 2;
  background: var(--surface);
}

.p09-order-sheet-table .is-pinned-left {
  left: var(--p09-pin-offset, 0);
  box-shadow: 1px 0 0 var(--line);
}

.p09-order-sheet-table .is-pinned-right {
  right: var(--p09-pin-offset, 0);
  box-shadow: -1px 0 0 var(--line);
}

.p09-order-sheet-table th.is-pinned-left,
.p09-order-sheet-table th.is-pinned-right {
  z-index: 4;
  background: #eef2f6;
}

.p09-row-not-selected > .is-pinned-left,
.p09-row-not-selected > .is-pinned-right {
  background: #f8fafc;
}

.p09-column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.p09-column-resizer:hover,
.p09-is-resizing-column .p09-column-resizer {
  border-right: 2px solid var(--accent);
}

.p09-is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.p09-row-not-selected {
  opacity: 0.58;
  background: #f8fafc;
}

.p09-fixed-source,
.p09-tracking-preview {
  color: var(--muted);
  font-size: 12px;
}

.p09-identity,
.p09-price-editor,
.p09-material-editor,
.p09-process-editor,
.p09-row-note {
  display: grid;
  gap: 6px;
}

.p09-identity strong,
.p09-identity span,
.p09-identity small,
.p09-price-editor small,
.p09-material-editor small,
.p09-process-editor small {
  display: block;
}

.p09-identity span,
.p09-identity small,
.p09-price-editor small,
.p09-material-editor details,
.p09-process-editor small {
  color: var(--muted);
  font-size: 11px;
}

.p09-quantity-editor {
  display: grid;
  grid-template-columns: minmax(24px, 1fr) auto minmax(42px, 1fr) auto minmax(24px, 1fr);
  gap: 4px;
  align-items: center;
  text-align: center;
}

.p09-quantity-editor input {
  min-height: 28px;
  padding-inline: 4px;
  text-align: center;
}

.p09-quantity-editor > span {
  color: var(--muted);
}

.p09-quantity-cell {
  display: grid;
  gap: 5px;
}

.p09-single-set-editor {
  display: grid;
  grid-template-columns: auto minmax(44px, 1fr);
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.p09-single-set-editor input {
  min-height: 26px;
  padding-inline: 4px;
  text-align: center;
}

.p09-price-editor label,
.p09-process-editor label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.p09-price-editor label > span,
.p09-process-editor label > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.p09-material-editor > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 4px;
}

.p09-material-editor > div > label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px;
  align-items: center;
}

.p09-material-editor > div > label > span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.p09-material-editor summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
}

.p09-process-route {
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.p09-process-route input {
  width: auto;
  min-height: auto;
}

.p09-process-editor {
  gap: 4px;
  justify-items: center;
}

.p09-process-editor-disabled {
  align-content: center;
}

.p09-process-controls {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.p09-process-route-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.p09-process-controls select,
.p09-process-value input {
  min-height: 28px;
  padding: 4px 5px;
}

.p09-process-controls select {
  width: min(66px, calc(100% - 24px));
  min-width: 58px;
}

.p09-specific-surface-treatment {
  display: grid !important;
  gap: 2px !important;
  width: 100%;
  min-width: 0;
}

.p09-specific-surface-treatment > span {
  line-height: 1.2;
  white-space: normal !important;
}

.p09-specific-surface-treatment select {
  width: 100%;
  min-width: 0;
}

.p09-process-value {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  width: 100%;
}

.p09-process-scan-hint {
  line-height: 1.35;
}

.p09-inline-reason:empty {
  display: none;
}

.p09-inline-reason-field {
  display: grid !important;
  gap: 3px !important;
  border-top: 1px dashed #c9d3df;
  padding-top: 5px;
}

.p09-inline-reason-field > span {
  color: #8a5a05 !important;
  font-size: 11px !important;
  white-space: normal !important;
}

.p09-price-readonly > strong:first-child {
  color: var(--ink);
}

.p09-order-sheet-table tfoot td {
  vertical-align: middle;
  border-top: 2px solid #aab9c8;
  background: #f3f7fa;
  color: var(--ink);
  font-size: 12px;
}

.p09-order-sheet-table tfoot td.is-pinned-left,
.p09-order-sheet-table tfoot td.is-pinned-right {
  z-index: 3;
  background: #f3f7fa;
}

.p09-order-sheet-table tfoot strong,
.p09-order-sheet-table tfoot small {
  display: block;
}

.p09-order-sheet-table tfoot small,
.p09-summary-empty {
  color: var(--muted);
  font-size: 11px;
}

.p09-missing-price {
  border: 1px solid #e5b65f;
  border-radius: 6px;
  background: #fff8e8;
  color: #8a5a05;
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.4;
}

.quote-fee-grid,
.process-time-grid,
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.quote-fee-grid div,
.process-time-grid div,
.scenario-grid article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.process-summary-row td {
  border-top: 2px solid var(--line-strong);
  background: #f8fafc;
  font-weight: 700;
}

.process-summary-row td:first-child {
  white-space: normal;
}

.process-summary-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.quote-fee-grid span,
.process-time-grid span,
.scenario-grid span,
.process-time-grid em,
.scenario-grid em,
.stacked-cell span,
.stacked-cell em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.process-view-toolbar,
.section-mini-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px 16px;
}

.process-view-toolbar > span,
.section-mini-head strong {
  font-weight: 700;
}

.process-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stacked-cell {
  display: grid;
  gap: 3px;
  min-width: 180px;
  max-width: 260px;
  white-space: normal;
}

.table-action {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 6px 9px;
  cursor: pointer;
}

.table-action:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.table-action.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
  font-size: 18px;
  line-height: 1;
}

.table-action.compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.2;
}

.table-action.compact.active {
  border-color: var(--accent);
  background: #e9f4f2;
  color: var(--accent-strong);
  font-weight: 700;
}

.table-action.secondary-danger {
  color: #8a3c32;
  border-color: #c79a91;
  background: #fff7f5;
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.field-config-panel {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}

.field-config-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.field-config-head h4,
.field-config-block h5 {
  margin: 0;
  font-size: 15px;
}

.field-config-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.field-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-config-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.5fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.field-config-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.field-config-block h5 {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.field-config-table {
  min-width: 920px;
}

.field-config-table code {
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px 16px;
}

.internal-order-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 2px;
}

.overview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.overview-card strong,
.overview-card span {
  display: block;
}

.overview-card span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.order-source-toolbar,
.order-list-toolbar,
.order-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.order-list-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.order-list-toolbar input,
.order-list-toolbar select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 5px 8px;
}

.order-list-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  overflow-x: auto;
  padding: 10px 16px;
}

.p10-toolbar-actions,
.p10-toolbar-filters,
.p10-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.p10-toolbar-actions,
.p10-toolbar-filters {
  flex: 0 1 auto;
  flex-wrap: wrap;
}

.p10-toolbar-filters {
  justify-content: flex-end;
  min-width: 0;
}

.p10-toolbar-filters label {
  flex: 0 1 auto;
  white-space: nowrap;
  font-size: 12px;
}

#p10SearchKeyword {
  width: 310px;
}

#p10DeliveryFilter {
  width: 92px;
}

#p10ExceptionFilter {
  width: 112px;
}

#p10OrderSort {
  width: 190px;
}

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

.p10-table-scroll {
  position: relative;
  max-height: 66vh;
  overflow: auto;
}

.p10-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 8px 16px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
}

.p10-pagination-bar label,
.p10-pagination-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.p10-pagination-bar select {
  width: auto;
  min-width: 68px;
}

.p10-order-list-table th {
  position: relative;
  white-space: normal;
  overflow-wrap: anywhere;
}

.p10-table-scroll .p10-order-list-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef2f6;
}

.p10-table-scroll .p10-order-list-table thead th.is-pinned-left,
.p10-table-scroll .p10-order-list-table thead th.is-pinned-right {
  z-index: 4;
}

.p10-order-list-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.p10-order-list-table .is-pinned-left,
.p10-order-list-table .is-pinned-right {
  position: sticky;
  z-index: 2;
  background: var(--surface);
}

.p10-order-list-table .is-pinned-left {
  left: var(--p10-pin-offset, 0);
  box-shadow: 1px 0 0 var(--line);
}

.p10-order-list-table .is-pinned-right {
  right: var(--p10-pin-offset, 0);
  box-shadow: -1px 0 0 var(--line);
}

.p10-order-list-table th.is-pinned-left,
.p10-order-list-table th.is-pinned-right {
  z-index: 4;
  background: #eef2f6;
}

.p10-column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.p10-column-resizer:hover,
.p10-is-resizing-column .p10-column-resizer {
  border-right: 2px solid var(--accent);
}

.p10-is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.p10-row-actions {
  flex-wrap: wrap;
}

.p10-order-summary-row > td {
  position: static;
  border-top: 0;
  background: #f4faf8;
  padding: 0;
  white-space: normal;
}

.p10-order-summary-row .order-row-expander-body {
  grid-template-columns: repeat(7, minmax(145px, 1fr));
  gap: 0;
  min-width: 0;
  margin: 0;
}

.p10-order-summary-row .order-row-expander-body > div {
  align-content: start;
  gap: 5px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px 12px;
}

.p10-order-summary-row .order-row-expander-body > div:last-child {
  border-right: 0;
}

.p10-production-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px !important;
  align-items: center;
  border-top: 0 !important;
  padding-top: 0 !important;
}

.p10-manual-completion-done {
  color: var(--accent-strong);
  font-size: 12px;
}

.p10-manual-completion-dialog {
  width: min(900px, calc(100vw - 36px));
}

.p10-manual-completion-order-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: #fff;
}

.p10-manual-completion-order-context > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.p10-manual-completion-order-context span,
.p10-manual-completion-pending-head span {
  color: var(--muted);
  font-size: 12px;
}

.p10-manual-completion-order-context strong {
  overflow-wrap: anywhere;
}

.p10-manual-completion-pending-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  background: #fff;
}

.p10-manual-completion-pending-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  margin-bottom: 7px;
}

.p10-manual-completion-pending-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
}

.p10-manual-completion-pending-items > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border-top: 1px dashed var(--line);
  padding-top: 5px;
  font-size: 12px;
}

.p10-manual-completion-pending-items span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.p10-manual-completion-pending-items strong {
  flex: 0 0 auto;
}

.p10-manual-completion-pending-items p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.p10-manual-completion-form {
  grid-template-columns: minmax(170px, 0.6fr) minmax(190px, 0.7fr) minmax(280px, 1.2fr);
}

.p10-manual-completion-operator {
  grid-column: auto;
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  background: #fbfcfe;
}

.p10-manual-completion-note {
  grid-row: auto;
}

@media (max-width: 760px) {
  .p10-manual-completion-order-context,
  .p10-manual-completion-pending-items,
  .p10-manual-completion-form {
    grid-template-columns: 1fr;
  }

  .p10-manual-completion-operator {
    grid-column: auto;
  }
}

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

.order-source-toolbar span {
  margin-right: 4px;
  color: var(--muted);
  font-weight: 700;
}

.order-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.form-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.form-field span,
.form-field strong {
  display: block;
}

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

.form-field strong {
  margin-top: 4px;
}

.rule-field {
  grid-column: span 2;
}

.order-create-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.order-create-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.order-create-grid strong {
  display: block;
  margin-bottom: 8px;
}

.order-create-grid dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.order-create-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.order-create-grid dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.order-source-actions {
  display: grid;
  gap: 8px;
}

.order-status-stack {
  display: grid;
  gap: 5px;
}

.order-row-expander summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.order-row-expander-body {
  display: grid;
  gap: 8px;
  min-width: 260px;
  margin-top: 8px;
}

.order-row-expander-body div {
  display: grid;
  gap: 3px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.order-row-expander-body strong,
.order-row-expander-body span {
  display: block;
}

.order-row-expander-body span {
  color: var(--muted);
  line-height: 1.4;
}

.p11-row-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  overflow: visible;
  white-space: nowrap;
}

.p11-row-actions .table-action {
  min-width: 0;
  padding: 3px 4px;
  white-space: nowrap;
}

.p11-row-primary-action {
  flex: 1 1 auto;
}

.p11-more-menu {
  position: relative;
  flex: 0 0 auto;
}

.p11-more-menu summary {
  min-width: 42px;
  list-style: none;
  cursor: pointer;
}

.p11-more-menu summary::-webkit-details-marker {
  display: none;
}

.p11-more-menu summary::after {
  content: "⌄";
  margin-left: 2px;
}

.p11-more-menu[open] summary::after {
  content: "⌃";
}

/* 位置由 positionRowMenu 按窗口算，不受表格框裁剪。 */
.p11-more-menu-panel {
  position: fixed;
  z-index: 14;
  display: grid;
  min-width: 122px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.16);
}

.p11-more-menu[open]:not(.is-positioned) > .p11-more-menu-panel,
.p24-more-menu[open]:not(.is-positioned) > div {
  visibility: hidden;
}

.p11-more-menu-panel > .table-action,
.p11-more-danger-zone .table-action {
  width: 100%;
  justify-content: flex-start;
}

.p11-more-danger-zone {
  display: grid;
  border-top: 1px solid var(--line);
  padding-top: 5px;
}

.status-chip {
  display: inline-block;
  border-radius: 6px;
  background: #eef6f5;
  color: var(--accent-strong);
  padding: 4px 7px;
  line-height: 1.35;
}

.p10-exception-status {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border-radius: 6px;
  padding: 4px 7px;
  line-height: 1.35;
}

.p10-exception-status strong {
  font-size: 12px;
}

.p10-exception-status small {
  color: inherit;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.78;
}

.p10-exception-status.is-open {
  background: #fff0e8;
  color: #9a451f;
}

.p10-exception-status.is-clear {
  background: #eef6f5;
  color: var(--accent-strong);
}

.p10-exception-status.is-unknown {
  background: #f1f3f6;
  color: var(--muted);
}

.order-workbench {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}

.order-workbench h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.detail-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.detail-overview-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.detail-overview-grid strong,
.detail-overview-grid span {
  display: block;
}

.detail-overview-grid span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.order-header-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.order-header-card section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.order-header-card strong {
  display: block;
  margin-bottom: 8px;
}

.order-header-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.order-header-card dt {
  color: var(--muted);
  font-size: 12px;
}

.order-header-card dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.order-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.order-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.summary-card strong,
.summary-card span,
.summary-card b,
.summary-card em,
.summary-card small {
  display: block;
}

.summary-card span,
.summary-card small {
  margin-top: 5px;
  color: var(--muted);
}

.summary-card em {
  margin-top: 6px;
  font-style: normal;
}

.summary-card b {
  margin-top: 3px;
}

.order-schedule-warning,
.summary-card .order-schedule-warning,
.order-row-expander-body .order-schedule-warning strong,
.order-row-expander-body .order-schedule-warning span {
  color: var(--warn);
  font-weight: 700;
}

.order-detail-head,
.label-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.order-detail-head span,
.label-toolbar span {
  color: var(--muted);
}

.order-detail-head > div:first-child {
  display: grid;
  gap: 3px;
}

.label-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.p11-selection-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  background: #fbfcfe;
}

.p11-table-batch-actions,
.p11-table-batch-actions .process-view-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.p11-table-batch-actions .process-view-switch {
  padding-right: 6px;
  border-right: 1px solid var(--line);
}

.p11-column-settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  background: #fbfcfe;
}

.p11-column-settings-toolbar > span {
  font-weight: 700;
}

.p11-column-add-control {
  position: relative;
}

.p11-column-add-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  width: min(340px, 76vw);
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(22, 34, 51, 0.16);
  padding: 5px;
}

.p11-column-add-menu[hidden] {
  display: none;
}

.p11-column-add-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 8px 9px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.p11-column-add-option:hover {
  background: var(--table-row-hover-bg);
}

.p11-column-add-option small,
.p11-column-add-empty {
  color: var(--muted);
}

.p11-column-add-empty {
  padding: 10px;
}

.p11-column-setting-row-compact {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(150px, 1fr) 108px 130px auto;
  align-items: end;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
}

.p11-column-setting-row-compact > label,
.p11-column-setting-identity {
  display: grid;
  gap: 3px;
}

.p11-column-setting-row-compact label > span,
.p11-column-setting-identity small {
  color: var(--muted);
  font-size: 11px;
}

.p11-column-setting-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.p11-batch-feedback {
  min-height: 0;
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.p11-batch-feedback:not(:empty) {
  min-height: 18px;
  padding-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.p11-batch-feedback[data-tone="error"] {
  color: var(--danger);
  background: #fff4f2;
}

.selection-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.selection-tools span {
  color: var(--muted);
  font-weight: 700;
}

.compact-selection-tools {
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 5px;
}

.compact-selection-tools-label {
  padding: 0 6px;
  font-size: 13px;
  white-space: nowrap;
}

.compact-selection-tools .table-action {
  border-radius: 6px;
}

.batch-action-menu {
  position: relative;
}

.batch-action-menu summary {
  list-style: none;
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 700;
}

.batch-action-menu summary::-webkit-details-marker {
  display: none;
}

.batch-action-menu summary::after {
  content: " ▾";
}

.batch-action-menu[open] summary::after {
  content: " ▴";
}

.batch-action-menu > div {
  position: absolute;
  right: 0;
  z-index: 3;
  display: grid;
  gap: 6px;
  min-width: 180px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  padding: 8px;
}

.batch-action-menu .table-action {
  text-align: left;
}

.delivery-create-panel {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.delivery-create-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.delivery-create-head > div {
  display: grid;
  gap: 4px;
}

.delivery-create-head span,
.delivery-source-label span,
.delivery-candidate-toolbar span {
  color: var(--muted);
}

.delivery-source-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px 16px;
}

.delivery-source-actions {
  width: 100%;
}

.delivery-source-label {
  display: grid;
  gap: 4px;
}

.delivery-customer-field {
  display: grid;
  gap: 4px;
}

.delivery-customer-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.delivery-customer-field select {
  width: min(360px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
}

.delivery-source-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.delivery-scope-field {
  display: inline-grid;
  grid-template-columns: auto minmax(130px, 160px);
  gap: 8px;
  align-items: center;
}

.delivery-scope-field span {
  color: var(--muted);
  font-weight: 700;
}

.delivery-scope-field select {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-weight: 800;
}

.delivery-example-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  background: #f8fafc;
}

.delivery-example-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.delivery-example-chip.success {
  border-color: #b8d9d2;
  background: #e8f4f2;
  color: var(--accent-strong);
}

.delivery-example-chip.warning {
  border-color: #ecd49c;
  background: #fff7df;
  color: #7a4d00;
}

.delivery-example-chip.neutral {
  border-color: #d5dde8;
  background: #f6f8fb;
  color: #526176;
}

.delivery-candidate-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.delivery-candidate-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.delivery-candidate-tools {
  justify-content: flex-end;
}

.delivery-candidate-customer-field {
  grid-template-columns: auto minmax(220px, 280px);
  align-items: center;
}

.delivery-candidate-customer-field select {
  width: 100%;
}

.delivery-candidate-table-wrap {
  overflow-x: auto;
}

.delivery-candidate-table {
  min-width: 1540px;
}

.delivery-candidate-table th,
.delivery-candidate-table td {
  white-space: nowrap;
}

.delivery-candidate-table td strong,
.delivery-candidate-table td span {
  display: block;
}

.delivery-candidate-table td span {
  color: var(--muted);
}

.dialog-panel.p18-import-dialog {
  width: min(1480px, calc(100vw - 48px));
  max-width: none;
  max-height: 94vh;
  overflow: hidden;
}

.p18-import-dialog #p18CandidateTable {
  width: 100%;
  min-width: 1269px;
}

.p18-import-source-dialog,
.p18-scan-dialog {
  width: min(680px, 94vw);
}

.p18-scan-dialog {
  width: min(860px, 94vw);
  max-height: 92vh;
  overflow: hidden;
}

.p18-surplus-dialog {
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: hidden;
}

.p18-surplus-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7fbfa;
}

.p18-surplus-summary strong {
  color: var(--teal-dark);
}

.p18-surplus-table-wrap {
  max-height: min(46vh, 460px);
}

.p18-surplus-table {
  min-width: 980px;
}

.p18-surplus-table td,
.p18-surplus-table th {
  vertical-align: middle;
}

.p18-surplus-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.p18-surplus-warning {
  margin: 0;
  padding: 10px 14px;
  color: #8a3b17;
  background: #fff5e9;
  border-top: 1px solid #efd3b5;
}

.production-material-state {
  display: block;
  margin-top: 4px;
  font-weight: 650;
}

.production-material-state.ready {
  color: #13735d;
}

.production-material-state.blocked {
  color: #a84422;
}

.p18-import-source-options,
.p18-table-import-mapping {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
}

.p18-import-source-dialog > .muted {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 12px 16px 16px;
  color: var(--muted);
  line-height: 1.5;
}

.p18-table-file-field,
.p18-scan-dialog > label {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 700;
}

.p18-table-file-field input,
.p18-scan-dialog > label input,
.p18-table-import-mapping select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

.p18-table-import-mapping {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.p18-table-import-mapping label {
  display: grid;
  min-width: 170px;
  flex: 1 1 170px;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#p18TableImportPreview {
  max-height: 42vh;
  padding: 12px 16px;
}

.p18-scan-feedback {
  min-height: 44px;
  margin: 0 16px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
  padding: 11px 12px;
  color: var(--muted);
  font-weight: 700;
}

.p18-scan-feedback[data-tone="success"] {
  border-color: #a8d8ca;
  background: #edf8f4;
  color: #176657;
}

.p18-scan-feedback[data-tone="warning"] {
  border-color: #e6c785;
  background: #fff8e8;
  color: #805b00;
}

.p18-scan-feedback[data-tone="error"] {
  border-color: #e5b0b0;
  background: #fff1f1;
  color: #9f2727;
}

.p18-scan-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 0 16px 10px;
}

.p18-scan-progress span {
  color: var(--muted);
  font-size: 12px;
}

.p18-scan-results {
  max-height: 48vh;
  overflow: auto;
  margin: 0 16px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.p18-scan-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.p18-scan-session {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px;
}

.p18-scan-result-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 1.2fr) minmax(220px, 1.5fr);
  gap: 10px;
  align-items: center;
  border-left: 4px solid var(--line-strong);
  background: #fff;
  padding: 8px 10px;
}

.p18-scan-result-row small {
  color: var(--muted);
}

.p18-scan-result-row.is-success {
  border-color: #2f8c6b;
  background: #edf8f4;
}

.p18-scan-result-row.is-warning {
  border-color: #c98919;
  background: #fff8e8;
}

.p18-scan-result-row.is-error {
  border-color: #bd4b44;
  background: #fff1f1;
}

.p18-review-checklist {
  display: grid;
}

.p18-review-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.p18-review-row:last-child {
  border-bottom: 0;
}

.p18-review-row > div {
  display: grid;
  gap: 3px;
}

.p18-review-row small {
  color: var(--muted);
}

.p18-review-row.is-success {
  background: #e4f4ed;
  color: #176747;
}

.p18-review-row.is-pending {
  background: #fff8e8;
  color: #805b00;
}

.p18-review-row.is-neutral {
  color: var(--muted);
}

.p18-review-check {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.p18-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 10px 16px;
}

.p18-import-toolbar label {
  display: grid;
  min-width: 150px;
  gap: 4px;
}

.p18-import-toolbar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.p18-import-toolbar input,
.p18-import-toolbar select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
}

.p18-import-toolbar .p18-import-keyword {
  flex: 1 1 360px;
}

.p18-import-toolbar .p18-import-status-field {
  flex: 0 0 150px;
}

#p18CandidateColumnSettingsButton[hidden] {
  display: none;
}

.p18-candidate-detail-context {
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #f2f8f6;
  padding: 8px 16px;
}

.p18-candidate-detail-context[hidden] {
  display: none;
}

.p18-candidate-detail-context > div {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: baseline;
}

.p18-candidate-detail-context span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p18-import-selection {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 9px 16px;
}

.p18-import-selection > span {
  color: var(--accent-strong);
  font-weight: 800;
}

.p18-import-dialog > .dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.98);
}

.p18-candidate-order-row > td {
  background: #f8fafc;
  font-weight: 700;
}

.p18-candidate-item-row > td {
  background: #fff;
}

.p18-candidate-item-table {
  min-width: 1120px;
  table-layout: fixed;
}

.p18-candidate-item-table th:nth-child(1),
.p18-candidate-item-table td:nth-child(1) {
  width: 64px;
}

.p18-candidate-item-table th:nth-child(2),
.p18-candidate-item-table td:nth-child(2) {
  width: 190px;
}

.p18-candidate-item-table th:nth-child(3),
.p18-candidate-item-table td:nth-child(3) {
  width: 150px;
}

.p18-candidate-item-table th:nth-child(4),
.p18-candidate-item-table td:nth-child(4) {
  width: 135px;
}

.p18-candidate-item-table th:nth-child(5),
.p18-candidate-item-table td:nth-child(5) {
  width: 160px;
}

.p18-candidate-item-table th:nth-child(6),
.p18-candidate-item-table td:nth-child(6) {
  width: 280px;
}

.p18-candidate-item-table th:nth-child(7),
.p18-candidate-item-table td:nth-child(7) {
  width: 190px;
}

.p18-candidate-item-table td {
  white-space: normal;
}

.p18-import-status {
  display: inline-block !important;
  width: fit-content;
  border-radius: 6px;
  background: #eef2f6;
  color: #526176;
  padding: 3px 7px;
  font-size: 12px;
}

.p18-import-status-ready {
  background: #e4f4ed;
  color: #176747;
}

.p18-import-status-pending,
.p18-import-status-unavailable {
  background: #fff3dc;
  color: #8a5a00;
}

.p18-import-status-partial {
  background: #fff0df;
  color: #a24d10;
}

.p18-import-status-shipped {
  background: #eaf0fa;
  color: #2f5f9f;
}

.p18-candidate-quantity-facts {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.p18-candidate-item-row td[data-column-key="order_no"] {
  padding-left: 22px;
}

.p18-candidate-child-mark {
  display: inline-block !important;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.p16-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.p16-filter-tools,
.p16-subview-actions,
.p16-import-toolbar,
.p16-import-selection,
.p16-output-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.p16-filter-tools {
  justify-content: flex-end;
  flex: 1 1 680px;
}

.p16-filter-tools > label:not(.p16-search-field),
.p16-output-options > label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.p16-filter-tools select,
.p16-output-options select,
.p16-group-head select,
.p16-group-head input,
.p16-group-head textarea,
.p16-spec-table input,
.p16-reason-fields select,
.p16-reason-fields textarea {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}

.p16-toolbar .field,
.p16-search-field {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  color: var(--muted);
  padding: 9px 10px;
  white-space: nowrap;
}

.p16-search-field {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  gap: 8px;
  align-items: center;
}

.p16-search-field input,
.p16-spec-quantity,
.p16-spec-note textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
}

.p16-workbench-note {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.p16-list-summary,
.p16-paste-hint {
  border-bottom: 1px solid var(--line);
  padding: 9px 16px;
  color: var(--muted);
  font-size: 12px;
}

.p16-current-order-context,
.p16-list-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 9px 16px;
  font-size: 12px;
}

.p16-current-order-context[hidden],
.p16-list-feedback[hidden] {
  display: none;
}

.p16-current-order-context {
  background: #f4faf8;
  color: #176657;
}

.p16-current-order-context strong {
  font-size: 13px;
}

.p16-current-order-context button {
  margin-left: auto;
}

.p16-list-feedback.is-success {
  border-color: #a8d8ca;
  background: #edf8f4;
  color: #176657;
}

.p16-list-feedback.is-error {
  border-color: #e5b0b0;
  background: #fff1f1;
  color: #9f2727;
}

.p16-list-feedback.is-info {
  background: #f4f7fb;
  color: #40516f;
}

.p16-paste-hint {
  background: #f4faf8;
  color: #176657;
}

.p16-workbench-meta {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 10px 16px;
}

.p16-workbench-meta label {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.p16-workbench-meta input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
  color: var(--ink);
  font: inherit;
}

.p16-detail-internal-note {
  display: flex;
  gap: 10px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  background: #fff9ea;
  padding: 9px 16px;
  color: #6f4a00;
  font-size: 12px;
}

.p16-detail-internal-note[hidden] {
  display: none;
}

.p16-detail-internal-note span {
  overflow-wrap: anywhere;
}

.p16-subview-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.p16-subview-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.p16-subview-head span {
  color: var(--muted);
  font-size: 12px;
}

.p16-draft-groups,
.p16-detail-groups {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.p16-draft-group,
.p16-detail-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.p16-group-head {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(260px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
  padding: 10px 12px;
}

.p16-group-head label,
.p16-reason-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.p16-attribute-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: stretch;
}

.p16-attribute-input .table-action {
  min-height: 34px;
  padding-inline: 9px;
  white-space: nowrap;
}

.p16-supplier-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 0;
  min-width: 0;
}

.p16-supplier-picker > input {
  width: 100%;
  min-width: 0;
  border-radius: 6px 0 0 6px;
}

.p16-supplier-picker > input::-webkit-calendar-picker-indicator {
  display: none !important;
}

.p16-supplier-picker > select {
  width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  font-size: 0;
}

.p16-supplier-picker > select option {
  font-size: 13px;
}

.p16-required-hint {
  color: #9b5b00;
  font-size: 11px;
  line-height: 1.35;
}

.p16-spec-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.p16-spec-table th,
.p16-spec-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.p16-spec-table th:nth-child(1) { width: auto; }
.p16-spec-table th:nth-child(2) { width: 150px; }
.p16-spec-table th:nth-child(3) { width: 92px; }

.p16-spec-table input {
  width: 100%;
}

.p16-source-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.p16-group-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 10px;
}

.p16-detail-selection-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 10px 16px;
}

.p16-detail-selection-bar[hidden] {
  display: none;
}

.p16-detail-selection-bar > span,
.p16-detail-selection-count {
  color: var(--muted);
  font-size: 12px;
}

.p16-detail-selection-count {
  margin-left: auto;
}

.p16-detail-spec-table th:nth-child(1) { width: 58px; }
.p16-detail-spec-table th:nth-child(2) { width: auto; }
.p16-detail-spec-table th:nth-child(3) { width: 130px; }
.p16-detail-spec-table th:nth-child(4) { width: 120px; }
.p16-detail-spec-table th:nth-child(5) { width: min(320px, 30vw); }

.p16-line-arrival-status {
  display: inline-block;
  border-radius: 6px;
  background: #fff4d8;
  color: #805b00;
  padding: 4px 7px;
  font-size: 12px;
}

.p16-line-arrival-status.is-received {
  background: #edf7f3;
  color: #176657;
}

.p16-workbench-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  padding: 10px 16px;
}

.p16-workbench-footer span {
  color: var(--muted);
  font-size: 12px;
}

.p16-workbench-footer span.is-info {
  color: #40516f;
}

.p16-workbench-footer span.is-success {
  color: #176657;
}

.p16-workbench-footer span.is-error {
  color: #9f2727;
  font-weight: 700;
}

.p16-import-dialog {
  width: min(1180px, calc(100vw - 40px));
  max-height: min(820px, calc(100vh - 40px));
}

.p16-import-toolbar,
.p16-import-selection {
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.p16-import-toolbar .p16-search-field {
  min-width: min(520px, 100%);
}

.p16-import-selection span {
  color: var(--muted);
  font-size: 12px;
}

.p16-import-table-wrap {
  max-height: 56vh;
  overflow: auto;
}

.p16-import-table {
  min-width: 1220px;
  border-collapse: collapse;
}

.p16-import-table th,
.p16-import-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.p16-import-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef2f6;
}

.p16-import-order-row td {
  border-top: 2px solid #9abbb4;
  border-bottom-color: #b8ccc6;
  background: #e7f2ef;
  color: #183e37;
  font-weight: 800;
}

.p16-reason-dialog,
.p16-output-dialog {
  width: min(760px, calc(100vw - 40px));
}

.p16-output-dialog {
  width: min(1120px, calc(100vw - 40px));
}

.p16-reason-fields,
.p16-output-options,
.p16-output-preview {
  padding: 12px 14px;
}

.p16-reason-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
  gap: 12px;
}

.p16-output-options {
  border-bottom: 1px solid var(--line);
}

.p16-output-options span {
  color: var(--muted);
  font-size: 12px;
}

.p16-output-preview {
  max-height: 52vh;
  overflow: auto;
}

.p16-output-sheet {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.p16-output-sheet h4,
.p16-output-sheet h5 {
  margin: 0 0 8px;
}

.p16-output-sheet table {
  width: 100%;
  border-collapse: collapse;
}

.p16-output-sheet th,
.p16-output-sheet td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
}

/* 2026-11-10 材料简易图片：预览就是那张图，窄图不放大。 */
.p16-output-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.p16-generated-image-preview {
  display: grid;
  gap: 8px;
  margin: 0;
}

.p16-generated-image-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.p16-generated-image-preview figcaption {
  color: var(--muted);
  font-size: 12px;
}

.p16-sheet-status {
  display: inline-grid;
  gap: 3px;
  border-radius: 6px;
  background: #edf7f3;
  color: #176657;
  padding: 4px 7px;
  font-size: 12px;
}

.p16-sheet-status.is-warning {
  background: #fff4d8;
  color: #805b00;
}

.p16-empty-view {
  padding: 30px 16px;
  color: var(--muted);
  text-align: center;
}

.p16-workbench-note h3,
.p16-material-output h3 {
  margin: 0;
  font-size: 15px;
}

.p16-workbench-note p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.scope-note {
  margin-top: 10px;
  border: 1px solid #f1d39b;
  border-radius: 8px;
  background: #fff8e8;
  color: #6f4a00;
  padding: 9px 10px;
  line-height: 1.5;
}

.p16-material-output {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.p16-material-output > span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.p16-supplier-groups {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.p16-supplier-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.p16-supplier-card h4 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  font-size: 14px;
}

.p16-summary-table {
  table-layout: fixed;
  min-width: 100%;
  border-collapse: collapse;
}

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

.p16-summary-table th {
  position: relative;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
}

.p16-table-scroll {
  position: relative;
  max-height: 66vh;
  overflow: auto;
}

.p16-table-scroll .p16-summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef2f6;
}

.p16-summary-table th,
.p16-summary-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.p16-summary-table .is-pinned-left,
.p16-summary-table .is-pinned-right {
  position: sticky;
  z-index: 2;
  background: var(--surface);
}

.p16-summary-table .is-pinned-left {
  left: var(--p16-pin-offset, 0);
  box-shadow: 1px 0 0 var(--line);
}

.p16-summary-table .is-pinned-right {
  right: var(--p16-pin-offset, 0);
  box-shadow: -1px 0 0 var(--line);
}

.p16-summary-table th.is-pinned-left,
.p16-summary-table th.is-pinned-right {
  z-index: 4;
  background: #eef2f6;
}

.p16-column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.p16-column-resizer:hover,
.p16-is-resizing-column .p16-column-resizer {
  border-right: 2px solid var(--accent);
}

.p16-is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.p16-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.p16-pagination-bar label,
.p16-pagination-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.p16-pagination-bar select {
  width: auto;
  min-width: 68px;
}

.p16-supplier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.p16-selected-count {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.p16-batch-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.p16-batch-action select,
.p16-batch-supplier {
  width: auto;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 5px 8px;
  color: var(--ink);
  font: inherit;
}

.p16-batch-supplier {
  min-width: 190px;
}

.p16-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.p16-arrival-status,
.p16-replenishment-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: #edf7f3;
  color: #176657;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
}

.p16-replenishment-badge {
  background: #fff4d8;
  color: #805b00;
}

.p16-spec-card.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26, 121, 107, 0.12);
}

.p16-supplier-detail {
  background: #fff;
}

.p16-material-group {
  padding: 10px 12px 12px;
}

.p16-material-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.p16-material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}

.p16-material-item,
.p16-spec-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
  min-height: 78px;
}

.p16-spec-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.p16-spec-row label,
.p16-spec-content {
  display: grid;
  gap: 6px;
}

.p16-spec-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.p16-spec-main span {
  color: var(--text);
}

.p16-spec-quantity {
  max-width: 82px;
}

.p16-spec-note {
  margin-top: 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.p16-spec-note strong,
.p16-spec-remark strong {
  color: var(--text);
}

.p16-spec-remark {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.p16-spec-remark input {
  min-height: 32px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
}

.p16-supplier-detail .p16-material-grid {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

.p16-procurement-editor {
  display: grid;
  grid-template-columns: minmax(135px, 0.8fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.p16-procurement-quantity,
.p16-procurement-status {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.p16-procurement-quantity span {
  color: var(--muted);
  font-size: 11px;
}

.p16-procurement-quantity label {
  display: flex;
  gap: 6px;
  align-items: center;
}

.p16-procurement-status select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
  color: var(--ink);
  font: inherit;
}

.p16-procurement-status span {
  display: block;
  line-height: 1.45;
}

.p16-procurement-editor .p16-spec-remark {
  grid-column: 1 / -1;
}

.p16-material-item strong,
.p16-material-item span {
  display: block;
}

.p16-material-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.supplier-export .p16-material-item {
  min-height: auto;
  font-weight: 700;
}

.p16-output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.p16-related-source {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.p16-related-source summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.p16-related-source table {
  width: 100%;
  min-width: 760px;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 12px;
}

.p16-related-source th,
.p16-related-source td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
}

.p16-related-source th {
  background: var(--soft);
}

.p16-search-summary {
  color: var(--muted);
  font-size: 12px;
}

.p16-output-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  padding: 14px 16px;
}

.p16-output-notes article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.p16-output-notes strong,
.p16-output-notes span {
  display: block;
}

.p16-output-notes span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.p16-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: var(--muted);
}

/* P16 第二轮：工作台与详情共用的汇总规格卡片网格。 */
.p16-group-card-summary {
  display: grid;
  gap: 3px;
  align-self: center;
  color: var(--muted);
  font-size: 11px;
}

.p16-group-card-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.p16-spec-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  padding: 12px;
}

.p16-card-grid-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 20px 12px;
  color: var(--muted);
  text-align: center;
}

.p16-spec-card.p16-draft-spec-card,
.p16-spec-card.p16-detail-spec-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.34fr);
  grid-template-rows: auto minmax(66px, 1fr);
  gap: 9px 8px;
  min-width: 0;
  min-height: 184px;
  padding: 10px;
  overflow: hidden;
}

.p16-draft-spec-card.has-material-note {
  border-left: 3px solid #d99a25;
}

.p16-draft-spec-card.is-invalid,
.p16-draft-group.is-invalid {
  border-color: #c33d32;
  box-shadow: 0 0 0 2px rgba(195, 61, 50, 0.12);
}

.p16-card-spec-row {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(50px, 1fr)) minmax(92px, 1.55fr);
  gap: 5px;
  min-width: 0;
}

.p16-card-spec-row label,
.p16-card-readonly-row > div {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
}

.p16-card-spec-row input,
.p16-card-note-row textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 5px 6px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.p16-card-spec-row input:focus,
.p16-card-note-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26, 121, 107, 0.1);
  outline: none;
}

.p16-dimension-input {
  position: relative;
  display: block;
  min-width: 0;
}

.p16-dimension-input input {
  display: block;
}

.p16-dimension-field.has-fixed-prefix .p16-dimension-input input {
  padding-left: 22px;
}

.p16-fixed-dimension-prefix {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.p16-dimension-field.is-disabled .p16-dimension-input input {
  border-style: dashed;
  background: #f1f4f6;
  color: var(--muted);
  cursor: not-allowed;
}

.p16-card-quantity-unit {
  display: grid;
  grid-template-columns: minmax(48px, 1fr) 36px;
  gap: 3px;
}

.p16-card-coverage-hint {
  display: block;
  margin-top: 4px;
  color: #35665d;
  font-weight: 600;
  line-height: 1.35;
}

.p16-card-quantity-unit input[type="number"],
.p16-procurement-quantity input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.p16-card-quantity-unit input[type="number"]::-webkit-inner-spin-button,
.p16-card-quantity-unit input[type="number"]::-webkit-outer-spin-button,
.p16-procurement-quantity input[type="number"]::-webkit-inner-spin-button,
.p16-procurement-quantity input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.p16-card-quantity-unit input:last-child {
  text-align: center;
}

.p16-draft-spec-card.is-aggregated .p16-card-quantity-unit input[readonly] {
  border-style: dashed;
  background: #f1f5f4;
  color: #176657;
  font-weight: 800;
}

.p16-card-note-row {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.p16-card-note-row.is-manual {
  grid-template-columns: 1fr;
}

.p16-card-note-block {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  margin: 0;
  border-radius: 5px;
  background: #f7f9fb;
  padding: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.p16-card-note-block > strong,
.p16-card-note-block > span:first-child {
  color: var(--ink);
  font-weight: 700;
}

.p16-card-internal-note {
  background: #fff9ea;
}

.p16-card-internal-note > span {
  overflow-wrap: anywhere;
}

.p16-card-note-row textarea {
  min-height: 46px;
  resize: vertical;
}

.p16-card-actions {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

.p16-card-actions .table-action {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 5px 6px;
  white-space: normal;
  font-size: 11px;
  line-height: 1.25;
}

.p16-card-actions .p16-not-purchase-action {
  border-color: #d7b66e;
  color: #805b00;
}

.p16-card-sources {
  min-width: 0;
  margin-top: 2px;
}

.p16-card-sources summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.p16-card-sources ul {
  display: grid;
  gap: 4px;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
}

.p16-card-sources li {
  display: grid;
  gap: 1px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 4px;
}

.p16-card-sources li span,
.p16-card-source-empty {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.p16-card-source-identity {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}

.p16-card-source-quantity {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
}

.p16-card-source-quantity > span:last-child {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.p16-card-source-quantity input {
  width: 58px;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 3px 5px;
  color: var(--ink);
  font: inherit;
  font-size: 10px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.p16-card-source-quantity input::-webkit-inner-spin-button,
.p16-card-source-quantity input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.p16-card-readonly-row > div {
  border-radius: 5px;
  background: #f7f9fb;
  padding: 6px;
}

.p16-card-readonly-row strong {
  color: var(--ink);
  overflow-wrap: anywhere;
  font-size: 12px;
}

.p16-detail-group-head {
  grid-template-columns: minmax(180px, 0.8fr) minmax(200px, 0.9fr) minmax(260px, 1.3fr);
  align-items: center;
}

.p16-detail-group-head > div:not(.p16-group-card-summary) {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.p16-detail-group-head > div > strong {
  color: var(--ink);
}

.p16-detail-card-actions {
  align-content: start;
}

.p16-detail-readonly-hint,
.p16-detail-arrival-select {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.p16-detail-arrival-select {
  display: flex;
  gap: 5px;
  align-items: center;
  border-radius: 5px;
  background: #f7f9fb;
  padding: 6px;
  color: var(--ink);
}

.p16-detail-arrival-select input {
  margin: 0;
}

.p16-detail-identity-list {
  min-width: 0;
  border-radius: 5px;
  background: #f7f9fb;
  padding: 5px;
}

.p16-detail-identity-list summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.p16-detail-identity-line {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  margin-top: 5px;
  border-top: 1px solid var(--line);
  padding-top: 5px;
  color: var(--ink);
}

.p16-detail-identity-line > span:nth-child(2) {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.p16-detail-identity-line strong,
.p16-detail-identity-line small {
  overflow-wrap: anywhere;
  font-size: 9px;
  line-height: 1.3;
}

.p16-detail-identity-line small {
  color: var(--muted);
}

.p16-arrival-quantity-editor {
  display: grid;
  grid-column: 1 / -1;
  gap: 3px;
  min-width: 0;
  border-top: 1px dashed var(--line);
  padding-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.p16-arrival-quantity-editor > span:last-child {
  display: grid;
  grid-template-columns: minmax(62px, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.p16-arrival-quantity-editor input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 4px 6px;
}

.p16-arrival-quantity-editor em {
  color: var(--ink);
  font-size: 10px;
  font-style: normal;
}

.p16-detail-identity-line.is-received {
  color: #176657;
}

.p16-detail-identity-marker {
  text-align: center;
  font-weight: 800;
}

.p16-presentation-badge {
  display: inline-block;
  margin-top: 3px;
  border-radius: 999px;
  background: #fff2cc;
  padding: 2px 5px;
  color: #805b00;
  font-size: 9px;
  line-height: 1.3;
}

.p16-purchase-no {
  color: #176657;
  letter-spacing: 0.01em;
}

.p16-card-action-dialog {
  width: min(620px, calc(100vw - 40px));
}

.p16-card-action-fields,
.p16-card-action-summary {
  padding: 12px 14px;
}

.p16-card-action-fields {
  display: grid;
  gap: 12px;
}

.p16-card-action-fields label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.p16-card-action-summary {
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.p16-card-action-fields .p16-card-action-summary {
  margin: -12px -14px 0;
}

.p16-import-order-row td {
  color: #263442;
  font-weight: 800;
}

.p16-import-order-row td strong,
.p16-import-order-row td span {
  display: inline;
}

.p16-import-item-row td {
  background-clip: padding-box;
}

.p16-import-item-indent {
  position: relative;
  display: grid;
  gap: 2px;
  padding-left: 18px;
}

.p16-import-item-indent::before {
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: 5px;
  width: 3px;
  background: #c8d9d5;
  content: "";
}

.p16-import-item-indent span {
  color: var(--muted);
  font-size: 11px;
}

.p16-import-quantity {
  color: #176657;
  font-size: 13px;
}

.p16-import-source-badge {
  display: block;
  width: fit-content;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff0d8;
  color: #8a4b00;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.p16-import-priority {
  color: #176657;
}

.p16-import-priority-row td {
  background: #fbfefc;
}

.p16-import-restore-row td {
  background: #fffaf0;
}

.p16-import-restore-row td:last-child {
  display: grid;
  gap: 5px;
  color: #805b00;
  font-weight: 700;
}

.p16-workbench-footer .is-processing {
  cursor: wait;
  opacity: 0.78;
}

@media (min-width: 1680px) {
  .p16-spec-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1149px) {
  .p16-spec-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .p16-group-head,
  .p16-detail-group-head {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .p16-spec-card-grid,
  .p16-group-head,
  .p16-detail-group-head {
    grid-template-columns: 1fr;
  }

  .p16-spec-card.p16-draft-spec-card,
  .p16-spec-card.p16-detail-spec-card {
    grid-template-columns: minmax(0, 1fr) 90px;
  }

  .p16-card-note-row {
    grid-template-columns: 1fr;
  }

  .p16-workbench-meta label {
    grid-template-columns: 1fr;
  }
}

@media print {
  body.p16-print-output * {
    visibility: hidden !important;
  }

  body.p16-print-output #p16OutputPreview,
  body.p16-print-output #p16OutputPreview * {
    visibility: visible !important;
  }

  body.p16-print-output #p16OutputPreview {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    background: #fff;
  }
}

.delivery-draft-panel {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.delivery-draft-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px 10px;
}

.delivery-draft-head strong,
.delivery-draft-head span {
  display: block;
}

.delivery-draft-head > div span {
  margin-top: 4px;
  color: var(--muted);
}

.delivery-draft-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 16px 14px;
}

.delivery-draft-tools {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
}

.delivery-draft-summary div,
.delivery-draft-summary label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.delivery-draft-summary span,
.delivery-draft-summary strong,
.delivery-draft-summary input {
  display: block;
}

.delivery-draft-summary span {
  color: var(--muted);
  font-size: 12px;
}

.delivery-draft-summary strong {
  margin-top: 4px;
}

.delivery-draft-summary input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px;
  color: var(--ink);
  font: inherit;
}

.delivery-draft-summary .p18-customer-order-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.delivery-draft-summary .p18-customer-order-field .inline-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
}

.delivery-draft-summary .p18-customer-order-field input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin: 0;
}

.delivery-draft-actions .p18-draft-action-buttons {
  flex: 0 0 auto;
}

.delivery-draft-actions .p18-draft-action-buttons button {
  white-space: nowrap;
}

.delivery-draft-actions .p18-confirm-feedback {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}


.delivery-draft-summary .p18-edit-lock-notice {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: 8px;
  background: #fff4dc;
  padding: 8px 10px;
  color: var(--warn);
  font-size: 13px;
}

.delivery-draft-table {
  min-width: 1320px;
}

.delivery-draft-table th,
.delivery-draft-table td {
  white-space: nowrap;
}

.delivery-draft-table td strong,
.delivery-draft-table td span {
  display: block;
}

.delivery-draft-table td span {
  color: var(--muted);
}

.p18-add-draft-row > td {
  border-top: 1px dashed var(--line-strong);
  background: #fbfcfe;
  padding: 6px 10px !important;
}

.p18-add-row-button {
  width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.p18-add-row-button:hover,
.p18-add-row-button:focus-visible {
  background: #edf8f4;
  outline: 1px solid #a8d8ca;
}

.delivery-draft-table .p18-add-row-button span {
  display: inline;
  color: inherit;
}

.delivery-qty-pair {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.delivery-qty-pair span {
  display: inline;
}

.delivery-quantity-input {
  width: 88px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
  font-weight: 800;
}

.delivery-quantity-input.is-over-limit,
.delivery-quantity-input.is-over-limit:focus {
  border-color: #b42318;
  outline-color: #b42318;
  color: #b42318;
}

.p18-over-limit-note {
  flex-basis: 100%;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
}

.p18-over-limit-note[hidden] {
  display: none;
}

.delivery-line-note-input {
  min-width: 300px;
}

.p18-manual-line-input {
  width: 100%;
  min-width: 120px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 8px;
  font: inherit;
}

.p18-manual-price {
  display: grid !important;
  gap: 5px;
  min-width: 120px;
}

.p18-manual-price label {
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr);
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.p18-manual-price input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--ink);
  font: inherit;
}

.p18-manual-price em,
.p18-locked-source {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.delivery-draft-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 14px;
}

.p18-review-option {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 260px;
  color: var(--ink);
  cursor: pointer;
}

.p18-review-option input {
  margin-top: 3px;
}

.p18-review-option span {
  display: grid;
  gap: 2px;
}

.p18-review-option small {
  color: var(--muted);
  font-weight: 400;
}

.p18-review-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.72;
}

.p18-draft-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.delivery-note-preview,
.receivable-statement-preview {
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.delivery-note-head,
.delivery-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
}

.delivery-list-head {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: #fbfcfe;
}

.delivery-list-filters {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(280px, 1fr) minmax(150px, 200px) auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 16px;
}

.delivery-list-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.delivery-list-filters input,
.delivery-list-filters select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.delivery-note-head strong,
.delivery-note-head span,
.delivery-list-head strong,
.delivery-list-head span {
  display: block;
}

.delivery-note-head span,
.delivery-list-head span {
  color: var(--muted);
}

.delivery-note-title,
.receivable-statement-title {
  border-top: 2px solid var(--line-strong);
  border-bottom: 2px solid var(--line-strong);
  padding: 12px 0;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
}

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

.delivery-note-title span {
  margin-top: 3px;
  font-size: 18px;
}

.delivery-note-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.delivery-note-meta div {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

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

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

.delivery-note-table {
  min-width: 1280px;
}

.receivable-statement-table {
  min-width: 1160px;
}

.delivery-note-table th,
.delivery-note-table td,
.receivable-statement-table th,
.receivable-statement-table td {
  white-space: nowrap;
}

.delivery-note-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.delivery-note-summary div {
  border-right: 1px solid var(--line);
  padding: 10px 12px;
}

.delivery-note-summary span,
.delivery-note-summary strong,
.delivery-note-signatures span,
.delivery-note-signatures strong {
  display: block;
}

.delivery-note-summary span,
.delivery-note-signatures span {
  color: var(--muted);
  font-size: 12px;
}

.delivery-note-signatures {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  padding-top: 14px;
}

.delivery-note-signatures div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.receivable-print-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
}

.receivable-print-settings > strong {
  color: var(--ink);
  margin-right: 4px;
}

.receivable-print-settings label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  padding: 7px 10px;
}

.receivable-print-settings input {
  width: auto;
}

.receivable-print-settings select {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 5px 8px;
}

.receivable-prior-unpaid-preview {
  margin-top: 12px;
}

.primary-inline {
  border-color: var(--accent-strong);
  background: var(--accent);
  color: #fff;
}

.receivable-list-panel,
.receivable-create-panel,
.receivable-draft-panel {
  border-bottom: 1px solid var(--line);
}

.receivable-list-panel[hidden],
.receivable-work-page[hidden],
.receivable-create-panel[hidden],
.receivable-draft-panel[hidden],
.receivable-statement-preview[hidden] {
  display: none;
}

.receivable-list-panel {
  background: #fff;
}

.receivable-work-page {
  border-top: 1px solid var(--line);
  background: #f7fafb;
}

.p20-work-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: #fff;
}

.p20-work-page-head > div,
.p20-workflow-step > div {
  display: grid;
  gap: 4px;
}

.p20-work-page-head strong {
  font-size: 16px;
}

.p20-work-page-head span,
.p20-workflow-step em {
  color: var(--muted);
  font-style: normal;
}

.p20-workflow-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px;
  background: #f7fafb;
}

.p20-workflow-step {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--muted);
}

.p20-workflow-step > span {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  background: #edf1f3;
  font-weight: 800;
}

.p20-workflow-step.is-active {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--ink);
}

.p20-workflow-step.is-active > span,
.p20-workflow-step.is-complete > span {
  background: var(--accent);
  color: #fff;
}

.p20-workflow-step.is-complete {
  color: var(--ink);
}

.receivable-create-panel,
.receivable-draft-panel {
  background: #fbfcfe;
}

.receivable-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 16px 14px;
  align-items: end;
}

.receivable-list-filter-row {
  --p20-filter-keyword-track: minmax(280px, 1.1fr);
  --p20-filter-customer-track: minmax(200px, 0.95fr);
  --p20-filter-period-track: minmax(220px, 1.15fr);
  --p20-filter-custom-period-track: minmax(260px, 1.2fr);
  --p20-filter-status-track: minmax(180px, 0.85fr);
  --p20-filter-sort-track: minmax(120px, 0.6fr);
  grid-template-columns: max-content var(--p20-filter-keyword-track) var(--p20-filter-customer-track) var(--p20-filter-period-track) var(--p20-filter-status-track) var(--p20-filter-sort-track);
  overflow-x: auto;
}

.receivable-list-filter-row.is-custom-period {
  grid-template-columns: max-content var(--p20-filter-keyword-track) var(--p20-filter-customer-track) var(--p20-filter-period-track) var(--p20-filter-custom-period-track) var(--p20-filter-status-track) var(--p20-filter-sort-track);
}

.receivable-list-search-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.receivable-list-search-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.receivable-list-search-inline input {
  min-width: 0;
}

.receivable-list-period-custom {
  display: grid;
  grid-template-columns: repeat(2, minmax(125px, 1fr));
  gap: 6px;
  align-items: end;
}

.receivable-list-period-custom[hidden] {
  display: none;
}

.p20-search-context-hint {
  display: block;
  max-width: 320px;
  margin-top: 4px;
  overflow: hidden;
  color: #7a5600;
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receivable-create-filter-row {
  grid-template-columns: minmax(240px, 1fr) minmax(170px, 210px) minmax(340px, 1.2fr);
}

.receivable-custom-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  align-items: end;
}

.receivable-custom-date-range[hidden] {
  display: none;
}

.receivable-filter-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.receivable-filter-row input,
.receivable-filter-row select {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.receivable-list-stats {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: #fbfcfe;
}

.receivable-list-stats[hidden] {
  display: none;
}

.receivable-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
}

.receivable-stats-grid span {
  display: grid;
  gap: 5px;
  min-height: 54px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 12px;
}

.receivable-stats-grid small,
.p21-payable-stats-grid small {
  color: var(--muted);
  font-size: 12px;
}

.receivable-stats-grid strong,
.p21-payable-stats-grid strong {
  color: var(--ink);
  font-size: 15px;
}

/* 兼容保留的客户汇总入口样式；当前主列表不再常驻渲染该按钮。 */
.receivable-list-stats .receivable-summary-open {
  margin-left: auto;
}

.dialog-panel.receivable-summary-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

.dialog-panel.receivable-invoice-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}

.receivable-invoice-dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 14px 16px 18px;
}

.receivable-invoice-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
}

.receivable-invoice-context > div {
  display: grid;
  gap: 3px;
  min-width: 130px;
}

.receivable-invoice-context span,
.receivable-invoice-form label {
  color: var(--muted);
}

.receivable-invoice-context strong {
  overflow-wrap: anywhere;
}

.receivable-invoice-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.receivable-invoice-metrics span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  color: var(--muted);
}

.receivable-invoice-metrics span + span {
  border-left: 1px solid var(--line);
}

.receivable-invoice-metrics strong {
  color: var(--ink);
  font-size: 16px;
}

.receivable-invoice-history {
  margin-top: 14px;
}

.receivable-invoice-history > strong {
  display: block;
  margin-bottom: 8px;
}

.receivable-invoice-history-table-wrap {
  overflow-x: auto;
}

.receivable-invoice-history-table {
  width: 100%;
  min-width: 560px;
}

.receivable-invoice-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.receivable-invoice-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.receivable-invoice-form input,
.receivable-invoice-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 9px;
  color: var(--ink);
  font: inherit;
}

.receivable-invoice-form textarea {
  resize: vertical;
}

.receivable-invoice-form .wide {
  grid-column: 1 / -1;
}

.receivable-invoice-dialog .dialog-feedback {
  margin-right: auto;
  color: var(--muted);
}

.receivable-invoice-dialog .dialog-feedback[data-tone="error"] {
  color: #a33a2c;
}

.receivable-invoice-dialog .notice {
  margin-top: 12px;
}

.table-action-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--line);
  background: #f3f5f7;
  color: var(--muted);
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .receivable-invoice-form {
    grid-template-columns: 1fr;
  }

  .receivable-invoice-form .wide {
    grid-column: auto;
  }

  .receivable-invoice-context {
    display: grid;
  }

  .receivable-invoice-metrics {
    grid-template-columns: 1fr;
  }

  .receivable-invoice-metrics span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .receivable-workflow-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.receivable-summary-dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 14px 16px 18px;
}

.receivable-summary-context {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.receivable-summary-context span,
.receivable-summary-customer-head span,
.receivable-summary-table td > span {
  color: var(--muted);
}

.receivable-summary-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  margin-bottom: 12px;
}

.receivable-summary-overview > span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  color: var(--muted);
}

.receivable-summary-overview > span + span {
  border-left: 1px solid var(--line);
}

.receivable-summary-overview strong {
  color: var(--ink);
  font-size: 16px;
}

.receivable-summary-customer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.receivable-summary-table-wrap {
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.receivable-summary-table {
  min-width: 860px;
}

.receivable-summary-table th,
.receivable-summary-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.receivable-summary-table td:first-child strong,
.receivable-summary-table td:first-child span {
  display: block;
}

.receivable-summary-expanded-row > td {
  padding: 0;
  background: #f8fafc;
}

.receivable-summary-expanded {
  display: grid;
  gap: 8px;
  padding: 12px 16px 14px;
}

.receivable-summary-expanded table {
  min-width: 720px;
  border: 1px solid var(--line);
  background: #fff;
}

.receivable-summary-expanded th,
.receivable-summary-expanded td {
  padding: 8px 10px;
}

.p21-note-strip {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: #fbfcfe;
}

.p21-note-strip strong {
  color: var(--accent-strong);
}

.p21-note-strip span {
  color: var(--muted);
  line-height: 1.6;
}

.p21-payable-stats {
  display: grid;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: #fff;
}

.p21-payable-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 10px;
}

.p21-payable-stats-grid span {
  display: grid;
  gap: 5px;
  min-height: 54px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 9px 12px;
}

.p23-note-strip {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: #fbfcfe;
}

.p23-note-strip strong {
  color: var(--accent-strong);
}

.p23-note-strip span {
  color: var(--muted);
  line-height: 1.6;
}

.p23-inventory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: #fff;
}

.p23-inventory-summary div,
.p23-toolbar label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
}

.p23-inventory-summary span,
.p23-inventory-table td span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.p23-toolbar {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) minmax(150px, 200px) minmax(220px, auto);
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  align-items: end;
}

.p23-action-hint {
  align-self: center;
  color: var(--muted);
}

.p23-inventory-table {
  min-width: 1180px;
}

.dialog-panel.p23-registration-dialog {
  display: flex;
  flex-direction: column;
  width: min(1380px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
}

.p23-registration-dialog-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 16px;
  background: #fbfcfe;
}

.p23-registration-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.p23-registration-steps span {
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.p23-registration-steps span.is-active {
  border-bottom: 3px solid var(--accent);
  background: #eef8f4;
  color: var(--accent-strong);
}

.p23-registration-steps span.is-complete {
  color: var(--accent-strong);
}

.p23-new-inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.p23-new-inventory-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.p23-registration-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.p23-registration-filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.p23-registration-filter-actions,
.p23-registration-batch-toolbar,
.p23-registration-batch-toolbar > div,
.p23-registration-batch-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.p23-registration-batch-toolbar {
  justify-content: space-between;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: #fff;
  padding: 8px 10px;
  color: var(--muted);
}

.p23-registration-table-wrap {
  margin-top: 0;
}

.p23-registration-table {
  min-width: 980px;
}

.p23-registration-table.is-confirmation {
  min-width: 940px;
}

.p23-registration-table tr.is-selected td {
  background: #eef8f4;
}

.p23-registration-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.p23-registration-table th span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.p23-registration-table .p23-version-badge {
  color: inherit;
}

.p23-registration-number {
  width: 112px;
  min-width: 112px;
}

.p23-registration-cost-readonly {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.p23-registration-note {
  width: 180px;
  min-width: 180px;
}

.p23-registration-batch-summary {
  justify-content: flex-end;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff;
  padding: 9px 10px;
}

.p23-registration-batch-summary span {
  border-left: 1px solid var(--line);
  padding-left: 10px;
  color: var(--muted);
}

.p23-registration-batch-summary span:first-child {
  border-left: 0;
}

.p23-registration-batch-summary strong {
  color: var(--text);
}

.p23-registration-confirm-head {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr) minmax(260px, 1.4fr);
  gap: 10px;
  margin-bottom: 12px;
}

.p23-registration-confirm-head > div,
.p23-registration-confirm-head label {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
}

.p23-registration-confirm-head span,
.p23-registration-confirm-head label {
  color: var(--muted);
  font-weight: 700;
}

.p23-registration-confirm-head strong {
  color: var(--text);
}

.p23-registration-dialog-actions {
  flex-shrink: 0;
}

.p23-new-inventory-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.p23-registration-selection {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.p23-registration-selection > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.p23-registration-selection span,
.p23-registration-hint,
.p23-registration-warning {
  color: var(--muted);
}

.p23-registration-hint,
.p23-registration-warning {
  margin: 12px 0 0;
  border-radius: 8px;
  padding: 10px 12px;
}

.p23-registration-hint {
  border: 1px dashed var(--line);
  background: #fff;
}

.p23-registration-warning {
  border: 1px solid #e2b75d;
  background: #fff8e8;
  color: #805600;
}

.p23-version-badge {
  display: inline-block !important;
  width: fit-content;
  margin-top: 4px;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
}

.p23-version-badge.is-current {
  background: #e8f5ef;
  color: #176b55;
}

.p23-version-badge.is-historical {
  background: #eef2f7;
  color: #4c6075;
}

.p23-version-badge.is-inactive {
  background: #fff0e7;
  color: #9a4c1c;
}

.p23-inventory-dialog {
  width: min(1120px, calc(100vw - 40px));
}

.p23-dialog-meta,
.p23-source-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.p23-dialog-meta > div,
.p23-source-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.p23-dialog-meta span,
.p23-source-summary span {
  color: var(--muted);
  font-size: 12px;
}

.p23-dialog-meta strong,
.p23-source-summary strong {
  overflow-wrap: anywhere;
}

.p23-source-summary {
  grid-template-columns: 1fr 1fr 2fr;
}

.p23-dialog-form {
  display: grid;
  grid-template-columns: 160px minmax(220px, 1fr) minmax(260px, 1.4fr);
  gap: 10px;
  margin-top: 12px;
}

.p23-dialog-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.p23-dialog-form input {
  min-width: 0;
}

.p23-movement-table {
  max-height: 330px;
}

.p23-movement-table td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.delivery-qty-available {
  flex-wrap: wrap;
}

.delivery-qty-available em {
  color: var(--muted);
  font-style: normal;
}

.p21-filter-row {
  display: grid;
  --p21-filter-keyword-track: minmax(280px, 1.1fr);
  --p21-filter-supplier-track: minmax(200px, 0.95fr);
  --p21-filter-period-track: minmax(240px, 1.15fr);
  --p21-filter-custom-period-track: minmax(260px, 1.2fr);
  --p21-filter-status-track: minmax(180px, 0.85fr);
  grid-template-columns: max-content var(--p21-filter-keyword-track) var(--p21-filter-supplier-track) var(--p21-filter-period-track) var(--p21-filter-status-track);
  gap: 10px;
  align-items: end;
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  overflow-x: auto;
}

.p21-filter-row.is-custom-period {
  grid-template-columns: max-content var(--p21-filter-keyword-track) var(--p21-filter-supplier-track) var(--p21-filter-period-track) var(--p21-filter-custom-period-track) var(--p21-filter-status-track);
}

.receivable-list-filter-row > .table-action,
.p21-open-workbench-button {
  white-space: nowrap;
}

.p21-supplier-search-control {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.p21-supplier-search-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.p21-supplier-search-inline input {
  min-width: 0;
}

.p21-filter-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.p21-filter-row input,
.p21-filter-row select {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

.finance-filter-resizable {
  position: relative;
  min-width: 0;
}

.filter-width-resizer {
  position: absolute;
  z-index: 3;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}

.filter-width-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 2px;
  height: 24px;
  border-left: 2px dotted var(--line-strong);
  transform: translateY(-50%);
  opacity: 0.72;
}

.filter-width-resizer:hover::after,
.finance-filter-is-resizing .filter-width-resizer::after,
.filter-width-resizer:focus-visible::after {
  border-left-color: var(--accent);
  opacity: 1;
}

.finance-filter-is-resizing,
.finance-filter-is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.p21-list-period-custom {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 6px;
  align-items: end;
}

.p21-list-period-custom[hidden] {
  display: none;
}

.p21-payable-table-wrap td strong,
.p21-payable-table-wrap td span {
  display: block;
}

.p21-payable-table-wrap td .p21-due-hint {
  color: var(--muted);
  font-size: 11px;
}

.p21-payable-table-wrap td span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.p21-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p21-summary-row {
  background: #fbfcfe;
  font-weight: 700;
}

.p21-summary-row td {
  border-top: 2px solid var(--line-strong);
}

.p21-summary-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.p21-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.p21-entry-grid[hidden] {
  display: none;
}

.p21-list-view[hidden] {
  display: none !important;
}

.p21-entry-panel {
  border: 0;
  border-radius: 0;
}

.p21-create-actions {
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.p21-custom-date-range[hidden] {
  display: none;
}

.p21-range-hint {
  margin: 0;
  padding: 0 16px 12px;
  color: var(--muted);
  line-height: 1.5;
}

.p21-scan-dialog {
  width: min(1480px, 100%);
}

.p21-scan-date-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.p21-scan-date-filter label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.p21-scan-date-filter input {
  min-width: 0;
}

.p21-scan-weight-input {
  display: block;
  margin-top: 4px;
}

.p21-scan-weight-input input {
  width: 150px;
  max-width: 100%;
}

.p21-scan-price-stack {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.p21-scan-price-stack small,
.p21-manual-line-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.p21-scan-unit-price,
.p21-scan-line-amount,
.p21-manual-line-row input {
  width: 150px;
  max-width: 100%;
  min-width: 90px;
}

.p21-manual-line-row input {
  width: 130px;
}

.p21-manual-line-row td {
  vertical-align: top;
}

.p21-add-manual-line-wrap {
  display: flex;
  justify-content: flex-start;
  padding: 0 14px 12px;
}

.p21-scan-table {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  margin-bottom: 12px;
}

.p21-range-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 8px;
  background: #fbfcfe;
  color: var(--muted);
  white-space: nowrap;
}

.p21-scan-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.p21-scan-summary span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
  color: var(--muted);
}

.p21-scan-summary strong {
  color: var(--ink);
}

.p21-detail-dialog {
  width: min(920px, 100%);
}

.p21-detail-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.p21-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}

.p21-payment-entry-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.p21-detail-grid span,
.p21-payment-entry-summary span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
  color: var(--muted);
  line-height: 1.35;
}

.p21-detail-grid strong,
.p21-payment-entry-summary strong {
  color: var(--ink);
}

.p21-detail-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.p21-detail-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.p21-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p21-edit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.p21-edit-form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.p21-edit-form-grid .wide-field {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .p21-edit-form-grid {
    grid-template-columns: 1fr;
  }

  .p21-edit-form-grid .wide-field {
    grid-column: auto;
  }
}

.p21-payment-records-table {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.p22-filter-row {
  display: grid;
  grid-template-columns: minmax(300px, 1.8fr) minmax(140px, 0.7fr) minmax(160px, 0.8fr) repeat(2, minmax(150px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.p22-open-workbench-button {
  align-self: end;
  min-height: 42px;
  white-space: nowrap;
}

.p22-filter-row label,
.p22-entry-type-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.p22-filter-row input,
.p22-filter-row select,
.p22-entry-type-row select {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

.p22-cash-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 16px;
}

.p22-cash-stats[hidden] {
  display: none;
}

.p22-cash-stats span {
  padding: 0 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.p22-cash-stats span:first-child {
  padding-left: 0;
  border-left: 0;
  color: var(--ink);
  font-weight: 700;
}

/* 2026-11-08 表格自己左右滑，外框不再比页面宽（原来右边被裁掉）。 */
.p22-cash-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.p22-cash-table-wrap > table {
  min-width: 1260px;
}

.p22-direction-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 700;
  white-space: nowrap;
}

.p22-direction-chip.is-income {
  background: #e8f5ef;
  color: #176b55;
}

.p22-direction-chip.is-expense {
  background: #fff0e7;
  color: #9a4c1c;
}

.p22-row-action-muted {
  color: var(--muted);
  font-size: 12px;
}

.p22-entry-type-row {
  display: flex;
  align-items: end;
  padding: 12px 16px 0;
}

.p22-entry-type-row label {
  width: min(320px, 100%);
}

.p22-entry-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px 0;
}

.p22-entry-panel[hidden] {
  display: none;
}

.p22-entry-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  color: var(--muted);
}

.p22-entry-summary span {
  padding: 0 12px;
  border-left: 1px solid var(--line);
}

.p22-entry-summary span:first-child {
  padding-left: 0;
  border-left: 0;
}

.p22-new-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding-top: 2px;
}

.p22-new-category-row label {
  display: grid;
  flex: 1 1 260px;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.p22-new-category-row input {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px;
}

.p24-boundary-strip {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.p24-boundary-strip strong {
  color: var(--accent-strong);
}

.p24-boundary-strip span {
  color: var(--muted);
  line-height: 1.5;
}

.p24-toolbar {
  display: grid;
  grid-template-columns: auto minmax(300px, 1fr) minmax(150px, 190px) minmax(170px, 220px) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.p24-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.p24-expense-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.p24-expense-summary > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fbfcfe;
}

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

.p24-expense-table {
  min-width: 1120px;
}

.p24-expense-table td strong,
.p24-expense-table td span {
  display: block;
}

.p24-expense-table td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.p24-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.p24-more-menu {
  position: relative;
}

.p24-more-menu summary {
  list-style: none;
  cursor: pointer;
}

.p24-more-menu summary::-webkit-details-marker {
  display: none;
}

.p24-more-menu[open] > div {
  position: fixed;
  z-index: 14;
  min-width: 90px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.14);
}

.p24-more-menu button {
  width: 100%;
}

.p24-expense-dialog {
  width: min(1040px, calc(100vw - 40px));
}

#p24ExpenseDialogBody {
  padding: 14px;
}

#p24ExpenseDialogBody > .dialog-actions {
  margin: 14px -14px -14px;
}

.p24-expense-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.p24-expense-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.p24-expense-form .wide-field {
  grid-column: span 2;
}

.p24-new-category-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(260px, 1.2fr);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid #b8d9d2;
  border-radius: 6px;
  background: #f7fbfa;
}

.p24-new-category-row[hidden] {
  display: none;
}

.p24-new-category-row span {
  align-self: center;
  color: var(--muted);
  line-height: 1.45;
}

.p24-expense-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.p24-expense-meta > div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.p24-expense-meta span {
  color: var(--muted);
  font-size: 12px;
}

.p24-expense-meta strong {
  overflow-wrap: anywhere;
}

.p24-expense-voucher {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.p24-expense-voucher img {
  display: block;
  max-width: 100%;
  max-height: 280px;
  margin-top: 8px;
  object-fit: contain;
}

.p24-expense-log-table {
  max-height: 260px;
}

.receivable-print-options {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(320px, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 16px 16px;
  background: #fff;
}

.receivable-print-options.compact {
  grid-template-columns: minmax(220px, max-content) minmax(320px, 1fr);
  border-top: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 16px 12px;
}

.receivable-print-options.compact .switch-row {
  min-height: 40px;
  background: #f7fbfa;
  border-color: #b8d9d2;
}

.switch-row,
.prior-unpaid-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
}

.switch-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

.switch-row input {
  width: auto;
}

.prior-unpaid-summary {
  display: block;
  overflow-x: auto;
  color: var(--muted);
}

.prior-unpaid-summary strong {
  color: var(--ink);
}

.prior-unpaid-breakdown {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, max-content);
  align-items: stretch;
  gap: 0;
  margin: 0;
  min-width: max-content;
}

.prior-unpaid-breakdown .prior-unpaid-title,
.prior-unpaid-breakdown .prior-unpaid-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 38px;
  white-space: nowrap;
}

.prior-unpaid-breakdown .prior-unpaid-title {
  border-left: 1px solid var(--line);
  border-radius: 6px 0 0 6px;
  background: #eef3f7;
}

.prior-unpaid-breakdown .prior-unpaid-cell {
  border-radius: 0;
}

.prior-unpaid-breakdown .prior-unpaid-total {
  border-radius: 0 6px 6px 0;
  background: #f7fbfa;
}

.prior-unpaid-breakdown b,
.prior-unpaid-breakdown strong {
  font-weight: 800;
}

.candidate-toolbar,
.receivable-draft-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px 10px;
}

.candidate-toolbar strong,
.candidate-toolbar span,
.receivable-draft-group-head strong,
.receivable-draft-group-head span,
.receivable-draft-group-head em {
  display: block;
}

.candidate-toolbar span,
.receivable-draft-group-head span,
.receivable-draft-group-head em {
  color: var(--muted);
  font-style: normal;
}

.receivable-draft-groups {
  display: grid;
  /* 列宽固定的明细表要在自己的框里左右滚动，不能把整页撑宽。 */
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 0 16px 16px;
}

.receivable-draft-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.receivable-draft-group table {
  min-width: 1220px;
}

.receivable-feedback-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.receivable-feedback-controls {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr) max-content;
  gap: 14px;
  align-items: end;
}

.receivable-feedback-controls > .table-action.icon-only {
  justify-self: end;
}

.receivable-feedback-copy {
  display: grid;
  gap: 4px;
  align-content: end;
}

.receivable-feedback-workbench strong,
.receivable-feedback-workbench span {
  display: block;
}

.receivable-feedback-workbench span {
  color: var(--muted);
}

.receivable-feedback-table table {
  min-width: 1320px;
}

.receivable-feedback-search-field {
  display: grid;
  gap: 6px;
  min-width: 320px;
  color: var(--muted);
  font-weight: 700;
}

.receivable-feedback-search-left {
  justify-self: start;
  width: min(420px, 100%);
}

.receivable-feedback-workbench .receivable-feedback-search-field {
  min-width: 0;
}

.receivable-feedback-search {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.receivable-feedback-save-status {
  flex: 1 1 auto;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.4;
}

.receivable-feedback-save-status[data-tone="pending"] {
  border-color: #f2c46d;
  color: #7a5600;
  background: #fff8e8;
}

.receivable-feedback-save-status[data-tone="success"] {
  border-color: #8bc7b9;
  color: #17634f;
  background: #effaf6;
}

.receivable-feedback-save-status[data-tone="error"] {
  border-color: #e8a49a;
  color: #9f2d20;
  background: #fff3f1;
}

.receivable-draft-group td strong,
.receivable-draft-group td span {
  display: block;
}

.receivable-draft-group td span {
  color: var(--muted);
}

.draft-line-title {
  display: block;
  padding: 0 16px 10px;
}

.inline-money-input,
.inline-note-input {
  width: 100%;
  min-width: 150px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.inline-note-input {
  min-width: 220px;
}

.receivable-feedback-locked-field {
  display: grid;
  gap: 5px;
}

.receivable-feedback-locked-input[readonly] {
  border-color: #cbd5d2;
  background: #f0f3f2;
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.receivable-feedback-locked-value {
  display: block;
  min-height: 20px;
  padding: 4px 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.receivable-feedback-lock-note {
  border-color: #d9e2df;
  background: #f4f7f6;
}

.receivable-feedback-lock-note strong {
  color: var(--muted);
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: #fff;
}

.receivable-draft-empty {
  grid-column: 1 / -1;
}

.receivable-workflow-strip {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin: 0 16px 14px;
  padding: 10px 12px;
  border: 1px solid #b8d9d2;
  border-radius: 8px;
  background: #f5fbf9;
}

.receivable-workflow-strip.is-compact {
  margin: 12px 0 0;
  padding: 9px 10px;
  background: #fbfcfe;
}

.receivable-workflow-strip.is-minimal {
  margin: 0;
  padding: 8px 10px;
  gap: 0;
}

.receivable-workflow-strip.is-minimal .receivable-workflow-current em {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receivable-workflow-current {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.receivable-workflow-current span,
.receivable-workflow-current em,
.receivable-workflow-hint {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.receivable-workflow-current strong {
  color: var(--ink);
}

.receivable-workflow-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.receivable-workflow-node {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.receivable-workflow-node b {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 50%;
  background: #edf1f3;
  font-size: 11px;
}

.receivable-workflow-node.is-done,
.receivable-workflow-node.is-current {
  border-color: #8bc7b9;
  color: #17634f;
  background: #effaf6;
}

.receivable-workflow-node.is-done b,
.receivable-workflow-node.is-current b {
  background: var(--accent);
  color: #fff;
}

.receivable-row-next {
  display: block;
  max-width: 230px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.receivable-row-next small {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 700;
}

.receivable-status-next {
  display: block;
  margin-top: 4px;
  max-width: 180px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.receivable-list-table-tools {
  display: flex;
  justify-content: flex-end;
}

#receivableListTable th[data-column-key="delivery_count"],
#receivableListTable td[data-column-key="delivery_count"] {
  text-align: center;
}

.receivable-due-date {
  display: block;
  font-weight: 700;
  white-space: nowrap;
}

.receivable-due-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.receivable-due-date.is-overdue,
.receivable-due-note.is-overdue {
  color: #b42318;
}

.app-update-bar {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 8px 12px 8px 16px;
  transform: translateX(-50%);
  border: 1px solid #e0b34c;
  border-radius: 8px;
  background: #fff4d6;
  color: #6b4a00;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.18);
}

.app-update-bar[hidden] {
  display: none;
}

@media print {
  .app-update-bar {
    display: none !important;
  }
}

.receivable-summary-date {
  display: grid;
  gap: 6px;
}

.row-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.row-action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.empty-table-cell strong,
.empty-table-cell span {
  display: block;
}

.empty-table-cell span {
  color: var(--muted);
  margin-top: 4px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
}

.dialog-backdrop[hidden] {
  display: none;
}

/* 默认宽度放在 :where 里不占优先级：各弹窗自己写的宽度才能生效，不受写在前面还是后面影响。 */
:where(.dialog-panel) {
  width: min(760px, 100%);
}

.dialog-panel {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.base-settings-panel {
  min-height: 620px;
}

.base-settings-panel .panel-head > div {
  display: grid;
  gap: 4px;
}

.settings-center-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 560px;
  border-top: 1px solid var(--line);
}

.settings-center-nav {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.settings-center-nav-group {
  display: grid;
  gap: 4px;
}

.settings-center-nav-group > strong {
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.settings-center-nav-group > button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.settings-center-nav-group > button:hover,
.settings-center-nav-group > button.active {
  background: #e8f5f2;
  color: var(--accent-strong);
}

.settings-center-nav-group > button.active {
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}

.settings-center-nav-group > button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.settings-center-content {
  min-width: 0;
  background: #fff;
}

.settings-center-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.settings-center-section-head h3,
.settings-center-section-head p {
  margin: 0;
}

.settings-center-section-head h3 {
  font-size: 16px;
}

.settings-center-section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.settings-center-section-head > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.settings-center-numbering {
  min-width: 0;
}

.settings-center-template-defaults {
  min-width: 0;
}

.settings-center-company {
  min-width: 0;
}

.company-profile-form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.company-profile-form-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.company-profile-form-title span,
.company-profile-form-section > p,
.customer-fee-override-row small {
  color: var(--muted);
  font-size: 12px;
}

.company-profile-form-section > p {
  margin: 0;
}

.company-profile-form-grid,
.company-fee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.company-fee-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.company-profile-form-grid label,
.company-fee-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.company-profile-form-grid input,
.company-profile-form-grid select,
.company-fee-grid input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
  font: inherit;
}

.company-profile-form-grid .full-row {
  grid-column: 1 / -1;
}

.company-profile-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 14px;
}

.company-profile-form-actions span {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.document-template-default-form {
  display: grid;
  grid-template-columns: 150px 150px minmax(180px, 1fr) minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.document-template-default-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.document-template-default-form select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
}

.document-template-default-table {
  min-width: 920px;
}

.document-template-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.document-template-preview > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px 11px;
}

.document-template-preview span {
  color: var(--muted);
  font-size: 12px;
}

.settings-center-numbering-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}

.base-settings-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 140px auto auto minmax(100px, auto);
  gap: 8px;
  align-items: end;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.base-settings-toolbar label,
.base-settings-form-body label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.base-settings-toolbar input,
.base-settings-toolbar select,
.base-settings-form-body input,
.base-settings-form-body select,
.base-settings-form-body textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
  font: inherit;
}

.base-settings-count {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.base-settings-table {
  min-width: 1100px;
}

.base-settings-table td > span,
.base-settings-table td > small {
  display: block;
}

.base-settings-table td > small {
  margin-top: 3px;
  color: var(--muted);
}

.base-settings-table .material-group-row td {
  background: #f2f7f6;
  border-top-color: #c9dcd7;
  font-weight: 600;
}

.material-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.material-group-toggle small {
  color: var(--muted);
  font-weight: 400;
}

.material-child-row td:first-child {
  color: var(--muted);
}

.material-child-branch {
  display: inline-block;
  margin-right: 6px;
  color: #9aaca8;
}

.base-settings-surcharge-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.base-settings-status {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #e7f5ef;
  color: #176b57;
  padding: 3px 8px;
  font-size: 12px;
}

.base-settings-status.is-disabled {
  background: #eef1f4;
  color: #64748b;
}

.base-settings-note {
  margin: 0;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.base-settings-dialog {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.base-settings-form-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.base-settings-form-body .full-row {
  grid-column: 1 / -1;
}

/* 工序表单的“同步到还没开始扫码的订单工序”只在改记录方式时显示。 */
.base-settings-form-body .inline-check[hidden] {
  display: none;
}

.base-settings-form-body .inline-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.base-settings-form-body .inline-check input {
  width: auto;
  min-height: auto;
}

.base-settings-check-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px;
}

.base-settings-check-grid[hidden] {
  display: none;
}

.base-settings-check-grid > strong,
.base-settings-check-grid > p {
  grid-column: 1 / -1;
  margin: 0;
}

.base-settings-check-grid > p {
  color: var(--muted);
  font-size: 12px;
}

.base-settings-process-label-grid {
  grid-template-columns: 1fr;
}

.base-settings-process-label-row {
  display: grid;
  grid-template-columns: 88px repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.base-settings-process-label-row > b {
  align-self: center;
  color: var(--ink);
}

.base-settings-role-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cfe2dc;
  border-radius: 7px;
  background: #f2faf7;
  padding: 9px 11px;
}

.base-settings-role-note span,
.base-settings-empty-guide {
  color: var(--muted);
  font-size: 12px;
}

.base-settings-empty-guide {
  grid-column: 1 / -1;
}

.base-settings-capability-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 88px 76px;
  gap: 6px;
  align-items: center;
}

.base-settings-capability-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.base-settings-capability-row input {
  min-width: 0;
  width: 100%;
}

.customer-fee-override-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-fee-override-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 100px;
  gap: 5px 8px;
  align-items: center;
}

.customer-fee-override-row small {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .settings-center-layout {
    grid-template-columns: 1fr;
  }

  .settings-center-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-center-nav-group {
    flex: 0 0 auto;
    min-width: 160px;
  }

  .base-settings-toolbar {
    grid-template-columns: 1fr 130px auto auto;
  }

  .base-settings-count,
  #baseSettingsAddBtn {
    grid-column: auto;
  }

  .base-settings-form-body,
  .base-settings-check-grid,
  .company-profile-form-grid,
  .company-fee-grid {
    grid-template-columns: 1fr;
  }

  .base-settings-process-label-row {
    grid-template-columns: 1fr;
  }

  .base-settings-capability-row {
    grid-template-columns: minmax(100px, 1fr) 88px 76px;
  }

  .document-template-default-form {
    grid-template-columns: 1fr 1fr;
  }
}

.p11-label-template-select {
  display: grid;
  grid-template-columns: auto minmax(220px, 420px);
  gap: 8px;
  align-items: center;
}

.p11-label-template-select select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
}

.production-employee-binding-panel {
  width: min(560px, 100%);
}

.production-employee-binding-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.production-employee-binding-current {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px 11px;
}

.production-employee-binding-current span,
.production-employee-binding-current small,
.production-employee-binding-body label span {
  color: var(--muted);
  font-size: 12px;
}

.production-employee-binding-body form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.production-employee-binding-body label {
  display: grid;
  gap: 5px;
}

.production-employee-binding-body input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
  font: inherit;
}

.production-employee-binding-feedback {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
}

.production-employee-binding-feedback[data-tone="success"] {
  color: var(--accent-strong);
}

.production-employee-binding-feedback[data-tone="error"] {
  color: #a33a2c;
}

.document-number-dialog {
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
}

.document-number-body {
  min-height: 0;
  padding: 12px 14px 14px;
  overflow: hidden;
}

.document-number-company-row {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 10px;
}

.document-number-company-row label {
  display: grid;
  gap: 5px;
  flex: 0 0 220px;
  font-weight: 700;
}

.document-number-company-row input,
.document-number-table input[type="text"],
.document-number-table input[type="number"],
.document-number-table select {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 5px 7px;
}

.document-number-company-row input:focus,
.document-number-table input:focus,
.document-number-table select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(27, 123, 111, 0.14);
  outline-offset: 1px;
}

.document-number-company-row p {
  margin: 0 0 7px;
  color: var(--muted);
  line-height: 1.5;
}

/* 全局数值字段统一直接输入；保留数值类型、范围和步长校验。 */
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

.document-number-table-wrap {
  max-height: min(58vh, 520px);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
}

.document-number-table {
  min-width: 1040px;
}

.document-number-table th,
.document-number-table td {
  padding: 7px 8px;
  white-space: nowrap;
}

.document-number-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.document-number-table td:first-child strong,
.document-number-table td:first-child small {
  display: block;
}

.document-number-table td:first-child small {
  margin-top: 2px;
  color: var(--muted);
}

.document-number-table input[data-document-number-field="type_code"] {
  width: 78px;
}

.document-number-table select[data-document-number-field="date_format"] {
  width: 132px;
}

.document-number-table input[data-document-number-field="sequence_digits"] {
  width: 82px;
}

.document-number-table select[data-document-number-field="reset_period"] {
  width: 104px;
}

.document-number-table input[data-document-number-field="separator"] {
  width: 72px;
}

.material-attribute-settings-table {
  min-width: 860px;
}

.material-attribute-settings-table input,
.material-attribute-settings-table select {
  width: 100%;
}

.material-attribute-settings-table td:first-child input {
  min-width: 180px;
}

.material-attribute-settings-table td:last-child {
  color: var(--muted);
  white-space: normal;
}

.document-number-active-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.document-number-active-field input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.document-number-preview {
  display: inline-block;
  min-width: 190px;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

.document-number-rule-row.is-inactive .document-number-preview {
  color: var(--muted);
  text-decoration: line-through;
}

.document-number-feedback {
  min-height: 20px;
  margin-right: auto;
  color: var(--muted);
}

.document-number-feedback[data-tone="success"] {
  color: var(--accent-strong);
}

.document-number-feedback[data-tone="error"] {
  color: #a33a2c;
}

.document-number-actions .primary-inline:hover {
  background: var(--accent-strong);
  color: #fff;
}

.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-head strong,
.dialog-head span {
  display: block;
}

.dialog-head span {
  margin-top: 4px;
  color: var(--muted);
}

.dialog-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #fbfcfe;
}

.receivable-print-dialog .receivable-print-settings {
  margin: 14px;
}

.config-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.config-list-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  line-height: 1.5;
}

.config-list-item strong,
.config-list-item span,
.config-list-item em {
  display: block;
}

.config-list-item span {
  margin-top: 4px;
  color: var(--muted);
}

.config-list-item em {
  margin-top: 6px;
  color: #334155;
  font-style: normal;
  word-break: break-word;
}

.config-chip {
  display: inline-block;
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
}

.config-chip.on {
  background: #e8f4f2;
  color: var(--accent-strong);
}

.config-chip.off {
  background: #eef2f6;
  color: var(--muted);
}

.adjust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 16px;
}

.adjust-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.writeoff-row select,
.writeoff-row input,
.adjust-card select,
.adjust-card input {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.adjust-card button {
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
}

.message {
  min-height: 22px;
  padding: 0 16px 16px;
  color: var(--accent-strong);
}

.p07-review-panel {
  border-color: #c8d6e4;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.review-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px 16px;
}

.review-card strong {
  font-size: 15px;
  color: var(--ink);
}

.review-card span {
  color: var(--muted);
  line-height: 1.6;
}

.p07-review-table {
  min-width: 1500px;
}

.p07-review-table th,
.p07-review-table td {
  vertical-align: top;
  line-height: 1.65;
}

.p07-review-table td:first-child strong {
  display: block;
  margin-bottom: 6px;
}

.p07-review-table td:first-child span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.review-risk,
.review-action {
  display: block;
}

.review-risk {
  color: #92400e;
}

.review-action {
  color: #0f766e;
  font-weight: 700;
}

.p07-risk-examples {
  padding: 0 24px 24px;
}

.review-subhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 18px 0 10px;
}

.review-subhead h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.review-subhead span {
  color: var(--muted);
  line-height: 1.6;
}

.p07-risk-example-table {
  min-width: 1280px;
}

.p07-risk-example-table th,
.p07-risk-example-table td {
  vertical-align: top;
  line-height: 1.65;
}

.p07-risk-example-table td:first-child {
  width: 180px;
}

.p07-risk-example-table td:first-child strong {
  color: var(--ink);
}

@media (max-width: 1450px) {
  .p10-order-summary-row .order-row-expander-body {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .order-list-toolbar {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .p10-toolbar-actions,
  .p10-toolbar-filters,
  .p10-toolbar-filters label {
    width: 100%;
  }

  .p10-toolbar-filters label {
    align-items: stretch;
  }

  #p10SearchKeyword,
  #p10DeliveryFilter,
  #p10ExceptionFilter,
  #p10OrderSort {
    width: 100%;
  }

  .p10-order-summary-row .order-row-expander-body {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    max-height: none;
  }

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

  .nav-home {
    grid-column: 1 / -1;
  }

  .module-subnav {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .module-tab-primary {
    margin-left: 0;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .document-number-dialog {
    max-height: calc(100vh - 24px);
  }

  .document-number-company-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .document-number-company-row label {
    flex-basis: auto;
  }

  .p25-maintenance-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .p25-detail-selection-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .p25-detail-transfer-actions {
    justify-content: flex-start;
  }

  .p25-display-toolbar {
    justify-content: flex-start;
  }

  .p25-search-toolbar label {
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }

  .p25-search-toolbar .p25-search-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .p25-local-feedback {
    white-space: normal;
  }

  .p25-column-setting-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .p25-rename-project-form {
    grid-template-columns: 1fr;
  }

  .metric-strip,
    .page-map-grid,
    .quote-toolbar,
    .new-quote-grid,
    .quote-header-groups,
    .field-config-grid,
    .order-header-card,
    .order-action-grid,
    .scan-workbench-head,
    .scan-list-toolbar,
    .scan-submit-bar,
    .p25-search-toolbar,
    .p25-dialog-form,
    .p25-column-settings,
    .p12-search-row,
    .p12-filter-row,
    .p12-summary-strip,
    .p15-preview-layout,
    .p16-toolbar,
    .p16-merge-grid,
    .p16-output-notes,
    .receivable-filter-row,
    .receivable-stats-grid,
    .p20-workflow-steps,
    .receivable-feedback-controls,
    .delivery-list-filters,
    .delivery-draft-summary,
    .p21-filter-row,
    .p21-payable-stats-grid,
    .p21-scan-date-filter,
    .p22-filter-row,
    .p22-expense-form,
    .p23-dialog-meta,
    .p23-inventory-summary,
    .p23-toolbar,
    .p23-source-summary,
    .p23-dialog-form,
    .p23-registration-filter-grid,
    .p23-registration-confirm-head,
    .p23-registration-selection,
    .p24-boundary-strip,
    .p24-toolbar,
    .p24-expense-summary,
    .p24-expense-form,
    .p24-new-category-row,
	    .p24-expense-meta,
	    .p09-external-meta,
	    .p09-external-import-grid,
	    .p09-source-choice-grid,
	    .review-summary,
    .writeoff-row,
    .adjust-grid {
    grid-template-columns: 1fr;
  }

  .p23-registration-batch-toolbar,
  .p23-registration-batch-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-center-tabs {
    flex-wrap: wrap;
  }

  .p24-expense-form .wide-field {
    grid-column: auto;
  }

    .field-config-head,
    .order-detail-head,
    .new-quote-head,
    .new-quote-actions,
    .p09-save-toolbar,
    .candidate-toolbar,
    .p20-work-page-head,
    .receivable-draft-group-head,
    .receivable-feedback-workbench,
    .label-toolbar,
    .delivery-draft-head,
  .delivery-draft-actions,
  .p11-selection-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .internal-order-page-actions,
  .p11-inline-filter {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .p11-overview-toolbar {
    grid-template-columns: 1fr;
  }

  .p11-toolbar-actions,
  .p11-toolbar-filters {
    width: 100%;
    justify-content: flex-start;
  }

  .p11-inline-filter select,
  .p11-inline-filter input {
    max-width: none;
    width: 100%;
  }

  .p11-order-context-strip,
  .p11-exception-form,
  .p11-label-preview-grid {
    grid-template-columns: 1fr;
  }

  .p11-order-context-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .p11-order-context-strip > div:last-child {
    border-bottom: 0;
  }

  .batch-action-menu > div {
    left: 0;
    right: auto;
  }
}

/* P18 第一轮：送货单主表、独立新建工作台、详情与打印 */
.p18-subview[hidden] {
  display: none !important;
}

.p18-subview {
  min-width: 0;
}

.p18-view-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 11px 16px;
}

.p18-view-head > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.p18-view-head > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.p18-workbench-section + .p18-workbench-section {
  border-top: 8px solid var(--bg);
}

.p18-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  grid-template-columns: none;
}

.p18-toolbar > .table-action {
  flex: 0 0 auto;
}

.p18-toolbar > label {
  flex: 0 1 170px;
  min-width: 132px;
}

.p18-toolbar > label:has(#p18ListKeyword) {
  flex-basis: 330px;
}

.p18-toolbar > label:has(#p18ListSort) {
  flex-basis: 205px;
}

.p18-toolbar input,
.p18-toolbar select {
  min-height: 34px;
  padding: 6px 8px;
}

.p18-result-summary {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 12px;
  line-height: 1.4;
}

.p18-table-shell {
  position: relative;
  max-height: min(64vh, 680px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.delivery-candidate-table-wrap.p18-table-shell {
  max-height: min(52vh, 560px);
  overflow: auto;
}

#deliveryDraftPanel .p18-table-shell {
  max-height: min(56vh, 600px);
}

.p18-detail-table {
  min-width: 1120px;
}

.p18-data-table {
  table-layout: fixed;
}

.p18-data-table caption {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  line-height: 1.4;
}

.p18-data-table th,
.p18-data-table td {
  position: relative;
  height: 44px;
  padding: 8px 9px;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.p18-data-table td > input,
.p18-data-table td > select,
.p18-data-table td > textarea {
  min-width: 0;
  max-width: 100%;
}

.p18-table-shell .p18-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #eef2f6;
  box-shadow: inset 0 -1px var(--line);
}

.p18-data-table .p18-pin-left,
.p18-data-table .p18-pin-right {
  position: sticky;
  z-index: 3;
  background: var(--surface);
  background-clip: padding-box;
}

.p18-data-table .p18-pin-left {
  box-shadow: 1px 0 0 var(--line);
}

.p18-data-table .p18-pin-right {
  box-shadow: -1px 0 0 var(--line);
}

.p18-table-shell .p18-data-table thead th.p18-pin-left,
.p18-table-shell .p18-data-table thead th.p18-pin-right {
  z-index: 7;
  background: #eef2f6;
}

.p18-data-table tbody tr:hover > .p18-pin-left,
.p18-data-table tbody tr:hover > .p18-pin-right {
  background: var(--table-row-hover-bg);
}

.p18-column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  z-index: 9;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.p18-column-resizer::after {
  position: absolute;
  top: 22%;
  right: 4px;
  bottom: 22%;
  width: 1px;
  background: transparent;
  content: "";
}

.p18-column-resizer:hover::after,
.p18-is-resizing-column .p18-column-resizer::after {
  width: 2px;
  background: var(--accent);
}

.p18-is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.p18-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.p18-row-actions .table-action {
  white-space: nowrap;
}

.p18-void-dialog {
  width: min(560px, calc(100vw - 32px));
}

.p18-void-note {
  display: grid;
  gap: 7px;
  padding: 16px;
  color: var(--text);
  font-weight: 700;
}

.p18-void-note textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.p18-void-feedback {
  margin: 0 16px 4px;
  border-radius: 6px;
  background: #f4f7fa;
  color: var(--muted);
  padding: 9px 10px;
  line-height: 1.45;
}

.p18-void-feedback[data-tone="error"] {
  background: #fff0ee;
  color: #9a332d;
}

.p18-void-history {
  background: #fff6f4;
}

.p18-restore-history {
  background: #edf8f4;
}

.p18-void-history small,
.p18-restore-history small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}

.p18-recently-created > td,
.p18-recently-created > td.p18-pin-left,
.p18-recently-created > td.p18-pin-right {
  background: #e8f5f1;
  box-shadow: inset 0 1px #8dc7b8, inset 0 -1px #8dc7b8;
}

.p18-recently-created > td:first-child {
  box-shadow: inset 4px 0 var(--accent), inset 0 1px #8dc7b8, inset 0 -1px #8dc7b8;
}

.p20-recently-created > td,
.p20-recently-created > td.p18-pin-right {
  background: #e8f5f1;
  box-shadow: inset 0 1px #8dc7b8, inset 0 -1px #8dc7b8;
}

.p20-recently-created > td:first-child {
  box-shadow: inset 4px 0 var(--accent), inset 0 1px #8dc7b8, inset 0 -1px #8dc7b8;
}

.p18-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 10px;
  align-items: center;
  min-height: 44px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  padding: 7px 16px;
  font-size: 12px;
}

.p18-pagination label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.p18-pagination select {
  width: auto;
  min-width: 66px;
  min-height: 31px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 4px 7px;
}

.p18-pagination:empty {
  display: none;
}

.p18-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.p18-detail-grid > div {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
}

.p18-detail-grid > div:nth-child(4n) {
  border-right: 0;
}

.p18-detail-grid > .wide {
  grid-column: 1 / -1;
  border-right: 0;
}

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

.p18-detail-grid strong {
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.p18-standard-available {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  background: #edf6f4;
  color: var(--accent-strong);
  padding: 5px 8px;
  font-weight: 700;
  line-height: 1.35;
}

.p18-inventory-breakdown {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.p18-inventory-breakdown span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.p18-inventory-breakdown span:last-child {
  border-bottom: 0;
}

.p18-inventory-breakdown strong {
  color: var(--ink);
}

#p18ColumnSettingsBody .p18-column-page-size {
  display: grid;
  grid-template-columns: minmax(100px, 150px) minmax(120px, 180px);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  padding: 8px;
  font-weight: 700;
}

#p18ColumnSettingsBody .p18-column-page-size select {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
}

#p18ColumnSettingsBody .p07-column-setting-row > div {
  display: flex;
  gap: 5px;
  align-items: center;
}

.p18-print-dialog {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
}

.p18-print-dialog > .dialog-head,
.p18-print-dialog > .dialog-actions {
  flex: 0 0 auto;
}

.p18-print-controls {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px 14px;
}

.p18-print-controls > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.p18-print-controls select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 6px 8px;
}

.p18-print-controls fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px 10px;
}

.p18-print-controls legend {
  color: var(--muted);
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
}

.p18-print-controls fieldset label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.p18-print-controls input {
  margin: 0;
}

.p18-print-sheet {
  flex: 1 1 auto;
  min-height: 360px;
  max-height: min(62vh, 680px);
  overflow: auto;
  border-bottom: 0;
}

.p18-print-sheet .table-wrap {
  overflow: auto;
}

.p18-print-sheet .delivery-note-table {
  width: 100%;
  min-width: 760px;
}

.p18-print-sheet .delivery-note-table th,
.p18-print-sheet .delivery-note-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .p18-detail-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .p18-detail-grid > div:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .p18-detail-grid > div:nth-child(2n) {
    border-right: 0;
  }

  .delivery-candidate-head {
    grid-template-columns: 1fr;
  }

  .delivery-candidate-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .p18-view-head,
  .delivery-create-head,
  .delivery-draft-head {
    align-items: stretch;
    flex-direction: column;
  }

  .p18-view-head > .selection-tools,
  .delivery-candidate-tools,
  .delivery-draft-tools,
  .delivery-draft-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .p18-draft-action-buttons {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .p18-toolbar {
    align-items: stretch;
  }

  .p18-toolbar > label,
  .p18-toolbar > label:has(#p18ListKeyword),
  .p18-toolbar > label:has(#p18ListSort) {
    flex: 1 1 100%;
    width: 100%;
  }

  .p18-toolbar > label input,
  .p18-toolbar > label select,
  .delivery-candidate-customer-field,
  .delivery-candidate-customer-field select,
  .delivery-scope-field,
  .delivery-scope-field select {
    width: 100%;
  }

  .delivery-candidate-customer-field,
  .delivery-scope-field {
    grid-template-columns: 1fr;
  }

  .delivery-draft-summary,
  .p18-detail-grid,
  .p18-print-controls {
    grid-template-columns: 1fr;
  }

  .p18-detail-grid > div,
  .p18-detail-grid > div:nth-child(2n),
  .p18-detail-grid > div:nth-child(4n) {
    border-right: 0;
  }

  .p18-data-table tbody .p18-pin-left,
  .p18-data-table tbody .p18-pin-right {
    position: static;
  }

  .p18-table-shell .p18-data-table thead th.p18-pin-left,
  .p18-table-shell .p18-data-table thead th.p18-pin-right {
    right: auto !important;
    left: auto !important;
  }

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

  #p18ColumnSettingsBody .p18-column-page-size {
    grid-template-columns: 1fr;
  }

  .p18-print-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .p18-print-sheet {
    min-height: 280px;
  }
}

@media print {
  body.p18-printing * {
    visibility: hidden !important;
  }

  body.p18-printing #p18PrintSheet,
  body.p18-printing #p18PrintSheet * {
    visibility: visible !important;
  }

  body.p18-printing {
    margin: 0;
    background: #fff;
    padding: 0;
  }

  body.p18-printing #p18PrintSheet {
    position: absolute;
    inset: 0;
    display: block !important;
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    margin: 0;
    background: #fff;
    padding: 0;
  }

  body.p18-printing #p18PrintSheet .table-wrap {
    overflow: visible;
  }

  body.p18-printing #p18PrintSheet .delivery-note-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  body.p18-printing #p18PrintSheet .delivery-note-table th,
  body.p18-printing #p18PrintSheet .delivery-note-table td {
    padding: 6px;
    color: #111;
    white-space: normal;
  }
}
.table-wrap tbody tr.excel-active-row > td {
  background-color: #f2f8f7;
}

.table-wrap tbody td.excel-active-cell {
  box-shadow: inset 0 0 0 2px #16756f;
  background-color: #e7f3f1;
  z-index: 3;
}

.table-wrap tbody td.excel-active-cell input,
.table-wrap tbody td.excel-active-cell select,
.table-wrap tbody td.excel-active-cell textarea {
  border-color: #16756f;
  box-shadow: 0 0 0 2px rgba(22, 117, 111, 0.12);
}

.p15-home-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.p11-process-expand {
  padding: 0;
  min-height: auto;
}

.p11-process-exception-marker,
.p12-process-exception-marker {
  color: #c62828 !important;
  font-weight: 700;
}

.p11-exception-reopen-note {
  display: block;
  flex-basis: 100%;
  color: #a45113;
  line-height: 1.4;
}

.p11-scan-batch-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f7fafb;
}

.p11-scan-fact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.p11-scan-fact-row > label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.p11-scan-fact-row > label > span {
  display: grid;
  gap: 2px;
}

.p11-scan-fact-row > small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.p11-scan-fact-row.is-voided {
  opacity: 0.68;
  background: #f7f8fa;
}

.p11-scan-void-mark {
  color: #b42318;
  font-weight: 700;
}

.p16-source-cancel-list {
  margin: 8px 0 0;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.p16-source-cancel-list summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
}

.p16-source-cancel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.p16-source-cancel-row > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.p16-source-cancel-row small {
  color: var(--muted);
}

.p16-source-cancel-row.is-cancelled {
  opacity: 0.7;
}

.p12-employee-admin-dialog,
.p12-supplier-admin-dialog {
  width: min(880px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
}

.p12-employee-admin-form,
.p12-supplier-admin-form {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fbfb;
}

.p12-employee-admin-fields,
.p12-supplier-admin-fields {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) auto auto;
  gap: 10px;
  align-items: end;
}

.p12-employee-admin-fields label:not(.p12-employee-admin-check),
.p12-supplier-admin-fields label:not(.p12-supplier-admin-check) {
  display: grid;
  gap: 5px;
}

.p12-employee-admin-fields label > span,
.p12-employee-admin-list-head span,
.p12-supplier-admin-fields label > span,
.p12-supplier-admin-list-head span {
  color: var(--muted);
  font-size: 12px;
}

.p12-employee-admin-check,
.p12-supplier-admin-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  white-space: nowrap;
}

.p12-employee-process-grid,
.p12-supplier-process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.p12-employee-process-grid label,
.p12-supplier-process-grid label {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.p12-employee-process-grid.is-disabled,
.p12-supplier-process-grid.is-disabled {
  opacity: 0.55;
}

.p12-employee-admin-form-actions,
.p12-employee-admin-list-head,
.p12-employee-admin-list article,
.p12-supplier-admin-form-actions,
.p12-supplier-admin-list-head,
.p12-supplier-admin-list article {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.p12-employee-admin-form-actions,
.p12-supplier-admin-form-actions {
  margin-top: 12px;
}

#p12EmployeeAdminFeedback {
  flex: 1;
  color: var(--muted);
}

#p12EmployeeAdminFeedback[data-tone="error"] {
  color: var(--danger);
}

#p12EmployeeAdminFeedback[data-tone="success"] {
  color: var(--success);
}

#p12SupplierAdminFeedback {
  flex: 1;
  color: var(--muted);
}

#p12SupplierAdminFeedback[data-tone="error"] {
  color: var(--danger);
}

#p12SupplierAdminFeedback[data-tone="success"] {
  color: var(--success);
}

.p12-employee-admin-list,
.p12-supplier-admin-list {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.p12-employee-admin-list article,
.p12-supplier-admin-list article {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.p12-employee-admin-list article > div:first-child,
.p12-supplier-admin-list article > div:first-child {
  display: grid;
  gap: 3px;
}

.p12-employee-admin-list article > div:last-child,
.p12-supplier-admin-list article > div:last-child {
  display: flex;
  gap: 6px;
}

.p12-employee-admin-list article.is-inactive,
.p12-supplier-admin-list article.is-inactive {
  background: #f3f4f5;
  opacity: 0.72;
}

@media (max-width: 820px) {
  .p12-employee-admin-fields,
  .p12-employee-process-grid,
  .p12-supplier-admin-fields,
  .p12-supplier-process-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.report-center-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.report-center-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.report-center-note {
  margin: 0;
  padding: 12px 14px;
  color: var(--muted);
}

.p15-issue-photo-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfa;
}

.p15-issue-photo-head,
.p15-issue-photo-head > div,
.p15-issue-qr-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.p15-issue-photo-file {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.p15-issue-photo-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.p15-issue-qr-panel {
  justify-content: flex-start;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
}

.p15-issue-qr-panel img {
  width: 112px;
  height: 112px;
}

.p15-issue-qr-panel > div {
  display: grid;
  gap: 5px;
}

.exception-photo-list,
.p11-exception-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exception-photo-list figure,
.p11-exception-photo-list a {
  display: grid;
  gap: 4px;
  width: 104px;
  margin: 0;
  color: inherit;
  font-size: 11px;
  text-decoration: none;
}

.exception-photo-list img,
.p11-exception-photo-list img {
  width: 104px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 5px;
  object-fit: cover;
  background: #fff;
}

.exception-upload-page {
  min-height: 100vh;
  margin: 0;
  padding: 16px;
  background: #eef3f2;
}

.exception-upload-card {
  display: grid;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.exception-upload-card h1,
.exception-upload-card p {
  margin: 0;
}

.exception-upload-context {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 7px;
  background: #eef8f5;
}

.exception-upload-picker {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #1f746b;
  border-radius: 8px;
  text-align: center;
}

.exception-upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 640px) {
  .p15-issue-photo-head,
  .p15-issue-qr-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .exception-upload-actions {
    grid-template-columns: 1fr;
  }
}

/* 首页：可配置工作台第一版 */
.workbench-page {
  min-width: 0;
}

.workbench-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
}

.workbench-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.workbench-toolbar h2 {
  font-size: 17px;
}

.workbench-toolbar p,
.workbench-storage-note,
#workbenchSaveStatus {
  color: var(--muted);
  font-size: 12px;
}

.workbench-toolbar-actions,
.workbench-editing-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

#workbenchEditingActions[hidden] {
  display: none !important;
}

#workbenchSaveStatus {
  max-width: 280px;
  text-align: right;
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.workbench-widget {
  grid-column: span 6;
  display: flex;
  min-width: 0;
  min-height: 218px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.workbench-widget.size-small {
  grid-column: span 3;
  min-height: 170px;
}

.workbench-widget.size-medium {
  grid-column: span 6;
}

.workbench-widget.size-large {
  grid-column: span 9;
  min-height: 280px;
}

.workbench-widget.size-full {
  grid-column: span 12;
  min-height: 250px;
}

.workbench-grid.is-editing .workbench-widget {
  border-style: dashed;
  border-color: #8db7b1;
}

.workbench-grid.is-editing .workbench-widget:hover,
.workbench-widget.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 111, 104, 0.12);
}

.workbench-widget.is-dragging {
  opacity: 0.46;
}

.workbench-widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px 9px;
}

.workbench-widget-head > div {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  justify-content: start;
  gap: 5px 7px;
  min-width: 0;
}

.workbench-widget-head strong {
  font-size: 15px;
}

.workbench-widget-head small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.4;
}

.workbench-tier-chip {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border: 1px solid #d9c9ff;
  border-radius: 999px;
  background: #f5f1ff;
  color: #6941c6;
  padding: 1px 6px;
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.workbench-module-link {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 2px 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.workbench-module-link:hover {
  text-decoration: underline;
}

.workbench-widget-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.workbench-metric {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 78px;
  background: #fbfcfd;
  padding: 10px 12px;
}

.workbench-metric strong {
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.1;
}

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

.workbench-metric.is-accent strong {
  color: var(--accent-strong);
}

.workbench-metric.is-success strong {
  color: #18794e;
}

.workbench-metric.is-warning strong,
.workbench-widget-list em.is-warning {
  color: #9a6700;
}

.workbench-metric.is-danger strong,
.workbench-widget-list em.is-danger {
  color: #b42318;
}

.workbench-widget-list {
  display: grid;
  flex: 1;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workbench-widget-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid #edf0f3;
  padding: 9px 12px;
}

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

.workbench-widget-list li > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workbench-widget-list strong,
.workbench-widget-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-widget-list small {
  color: var(--muted);
}

.workbench-widget-list em {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.workbench-widget-empty {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 72px;
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.workbench-widget-editor {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #f7faf9;
  padding: 8px 10px;
}

.workbench-drag-handle {
  margin-right: auto;
  color: var(--accent-strong);
  cursor: grab;
  font-size: 12px;
  font-weight: 700;
  user-select: none;
}

.workbench-drag-handle:active {
  cursor: grabbing;
}

.workbench-widget-editor label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.workbench-widget-editor select {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  padding: 4px 7px;
}

.table-action.danger-inline {
  border-color: #e7b1aa;
  background: #fff8f7;
  color: #9f3026;
}

.workbench-empty-state {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 260px;
  align-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.workbench-empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.workbench-storage-note {
  margin-top: 10px;
  text-align: right;
}

.workbench-widget-dialog {
  display: flex;
  width: min(820px, 100%);
  max-height: calc(100vh - 48px);
  flex-direction: column;
}

.workbench-widget-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
}

.workbench-catalog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
}

.workbench-catalog-item.is-selected {
  background: #f6f8fa;
}

.workbench-catalog-item > div {
  min-width: 0;
}

.workbench-catalog-item strong {
  margin-right: 5px;
}

.workbench-catalog-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .workbench-widget.size-small {
    grid-column: span 6;
  }

  .workbench-widget.size-large {
    grid-column: span 12;
  }
}

@media (max-width: 820px) {
  .workbench-toolbar,
  .workbench-toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workbench-editing-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  #workbenchSaveStatus {
    max-width: none;
    text-align: left;
  }

  .workbench-widget,
  .workbench-widget.size-small,
  .workbench-widget.size-medium,
  .workbench-widget.size-large,
  .workbench-widget.size-full {
    grid-column: 1 / -1;
  }

  .workbench-widget-catalog {
    grid-template-columns: 1fr;
  }
}

/* 全站超高对话框可达性：任何弹窗都不能被视口裁掉。 */
dialog {
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.dialog-backdrop {
  overflow-y: auto;
  overscroll-behavior: contain;
  place-items: safe center;
}

.dialog-backdrop > .dialog-panel {
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.dialog-backdrop > .dialog-panel > .dialog-head,
.dialog-backdrop > .dialog-panel > .dialog-actions {
  position: sticky;
  z-index: 30;
  flex: 0 0 auto;
}

.dialog-backdrop > .dialog-panel > .dialog-head {
  top: 0;
  background: #fff;
}

.dialog-backdrop > .dialog-panel > .dialog-actions {
  bottom: 0;
  background: #fbfcfe;
}

/* P07 客户确认后维护 P25：头尾固定，仅中间零件清单滚动。 */
.dialog-backdrop > .dialog-panel.p07-p25-archive-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(820px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

#p07P25ArchiveDialogBody {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (max-width: 640px) {
  dialog {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .dialog-backdrop {
    padding: 10px;
  }

  .dialog-backdrop > .dialog-panel,
  .dialog-backdrop > .dialog-panel.p07-p25-archive-dialog {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }
}

/* 2026-10-26 工序格子分色（用户确认样例）：
   不用扫码=灰虚线、待扫码=白底橙框、进行中=蓝、已完成=绿、
   可选未做（非必检零件的品质检验等）=浅灰虚线、有未关闭异常=红框。 */
.status-chip.proc-na,
.p12-process-cell.proc-na {
  background: transparent;
  color: #9aa3ad;
  border: 1px dashed #d5dae0;
}

.status-chip.proc-todo {
  background: #ffffff;
  color: #b45309;
  border: 1.5px solid #f59e0b;
  font-weight: 700;
}

.p12-process-cell.proc-todo {
  background: #ffffff;
  box-shadow: inset 0 0 0 1.5px #f59e0b;
}

.p12-process-cell.proc-todo strong {
  color: #b45309;
}

.status-chip.proc-doing,
.p12-process-cell.proc-doing {
  background: #e7f0fb;
  color: #1d4f8f;
}

.p12-process-cell.proc-doing strong {
  color: #1d4f8f;
}

.status-chip.proc-done,
.p12-process-cell.proc-done {
  background: #e3f3e8;
  color: #1f6b3a;
}

.p12-process-cell.proc-done strong {
  color: #1f6b3a;
}

.status-chip.proc-optional,
.p12-process-cell.proc-optional {
  background: #f5f6f8;
  color: #6b7480;
  border: 1px dashed #c3c9d1;
}

.status-chip.proc-exception,
.p12-process-cell.proc-exception {
  box-shadow: inset 0 0 0 2px #dc2626;
}

.p11-compact-status.is-external .status-chip.proc-todo {
  color: #b45309;
}

.p11-compact-status.is-external .status-chip.proc-doing {
  color: #1d4f8f;
}

.p11-compact-status.is-external .status-chip.proc-done {
  color: #1f6b3a;
}

.p11-compact-status.is-external .status-chip.proc-na,
.p11-compact-status.is-external .status-chip.proc-optional {
  color: #6b7480;
}

/* 2026-10-26 P09 必检列 */
.p09-inspection-header {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.p09-inspection-all,
.p09-inspection-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.p09-checkpoint-cell {
  display: grid;
  gap: 4px;
}

.p09-inspection-reason {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  border: 1px solid #f59e0b;
}

.p09-checkpoint-auto {
  color: var(--muted);
  font-size: 12px;
}

/* 2026-10-26 一键检验弹窗 */
.p12-bulk-inspection-dialog {
  width: min(860px, calc(100vw - 32px));
}

.p12-bulk-inspection-dialog td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.p12-bulk-inspection-dialog input[type="number"] {
  width: 90px;
}

/* 2026-10-27 外协页状态与工序格子同一套颜色：待发出=白底橙框、在外/部分=蓝、已回/厂内已完成=绿、异常=红 */
.p12-external-status.waiting {
  background: #ffffff;
  color: #b45309;
  box-shadow: inset 0 0 0 1.5px #f59e0b;
}

.p12-external-status.sent,
.p12-external-status.partial,
.p12-external-status.partial_sent {
  background: #e7f0fb;
  color: #1d4f8f;
}

.p12-external-status.returned,
.p12-external-status.internal_done {
  background: #e3f3e8;
  color: #1f6b3a;
}

.p12-external-status.exception {
  background: #fff0ed;
  color: #b42318;
  box-shadow: inset 0 0 0 1.5px #dc2626;
}

/* 2026-10-27 订单零件页紧凑工序格子：状态标签可点开扫码记录，窄列不丢内容 */
.p11-process-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.p11-process-chip.proc-todo,
.p11-process-chip.proc-na,
.p11-process-chip.proc-optional {
  border-width: 1px;
}

.p11-process-chip:hover,
.p11-process-chip:focus-visible {
  filter: brightness(0.96);
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.p11-chip-caret {
  font-size: 11px;
  opacity: 0.7;
}

.p11-process-quantity-line,
.p11-process-treatment-line,
.p11-process-transfer-line {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1.25;
}

.p11-process-treatment-line {
  color: #1d4f8f;
  font-weight: 600;
}

.p11-process-transfer-line {
  color: #7c3aed;
}

/* 2026-10-27 生产进度紧凑格子 */
.p12-panel .p12-process-cell span,
.p12-panel .p12-process-cell small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}

.p12-process-transfer-marker {
  color: #7c3aed !important;
}

/* 2026-10-27 扫码弹窗工序选项：与工序格子同一套颜色，能做的在前，文字可换行 */
.p12-scan-process-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.p12-scan-process-grid label small,
.p15-process-options label small {
  white-space: normal;
  overflow-wrap: anywhere;
}

.p12-scan-process-grid label.proc-todo,
.p15-process-options label.proc-todo {
  border-color: #f59e0b;
  box-shadow: inset 0 0 0 0.5px #f59e0b;
}

.p12-scan-process-grid label.proc-doing,
.p15-process-options label.proc-doing {
  border-color: #9cc0ea;
  background: #e7f0fb;
}

.p12-scan-process-grid label.proc-done,
.p15-process-options label.proc-done {
  border-color: #a9d8b8;
  background: #e3f3e8;
}

.p12-scan-process-grid label.proc-optional,
.p15-process-options label.proc-optional {
  border-style: dashed;
  background: #f5f6f8;
}

.p12-scan-process-grid label.proc-exception,
.p15-process-options label.proc-exception {
  box-shadow: inset 0 0 0 2px #dc2626;
}

.p12-scan-process-grid label.selected,
.p15-process-options label.selected {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

/* 2026-10-27 一键检验：快捷勾选按钮 */
.p12-bulk-inspection-body {
  display: grid;
  grid-template-rows: auto auto minmax(160px, 1fr);
  min-height: 0;
  overflow: hidden;
}

.p12-bulk-inspection-rules {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.p12-bulk-inspection-dialog .p12-external-dialog-table-wrap {
  overflow: auto;
}

/* 2026-10-27 转外协 / 撤回外协弹窗 */
.p11-outsource-dialog {
  width: min(820px, calc(100vw - 32px));
}

.p11-outsource-body {
  display: grid;
  grid-template-rows: auto auto auto minmax(140px, 1fr);
  min-height: 0;
  overflow: hidden;
}

.p11-outsource-controls {
  display: grid;
  grid-template-columns: minmax(140px, 0.6fr) minmax(200px, 1fr) minmax(220px, 1.2fr);
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.p11-outsource-controls label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.p11-outsource-dialog td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.p11-outsource-dialog input[type="number"] {
  width: 90px;
}

@media (max-width: 720px) {
  .p11-outsource-controls {
    grid-template-columns: 1fr;
  }
}

/* 2026-10-27 外协页头部按钮：增加“按外协对象发出/回货”后不让按钮文字竖排 */
.p12-external-toolbar > div:first-child {
  flex: 1 1 260px;
  min-width: 0;
}

.p12-external-toolbar-actions {
  flex: 0 1 auto;
  flex-wrap: wrap;
}

.p12-external-toolbar-actions > .table-action {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* 2026-10-27 按外协对象扫码弹窗：保持简洁，比批次弹窗窄 */
.p12-supplier-scan-dialog {
  width: min(96vw, 980px);
}

.p12-supplier-scan-dialog td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.p12-supplier-scan-dialog input[type="number"] {
  width: 90px;
}

/* 2026-10-27 简洁弹窗（一键检验 / 转外协 / 按外协对象扫码）：表格跟随弹窗宽度，
   不沿用外协批次大弹窗的 1040px 最小宽度，最后一列数量不再被挤出视野。 */
.p12-bulk-inspection-dialog .p12-external-dialog-table,
.p11-outsource-dialog .p12-external-dialog-table,
.p12-supplier-scan-dialog .p12-external-dialog-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}

.p12-bulk-inspection-dialog .p12-external-dialog-table th:first-child,
.p11-outsource-dialog .p12-external-dialog-table th:first-child,
.p12-supplier-scan-dialog .p12-external-dialog-table th:first-child {
  width: 44px;
}

/* 2026-10-27 转外协对话框二次修订：工序横排勾选，勾上的工序才出现数量列 */
.p11-outsource-dialog .p11-outsource-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.p11-outsource-dialog .p12-external-dialog-table-wrap {
  flex: 1 1 auto;
  min-height: 140px;
  overflow: auto;
}

.p11-outsource-processes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 10px 12px 6px;
  font-size: 12px;
  color: var(--muted);
}

.p11-outsource-process-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.p11-outsource-process-chip.is-checked {
  border-color: #c2410c;
  background: #fff7ed;
  color: #9a3412;
}

.p11-outsource-empty {
  color: var(--danger);
}

.p11-outsource-reason {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.p11-outsource-table th,
.p11-outsource-table td {
  white-space: nowrap;
}

.p11-outsource-part label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.p11-outsource-part strong {
  display: block;
}

.p11-outsource-cell input[type="number"] {
  width: 70px;
}

.p11-outsource-cell small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.p11-outsource-cell.is-na {
  color: var(--muted);
  background: #f8fafc;
}

.p11-outsource-cell.is-cancel small {
  color: #9a3412;
}

.p11-outsource-cell.is-changed input {
  border-color: #c2410c;
  background: #fff7ed;
}

.p11-outsource-table tr.is-unselected td {
  opacity: 0.5;
}

.p11-outsource-note-input {
  width: 150px;
}

.p11-outsource-result-shell {
  display: grid;
  gap: 0;
}

/* 未加工退回弹窗 */
.p12-unprocessed-return-dialog {
  width: min(560px, calc(100vw - 32px));
}

.p12-unprocessed-shell {
  display: grid;
  grid-template-rows: auto auto auto;
}

.p12-unprocessed-body {
  display: grid;
  gap: 10px;
  padding: 12px;
  font-size: 13px;
}

.p12-unprocessed-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.p12-unprocessed-body > label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.p12-unprocessed-body input[type="number"] {
  width: 120px;
}

.p12-unprocessed-body fieldset {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.p12-unprocessed-body fieldset legend {
  padding: 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.p12-unprocessed-body fieldset small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}

.p12-unprocessed-body .is-disabled {
  opacity: 0.55;
}

/* 订单零件页工序记录里的转外协留痕 */
.p11-outsource-records {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  font-size: 12px;
}

.p11-outsource-record {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.p11-outsource-record small {
  display: block;
  color: var(--muted);
}

.p12-unprocessed-body fieldset label.inline-check {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
}

.p12-unprocessed-body fieldset input[type="radio"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

/* 2026-10-29 确认已回只显示点的那个零件，其余收起 */
.p12-external-return-more td {
  background: #f8fafc;
}

.p12-external-return-more small {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}

/* 2026-10-29 表面处理格子第一行显示具体处理名称 */
.p12-process-cell.is-surface strong,
.p11-process-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p12-process-cell .p12-surface-missing {
  color: var(--danger);
}

.p11-process-chip.p11-surface-missing {
  color: var(--danger);
}

/* 2026-10-29 工序扫码记录：厂内/外协标签与两组纠正操作 */
.p11-scan-scope-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 18px;
  vertical-align: 1px;
}

.p11-scan-scope-tag.is-internal {
  background: #e0f2fe;
  color: #075985;
}

.p11-scan-scope-tag.is-external {
  background: #ffedd5;
  color: #9a3412;
}

.p11-scan-batch-toolbar {
  flex-wrap: wrap;
}

.p11-scan-batch-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.p11-scan-batch-feedback {
  flex-basis: 100%;
  color: var(--danger);
  font-weight: 600;
}

.p11-scan-batch-feedback:empty {
  display: none;
}

/* 2026-10-29 修改订单定位零件 */
.p09-locate-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 12px;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  font-weight: 600;
}

.p09-locate-bar[hidden] {
  display: none;
}

tr.p09-locate-hit > td {
  background: #fef9c3 !important;
}

tr.p09-locate-hit.is-locate-current > td {
  background: #fde68a !important;
  box-shadow: inset 0 2px 0 #f59e0b, inset 0 -2px 0 #f59e0b;
}

.p12-external-process-note {
  display: block;
  max-width: 220px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* P23 调整库存：按实盘数量时显示差多少 */
.p23-adjust-preview {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted, #5b6574);
}

/* 全局弹窗调大小：右下角手柄、放大按钮，松手后记住大小。 */
.dialog-resize-grip {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: block;
  flex: 0 0 auto;
  align-self: flex-end;
  justify-self: end;
  width: 18px;
  height: 18px;
  margin: -18px 0 0 auto;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(
    135deg,
    transparent 0 50%,
    var(--line-strong) 50% 58%,
    transparent 58% 68%,
    var(--line-strong) 68% 76%,
    transparent 76% 86%,
    var(--line-strong) 86% 94%,
    transparent 94%
  );
}

.dialog-maximize-button {
  flex: 0 0 auto;
  margin-left: auto;
  margin-right: 8px;
}

.dialog-maximize-button + .icon-only,
.dialog-maximize-button + [data-close-p12-scan-dialog] {
  margin-left: 0;
}

.is-user-flex {
  display: flex;
  flex-direction: column;
}

.is-user-flex > * {
  flex: 0 0 auto;
}

.is-user-flex > .dialog-grow {
  flex: 1 0 auto;
}

.is-user-sized .table-wrap {
  max-height: none;
}

body.is-dialog-resizing,
body.is-dialog-resizing * {
  cursor: nwse-resize !important;
  user-select: none !important;
}

@media print {
  .dialog-resize-grip,
  .dialog-maximize-button {
    display: none !important;
  }
}

/* 发票记录行内修改、作废 */
.receivable-invoice-history-table input {
  width: 100%;
  min-width: 96px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

.receivable-invoice-row-actions {
  white-space: nowrap;
}

.receivable-invoice-voiding td {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: #fff8f7;
}

.receivable-invoice-voiding label {
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.receivable-invoice-voided {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.receivable-invoice-voided summary {
  cursor: pointer;
}

.receivable-invoice-voided p {
  margin: 6px 0 0;
}

/* 收支台账：入口按钮和改错窗口 */
.p22-entry-buttons {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 8px;
}

.p22-filter-row .p22-show-voided {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  white-space: nowrap;
}

.p22-filter-row .p22-show-voided input {
  width: auto;
  min-height: 0;
}

.p22-row-voided td {
  color: var(--muted);
  background: #f7f8fa;
}

.p22-row-voided td:first-child strong {
  text-decoration: line-through;
}

.dialog-panel.p22-record-edit-dialog {
  width: min(920px, calc(100vw - 40px));
}

.p22-record-edit-dialog .p21-detail-grid {
  margin: 14px 16px 0;
}

.p22-edit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px 0;
}

.p22-edit-form label,
.p22-edit-void label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.p22-edit-form .wide-field {
  grid-column: 1 / -1;
}

.p22-edit-form input,
.p22-edit-form select,
.p22-edit-void input,
.p22-edit-reverse-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
  font: inherit;
}

.p22-edit-hint {
  margin: 8px 16px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.p22-edit-allocations {
  padding: 14px 16px 0;
}

.p22-edit-allocations .table-wrap {
  margin-top: 8px;
}

.p22-edit-allocations .p22-edit-hint {
  margin-left: 0;
  margin-right: 0;
}

.p22-edit-reverse-row td {
  background: #fff8f7;
}

.p22-edit-reverse-row td > * {
  vertical-align: middle;
}

.p22-edit-reverse-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(420px, 100%);
  margin-right: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.p22-edit-reversals {
  margin: 12px 16px 0;
  color: var(--muted);
  font-size: 13px;
}

.p22-edit-reversals summary {
  cursor: pointer;
}

.p22-edit-reversals p {
  margin: 6px 0 0;
}

.p22-edit-void {
  margin: 14px 16px 0;
  border: 1px solid #f2b8b5;
  border-radius: 8px;
  background: #fff8f7;
  padding: 12px;
}

.p22-edit-void p {
  margin: 6px 0 10px;
  color: #a33b35;
  font-size: 13px;
  line-height: 1.5;
}

.p22-edit-void-button {
  margin-right: auto;
}

.p22-record-edit-dialog .dialog-actions {
  margin-top: 14px;
}

/* 收支记录查看窗口 */
.p22-edit-notice {
  margin-right: auto;
  color: #17603f;
  font-size: 13px;
}

/* 内部订单草稿 */
.p09-save-toolbar .p09-draft-feedback {
  color: #17603f;
}

.p09-save-toolbar .p09-draft-feedback.is-error {
  color: #b42318;
}

.p09-draft-feedback[hidden] {
  display: none;
}

.p10-order-draft-row > td {
  background: #fffbf0;
}

.status-chip.is-draft {
  border-color: #e6c469;
  background: #fff4d6;
  color: #8a5a00;
}

/* 手机扫码 */
.qr-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.p15-tracking-form .qr-scan-actions {
  grid-column: 1 / -1;
}

.qr-scan-actions .table-action {
  flex: 1 1 0;
  min-height: 40px;
}

.qr-scan-dialog {
  width: min(94vw, 520px);
  max-width: none;
  max-height: calc(100dvh - 24px);
  border: 0;
  border-radius: 10px;
  background: #fff;
  padding: 0;
}

.qr-scan-dialog::backdrop {
  background: rgb(15 23 42 / 70%);
}

.qr-scan-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.qr-scan-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.qr-scan-head strong {
  display: block;
}

.qr-scan-head .table-action {
  flex: none;
  white-space: nowrap;
}

.qr-scan-head span {
  color: var(--muted);
  font-size: 12px;
}

.qr-scan-stage {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
  aspect-ratio: 1;
}

.qr-scan-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-scan-frame {
  position: absolute;
  inset: 18%;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgb(0 0 0 / 28%);
}

.qr-scan-feedback {
  min-height: 20px;
  color: #17603f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.qr-scan-feedback.is-error {
  color: #b42318;
}

.mobile-nav-toggle {
  display: none;
}

/* 手机：菜单收起来，点“菜单”才展开 */
@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    width: 100%;
    height: auto;
    max-height: 100dvh;
    padding: 8px 12px;
  }

  .sidebar .brand {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    margin-left: auto;
    min-height: 36px;
  }

  .sidebar .nav-list,
  .sidebar-version-note {
    display: none;
  }

  body.mobile-nav-open .sidebar .nav-list {
    display: grid;
    margin-top: 10px;
  }

  .workspace {
    padding: 10px;
  }

  .topbar {
    position: static;
    margin: -10px -10px 8px;
  }

  .p15-preview-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 0;
  }

  /* 员工打开就是扫码，说明文字和重复的标题收起来，扫码按钮放最上面。 */
  #workspaceSubtitle,
  #contentNotice,
  .p15-panel > .panel-head {
    display: none;
  }

  .p15-home-actions {
    order: -1;
    flex-wrap: wrap;
  }

  .p15-home-actions [data-focus-p15-scan] {
    flex: 1 1 100%;
    min-height: 48px;
    font-size: 16px;
  }

  .p15-home-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .p15-tracking-form input {
    font-size: 16px;
  }

  .p15-scan-dialog {
    width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  /* 扫到的零件一屏看全，不用左右滑。 */
  .p15-scan-list {
    overflow-x: hidden;
  }

  .p15-scan-summary {
    flex-wrap: wrap;
  }

  .p15-scan-summary > label,
  .p15-scan-summary > .p15-quantity-line,
  .p15-scan-summary > small {
    flex: 1 1 100%;
    min-width: 0;
  }

  .p15-scan-summary > label > span {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .p15-quantity-line [data-remove-p15-scan-row] {
    margin-left: auto;
  }

  .p15-process-options > label,
  .p15-process-options > [data-toggle-p15-scan-processes] {
    flex: 1 1 100%;
    min-height: 44px;
  }
}

/* 模板版式：生产标签自由摆放，送货单分三块。字缩放见 tplFitInner。 */
.tpl-free-card {
  position: relative;
  padding: 0;
}

.tpl-box {
  position: absolute;
  box-sizing: border-box;
  overflow: hidden;
}

.tpl-box-inner {
  --tpl-scale: 1;
  width: calc(100% / var(--tpl-scale));
  font-size: 12px;
  line-height: 1.22;
  overflow-wrap: anywhere;
  transform: scale(var(--tpl-scale));
  transform-origin: 0 0;
}

.tpl-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tpl-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  color: #000;
}

.tpl-table th,
.tpl-table td {
  border: 0.2mm solid #000;
  padding: 0.3em 0.4em;
  font-weight: 400;
  text-align: left;
  overflow-wrap: anywhere;
}

.tpl-table th {
  background: #fff;
  color: #000;
  font-weight: 700;
}

.tpl-table tbody tr:last-child td {
  border-bottom: 0.2mm solid #000;
}

.tpl-doc-table-wrap {
  flex: none;
}

.tpl-doc-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2mm;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #111;
  background: #fff;
  color: #000;
  padding: 7mm;
}

.tpl-zone {
  display: flex;
  flex-wrap: wrap;
  row-gap: 1mm;
}

.tpl-zone-line {
  box-sizing: border-box;
  max-width: 100%;
  flex-grow: 0;
  flex-shrink: 0;
  padding-right: 2mm;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* 2026-11-10 搜索框前的“扫码”按钮、等待扫码的框、从搜索点进详情时标亮的行。 */
.scan-search-field {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.scan-search-field > input {
  flex: 1 1 auto;
  min-width: 0;
}

.scan-search-button {
  flex: none;
  white-space: nowrap;
}

.scan-search-button.is-active {
  background: #176657;
  border-color: #176657;
  color: #fff;
}

input.is-scan-waiting {
  outline: 2px solid #176657;
  outline-offset: 1px;
  background: #f0faf6;
}

tr.is-search-located > td {
  background: #fff4c2 !important;
}

/* 2026-11-10 导出图片、PDF：照打印的样子画，不要屏幕上的页框。 */
.tpl-export-host .tpl-doc-page,
.tpl-export-host .tpl-sheet {
  border: 0 !important;
}

.tpl-export-feedback {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

.tpl-export-feedback[data-tone="error"] {
  color: #b42318;
}

.tpl-export-feedback[data-tone="ok"] {
  color: #176657;
}

/* 2026-11-09：设计页里勾“下面画横线”的行。 */
.tpl-zone-line.has-rule {
  border-bottom: 0.3mm solid #000;
  padding-bottom: 1.5mm;
  margin-bottom: 1.5mm;
}

.tpl-zone-line.is-blank {
  min-height: 1px;
}

.tpl-doc-page-no {
  position: absolute;
  right: 7mm;
  bottom: 2mm;
  font-size: 2.6mm;
}

.tpl-sheet {
  display: grid;
  box-sizing: border-box;
  width: var(--sheet-width);
  height: calc(var(--sheet-height) - 0.2mm);
  overflow: hidden;
  background: #fff;
  align-content: start;
  justify-content: start;
}

.tpl-preview-sheets {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  max-height: min(60vh, 620px);
  overflow: auto;
  padding: 14px 16px;
  background: #f4f6fa;
}

.tpl-scale-wrap {
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  outline: 1px solid var(--line-strong);
}

.tpl-scale-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

#p18PrintCopies {
  width: 96px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 8px;
}

.tpl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 3px 6px 3px 9px;
  font-size: 12px;
}

.tpl-x {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}

.tpl-x:hover {
  color: #b42318;
}

/* 设计页 */
.template-designer-dialog {
  width: min(1340px, calc(100vw - 32px));
}

.tpl-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
}

.tpl-top label {
  display: grid;
  gap: 4px;
}

.tpl-top input,
.tpl-top select,
.tpl-note input,
.tpl-props input[type="text"],
.tpl-props input[type="number"],
.tpl-props select,
.tpl-preview-pick select {
  min-height: 32px;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 5px 8px;
  color: var(--text);
}

.tpl-spec-form[hidden] {
  display: none;
}

.tpl-fit-hint {
  font-size: 12px;
  color: var(--muted);
}

.tpl-fit-hint.is-error,
.tpl-stage-hint.is-error,
.tpl-warn {
  color: #b42318;
}

.tpl-warn[hidden] {
  display: none;
}

.tpl-main {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 300px;
  gap: 14px;
  padding: 12px 16px;
}

.tpl-left,
.tpl-right {
  display: grid;
  gap: 6px;
  align-content: start;
  font-size: 13px;
}

.tpl-cap {
  margin: 6px 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.tpl-cap[data-tpl-zone] {
  cursor: pointer;
}

.tpl-cap.is-active {
  color: var(--accent);
  font-weight: 600;
}

.tpl-empty {
  margin: 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.tpl-line {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 6px;
}

.tpl-line:hover {
  background: #f4f6fa;
}

.tpl-line.is-selected {
  border-color: var(--accent);
  background: #eef6f3;
}

.tpl-line-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tpl-grip {
  color: var(--muted);
  cursor: grab;
}

.tpl-center {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.tpl-preview-pick {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.tpl-preview-pick select {
  flex: 1 1 auto;
}

.tpl-stage {
  display: flex;
  justify-content: center;
  min-height: 200px;
  overflow: hidden;
  border-radius: 8px;
  background: #f4f6fa;
  padding: 12px;
}

.tpl-stage-hint {
  min-height: 16px;
  font-size: 12px;
  color: var(--muted);
}

.tpl-stage [data-tpl-item] {
  cursor: move;
  outline: 0.1mm dashed rgba(23, 96, 63, 0.35);
}

.tpl-stage .is-selected[data-tpl-item] {
  outline: 0.25mm solid var(--accent);
}

.tpl-stage .is-ghost {
  color: #98a2b3;
}

.tpl-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.6mm;
  height: 1.6mm;
  background: var(--accent);
  cursor: nwse-resize;
  opacity: 0;
}

.tpl-stage .is-selected .tpl-handle {
  opacity: 1;
}

.tpl-props {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.tpl-props label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.tpl-props output {
  color: var(--text);
}

.tpl-prop-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}

.tpl-inline {
  display: flex !important;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}

.tpl-cols {
  display: grid;
  gap: 4px;
}

.tpl-col {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 58px auto;
  gap: 4px;
  align-items: center;
}

.tpl-contents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 8px;
}

.tpl-contents label {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 2px 0;
}

.tpl-actions {
  flex-wrap: wrap;
}

.tpl-note {
  display: flex;
  flex: 1 1 200px;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.tpl-note input {
  flex: 1 1 auto;
}

.material-density-hint {
  display: block;
  margin-top: 3px;
  color: #b42318;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.material-density-hint[hidden] {
  display: none;
}

/* 登录和权限 */
.auth-hidden {
  display: none !important;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #f1f5f4;
  padding: 16px;
}

.auth-screen[hidden],
.auth-screen [hidden],
.auth-user-bar[hidden] {
  display: none !important;
}

.auth-card {
  display: grid;
  gap: 16px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 16px 50px rgb(15 23 42 / 12%);
}

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

.auth-login-panel {
  display: grid;
  gap: 18px;
}

.auth-code-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* 手机先扫码，账号放后面。 */
.auth-screen.is-phone .auth-code-block {
  order: -1;
  border-top: 0;
  padding-top: 0;
}

.auth-screen.is-phone .auth-password-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form h2 {
  margin: 0;
  font-size: 15px;
}

.auth-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.auth-form input {
  min-height: 42px;
  font-size: 16px;
}

.auth-form button[type="submit"] {
  min-height: 44px;
}

.auth-message {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.auth-message.is-error {
  color: #b42318;
}

.auth-user-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  font-size: 13px;
}

.auth-role-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.auth-audit-title {
  margin: 18px 0 8px;
}

.auth-permission-dialog {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 4px;
  font-size: 13px;
}

/* 2026-11-10 身份里的“共用电脑：谁来扫谁的码” */
.auth-field.auth-shared-scan {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-shared-scan input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 1px 0 0;
}

.auth-shared-scan > span {
  font-weight: 600;
}

.auth-shared-scan small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.auth-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.auth-page-grid label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.auth-reset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.auth-dialog-feedback {
  min-height: 18px;
  color: #b42318;
  font-size: 13px;
}

/* 手机和只有员工扫码的人：没有菜单。 */
body.auth-one-page .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.auth-one-page .sidebar {
  display: none;
}

body.auth-phone #workspaceSubtitle,
body.auth-phone #contentNotice,
body.auth-phone .p15-panel > .panel-head {
  display: none;
}

@media (max-width: 760px) {
  .auth-page-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 2026-11-07 勾选权限、员工工作台、加急 */
.auth-permission-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.auth-perm-panel {
  display: grid;
  gap: 8px;
}

.auth-perm-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}

.auth-perm-head small,
.auth-perm-hint {
  color: var(--muted);
  font-size: 12px;
}

.auth-perm-amount {
  display: inline-flex !important;
  grid-template-columns: none !important;
  gap: 6px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}

.auth-perm-amount input,
.auth-perm-row input {
  width: 20px !important;
  height: 20px;
  min-height: 0 !important;
  margin: 0 auto;
}

.auth-perm-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  align-items: start;
}

.auth-perm-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px 8px;
}

.auth-perm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  align-items: center;
  min-height: 34px;
  font-size: 13px;
}

.auth-perm-group-head {
  min-height: 28px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.auth-perm-group-head > span:not(:first-child) {
  text-align: center;
}

.auth-perm-label.is-action {
  padding-left: 14px;
}

.auth-perm-row.is-off {
  color: var(--muted);
}

.auth-perm-fixed {
  grid-column: 2 / 4;
  font-size: 12px;
  text-align: right;
}

.auth-perm-link {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #2f6f6f);
  font-size: 12px;
  cursor: pointer;
}

.auth-perm-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--soft, #f5f7f7);
  font-size: 13px;
}

.auth-role-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-role-picker legend {
  padding: 0 4px;
  font-size: 13px;
}

.auth-role-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px 12px;
  max-height: 180px;
  overflow: auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-role-person {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  font-size: 13px;
}

.auth-role-person input {
  width: 18px;
  height: 18px;
  min-height: 0;
}

.auth-role-person small {
  color: var(--muted);
  font-size: 12px;
}

.auth-role-person.is-off {
  color: var(--muted);
}

.auth-person-summary {
  max-width: 280px;
  white-space: normal;
  font-size: 12px;
}

.auth-phone-tabs {
  display: flex;
  gap: 8px;
  width: 100%;
}

.auth-phone-tabs[hidden] {
  display: none;
}

.auth-phone-tabs button {
  flex: 1;
  min-height: 40px;
}

.auth-phone-tabs button.is-active {
  background: var(--accent, #2f6f6f);
  color: #fff;
}

body.auth-phone .workbench-toolbar-actions,
body.auth-phone .workbench-module-link {
  display: none;
}

.urgent-chip {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: #b42318;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.p12-tracking-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.workbench-widget-list li.is-urgent strong {
  color: #b42318;
}

.workbench-history-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px 12px 0;
  margin-bottom: 8px;
}

body.auth-phone .workbench-toolbar {
  display: none;
}

.workbench-table-wrap {
  overflow-x: auto;
}

.workbench-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.workbench-mini-table th,
.workbench-mini-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.workbench-load-order {
  margin-top: 6px;
  font-size: 13px;
}

.workbench-load-order summary {
  cursor: pointer;
}

.workbench-load-order ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.p07-order-change-note {
  display: block;
  color: #b42318;
  font-size: 13px;
}

.price-pending-text {
  color: #b42318;
  font-size: 12px;
}

/* 2026-11-08 上传图片暂时关闭：入口隐藏 */
.upload-closed,
.upload-closed[hidden] {
  display: none !important;
}

/* 2026-11-08 按钮统一 */
.filter-buttons {
  display: flex;
  gap: 8px;
  align-items: end;
}

/* 内部订单：搜索、清除排在所有筛选条件后面，导出和列设置放最后 */
.p10-toolbar-filters [data-search-p10-orders],
.p10-toolbar-filters [data-clear-p10-orders] {
  order: 10;
}

.p10-toolbar-filters [data-export-p10-orders],
.p10-toolbar-filters [data-open-p10-column-settings] {
  order: 11;
}

.p10-toolbar-actions {
  flex: 0 0 auto;
}

.p10-toolbar-actions .table-action {
  white-space: nowrap;
}

.nowrap-button {
  white-space: nowrap;
  flex: 0 0 auto;
}

.danger-far-right {
  margin-left: auto;
}

.p07-bottom-save {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}

.p20-step-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* 2026-11-08 页面上不显示版本名 */
.sidebar-version-note[hidden] {
  display: none;
}

/* 真实数据不显示顶上提示条 */
#contentNotice[hidden] {
  display: none;
}

/* 2026-11-08 一块里只留一个主按钮：表单底部的“取消”等普通按钮不用主色 */
.form-actions button.table-action:not(.primary-inline) {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}

.form-actions button.table-action:not(.primary-inline):hover {
  border-color: var(--accent);
  background: #fff;
}
