/* 优杰美智能粘贴录单工作台 · 统一清透账本壳层与高密度核对单设计 */
.paste-order-page {
  background: var(--bg, #f6f7f8);
  color: var(--ink, #17231e);
}

/* 统一左侧平台导航栏（完全继承 style.css 中 #workspace .sidebar 的 196px 与品牌结构） */
#workspace .po-unified-sidebar {
  width: var(--sidebar-w, 196px);
  color: var(--ink);
  font-family: var(--font);
}

.po-nav-item[hidden] {
  display: none !important;
}

#workspace .paste-order-workbench {
  margin-left: var(--sidebar-w, 196px);
  max-width: 1880px;
  padding: 0 22px 24px;
}

/* 合并后的单层紧凑顶栏 */
.po-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line, #dce2e0);
}

.po-header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.po-title-bar-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.po-header-title h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.25;
  margin: 0;
  color: var(--ink, #17231e);
}

.po-header-title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted, #65746d);
}

.po-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.po-top-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.po-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--green-soft, #eef5f1);
  border: 1px solid #cce0d5;
  color: var(--green, #1b5944);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.po-chip[hidden] {
  display: none !important;
}

.po-chip.po-chip-muted {
  background: #f1f4f3;
  border-color: var(--line, #dce2e0);
  color: var(--muted, #65746d);
  font-weight: 500;
}

.po-chip.po-chip-error {
  background: #fdf2f0;
  border-color: #ecc6bf;
  color: #a12c1f;
}

.po-cap-bar {
  margin: 8px 0;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #dce2e0);
  font-size: 12px;
  color: var(--ink-secondary, #3e4d46);
  line-height: 1.45;
}

.po-cap-bar.is-error {
  background: #fff9eb;
  border-color: #e6c587;
  color: #8a520a;
  font-weight: 550;
}

.po-compact-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  background: #fff;
  border: 1px solid #d4dfd7;
  border-radius: 7px;
  padding: 0 8px 0 10px;
  height: 34px;
  font-size: 12px;
  color: var(--muted, #74827c);
}

.po-compact-select-wrap span {
  white-space: nowrap;
  font-weight: 500;
}

.po-compact-select-wrap select {
  border: 0;
  background: transparent;
  padding: 0 4px;
  height: 32px;
  width: auto;
  min-width: 148px;
  max-width: 220px;
  margin: 0;
  font-size: 12.5px;
  color: var(--ink, #20332e);
  font-weight: 550;
  box-shadow: none;
}

.po-compact-select-wrap select:focus {
  box-shadow: none;
}

.po-btn-compact {
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.po-link-btn {
  text-decoration: none;
}

/* 单一反馈横幅 */
.po-alert-banner {
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  margin-bottom: 12px;
  border: 1px solid #cfe0d4;
  background: #eef6f1;
  color: #1e5641;
  line-height: 1.5;
}

.po-alert-banner.error-box {
  background: #fff2ed;
  border-color: #f2c8b8;
  color: #9c3519;
  font-weight: 550;
}

/* 双栏主工作区：桌面端左 38fr 粘性原文台 + 右 62fr 核对单 */
.po-split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 38fr) minmax(0, 62fr);
  gap: 14px;
  align-items: start;
}

.po-raw-pane {
  position: sticky;
  top: 10px;
  min-width: 0;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-color: var(--line, #dce2e0);
  box-shadow: 0 1px 2px rgba(16, 28, 22, 0.04);
}

.po-editor-pane {
  min-width: 0;
  padding: 16px 18px;
  border-color: var(--line, #dce2e0);
  box-shadow: 0 1px 2px rgba(16, 28, 22, 0.04);
}

.po-pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.po-pane-header h2 {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 1px;
}

.po-pane-header p {
  margin: 0;
  font-size: 11.5px;
}

.po-channel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

/* 录单建单方式分段切换（按收单群录单 | 直接选客户建单） */
.po-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface-muted, #f1f4f3);
  border: 1px solid var(--line, #dce2e0);
}

.po-mode-tab {
  height: 31px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted, #65746d);
  font-size: 12.5px;
  font-weight: 550;
}

.po-mode-tab:hover:not(:disabled):not(.is-active) {
  color: var(--ink, #17231e);
  background: rgba(255, 255, 255, 0.65);
}

.po-mode-tab.is-active {
  background: #ffffff;
  border-color: var(--line-strong, #c5cfcc);
  color: var(--green, #1b5944);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(16, 28, 22, 0.06);
}

/* 吉客云客户档案直选面板 */
.po-direct-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.po-direct-search-wrap {
  position: relative;
  min-width: 0;
}

.po-direct-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.po-direct-search-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 5px 10px;
  font-size: 13px;
}

.po-direct-results {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 92;
  max-height: 290px;
  overflow-y: auto;
  padding: 5px;
  background: #ffffff;
  border: 1px solid #c3d4c9;
  border-radius: 9px;
  box-shadow: 0 12px 32px rgba(20, 46, 36, 0.14), 0 2px 6px rgba(20, 46, 36, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.po-direct-opt {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.po-direct-opt:hover {
  background: #eff5f1;
}

.po-direct-opt-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.po-direct-opt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #17231e);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-direct-opt-sub {
  font-size: 11.5px;
  color: var(--muted, #65746d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-direct-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-direct-tag.is-ok {
  background: #e7f4ec;
  border: 1px solid #c3dfd0;
  color: #185840;
}

.po-direct-tag.is-incomplete {
  background: #fff4df;
  border: 1px solid #f0cc8a;
  color: #8a520a;
}

.po-direct-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted, #65746d);
}

.po-direct-selected-card {
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid #cfe0d4;
  background: #f6faf7;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.po-direct-selected-card.is-incomplete {
  border-color: #ecc6bf;
  background: #fff6f4;
}

.po-direct-selected-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.po-direct-selected-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.po-direct-selected-title strong {
  font-size: 13px;
  color: var(--ink, #17231e);
}

.po-direct-selected-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--muted, #65746d);
  background: #ffffff;
  border: 1px solid var(--line, #dce2e0);
  padding: 1px 6px;
  border-radius: 4px;
}

.po-direct-source-ok {
  font-size: 12px;
  color: #1e5641;
  font-weight: 550;
}

.po-direct-source-picker {
  font-size: 11.5px;
  font-weight: 550;
  color: #465c52;
  margin: 0;
}

.po-direct-source-picker select {
  margin-top: 4px;
  height: 33px;
  padding: 4px 8px;
  font-size: 12.5px;
}

.po-direct-incomplete-alert {
  font-size: 12px;
  line-height: 1.5;
  color: #9c3519;
  font-weight: 550;
}

.po-field-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.po-field-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-secondary, #3e4d46);
  margin: 0;
}

.po-combobox {
  position: relative;
  min-width: 0;
}

.po-sr-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.po-combo-trigger {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: 6px;
  border: 1px solid var(--line-strong, #c5cfcc);
  background: #fff;
  color: var(--ink, #17231e);
  font-size: 13px;
  font-weight: 550;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.po-combo-trigger:hover:not(:disabled) {
  border-color: #8eb09d;
  background: #fcfefd;
}

.po-combo-trigger:focus-visible,
.po-combobox.is-open .po-combo-trigger {
  border-color: var(--green, #1d5e49);
  box-shadow: 0 0 0 3px rgba(29, 94, 73, 0.12);
  outline: none;
}

.po-combo-trigger:disabled {
  background: #f4f7f5;
  border-color: #dde5df;
  color: #4c5f56;
  cursor: default;
  opacity: 1;
}

.po-combo-trigger.is-placeholder .po-combo-trigger-main {
  color: #788880;
  font-weight: 450;
}

.po-combo-trigger-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-combo-trigger-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf4ef;
  color: #255b46;
  border: 1px solid #d5e4da;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-combo-trigger:disabled .po-combo-trigger-badge {
  background: #e9efeb;
  color: #55695f;
  border-color: #d6e0d9;
}

.po-combo-chevron {
  flex-shrink: 0;
  font-size: 11px;
  color: #6a7d73;
  transition: transform 0.15s ease, color 0.15s ease;
}

.po-combobox.is-open .po-combo-chevron {
  transform: rotate(180deg);
  color: var(--green, #1d5e49);
}

.po-combo-trigger:disabled .po-combo-chevron {
  display: none;
}

.po-combo-popover {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 90;
  background: #fff;
  border: 1px solid #c3d4c9;
  border-radius: 9px;
  box-shadow: 0 12px 32px rgba(20, 46, 36, 0.14), 0 2px 6px rgba(20, 46, 36, 0.06);
  overflow: hidden;
}

.po-combo-search-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid #e4ece6;
  background: #f8fbf9;
}

.po-combo-search-icon {
  flex-shrink: 0;
  font-size: 14px;
  color: #687c72;
  line-height: 1;
}

.po-combo-search-input {
  flex: 1;
  min-width: 0;
  height: 31px !important;
  margin: 0 !important;
  padding: 3px 9px !important;
  font-size: 12.5px !important;
  border: 1px solid #cfddd4 !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: var(--ink, #20332e) !important;
}

.po-combo-search-input:focus {
  border-color: var(--green, #1d5e49) !important;
  box-shadow: 0 0 0 2px rgba(29, 94, 73, 0.1) !important;
  outline: none !important;
}

.po-combo-count {
  flex-shrink: 0;
  font-size: 11px;
  color: #6c7f75;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.po-combo-list {
  max-height: 276px;
  overflow-y: auto;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.po-combo-option {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 7px 9px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 480;
  color: var(--ink, #20332e);
  cursor: pointer;
  transition: background 0.1s ease;
}

.po-combo-option:hover,
.po-combo-option.is-active {
  background: #eff5f1;
}

.po-combo-option.is-selected {
  background: #e6f2eb;
  color: #174f3d;
  font-weight: 600;
}

.po-combo-opt-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.po-combo-opt-check {
  width: 14px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--green, #1d5e49);
  text-align: center;
}

.po-combo-opt-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-combo-opt-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f2f6f3;
  color: #54695f;
  border: 1px solid #dfe8e2;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.po-combo-option.is-selected .po-combo-opt-tag {
  background: #dceddf;
  color: #1d5742;
  border-color: #c3dcc9;
}

.po-combo-hl {
  background: #fef08a;
  color: #19382d;
  padding: 0 1px;
  border-radius: 2px;
  font-weight: 650;
}

.po-combo-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12.5px;
  color: #6c7d74;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.po-combo-empty button {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.po-policy-hint {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f4f8f5;
  border-left: 3px solid var(--green, #1d5e49);
  color: #365246;
  line-height: 1.45;
}

.po-raw-editor-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.po-raw-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.po-raw-label-row label {
  font-size: 12px;
  font-weight: 550;
  color: #495d54;
  margin: 0;
}

.po-text-btn {
  background: transparent;
  border: 0;
  padding: 2px 6px;
  font-size: 11.5px;
  color: var(--muted, #74827c);
  border-radius: 4px;
}

.po-text-btn:hover {
  background: #eef3ef;
  color: var(--ink, #20332e);
}

#raw-text-input {
  min-height: 124px;
  max-height: 340px;
  resize: vertical;
  font: 13px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", monospace;
  white-space: pre-wrap;
  background: #fbfcfc;
  border-color: var(--line-strong, #c5cfcc);
  padding: 9px 11px;
}

#raw-text-input:focus {
  background: #fff;
  border-color: var(--green, #1b5944);
}

.po-dirty-banner {
  background: #fff9eb;
  border: 1px solid #e6c587;
  border-radius: 7px;
  padding: 9px 12px;
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #7c4d08;
}

.po-raw-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.po-btn-parse {
  flex: 1;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.po-kbd-hint {
  font-size: 11.5px;
  color: var(--muted, #74827c);
  white-space: nowrap;
}

.po-kbd-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f0f4f1;
  border: 1px solid #d2ddd5;
  border-radius: 4px;
  color: #3c5148;
}

.po-raw-snapshot-drawer {
  border-top: 1px dashed #dce6df;
  padding-top: 7px;
  font-size: 12px;
}

.po-raw-snapshot-drawer summary {
  color: var(--muted, #74827c);
  font-size: 11.5px;
}

.po-raw-snapshot-drawer pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  max-height: 150px;
  overflow: auto;
  border-radius: 6px;
  border: 1px solid #e1eae3;
  background: #f6f9f6;
  font: 12px/1.55 "SFMono-Regular", Consolas, "PingFang SC", monospace;
  color: var(--ink, #20332e);
}

/* 右侧空态引导（去重模板步骤卡，保持克制清晰） */
.po-cap-bar:empty,
.po-cap-bar[hidden] {
  display: none !important;
  margin: 0;
  padding: 0;
  border: 0;
}

.po-empty-guide {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted, #65746d);
}

.po-empty-guide h3 {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--ink, #20332e);
  margin: 0 0 6px;
}

.po-empty-guide p {
  max-width: 460px;
  margin: 0 auto;
  font-size: 12.5px;
}

.po-steps-row {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.po-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid #dde7e0;
  font-size: 12px;
  color: #364d43;
}

.po-step-pill b {
  width: 19px;
  height: 19px;
  border-radius: 99px;
  background: var(--green, #1d5e49);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 右侧核对单头部 */
.po-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line, #e1e8e2);
  margin-bottom: 12px;
}

.po-title-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.po-title-inline h2,
.po-title-inline h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.po-rev-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #edf3ee;
  color: #2b5442;
}

.po-subtle-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f5f2;
  color: var(--muted, #74827c);
}

#draft-summary-meta {
  margin: 4px 0 0;
  font-size: 12px;
}

.po-sheet-sync {
  display: flex;
  align-items: center;
  gap: 6px;
}

.po-unsaved-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff4df;
  border: 1px solid #f0cc8a;
  color: #875000;
  font-size: 11.5px;
  font-weight: 600;
}

.po-sync-ok-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8f5ed;
  border: 1px solid #c3e1ce;
  color: #1d6446;
  font-size: 11.5px;
  font-weight: 550;
}

/* 可点击定位的待处理事项面板 */
.po-issues-panel {
  border-radius: 8px;
  padding: 10px 13px;
  margin-bottom: 12px;
  border: 1px solid #f0c9ba;
  background: #fff6f2;
  color: #8f361c;
}

.po-issues-panel.is-warn-only {
  border-color: #edd5a1;
  background: #fffaf0;
  color: #7d500c;
}

.po-issues-title {
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 6px;
}

.po-issues-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.po-issue-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  border: 1px solid #eec0ae;
  color: #983317;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
}

.po-issue-chip:hover {
  background: #ffece5;
  border-color: #df9b82;
}

.po-issue-chip.po-issue-warn {
  border-color: #e8cd93;
  color: #7d500c;
}

.po-issue-chip.po-issue-warn:hover {
  background: #fff3db;
}

/* 分区样式：去套娃化，清晰分割线 */
.po-section {
  padding: 12px 0;
  border-bottom: 1px solid #e6ede8;
}

.po-consignee-section {
  padding-top: 2px;
}

.po-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.po-section-head h3 {
  font-size: 14px;
  font-weight: 650;
  margin: 0;
  color: var(--ink, #20332e);
}

.po-region-pill {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef5f0;
  border: 1px solid #d4e4d9;
  color: #265944;
  font-weight: 550;
}

.po-consignee-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
}

.po-col-full {
  grid-column: 1 / -1;
}

.po-consignee-grid label,
.po-meta-strip label {
  font-size: 11.5px;
  font-weight: 550;
  color: #53665d;
}

.po-consignee-grid input {
  margin-top: 4px;
  height: 35px;
  padding: 5px 10px;
  font-size: 13px;
}

.po-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  margin-top: 9px;
  padding: 9px 10px;
  background: #f8faf8;
  border: 1px solid #e4ece6;
  border-radius: 7px;
}

.po-meta-strip input {
  margin-top: 3px;
  height: 32px;
  padding: 4px 8px;
  font-size: 12.5px;
}

/* 商品明细卡片：左色条视觉引导 + 行内搜货 + 快捷报价 */
.po-items-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 10px;
}

.po-line-card {
  border: 1px solid #d6e2da;
  border-left: 3.5px solid #23684f;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fcfdfc;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 9px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.po-line-card.is-incomplete {
  border-left-color: #d07b1d;
  background: #fffefb;
}

.po-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.po-line-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink, #20332e);
}

.po-line-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 5px;
  background: #e8f1eb;
  color: #1d5e49;
  font-size: 11.5px;
  font-weight: 700;
}

.po-sku-matched-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: #e7f4ec;
  border: 1px solid #c3dfd0;
  color: #185840;
  font-size: 11.5px;
  font-weight: 600;
}

.po-sku-missing-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  background: #fff1e6;
  border: 1px solid #f1cba8;
  color: #a14712;
  font-size: 11.5px;
  font-weight: 600;
}

/* 候选选择与在线档案搜索栏 */
.po-sku-resolver-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 1fr);
  gap: 8px 10px;
  align-items: end;
  padding: 8px 10px;
  background: #f4f8f5;
  border: 1px solid #e0eae3;
  border-radius: 7px;
}

.po-sku-resolver-bar.single-col {
  grid-template-columns: 1fr;
}

.po-sku-resolver-bar label {
  font-size: 11.5px;
  font-weight: 550;
  color: #465c52;
  margin: 0;
}

.po-sku-resolver-bar select,
.po-sku-resolver-bar input {
  height: 33px;
  padding: 4px 9px;
  font-size: 12.5px;
  margin-top: 3px;
}

.po-goods-search-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.po-goods-search-inline input {
  margin-top: 0;
  flex: 1;
}

.po-cand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.po-cand-chip {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  background: #fff;
  border: 1px solid #bfd6c8;
  color: #1c5843;
  font-weight: 550;
}

.po-cand-chip:hover {
  background: #e6f3ec;
  border-color: #88b89d;
}

.po-search-note {
  font-size: 11.5px;
  color: #4b6358;
}

/* 商品行字段网格 */
.po-line-grid {
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) minmax(115px, 1fr) 86px minmax(150px, 1.15fr) 106px;
  gap: 8px 10px;
  align-items: end;
}

.po-line-grid label {
  font-size: 11.5px;
  color: #53665d;
  margin: 0;
}

.po-line-grid input {
  margin-top: 3px;
  height: 34px;
  padding: 4px 8px;
  font-size: 13px;
}

.po-price-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.po-inline-price-btn {
  padding: 1px 7px;
  height: 21px;
  font-size: 11px;
  border-radius: 4px;
  background: #eaf3ed;
  border: 1px solid #c3d9cb;
  color: #1c5b44;
  font-weight: 600;
}

.po-inline-price-btn:hover {
  background: #dcece2;
}

.po-line-total-cell {
  text-align: right;
  padding-bottom: 4px;
}

.po-line-total-cell span {
  display: block;
  font-size: 11px;
  color: var(--muted, #74827c);
}

.po-line-total-cell strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #20332e);
  font-variant-numeric: tabular-nums;
}

.po-line-meta-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted, #74827c);
}

.po-price-source-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #e7f3ec;
  color: #1b5c43;
}

.po-price-source-tag.is-missing {
  background: #fcebe6;
  color: #a1361c;
}

.po-sku-manual-details {
  font-size: 11.5px;
}

.po-sku-manual-details summary {
  color: var(--muted, #74827c);
  font-size: 11.5px;
}

.po-sku-manual-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.po-sku-manual-row input {
  width: 210px;
  height: 30px;
  padding: 3px 8px;
  font-size: 12px;
}

/* 价格建议抽屉 */
.po-price-drawer {
  border-top: 1px solid #d9e6dd;
  background: #f5faf7;
  padding: 9px 11px;
  border-radius: 7px;
  display: grid;
  gap: 7px;
}

.po-price-drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  font-size: 11.5px;
  color: #3a5649;
}

.po-price-suggestions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 7px;
}

.po-suggestion-card {
  border: 1px solid #c2d9cb;
  border-radius: 7px;
  padding: 7px 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.po-suggestion-info {
  font-size: 11.5px;
  line-height: 1.4;
}

.po-suggestion-info strong {
  font-size: 14px;
  color: var(--green, #1d5e49);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}

/* 底部粘性结算与确认操作栏 */
.po-settlement-bar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #dce2e0);
  border-top: 2px solid var(--green, #1b5944);
  box-shadow: 0 -4px 12px rgba(16, 28, 22, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.po-ledger-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.po-ledger-item {
  display: flex;
  flex-direction: column;
}

.po-ledger-item span {
  font-size: 11.5px;
  color: var(--muted, #74827c);
}

.po-ledger-item em {
  font-style: normal;
  color: #365a49;
}

.po-ledger-item strong {
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #20332e);
}

.po-strategy-sub {
  font-size: 11px;
  color: var(--muted, #74827c);
}

.po-strategy-sub b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.po-ledger-plus,
.po-ledger-eq {
  font-size: 16px;
  font-weight: 600;
  color: #8aa094;
}

.po-ledger-total {
  padding-left: 8px;
  border-left: 2px solid #c5dbcd;
}

.po-ledger-total strong {
  font-size: 21px;
  font-weight: 750;
  color: var(--green, #1d5e49);
}

.po-action-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.po-action-cluster #selection-context {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  background: #e8f5ed;
  border: 1px solid #c3e1ce;
  color: #1d6446;
}

.po-action-cluster #selection-context:empty,
.po-action-cluster #selection-context[hidden] {
  display: none !important;
}

.po-action-cluster:has(#confirm-create-btn:disabled) #selection-context,
.po-action-cluster #selection-context[data-tone="attention"] {
  background: #fffbeb;
  border-color: #f3cc85;
  color: #78350f;
}

.po-btn-confirm {
  min-width: 126px;
  height: 40px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 2px 6px rgba(29, 94, 73, 0.22);
}

/* 建单回执面板 */
.po-execution-panel {
  border: 1px solid #b8d8c7;
  border-left: 3px solid var(--green, #1b5944);
  border-radius: 8px;
  padding: 14px 16px;
  background: #f4faf6;
  margin-top: 14px;
}

.po-execution-panel.is-unknown {
  border-color: #e6c587;
  border-left-color: #b4690e;
  background: #fff9eb;
}

.po-execution-panel.is-unknown #exec-recheck-btn {
  border-color: #d6a456;
  background: #fff;
  color: #8a520a;
  font-weight: 600;
}

.po-execution-panel.is-failed {
  border-color: #ecc6bf;
  border-left-color: #a12c1f;
  background: #fdf2f0;
}

.po-exec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.po-exec-message {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #20332e);
  margin: 8px 0 10px;
}

.po-exec-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line, #e1e8e2);
  border-radius: 7px;
  font-size: 12.5px;
}

.po-exec-kv-grid span {
  display: block;
  font-size: 11px;
  color: var(--muted, #74827c);
}

.po-exec-kv-grid strong {
  font-size: 14px;
  color: var(--green, #1d5e49);
  font-variant-numeric: tabular-nums;
}

.po-exec-candidates {
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff8eb;
  border: 1px solid #edd095;
  margin-top: 10px;
  font-size: 12px;
}

.po-tech-details {
  margin-top: 12px;
  padding-top: 8px;
  font-size: 11.5px;
}

.po-tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
  color: var(--muted, #74827c);
}

.po-tech-grid code {
  color: var(--ink, #20332e);
  background: #eff3ef;
  padding: 1px 6px;
  border-radius: 4px;
}

.po-footer {
  margin-top: 18px;
  padding: 12px 0 4px;
  font-size: 11.5px;
  color: var(--muted, #74827c);
}

/* 响应式窄屏堆叠布局（严格保持桌面并排、笔记本零右溢、平板手机上下堆叠对齐） */
@media (max-width: 1440px) {
  .po-sku-resolver-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .po-line-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 92px;
  }

  .po-meta-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  #workspace .po-unified-sidebar {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line, #dce2e0);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #workspace .po-unified-sidebar .sidebar-scroll {
    width: 100%;
    min-width: 0;
    overflow: visible;
    padding: 0;
  }

  #workspace .po-unified-sidebar nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 2px;
  }

  #workspace .po-unified-sidebar .nav-section-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  #workspace .po-unified-sidebar .nav-section-title {
    grid-column: 1 / -1;
    padding: 2px 4px;
  }

  #workspace .po-unified-sidebar nav a[href="/?domain=bank"] {
    margin-top: 0;
  }

  #workspace .po-unified-sidebar .sidebar-account {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 2px;
    padding: 8px 0 0;
    border-top: 1px solid var(--line, #dce2e0);
    gap: 8px;
  }

  #workspace .po-unified-sidebar .account-actions {
    flex: 0 0 auto;
  }

  #workspace .po-nav-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 6px 8px;
    font-size: 12px;
  }

  #workspace .po-nav-item.active::before {
    display: none;
  }

  #workspace .paste-order-workbench {
    margin-left: 0;
    padding: 0 14px 24px;
  }

  .po-top-badges {
    display: none;
  }

  .po-split-layout {
    grid-template-columns: 1fr;
  }

  .po-raw-pane {
    position: static;
    max-height: none;
  }

  .po-sku-resolver-bar {
    grid-template-columns: 1fr;
  }

  .po-settlement-bar {
    position: static;
  }
}

@media (max-width: 700px) {
  #workspace .po-unified-sidebar .nav-section-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .po-compact-select-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .po-compact-select-wrap select {
    min-width: 0;
    flex: 1;
    max-width: none;
  }

  .po-channel-grid,
  .po-consignee-grid,
  .po-meta-strip,
  .po-line-grid {
    grid-template-columns: 1fr;
  }
}
