* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, "Microsoft YaHei", sans-serif; color: #1f2937; background: #f4f6f8; }
button, input, select { font: inherit; }
button { border: 0; background: #1677ff; color: white; padding: 10px 14px; border-radius: 6px; cursor: pointer; }
button:hover { background: #0958d9; }
button.ghost { background: #eef2f7; color: #344054; }
button.success { background: #16a34a; color: white; }
button.success:hover { background: #15803d; }
button.muted-action { background: #eef2f7; color: #98a2b3; cursor: pointer; }
button.muted-action:hover { background: #e4e7ec; color: #667085; }
button.danger { background: #fff1f0; color: #b42318; }
button.danger:hover { background: #ffd6d2; color: #912018; }
button.inline-link { background: transparent; color: #1677ff; padding: 0; border-radius: 0; font-weight: 700; }
button.inline-link:hover { background: transparent; color: #0958d9; text-decoration: underline; }
.product-inactive-row { background: #f8fafc; color: #667085; }
.product-inactive-row:hover { background: #f1f5f9; }
.product-status { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.product-status.active { color: #067647; background: #ecfdf3; }
.product-status.inactive { color: #475467; background: #eaecf0; }
input, select { width: 100%; border: 1px solid #d0d5dd; border-radius: 6px; padding: 9px 10px; background: white; }
input[readonly] { background: #f8fafc; color: #475467; cursor: not-allowed; }
input[type="date"][readonly] { pointer-events: none; }
label { display: grid; gap: 6px; color: #475467; font-size: 13px; }
.input-with-button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.input-with-button button { white-space: nowrap; padding: 9px 12px; }
.supplier-cell { min-width: 220px; }
.hidden { display: none !important; }
.login { min-height: 100vh; display: grid; place-items: center; background: #e9eef5; }
.login-panel { width: min(380px, calc(100vw - 32px)); display: grid; gap: 16px; background: white; padding: 28px; border: 1px solid #d9e0ea; border-radius: 8px; box-shadow: 0 12px 30px rgba(16,24,40,.08); }
.login-panel h1 { margin: 0 0 8px; font-size: 24px; }
.login-panel p { min-height: 20px; margin: 0; color: #d92d20; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 118px 1fr; }
aside { background: #162033; color: white; padding: 14px 10px; position: relative; z-index: 30; overflow: visible; }
.brand { font-size: 18px; font-weight: 700; padding: 8px 8px 18px; line-height: 1.25; }
.nav, .module-nav { width: 100%; text-align: left; background: transparent; color: #d0d5dd; margin: 3px 0; }
.work-order-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #f04438; color: white; font-size: 12px; font-weight: 700; }
.nav:hover, .nav.active, .module-nav:hover, .module-nav.active, .nav-group.open > .module-nav { background: #263752; color: white; }
.nav-group { position: relative; }
.module-nav { display: flex; align-items: center; justify-content: space-between; }
.module-nav::after { content: "›"; color: #98a2b3; font-size: 18px; line-height: 1; }
.module-flyout { display: none; position: absolute; left: 100%; top: 0; width: min(560px, calc(100vw - 140px)); background: white; color: #1f2937; border: 1px solid #e4e7ec; border-radius: 8px; box-shadow: 0 18px 42px rgba(16,24,40,.18); padding: 14px; z-index: 60; }
.module-flyout.wide { width: min(720px, calc(100vw - 140px)); }
.module-flyout::before { content: ""; position: absolute; left: -10px; top: 0; width: 10px; height: 100%; }
.nav-group:hover .module-flyout, .nav-group.open .module-flyout { display: block; }
.flyout-tabs { display: flex; gap: 22px; align-items: center; border-bottom: 1px solid #e4e7ec; margin-bottom: 12px; padding-bottom: 9px; color: #667085; font-size: 13px; }
.flyout-tabs span.active { color: #1677ff; font-weight: 700; }
.flyout-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.module-flyout.wide .flyout-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flyout-section { min-width: 0; }
.flyout-section h4 { margin: 0 0 7px; color: #667085; font-size: 13px; font-weight: 700; }
.module-link { color: #344054; padding: 8px 10px; border-radius: 6px; }
.module-link:hover, .module-link.active { background: #eef6ff; color: #1677ff; }
main { min-width: 0; }
header { height: 76px; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; background: white; border-bottom: 1px solid #e4e7ec; gap: 16px; }
h2 { margin: 0; font-size: 22px; }
header p { margin: 5px 0 0; color: #667085; }
.workspace-tabs-bar { min-width: 0; height: 44px; display: flex; align-items: stretch; gap: 8px; padding: 0 12px; background: #f8fafc; border-bottom: 1px solid #dfe4ea; }
.workspace-tabs { min-width: 0; flex: 1 1 auto; display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.workspace-tab { flex: 0 0 auto; max-width: 220px; height: 36px; display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 0 11px; overflow: hidden; color: #475467; background: #eef2f7; border: 1px solid #dfe4ea; border-bottom: 0; border-radius: 6px 6px 0 0; }
.workspace-tab:hover { color: #1677ff; background: #f4f8ff; }
.workspace-tab.active { color: #1677ff; background: white; box-shadow: inset 0 -2px #1677ff; }
.workspace-tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-tab-dirty { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #f79009; }
.workspace-tab-close { flex: 0 0 auto; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; color: #667085; font-size: 17px; line-height: 1; }
.workspace-tab-close:hover { color: #b42318; background: #fee4e2; }
.workspace-tab-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.workspace-tab-actions button { padding: 6px 9px; font-size: 12px; white-space: nowrap; }
.workspace-tab-actions button:disabled { opacity: .45; cursor: not-allowed; }
.sale-workspace-bar { display:flex; align-items:center; gap:8px; margin-bottom:10px; padding:8px 10px; background:#f8fafc; border:1px solid #dfe4ea; border-radius:8px; }
.sale-workspace-tabs { min-width:0; flex:1 1 auto; display:flex; align-items:center; gap:6px; overflow-x:auto; overflow-y:hidden; scrollbar-width:thin; }
.sale-workspace-tab { flex:0 0 auto; max-width:230px; min-height:34px; display:flex; align-items:center; gap:7px; padding:6px 9px 6px 11px; color:#475467; background:#fff; border:1px solid #d0d5dd; border-radius:7px; font-weight:700; }
.sale-workspace-tab:hover { color:#1677ff; border-color:#91caff; background:#f5f9ff; }
.sale-workspace-tab.active { color:#0958d9; border-color:#1677ff; background:#eaf3ff; box-shadow:0 0 0 1px rgba(22,119,255,.08); }
.sale-workspace-tab-label { max-width:168px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sale-workspace-tab-dirty { width:7px; height:7px; flex:0 0 auto; border-radius:50%; background:#f79009; }
.sale-workspace-tab-draft { flex:0 0 auto; padding:1px 5px; border-radius:999px; color:#b54708; background:#fffaeb; border:1px solid #fedf89; font-size:11px; }
.sale-workspace-tab-close { display:inline-grid; place-items:center; width:18px; height:18px; flex:0 0 auto; border-radius:4px; color:#667085; font-size:17px; line-height:1; }
.sale-workspace-tab-close:hover { color:#b42318; background:#fee4e2; }
.sale-workspace-add { flex:0 0 auto; white-space:nowrap; }
.sale-workspace-add:disabled { opacity:.45; cursor:not-allowed; }
.sale-workspace-hint { flex:0 0 auto; color:#667085; font-size:12px; white-space:nowrap; }
@media (max-width: 980px) {
  .sale-workspace-bar { align-items:stretch; flex-wrap:wrap; }
  .sale-workspace-tabs { flex-basis:100%; }
  .sale-workspace-hint { flex:1 1 auto; white-space:normal; }
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.user-menu { position: relative; }
.user-chip { background: #f8fafc; color: #344054; border: 1px solid #d0d5dd; white-space: nowrap; font-weight: 700; }
.user-chip:hover { background: #eef6ff; color: #1677ff; border-color: #91caff; }
.user-chip::after { content: "⌄"; margin-left: 8px; color: #667085; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 160px; background: white; border: 1px solid #e4e7ec; border-radius: 8px; box-shadow: 0 12px 28px rgba(16,24,40,.14); padding: 6px; z-index: 80; }
.user-menu-panel button { width: 100%; text-align: left; background: transparent; color: #344054; padding: 9px 10px; }
.user-menu-panel button:hover { background: #eef6ff; color: #1677ff; }
.user-menu-panel button.ghost { background: transparent; color: #b42318; }
.user-menu-panel button.ghost:hover { background: #fff1f0; color: #912018; }
.top-search { width: min(380px, 38vw); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid #e4e7ec; border-radius: 7px; padding: 4px 8px; }
.top-search span { color: #344054; font-weight: 700; white-space: nowrap; }
.top-search input { border: 0; background: transparent; padding: 6px; }
.top-search input:focus { outline: 0; }
.page { padding: 22px 24px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.dash-main { min-width: 0; display: grid; gap: 14px; }
.dash-side { background: transparent; color: #1f2937; padding: 0; display: grid; gap: 12px; align-content: start; }
.dash-tabs { display: flex; gap: 18px; font-weight: 700; }
.dash-tabs button { background: transparent; color: #344054; padding: 4px 0; border-radius: 0; }
.dash-tabs button.active { color: #1677ff; border-bottom: 2px solid #1677ff; }
.quick-actions { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 10px; }
.quick-actions button { background: white; color: #344054; border: 1px solid #dbe7f6; min-height: 46px; text-align: left; font-weight: 700; box-shadow: 0 4px 12px rgba(16,24,40,.04); }
.quick-actions button:hover { background: #eef6ff; color: #1677ff; border-color: #91caff; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; }
.metrics div { background: white; border: 1px solid #e4e7ec; border-radius: 8px; padding: 18px; position: relative; overflow: hidden; }
.metrics div::before { content: ""; position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: #4096ff; }
.metrics strong { display: block; font-size: 24px; margin-bottom: 8px; }
.metrics span { color: #667085; }
#orderControl .metrics .metric-filter { position: relative; overflow: hidden; width: 100%; min-height: 92px; padding: 18px; border: 1px solid #e4e7ec; border-radius: 8px; background: white; color: #101828; text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
#orderControl .metrics .metric-filter::before { content: ""; position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: #4096ff; }
#orderControl .metrics .metric-filter:hover { border-color: #91caff; background: #f8fbff; }
#orderControl .metrics .metric-filter.active { border-color: #1677ff; background: #eff8ff; box-shadow: 0 0 0 2px rgba(22,119,255,.08); }
#orderControl .metrics .metric-filter.active::before { width: 5px; background: #1677ff; }
.panel, .side-card, .asset-card { background: white; border: 1px solid #e4e7ec; border-radius: 8px; padding: 16px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel-title h3, .side-card h3, .asset-card h3 { margin: 0; font-size: 16px; }
.panel-title span { color: #667085; font-size: 13px; }
.trace-result {
  margin: 0 16px 12px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.trace-result div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.trace-result b { color: #1d4ed8; }
.trace-result span { color: #475569; }
.trace-panel { margin-top: 14px; box-shadow: none; border: 1px solid #e5e7eb; }
.trend-chart { height: 270px; display: flex; align-items: end; gap: 28px; border-top: 1px solid #eef2f6; border-bottom: 1px solid #d0d5dd; padding: 22px 26px 0; overflow-x: auto; background: linear-gradient(#fff, #fff), repeating-linear-gradient(to bottom, transparent 0 49px, #eef2f6 50px); background-blend-mode: normal; }
.trend-item { min-width: 76px; height: 100%; display: grid; align-content: end; justify-items: center; gap: 6px; color: #667085; font-size: 12px; }
.trend-bar { width: 24px; min-height: 4px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #69b1ff, #1677ff); box-shadow: 0 6px 14px rgba(22,119,255,.18); }
.trend-amount { color: #344054; font-weight: 700; }
.asset-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.asset-card { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: center; min-height: 190px; }
.asset-card h3 { grid-column: 1 / -1; }
.asset-card dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; }
.asset-card dt { color: #667085; }
.asset-card dd { margin: 0; font-weight: 700; }
.asset-card .mini-table { border: 0; max-height: 140px; }
.asset-card .mini-table th, .asset-card .mini-table td { padding: 7px 8px; }
.asset-card.asset-table-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 140px; align-items: stretch; }
.asset-table-card .mini-table { width: 100%; height: 140px; max-height: 140px; overflow-x: hidden; overflow-y: auto; }
.asset-table-card .mini-table table { width: 100%; table-layout: fixed; }
.asset-table-card .mini-table th, .asset-table-card .mini-table td { overflow: hidden; text-overflow: ellipsis; }
.customer-metrics { margin-bottom: 12px; }
.donut { width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(#4096ff calc(var(--a) * 1%), #45d6c8 0); position: relative; justify-self: center; }
.donut::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: white; }
.donut.green { background: conic-gradient(#3ccbbb calc(var(--a) * 1%), #f7b955 0); }
.donut.purple { background: conic-gradient(#9254de calc(var(--a) * 1%), #ff6b7a 0); }
.side-card ol { margin: 10px 0 0; padding-left: 24px; display: grid; gap: 10px; }
.side-card li { color: #344054; }
.side-card li span { float: right; font-weight: 700; color: #101828; }
.side-card p { margin: 10px 0; color: #475467; }
.side-card b { color: #1677ff; }
.side-card.muted { background: #f8fafc; }
.flow-tabs { display: flex; gap: 22px; border-bottom: 1px solid #e4e7ec; margin-bottom: 22px; }
.flow-tabs button { background: transparent; color: #344054; border-radius: 0; padding: 0 0 10px; }
.flow-tabs button.active { color: #1677ff; border-bottom: 2px solid #1677ff; }
.report-tabs { display: flex; gap: 18px; border-bottom: 1px solid #e4e7ec; margin-bottom: 14px; }
.report-tabs button { background: transparent; color: #344054; border-radius: 0; padding: 0 0 10px; }
.report-tabs button.active { color: #1677ff; border-bottom: 2px solid #1677ff; }
.customer-workspace-tabs { display: flex; align-items: flex-end; gap: 4px; margin: -10px 0 16px; border-bottom: 1px solid #dfe4ea; }
.customer-workspace-tabs button { display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 10px 14px; overflow: hidden; color: #475467; background: #f2f4f7; border: 1px solid #dfe4ea; border-bottom: 0; border-radius: 6px 6px 0 0; }
.customer-workspace-tabs button.active { color: #1677ff; background: white; box-shadow: inset 0 -2px #1677ff; }
.customer-workspace-tabs button span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-workspace-tabs .tab-close { flex: 0 0 auto; padding: 0 2px; font-size: 18px; line-height: 1; color: #667085; }
.customer-workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 16px 18px; background: white; border: 1px solid #e4e7ec; border-radius: 8px; }
.customer-workspace-head h2 { margin: 0 0 6px; font-size: 22px; }
.customer-workspace-head p { margin: 0; color: #667085; }
.customer-product-editor { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; padding: 18px; background: white; border: 1px solid #d0d5dd; border-radius: 8px; }
.customer-product-editor h3 { grid-column: 1 / -1; margin: 0; }
.customer-product-editor .dialog-actions { grid-column: 1 / -1; }
@media (max-width: 1100px) { .customer-product-editor { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
.customer-drawing-upload-card { display: grid; grid-template-columns: minmax(320px,1fr) auto; gap: 14px 18px; align-items: center; margin-bottom: 18px; padding: 18px; background: #f8fbff; border: 1px solid #b8d4f8; border-radius: 10px; }
.customer-drawing-upload-card h3,.customer-drawing-toolbar h3,.customer-drawing-history h3 { margin: 0 0 6px; }
.customer-drawing-upload-card p { margin: 0; color: #475467; }
.customer-drawing-drop-zone { grid-column: 1 / -1; padding: 24px; text-align: center; color: #175cd3; background: white; border: 2px dashed #84adf4; border-radius: 10px; cursor: pointer; }
.customer-drawing-drop-zone.dragging { color: #fff; background: #1570ef; border-color: #1570ef; }
.customer-drawing-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.customer-drawing-search,.customer-drawing-bulk-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.customer-drawing-search input { min-width: 260px; }
.customer-drawing-bulk-actions { margin: 10px 0; padding: 10px; background: #f8fafc; border: 1px solid #e4e7ec; border-radius: 8px; }
.customer-drawing-bulk-actions span { margin-right: auto; color: #475467; font-weight: 700; }
.customer-drawing-progress { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(240px,1fr) auto; align-items: center; gap: 12px; }
.customer-drawing-progress progress { width: 100%; height: 18px; }
.customer-drawing-progress div { display: flex; gap: 10px; min-width: 260px; color: #475467; }
.customer-drawing-progress.hidden { display: none; }
.customer-drawing-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e4e7ec; }
.customer-drawing-upload-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.customer-drawing-upload-summary span { padding: 7px 10px; color: #344054; background: #eef4ff; border-radius: 999px; }
.customer-drawing-upload-summary .danger-text { color: #b42318; background: #fef3f2; }
#customerDrawingUploadState.success { color: #067647; font-weight: 700; }
#customerDrawingUploadState.warning { color: #b54708; font-weight: 700; }
#customerDrawingUploadState.error { color: #b42318; font-weight: 700; }
@media (max-width: 900px) { .customer-drawing-upload-card { grid-template-columns: 1fr; } .customer-drawing-drop-zone { grid-column: 1; } .customer-drawing-toolbar { align-items: stretch; flex-direction: column; } .customer-drawing-progress { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .workspace-tabs-bar { padding-right: 6px; }
  .workspace-tab { max-width: 170px; }
  .workspace-tab-actions button { width: 34px; overflow: hidden; color: transparent; position: relative; }
  .workspace-tab-actions button::after { position: absolute; inset: 0; display: grid; place-items: center; color: #344054; content: "×"; font-size: 16px; }
  #closeOtherWorkspaceTabs::after { content: "留一"; font-size: 11px; }
  #closeAllWorkspaceTabs::after { content: "全关"; font-size: 11px; }
}

.shipping-control-nav { gap: 8px; }
.shipping-control-field { border: 1px solid #b8d4ff; border-radius: 10px; padding: 8px 10px; background: #f5f9ff; }
.shipping-control-field.disabled { opacity: .55; background: #f2f4f7; }
.shipping-control-toggle { display: flex; align-items: center; gap: 8px; color: #175cd3; }
.shipping-control-toggle input { width: 18px; height: 18px; margin: 0; }
.shipping-control-field small { color: #475467; line-height: 1.4; }
.shipping-control-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.shipping-control-head h2 { margin: 0 0 4px; }
.shipping-control-head p { margin: 0; color: #667085; }
.shipping-control-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px solid #d0d5dd; border-radius: 10px; background: #f8fafc; margin-bottom: 10px; }
.shipping-control-tabs button { background: white; color: #344054; border: 1px solid #b8d4ff; border-radius: 999px; }
.shipping-control-tabs button.active { background: #1677ff; color: white; border-color: #1677ff; }
.shipping-control-tabs b { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 99px; background: rgba(255,255,255,.25); }
.shipping-control-summary { display: flex; gap: 12px; align-items: center; padding: 10px 12px; color: #475467; }
.shipping-control-summary strong { color: #101828; }
.shipping-control-list { display: grid; gap: 14px; }
.shipping-control-card { border: 1px solid #d0d5dd; border-left: 5px solid #1677ff; border-radius: 12px; background: white; box-shadow: 0 2px 8px rgba(16,24,40,.06); padding: 14px; }
.shipping-control-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.shipping-control-card-head > div { display: grid; gap: 4px; }
.shipping-control-card-head strong { font-size: 18px; color: #1849a9; }
.shipping-control-card-head span { color: #475467; }
.shipping-control-state { margin: 12px 0; padding: 10px 12px; border-radius: 8px; font-weight: 700; }
.shipping-control-state.pending { color: #b54708; background: #fffaeb; border: 1px solid #fedf89; }
.shipping-control-state.approved { color: #067647; background: #ecfdf3; border: 1px solid #abefc6; }
.shipping-control-state.rejected { color: #b42318; background: #fef3f2; border: 1px solid #fecdca; }
.shipping-control-state.done { color: #175cd3; background: #eff8ff; border: 1px solid #b2ddff; }
.shipping-control-metrics { display: grid; grid-template-columns: repeat(6,minmax(120px,1fr)); gap: 8px; margin-bottom: 10px; }
.shipping-control-metrics div { display: grid; gap: 3px; padding: 9px; border-radius: 8px; background: #f8fafc; }
.shipping-control-metrics span { color: #667085; font-size: 12px; }
.shipping-control-metrics strong { color: #101828; }
.shipping-control-delivery { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 9px 11px; margin-bottom: 8px; border-radius: 8px; background: #f9fafb; color: #475467; }
.shipping-control-delivery b { color: #344054; }
.shipping-control-detail { border-top: 1px solid #eaecf0; padding-top: 8px; margin-top: 8px; }
.shipping-control-detail summary { cursor: pointer; color: #175cd3; font-weight: 700; padding: 6px 0; }
.shipping-control-events { display: grid; gap: 8px; padding: 8px 0; }
.shipping-control-events > div { display: grid; grid-template-columns: minmax(220px,.6fr) minmax(280px,1fr); gap: 8px; padding: 8px 10px; background: #f8fafc; border-radius: 7px; }
.shipping-control-events p { grid-column: 1/-1; margin: 0; color: #b42318; }
.shipping-control-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.shipping-control-actions .shipping-execute { background: #067647; }
.shipping-control-order-badge { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 99px; color: #7a2e0e; background: #ffead5; font-size: 12px; font-weight: 700; }
.shipping-control-block-warning { margin-top: 7px; padding: 7px 9px; border-radius: 7px; color: #b54708; background: #fffaeb; border: 1px solid #fedf89; font-weight: 700; }

@media (max-width: 1100px) {
  .shipping-control-metrics { grid-template-columns: repeat(3,minmax(120px,1fr)); }
}
.flow-board { min-height: 620px; display: grid; place-items: center; background: white; border: 1px solid #eef2f6; border-radius: 8px; overflow: auto; }
.flow-canvas { position: relative; width: min(980px, 100%); min-height: 420px; padding: 34px; }
.flow-group { position: absolute; background: #eaf4ff; border-radius: 8px; border: 1px solid #d8ebff; }
.flow-group.primary { background: #f3edff; border-style: dashed; border-color: #dbc7ff; }
.flow-group-label { position: absolute; top: -13px; left: 0; background: #1d9bf0; color: white; padding: 3px 10px; border-radius: 3px; font-size: 12px; }
.flow-node { position: absolute; width: 132px; min-height: 58px; border: 0; background: white; color: #1f2937; border-radius: 7px; box-shadow: 0 8px 18px rgba(16,24,40,.12); display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; padding: 9px 10px; text-align: left; cursor: pointer; }
.flow-node:hover { outline: 2px solid #91caff; }
.flow-node.todo { opacity: .72; cursor: not-allowed; }
.flow-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: white; font-weight: 700; }
.flow-node strong { display: block; font-size: 14px; }
.flow-node span { display: block; color: #667085; font-size: 12px; margin-top: 3px; }
.flow-line { position: absolute; height: 2px; background: #5aa7ff; transform-origin: left center; }
.flow-line.dashed { background: repeating-linear-gradient(to right, #5aa7ff 0 6px, transparent 6px 10px); }
.flow-line::after { content: ""; position: absolute; right: -1px; top: -4px; border-left: 8px solid #5aa7ff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.flow-note { position: absolute; color: #5b7ea8; font-size: 12px; background: white; padding: 1px 5px; }
.flow-legend { position: absolute; right: 18px; top: 14px; display: flex; gap: 14px; color: #475467; font-size: 12px; }
.legend-dot { width: 12px; height: 12px; display: inline-block; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.toolbar { display: grid; grid-template-columns: 1fr 1.3fr .8fr .8fr 1.2fr auto; gap: 10px; margin-bottom: 14px; }
.customer-toolbar { grid-template-columns: 1fr 1fr 2fr auto; }
.customer-toolbar input[readonly] { color: #667085; background: #f2f4f7; cursor: not-allowed; }
.supplier-toolbar { grid-template-columns: 1fr 1fr 1fr 1.4fr 1.4fr auto; }
.user-toolbar { grid-template-columns: 1fr 1fr 180px auto; }
.workstation-access-form { width: min(640px, calc(100vw - 64px)); }
.workstation-access-form fieldset { display: grid; grid-template-columns: repeat(2,minmax(180px,1fr)); gap: 10px 18px; padding: 14px; border: 1px solid #d0d5dd; border-radius: 8px; }
.workstation-access-form fieldset label { display: flex; align-items: center; gap: 8px; }
.workstation-access-form fieldset input { width: auto; }
.workstation-access-form fieldset.is-disabled { opacity: .45; }
.workstation-access-summary { display: block; margin-top: 3px; color: #667085; font-size: 12px; }
.work-order-form { grid-template-columns: 220px 1fr 1.4fr 220px auto; }
.work-order-detail { margin-top: 14px; padding: 16px; border: 1px solid #d0d5dd; border-radius: 10px; background: #fff; }
.work-order-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-order-timeline { display: grid; gap: 9px; margin-top: 12px; }
.work-order-event { padding: 10px 12px; border-left: 4px solid #2e90fa; border-radius: 6px; background: #f8fafc; }
.work-order-event small { display: block; margin-top: 4px; color: #667085; }
.work-order-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 220px; }
.work-order-actions select { width: auto; min-width: 112px; }
.filter-bar { margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }
.filter-bar input { flex: 1; }
.filter-bar.shipping-control-filters {
  display: grid;
  grid-template-columns: minmax(320px,1fr) 170px 150px 150px max-content max-content;
  align-items: center;
}
.filter-bar.shipping-control-filters > input,
.filter-bar.shipping-control-filters > select { width: 100%; min-width: 0; }
.filter-bar.shipping-control-filters > button { white-space: nowrap; }
@media (max-width: 1100px) {
  .filter-bar.shipping-control-filters { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 720px) {
  .filter-bar.shipping-control-filters { grid-template-columns: 1fr 1fr; }
  .filter-bar.shipping-control-filters #shippingControlKeyword { grid-column: 1 / -1; }
}

.fund-report-filter { flex-wrap: wrap; align-items: end; }
.fund-report-filter label { display: grid; gap: 5px; min-width: 138px; color: #475467; font-size: 13px; }
.fund-report-filter input, .fund-report-filter select { min-height: 38px; }
.fund-summary-row { grid-template-columns: repeat(5, minmax(150px, 1fr)); margin-bottom: 18px; }
.fund-summary-row .asset-card { display: block; min-height: 112px; }
.fund-summary-row .asset-card strong { display: block; margin: 12px 0 6px; color: #175cd3; font-size: 24px; }
.fund-summary-row .asset-card p { margin: 0; color: #667085; }
.fund-summary-row .warning-card { border-color: #fdb022; background: #fffaeb; }
.fund-summary-row .warning-card strong { color: #b54708; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.section-title-row span, .form-hint { color: #667085; font-size: 13px; }
.product-search-bar { display: grid; grid-template-columns: minmax(320px, 1fr) auto auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.product-search-bar input { min-width: 0; width: 100%; }
.product-search-bar button { white-space: nowrap; }
.product-category-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; padding: 9px 10px; border: 1px solid #d9e8ff; border-radius: 8px; background: #f8fbff; }
.product-category-title { margin-right: 2px; color: #344054; font-weight: 700; white-space: nowrap; }
.product-category-select, #productStatusFilter { width: auto; min-width: 150px; max-width: 260px; border-color: #b2ccff; border-radius: 999px; background-color: #fff; color: #175cd3; font-weight: 700; cursor: pointer; }
.product-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; color: #667085; font-size: 13px; }
.product-filter-chip { padding: 5px 10px; border: 1px solid #84adff; border-radius: 999px; background: #eff4ff; color: #175cd3; font-size: 12px; font-weight: 700; }
.product-filter-chip:hover { background: #dbe8ff; }
@media (max-width: 900px) {
  .product-search-bar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .product-search-bar .export-btn { grid-column: 1 / -1; }
  .product-category-title { width: 100%; }
  .product-category-select, #productStatusFilter { flex: 1 1 180px; max-width: none; }
}
.production-sort-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: #667085; font-size: 13px; }
.production-sort-label select { min-width: 150px; color: #172b4d; font-weight: 700; }
.outsourcing-ledger-filter #outsourcingLedgerKeyword { flex: 1 1 520px; }
.outsourcing-ledger-filter #outsourcingLedgerStatus { flex: 0 0 130px; }
.outsourcing-ledger-filter input[type="date"] { flex: 0 0 150px; }
#outsourcingLedgerDetail > h3 { margin: 20px 0 10px; }
#outsourcingLedgerDetail .panel-title > div:last-child { display: flex; gap: 8px; }
.stats-filter input { max-width: 220px; flex: 0 0 220px; }
.stats-filter select { max-width: 140px; }
.stats-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin: 14px 0; }
.stats-grid .panel { min-width: 0; }
.step-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; margin: 0 0 12px; }
.step-card { min-height: 82px; background: white; color: #344054; border: 1px solid #e4e7ec; border-radius: 8px; text-align: left; padding: 9px 10px; display: grid; gap: 6px; box-shadow: 0 4px 12px rgba(16,24,40,.04); }
.step-card:hover { background: #eef6ff; border-color: #91caff; color: #1677ff; }
.step-card.active { background: #1677ff; color: white; border-color: #1677ff; }
.step-card span { font-weight: 700; }
.step-card strong { font-size: 24px; line-height: 1; }
.step-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.step-card-title b { font-size: 13px; color: #667085; }
.step-card.active .step-card-title b { color: rgba(255,255,255,.82); }
.step-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; font-size: 11px; color: #667085; }
.step-card-grid em { display: block; font-style: normal; color: inherit; }
.step-card-grid b { display: block; margin-top: 1px; font-size: 14px; color: #101828; }
.step-card.active .step-card-grid { color: rgba(255,255,255,.78); }
.step-card.active .step-card-grid b { color: white; }
.dispatch-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin: 8px 0 10px;
  background: #fff;
  border: 1px solid #d9e8ff;
  border-radius: 8px;
}
.dispatch-filter-bar span {
  font-weight: 700;
  color: #1d2939;
  margin-right: 4px;
}
.dispatch-filter-bar button {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
  padding: 6px 12px;
  border-radius: 999px;
}
.dispatch-filter-bar button.active {
  background: #1677ff;
  border-color: #1677ff;
  color: #fff;
}
.batch-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 0 12px; padding: 10px 12px; background: #f8fbff; border: 1px solid #d6e8ff; border-radius: 8px; }
.batch-bar span { color: #475467; font-weight: 700; }
.scan-layout { display: grid; gap: 14px; }
.scan-card, .scan-order { background: white; border: 1px solid #e4e7ec; border-radius: 8px; padding: 18px; }
.scan-card h3, .scan-order h3 { margin: 0 0 8px; font-size: 18px; }
.scan-card p { margin: 0 0 14px; color: #667085; }
.scan-search { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 10px; }
.scan-search input { font-size: 20px; font-weight: 700; letter-spacing: 0; }
.scan-status { margin-top: 10px; font-weight: 700; }
.scan-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.scan-head p { margin: 0; color: #667085; }
.scan-step { display: grid; justify-items: end; gap: 6px; }
.scan-step small { color: #667085; font-weight: 700; }
.scan-meta { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 10px 16px; color: #475467; }
.scan-meta b { color: #b42318; margin-left: 6px; }
.scan-warning { margin-top: 12px; padding: 10px 12px; border-radius: 6px; background: #fff7e6; color: #ad4e00; font-weight: 700; }
.scan-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.scan-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.detail-link { display: inline-block; margin-right: 8px; white-space: nowrap; }
.detail-summary { display: inline-block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: #667085; }
.production-bill { display: block; color: #344054; overflow-wrap: anywhere; }
.production-order-meta, .production-last-meta { margin-top: 4px; color: #667085; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.production-path-cell, .production-step-cell { line-height: 1.45; overflow-wrap: anywhere; }
.production-path-cell .tag-row, .production-path-cell > div { margin-top: 4px; }
.production-step-cell .danger-text { margin-top: 5px; white-space: normal; overflow-wrap: anywhere; }
.outsourcing-origin-badge { display: grid; gap: 1px; margin-top: 6px; padding: 6px 8px; border: 1px solid #b692f6; border-radius: 6px; background: #f4f0ff; font-size: 12px; line-height: 1.35; }
.outsourcing-origin-badge span { color: #6941c6; font-size: 11px; font-weight: 700; }
.outsourcing-origin-badge strong { color: #5925dc; }
.outsourcing-origin-badge small { color: #667085; font-size: 11px; }
.outsourcing-flow-line { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; padding: 5px 7px; border-left: 3px solid #7f56d9; background: #f9f5ff; color: #6941c6; font-size: 12px; line-height: 1.35; }
.outsourcing-flow-line strong { color: #5925dc; }
.internal-origin-badge { display: grid; gap: 1px; margin-top: 6px; padding: 6px 8px; border: 1px solid #84adff; border-radius: 6px; background: #eff8ff; font-size: 12px; line-height: 1.35; }
.internal-origin-badge span { color: #175cd3; font-size: 11px; font-weight: 700; }
.internal-origin-badge strong { color: #1849a9; }
.internal-origin-route { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; padding: 5px 7px; border-left: 3px solid #2e90fa; background: #eff8ff; color: #175cd3; font-size: 12px; line-height: 1.35; }
.internal-origin-route strong { color: #1849a9; }
.departed-branch-badge { display: grid; gap: 1px; margin-top: 6px; padding: 6px 8px; border: 1px solid #fec84b; border-radius: 6px; background: #fffaeb; font-size: 12px; line-height: 1.35; }
.departed-branch-badge span { color: #b54708; font-size: 11px; font-weight: 700; }
.departed-branch-badge strong { color: #93370d; }
.departed-branch-route { display: grid; gap: 2px; margin-top: 6px; padding: 5px 7px; border-left: 3px solid #f79009; background: #fffaeb; font-size: 12px; line-height: 1.35; }
.departed-branch-route span { color: #b54708; font-size: 11px; font-weight: 700; }
.departed-branch-route strong { color: #93370d; }
.production-detail-cell .detail-link { display: block; margin: 0 0 4px; }
.production-detail-cell .detail-summary { display: -webkit-box; max-width: 100%; white-space: normal; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.production-detail-cell .status-pill { margin-top: 5px; white-space: normal; }
.production-detail-cell .muted-text, .production-detail-cell .partial-alert, .production-detail-cell .partial-hint, .production-detail-cell .danger-text { white-space: normal; overflow-wrap: anywhere; }
.quality-rework-badge { display: grid; gap: 2px; margin-top: 6px; padding: 6px 8px; border: 1px solid #f04438; border-radius: 6px; background: #fff1f0; color: #b42318; font-size: 12px; line-height: 1.35; }
.quality-rework-badge strong { color: #b42318; }
.quality-rework-badge span { display: block; overflow-wrap: anywhere; }
.source-branch-card { display: grid; gap: 3px; margin-top: 6px; padding: 7px 9px; border-radius: 7px; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.outsourcing-return-branch { border: 1px solid #b692f6; background: #f4f0ff; color: #5925dc; }
.source-branch-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.source-branch-title strong { color: #5925dc; }
.source-branch-title > span { flex: 0 0 auto; font-weight: 800; }
.source-branch-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.source-branch-tags span { padding: 1px 6px; border-radius: 999px; background: #e9d7fe; color: #5925dc; font-weight: 700; }
.source-branch-path { color: #6941c6; font-weight: 700; }
.source-branch-destination { color: #475467; }
.quality-rework-reason { margin-top: 3px; color: #b42318; font-size: 12px; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.production-date-line { line-height: 1.5; white-space: nowrap; }
.production-last-action { display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.production-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.production-actions:empty { display: none; }
.production-actions button, .production-more button { width: 100%; min-height: 34px; padding: 8px 7px; white-space: normal; line-height: 1.25; font-size: 12px; }
.production-more { margin-top: 5px; position: relative; }
.production-more summary { cursor: pointer; color: #1677ff; font-size: 12px; font-weight: 700; list-style-position: inside; }
.production-more > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 5px; }
#production .table-wrap { width: 100%; max-width: 100%; overflow-x: hidden; }
#productionTable { width: 100%; table-layout: fixed; }
#productionTable th, #productionTable td { padding: 9px 8px; white-space: normal; vertical-align: top; overflow-wrap: anywhere; }
#productionTable th:nth-child(1), #productionTable td:nth-child(1) { width: 3%; text-align: center; }
#productionTable th:nth-child(2), #productionTable td:nth-child(2) { width: 12%; }
#productionTable th:nth-child(3), #productionTable td:nth-child(3) { width: 11%; }
#productionTable th:nth-child(4), #productionTable td:nth-child(4) { width: 14%; }
#productionTable th:nth-child(5), #productionTable td:nth-child(5) { width: 20%; }
#productionTable th:nth-child(6), #productionTable td:nth-child(6) { width: 7%; }
#productionTable th:nth-child(7), #productionTable td:nth-child(7) { width: 9%; }
#productionTable th:nth-child(8), #productionTable td:nth-child(8) { width: 12%; }
#productionTable th:nth-child(9), #productionTable td:nth-child(9) { width: 12%; }
.production-batch-row > td { border-top: 2px solid var(--batch-accent, #2563eb); border-bottom-color: color-mix(in srgb, var(--batch-accent, #2563eb) 22%, #eef2f6); background: var(--batch-bg, #eff6ff) !important; }
.production-batch-row > td:first-child { border-left: 6px solid var(--batch-accent, #2563eb); }
.production-batch-row.batch-blue { --batch-accent: #2563eb; --batch-bg: #eaf3ff; }
.production-batch-row.batch-red { --batch-accent: #dc2626; --batch-bg: #feecec; }
.production-batch-row.batch-orange { --batch-accent: #ea580c; --batch-bg: #fff0e6; }
.production-batch-row.batch-yellow { --batch-accent: #ca8a04; --batch-bg: #fff8d6; }
.production-batch-row.batch-green { --batch-accent: #16a34a; --batch-bg: #e8f8ed; }
.production-batch-row.batch-purple { --batch-accent: #7c3aed; --batch-bg: #f1eafe; }
.production-batch-row.batch-pink { --batch-accent: #db2777; --batch-bg: #fdebf3; }
.inventory-production-row > td { background:#ecfeff !important; border-top:1px solid #99f6e4; border-bottom:1px solid #99f6e4; }
.inventory-production-row > td:first-child { border-left:5px solid #0f9f8f; }
.inventory-production-row > td:last-child { border-right:1px solid #99f6e4; }
.inventory-production-mark { color:#0f766e; font-size:20px; font-weight:900; }
.inventory-production-badge { display:inline-flex; margin-top:5px; padding:2px 8px; border-radius:999px; background:#ccfbf1; color:#115e59; font-weight:800; font-size:12px; }
.inventory-manual-transfer-row > td { background:#fff7ed !important; border-color:#fed7aa; }
.inventory-manual-transfer-row > td:first-child { border-left-color:#f97316; }
.inventory-manual-transfer-row .inventory-production-badge { background:#ffedd5; color:#9a3412; }
.batch-board-star { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--batch-accent, #2563eb); font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(15,23,42,.12)); }
.batch-board-title { display: block; color: #172554; font-size: 15px; letter-spacing: .2px; }
.batch-board-badge { display: inline-flex; margin-top: 5px; padding: 3px 8px; border: 1px solid color-mix(in srgb, var(--batch-accent, #2563eb) 35%, white); border-radius: 999px; color: var(--batch-accent, #2563eb); background: rgba(255,255,255,.72); font-size: 12px; font-weight: 800; }
.production-batch-row .batch-progress { height: 8px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.82); box-shadow: inset 0 0 0 1px rgba(15,23,42,.08); }
.production-batch-row .batch-progress i { display: block; height: 100%; border-radius: inherit; background: var(--batch-accent, #2563eb); }
.production-batch-row button { border: 1px solid color-mix(in srgb, var(--batch-accent, #2563eb) 32%, white); background: var(--batch-accent, #2563eb); font-weight: 700; }
.dialog-detail { padding: 18px; background: white; }
.sale-detail-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.sale-detail-head h3 { margin: 0 0 6px; font-size: 20px; }
.sale-detail-head p { margin: 0; color: #667085; }
.sale-detail-meta { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 10px 16px; margin-bottom: 14px; color: #475467; }
.sale-detail-meta .wide { grid-column: span 3; }
.detail-table { max-height: 52vh; }
.sale-detail-total { display: flex; justify-content: flex-end; gap: 24px; margin-top: 12px; font-weight: 700; }
.export-btn { white-space: nowrap; }
.low-stock-tools { display: flex; align-items: end; gap: 10px; }
.low-stock-tools label { width: 180px; }
.sales-filter { display: grid; grid-template-columns: 1.4fr 180px 160px 160px auto auto auto; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 14px; background: white; padding: 18px; border: 1px solid #e4e7ec; border-radius: 8px; align-items: end; }
.compact-form { grid-template-columns: repeat(3, minmax(180px, 1fr)); margin-bottom: 12px; }
.account-card { display: grid; grid-template-columns: minmax(280px, 1fr) 1fr; gap: 18px; background: white; border: 1px solid #e4e7ec; border-radius: 8px; padding: 18px; margin-bottom: 12px; }
.account-card h3 { margin: 0 0 8px; font-size: 18px; }
.account-card p { margin: 0; color: #667085; }
.account-card dl { display: grid; grid-template-columns: 90px 1fr; gap: 10px 12px; margin: 0; align-content: center; }
.account-card dt { color: #667085; }
.account-card dd { margin: 0; font-weight: 700; }
.check-label { min-height: 38px; display: inline-flex; align-items: center; justify-self: start; align-self: end; gap: 8px; width: auto; max-width: 260px; padding: 9px 10px; border: 1px solid #d0d5dd; border-radius: 6px; background: white; color: #344054; font-weight: 600; }
.check-label input { width: auto; margin: 0; padding: 0; flex: 0 0 auto; }
.check-label span { white-space: nowrap; line-height: 1.2; }
.process-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; background: #f8fbff; border: 1px solid #cfe2ff; border-radius: 8px; padding: 8px 10px; box-shadow: inset 3px 0 0 #1677ff; }
.process-head { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 0; border-right: 1px solid #dbeafe; }
.process-head strong { display: block; color: #101828; font-size: 15px; white-space: nowrap; }
.process-head span, .process-head em { display: none; }
.process-group { display: flex; align-items: center; gap: 6px; }
.process-group-title { color: #667085; font-size: 12px; font-weight: 700; white-space: nowrap; margin-left: 2px; }
.process-options label { position: relative; min-height: 32px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #d0d5dd; border-radius: 999px; background: white; color: #344054; font-size: 13px; font-weight: 700; text-align: center; cursor: pointer; transition: .15s ease; padding: 0 10px; }
.process-options label:hover { border-color: #91caff; background: #eef6ff; color: #1677ff; }
.process-options label input { position: absolute; opacity: 0; pointer-events: none; }
.process-options label span { line-height: 1.2; }
.process-options label:has(input:checked) { border-color: #1677ff; background: #1677ff; color: white; box-shadow: 0 3px 10px rgba(22,119,255,.16); }
.process-options label:has(input:checked)::before { content: "✓"; font-weight: 900; flex: 0 0 auto; }
.process-group.external label:has(input:checked) { background: #7a5af8; border-color: #7a5af8; box-shadow: 0 3px 10px rgba(122,90,248,.14); }
.process-group.finish label:has(input:checked) { background: #12b76a; border-color: #12b76a; box-shadow: 0 3px 10px rgba(18,183,106,.14); }
.process-reset { margin-left: auto; min-height: 32px; padding: 0 12px; }
.table-wrap, .sale-box { background: white; border: 1px solid #e4e7ec; border-radius: 8px; overflow: auto; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 0 2px; color: #475467; }
.pager label { display: flex; grid-template-columns: none; align-items: center; gap: 6px; }
.pager select { width: auto; min-width: 86px; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
button:disabled { opacity: .45; cursor: not-allowed; }
.bulk-box { background: white; border: 1px solid #e4e7ec; border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.bulk-box summary { cursor: pointer; font-weight: 700; }
.bulk-box textarea { width: 100%; min-height: 150px; margin-top: 12px; border: 1px solid #d0d5dd; border-radius: 6px; padding: 10px; resize: vertical; }
.bulk-actions, .dialog-actions, .form-actions { display: flex; gap: 10px; margin-top: 12px; justify-content: flex-end; }
.form-actions button { min-width: 180px; }
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid #fedf89; background: #fffbeb; border-radius: 8px; color: #7a2e0e; }
.draft-bar strong { display: block; color: #101828; margin-bottom: 3px; }
.draft-bar span { color: #7a2e0e; }
.draft-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid #eef2f6; text-align: left; white-space: nowrap; }
th { background: #f8fafc; color: #475467; font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; background: #eef2f7; color: #344054; font-size: 12px; font-weight: 700; }
.status-pill.pending { background: #fff1f0; color: #d92d20; }
.status-pill.received { background: #fff7e6; color: #b54708; }
.status-pill.processing { background: #e6f4ff; color: #0958d9; }
.status-pill.completion_pending { background: #f4ebff; color: #6941c6; }
.status-pill.producing { background: #fff7e6; color: #b54708; }
.status-pill.shipped { background: #eef2f7; color: #344054; }
.status-pill.created { background: #f2f4f7; color: #344054; }
.status-pill.workshop, .status-pill.cutting { background: #e6f4ff; color: #0958d9; }
.status-pill.lathe, .status-pill.milling, .status-pill.outsourcing { background: #f9f0ff; color: #722ed1; }
.status-pill.external_wait_out, .status-pill.external_out, .status-pill.external_returned { background: #fff7e6; color: #b54708; }
.status-pill.inspection { background: #ecfdf3; color: #027a48; }
.status-pill.packing { background: #fff1f0; color: #d92d20; }
.status-pill.completed, .status-pill.done { background: #ecfdf3; color: #027a48; }
.batch-step-progress-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 280px; }
.batch-step-progress-list .status-pill { white-space: nowrap; }
.batch-dual-progress{display:grid;gap:5px;min-width:150px}.batch-metric-progress>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.batch-metric-progress>div:first-child span{font-weight:700;color:#475569}.batch-metric-progress>div:first-child strong{font-size:12px;color:#1e3a5f}.batch-metric-progress .batch-progress{height:6px;margin:3px 0 0;background:#e7edf5}.batch-metric-progress.received .batch-progress i{background:#2563eb}.batch-metric-progress.boxed .batch-progress i{background:#16a34a}
.delivery-date { font-weight: 700; }
.delivery-tag { display: inline-flex; margin-left: 8px; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef2f7; color: #344054; }
tr.delivery-overdue { background: #fff1f0; }
tr.delivery-overdue .delivery-tag { background: #ffd6d2; color: #b42318; }
tr.delivery-today { background: #fff7e6; }
tr.delivery-today .delivery-tag { background: #ffe7ba; color: #ad4e00; }
tr.delivery-soon { background: #fffbea; }
tr.delivery-soon .delivery-tag { background: #fef0c7; color: #b54708; }
tr.production-partial-row { background: #eef6ff; box-shadow: inset 4px 0 0 #1677ff; }
tr.production-partial-row .delivery-tag { background: #d6e8ff; color: #0958d9; }
.mixed-order-badge { display: inline-flex; align-items: center; margin-left: 7px; padding: 2px 8px; border-radius: 999px; background: #722ed1; color: #fff; font-size: 12px; font-weight: 800; vertical-align: middle; }
.mixed-order-line { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mixed-order-line .mixed-order-badge { margin-left: 0; }
.mixed-waiting-warning { margin-top: 8px; padding: 8px 10px; border: 1px solid #faad14; border-radius: 8px; background: #fff7e6; color: #873800; font-weight: 700; line-height: 1.45; }
.partial-hint { color: #0958d9; font-size: 12px; font-weight: 700; margin-top: 4px; }
.row-done { color: #667085; background: #fcfcfd; }
.countdown { color: #0958d9; font-weight: 700; }
.countdown.overdue { color: #d92d20; }
.muted-text { color: #667085; }
.danger-text { color: #b42318; font-weight: 700; margin-top: 4px; }
.partial-alert { color: #0958d9; font-weight: 700; margin-top: 4px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.mini-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 7px; background: #eef6ff; color: #0958d9; font-size: 12px; font-weight: 700; }
.mini-tag.danger-tag { background: #fff1f0; color: #b42318; }
.mini-tag.muted-tag { background: #f2f4f7; color: #475467; }
.mini-tag.material-tag { background: #fff7e6; color: #b54708; }
.sale-box { padding: 18px; display: grid; gap: 14px; }
.sale-summary { background: #f8fafc; border: 1px solid #e4e7ec; border-radius: 6px; padding: 10px 12px; color: #475467; font-weight: 700; text-align: right; }
.sale-summary b { color: #101828; }
.sale-order-bar { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(160px, .7fr) minmax(220px, 1fr); gap: 10px; align-items: end; }
.sale-order-bar label { min-width: 0; color: #344054; font-weight: 700; }
.line-editor { display: grid; grid-template-columns: minmax(250px, 1.55fr) minmax(110px, .7fr) minmax(130px, .85fr) minmax(140px, .9fr) minmax(75px, .5fr) minmax(85px, .55fr) minmax(150px, .95fr) minmax(125px, .8fr) minmax(125px, .8fr) minmax(140px, .85fr) auto; gap: 10px; align-items: end; }
.line-editor label,
.line-editor .product-pick-label { min-width: 0; color: #344054; font-weight: 700; }
.line-editor button { align-self: end; min-width: 76px; }
.sale-print-fields { display: grid; grid-template-columns: minmax(280px, 440px); justify-content: end; }
.sale-print-fields label { min-width: 0; color: #344054; font-weight: 700; }
.product-pick-field,
.customer-pick-field { position: relative; display: block; }
.product-pick-field input,
.customer-pick-field input { padding-right: 76px; }
.product-pick-field > button,
.customer-pick-field > button { position: absolute; right: 4px; top: 4px; bottom: 4px; min-width: 64px; padding: 0 10px; border-radius: 5px; }
.product-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 120; max-height: 280px; overflow: auto; background: white; border: 1px solid #91caff; border-radius: 7px; box-shadow: 0 12px 28px rgba(16,24,40,.16); padding: 4px; }
.product-suggest-item { position: static !important; width: 100%; min-width: 0 !important; min-height: 38px; display: grid; grid-template-columns: auto minmax(76px, .7fr) minmax(110px, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px !important; border-radius: 5px !important; background: white !important; color: #344054 !important; text-align: left; }
.product-suggest-item:hover,
.product-suggest-item.active { background: #eef6ff !important; color: #1677ff !important; }
.product-suggest-item strong { color: #101828; }
.product-suggest-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-suggest-item em { color: #667085; font-style: normal; white-space: nowrap; }
.product-suggest-empty { padding: 10px; color: #667085; font-size: 13px; }
.product-source-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 2px 6px; border-radius: 999px; background: #e6f4ff; color: #0958d9; font-size: 12px; font-weight: 700; white-space: nowrap; }
.product-suggest-item.customer .product-source-badge { background: #fff7e6; color: #ad6800; }
.sale-product-search-tools { display: flex; align-items: center; gap: 8px; min-height: 24px; margin-top: -2px; }
.product-source-tabs { display: inline-flex; padding: 2px; border: 1px solid #d0d5dd; border-radius: 6px; background: #f2f4f7; }
.product-source-tab { position: static !important; min-width: 0 !important; min-height: 0 !important; padding: 2px 8px !important; border: 0 !important; border-radius: 4px !important; background: transparent !important; color: #667085 !important; font-size: 12px !important; line-height: 18px; }
.product-source-tab.active { background: #1677ff !important; color: white !important; }
.product-source-tab[data-product-search-mode="customer"].active { background: #fa8c16 !important; }
.product-source-status { overflow: hidden; color: #667085; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.product-source-status.selected-master { color: #0958d9; font-weight: 600; }
.product-source-status.selected-customer { color: #ad6800; font-weight: 600; }
.product-suggest-switch { position: static !important; min-width: 0 !important; min-height: 0 !important; margin-left: 6px; padding: 3px 8px !important; border-radius: 4px !important; font-size: 12px !important; }
.customer-suggest { min-width: 420px; }
.customer-suggest-item { grid-template-columns: minmax(110px, .8fr) minmax(150px, 1.2fr) auto; }
.customer-suggest-item span { white-space: normal; }
.customer-pick-label,
.product-pick-label { position: relative; display: grid; gap: 6px; min-width: 0; }
body.dialog-fallback-active { overflow: hidden; }
body.dialog-fallback-active::before { content: ""; position: fixed; inset: 0; z-index: 999; background: rgba(16,24,40,.45); }
@media (max-width: 900px) {
  .product-suggest-item { grid-template-columns: auto minmax(68px, .7fr) minmax(100px, 1fr); }
  .product-suggest-item em { grid-column: 2 / -1; white-space: normal; }
  .sale-product-search-tools { align-items: flex-start; flex-direction: column; gap: 4px; }
}
dialog.dialog-fallback { position: fixed; display: block; inset: 5vh 16px auto; z-index: 1000; max-height: 90vh; overflow: auto; margin: 0 auto; background: white; box-shadow: 0 18px 60px rgba(16,24,40,.35); }
.picker-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.picker-head h3 { margin: 0 0 4px; font-size: 20px; }
.picker-head p { margin: 0; color: #667085; }
.picker-search { display: grid; grid-template-columns: minmax(240px, 1fr) 92px; gap: 10px; margin-bottom: 12px; }
.picker-table { max-height: 58vh; }
#toast { position: fixed; right: 22px; bottom: 22px; background: #101828; color: white; padding: 12px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 420px; }
#toast.show { opacity: 1; }
dialog { width: min(1080px, calc(100vw - 32px)); border: 0; border-radius: 8px; padding: 0; }
dialog::backdrop { background: rgba(16,24,40,.45); }
#outsourcingDialog,
#afterSaleDialog,
#inspectionDialog,
#completionDialog,
#saleDetailDialog {
  width: min(1400px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}
#printArea { padding: 24px; background: white; }
#directPrintRoot { display: none; }
#printSettingsDialog { width: min(1320px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
#quotePrintSettingsDialog { width: min(1320px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
.print-template-toolbar { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(240px, 1fr) auto; gap: 10px; align-items: end; padding: 10px 16px; border-top: 1px solid #eef2f6; background: #f8fafc; }
.print-template-toolbar label { color: #344054; font-weight: 700; }
.print-template-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.print-template-actions button { padding: 8px 10px; white-space: nowrap; }
.print-column-width-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid #eef2f6; color: #475467; font-size: 12px; background: #fff; }
.print-column-width-toolbar > :first-child { flex: 1 1 auto; }
.print-column-width-toolbar button { flex: 0 0 auto; padding: 6px 10px; white-space: nowrap; }
.print-column-width-status { flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; color: #344054; background: #f2f4f7; font-weight: 700; }
.print-column-width-status.custom { color: #175cd3; background: #eff8ff; }
.print-settings-preview { margin: 0 16px; padding: 12px; max-height: 44vh; overflow: auto; background: #f2f4f7; border: 1px solid #d0d5dd; border-radius: 6px; }
.print-settings-preview .compact-production-slip { margin: 0 auto; background: white; box-shadow: 0 2px 8px rgba(16,24,40,.16); transform-origin: top center; }
.print-settings-preview .print-column-resize-enabled thead th { position: relative; overflow: visible; }
.print-column-resize-handle { position: absolute; top: -1px; right: -6px; z-index: 4; width: 12px !important; min-width: 12px !important; height: calc(100% + 2px); min-height: 0 !important; margin: 0; padding: 0 !important; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; cursor: col-resize; touch-action: none; }
.print-column-resize-handle::after { content: ""; position: absolute; top: 1px; bottom: 1px; left: 5px; width: 2px; border-radius: 2px; background: #2e90fa; opacity: .55; }
.print-column-resize-handle:hover::after,
.print-column-resize-handle:focus-visible::after,
.print-column-resizing .print-column-resize-handle::after { width: 3px; background: #1570ef; opacity: 1; }
.print-column-resize-handle:focus-visible { outline: 2px solid #84caff; outline-offset: 1px; }
body.print-column-resizing { cursor: col-resize !important; user-select: none; }
.print-settings { display: grid; grid-template-columns: minmax(210px, 1.3fr) minmax(210px, 1.3fr) minmax(190px, 1fr) 105px 105px 125px; gap: 10px; padding: 12px 16px 0; background: white; border-top: 1px solid #eef2f6; align-items: end; }
.print-settings label { color: #344054; font-weight: 700; }
.print-settings button { align-self: end; }
.print-title-setting { grid-column: span 1; }
.print-template-fields { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 10px; align-items: start; }
.print-field-group { min-width: 0; padding: 8px; border: 1px solid #d0d5dd; border-radius: 6px; background: #f8fafc; }
.print-field-group-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.print-field-group-head strong { color: #101828; }
.print-field-group-head span { color: #667085; font-size: 11px; white-space: nowrap; }
.print-field-list { display: grid; gap: 4px; max-height: 190px; overflow: auto; padding-right: 3px; }
.print-field-row { display: grid; grid-template-columns: minmax(0, 1fr) 24px 44px 44px; gap: 4px; align-items: center; min-height: 30px; padding: 3px 5px; border: 1px solid transparent; border-radius: 4px; background: white; }
.print-field-row.selected { border-color: #bfdbfe; background: #eff6ff; }
.print-field-row label { display: flex; min-width: 0; align-items: center; gap: 5px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.print-field-row input { width: auto; flex: 0 0 auto; }
.print-field-order { text-align: center; color: #2563eb; font-weight: 700; }
.print-field-move { min-height: 24px; padding: 3px 4px !important; font-size: 11px; }
.print-driver-hint { grid-column: 1 / -1; margin: 0; padding: 2px 0 10px; color: #667085; font-size: 12px; }
.quote-print-settings { display:grid; grid-template-columns:repeat(5,minmax(130px,1fr)); gap:10px; padding:12px 16px 0; align-items:end; background:#fff; border-top:1px solid #eef2f6; }
.quote-print-settings label { color:#344054; font-weight:700; }
.quote-print-field-group { grid-column:1 / -1; }
.quote-print-field-group .print-field-list { grid-template-columns:repeat(3,minmax(220px,1fr)); max-height:210px; }
.quote-print-settings-preview { max-height:48vh; }
.quote-template-page { width:min(820px,100%); min-height:520px; margin:0 auto; padding:0 40px 46px; overflow:hidden; color:#0f172a; background:#fff; box-shadow:0 2px 10px rgba(15,23,42,.16); }
.quote-template-page > header { display:flex; justify-content:space-between; align-items:center; margin:0 -40px; padding:25px 40px 20px; color:#fff; background:#0f2b4d; border-bottom:4px solid #be8f2d; }
.quote-template-page > header strong { font-size:var(--quote-brand-size); }
.quote-template-page > header span { font-size:max(8px,calc(var(--quote-brand-size) - 2px)); }
.quote-template-page h2 { margin:22px 0 7px; text-align:center; color:#0f2b4d; font-size:var(--quote-title-size); letter-spacing:4px; }
.quote-template-page > i { display:block; width:190px; height:3px; margin:0 auto 18px; background:#be8f2d; }
.quote-template-meta { display:grid; grid-template-columns:1fr 1fr; gap:8px 20px; padding:14px 18px; border-radius:8px; background:#eff4f9; font-size:13px; }
.quote-template-page table { width:100%; table-layout:fixed; margin:18px 0 14px; border-collapse:collapse; }
.quote-template-page th,.quote-template-page td { padding:var(--quote-cell-y,7px) 6px; border:1px solid #94a3b8; line-height:var(--quote-line-height,1.3); vertical-align:middle; overflow-wrap:anywhere; }
.quote-template-page th { color:#fff; background:#0f2b4d; text-align:center; font-size:var(--quote-head-size); }
.quote-template-page td { font-size:var(--quote-body-size); }
.quote-template-page td.number { padding-left:3px; padding-right:3px; text-align:center; white-space:nowrap; }
.quote-template-page tbody tr:nth-child(even) { background:#f8fafc; }
.quote-template-total { width:310px; margin-left:auto; padding:13px 18px; border:2px solid #be8f2d; border-radius:8px; color:#1c4e79; background:#eff4f9; text-align:right; }
.quote-template-total strong { margin-left:24px; color:#0f2b4d; font-size:19px; }
.dialog-form { padding: 22px; display: grid; gap: 14px; background: white; }
.dialog-form h3 { margin: 0; font-size: 20px; }
.contract-supplier-card { display:grid; grid-template-columns:1fr 2fr; gap:7px 18px; padding:14px 16px; border:1px solid #d7e1eb; border-left:4px solid #8c141c; border-radius:7px; background:#f8fafc; color:#344054; }
.contract-supplier-card strong { grid-column:1 / -1; color:#8c141c; }
.contract-warning { padding:11px 13px; border:1px solid #f0c36d; border-radius:7px; background:#fff8e8; color:#8a4b08; line-height:1.55; }
.product-dialog-error { padding: 10px 12px; border-left: 4px solid #d92d20; border-radius: 6px; background: #fef3f2; color: #b42318; font-weight: 700; }
.outsourcing-form { min-width: min(1360px, calc(100vw - 52px)); }
.outsourcing-form .form-grid { padding: 0; border: 0; }
#saleDetailDialog .dialog-detail { min-width: min(1360px, calc(100vw - 52px)); }
.info-strip {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
}
.transport-tasks-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}
.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.allocation-summary {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  background: #f0fdf4;
  color: #111827;
  border: 1px solid #bbf7d0;
  font-size: 13px;
}
.allocation-group {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d1fae5;
  border-radius: 6px;
  background: white;
}
.allocation-title {
  font-weight: 700;
  color: #047857;
}
.allocation-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}
.allocation-table th,
.allocation-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  white-space: nowrap;
}
.allocation-table th {
  background: #f8fafc;
  color: #334155;
}
.transport-tasks-panel .table-wrap {
  overflow-x: auto;
}
.transport-tasks-panel table {
  min-width: 1180px;
}
.transport-tasks-panel td:nth-child(4) input {
  min-width: 260px;
}
.print-title { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.print-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin-bottom: 16px; }
.production-slip { width: 241mm; min-height: 140mm; max-width: 100%; margin: 0 auto; color: #111827; font-size: 13px; }
.production-slip .print-title { margin-bottom: 4px; }
.slip-head { display: grid; grid-template-columns: 1fr 112px; align-items: center; gap: 12px; margin-bottom: 8px; }
.slip-qr-box { display: grid; justify-items: center; gap: 3px; font-size: 11px; color: #344054; }
.slip-qr { width: 92px; height: 92px; display: block; }
.slip-qr-placeholder { width: 92px; height: 92px; border: 1px dashed #98a2b3; display: grid; place-items: center; text-align: center; color: #667085; font-size: 12px; padding: 8px; }
.slip-subtitle { text-align: center; color: #475467; margin-bottom: 10px; }
.slip-copy-line { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; font-size: 12px; color: #344054; }
.slip-copy-line span { border: 1px solid #98a2b3; text-align: center; padding: 3px 4px; }
.slip-meta { grid-template-columns: repeat(4, 1fr); border-top: 1px solid #111827; border-left: 1px solid #111827; gap: 0; margin-bottom: 0; }
.slip-meta div { border-right: 1px solid #111827; border-bottom: 1px solid #111827; padding: 5px 7px; min-height: 28px; }
.slip-meta .wide { grid-column: span 2; }
.slip-table { border: 1px solid #111827; border-top: 0; font-size: 12px; }
.slip-table th, .slip-table td { border: 1px solid #111827; padding: 5px 6px; white-space: normal; }
.slip-table th { background: #f2f4f7; color: #111827; text-align: center; }
.slip-table tfoot td { font-weight: 700; }
.purchase-slip .slip-table { margin-top: 8px; border-top: 1px solid #111827; }
.purchase-slip .slip-table:first-of-type { margin-top: 0; }
.purchase-slip .purchase-items-table td:nth-child(2) { min-width: 120px; }
.purchase-slip .purchase-items-table td:nth-child(8),
.purchase-slip .purchase-items-table td:nth-child(9),
.purchase-slip .purchase-items-table td:nth-child(10) { text-align: right; }
.model-cell { font-size: 18px; font-weight: 800; text-align: center; letter-spacing: .5px; }
.slip-summary { display: grid; grid-template-columns: repeat(4, 1fr); border-left: 1px solid #111827; }
.slip-summary div { border-right: 1px solid #111827; border-bottom: 1px solid #111827; padding: 6px 7px; }
.slip-note { border: 1px solid #111827; border-top: 0; padding: 7px; min-height: 30px; }
.slip-sign { display: grid; grid-template-columns: repeat(6, 1fr); border-left: 1px solid #111827; }
.slip-sign div { border-right: 1px solid #111827; border-bottom: 1px solid #111827; padding: 10px 7px; min-height: 38px; }
.compact-production-slip { width: 215.9mm; min-height: 93.1mm; height: 93.1mm; box-sizing: border-box; padding: 3mm 4mm; overflow: hidden; display: flex; flex-direction: column; font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif; font-size: 11px; color: #000; background: #fff; }
.compact-production-slip + .compact-production-slip { margin-top: 8mm; }
.compact-production-slip .slip-copy-line { gap: 2mm; margin-bottom: 1.5mm; font-size: 9px; }
.compact-production-slip .slip-copy-line span { padding: 1px 2px; border-color: #000; }
.compact-slip-head { grid-template-columns: minmax(0, 1fr) 67mm; gap: 2mm; margin-bottom: 1mm; min-height: 20mm; }
.compact-production-slip .print-title { font-size: 17px; line-height: 1.15; margin: 0 0 1.2mm; }
.compact-production-slip .slip-qr { width: 16mm; height: 16mm; }
.compact-production-slip .slip-qr-placeholder { width: 16mm; height: 16mm; padding: .8mm; font-size: 8px; }
.compact-production-slip .slip-qr-box { gap: 1px; font-size: 8px; color: #000; }
.compact-slip-meta { display: grid; grid-template-columns: 38mm 12mm minmax(0, 1fr); grid-template-rows: repeat(3, 1fr); gap: .5mm 1.5mm; align-items: center; line-height: 1.15; font-size: 10px; }
.compact-slip-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-meta-left { grid-column: 1; }
.compact-meta-right { grid-column: 3; }
.compact-meta-row-1 { grid-row: 1; }
.compact-meta-row-2 { grid-row: 2; }
.compact-meta-row-3 { grid-row: 3; }
.compact-slip-left-qr { grid-column: 2; grid-row: 1 / span 3; display: grid; place-items: center; }
.compact-slip-left-qr .slip-qr, .compact-slip-left-qr .slip-qr-placeholder { width: 12mm; height: 12mm; }
.compact-slip-table { width: 100%; table-layout: fixed; border-top: 1px solid #000; border-bottom: 1px solid #000; font-size: 12px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.compact-slip-table th, .compact-slip-table td { box-sizing: border-box; padding: .15mm .6mm; border: 1px solid #000; overflow: hidden; text-overflow: clip; white-space: normal; text-align: center; vertical-align: middle; line-height: 1.08; }
.compact-slip-table th { height: 5mm; background: transparent; white-space: nowrap; }
.compact-slip-table tbody td { height: 7.4mm; }
.compact-slip-table .compact-cell-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; max-height: 2.16em; overflow: hidden; white-space: normal; overflow-wrap: anywhere; word-break: break-all; }
.compact-slip-table .model-cell { font-size: 13px; letter-spacing: 0; }
.compact-slip-table tfoot td { height: 5mm; white-space: nowrap; }
.processing-production-slip, .processing-production-slip * { font-weight: 400 !important; }
.processing-production-slip .print-title { font-size: var(--production-title-font-size, 17px); }
.processing-production-slip .compact-slip-meta { grid-template-columns: 42mm 12mm minmax(0, 1fr); font-size: 13px; }
.processing-production-slip .compact-slip-operator { position: absolute; left: 21mm; right: 0; top: 2mm; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.15; text-align: left; }
.processing-production-slip .compact-slip-table { border-collapse: separate; border-spacing: 0; border: 1px solid #000; font-size: var(--production-table-font-size, 13px); }
.processing-production-slip .compact-slip-table th, .processing-production-slip .compact-slip-table td { height: auto; padding: 0 2px; border: 0; border-right: 1px solid #000; border-bottom: 1px solid #000; line-height: var(--production-table-line-height, 14px); }
.processing-production-slip .compact-slip-table th:last-child, .processing-production-slip .compact-slip-table td:last-child { border-right: 0; }
.processing-production-slip .compact-slip-table thead th { height: 20px; white-space: nowrap; }
.processing-production-slip .compact-slip-table tbody td { height: 30px; }
.processing-production-slip .compact-slip-table tfoot td { height: 20px; border-bottom: 0; white-space: nowrap; }
.production-page-total.has-stock-note { display: flex; align-items: center; justify-content: space-between; gap: 3mm; text-align: left; }
.production-page-total.has-stock-note span:last-child { margin-left: auto; text-align: right; }
.processing-production-slip .compact-slip-table .compact-cell-text { max-height: calc(var(--production-table-line-height, 14px) * 2); line-height: var(--production-table-line-height, 14px); }
.processing-production-slip .compact-slip-table .model-cell { font-size: var(--production-table-font-size, 13px); letter-spacing: 0; }
.compact-col-seq { width: 5%; }
.compact-col-model { width: 14%; }
.compact-col-material { width: 8%; }
.compact-col-process { width: 18%; }
.compact-col-product { width: 17%; }
.compact-col-qty { width: 7%; }
.compact-col-unit { width: 6%; }
.compact-col-note { width: 9%; }
.compact-col-drawing { width: 16%; }
.compact-slip-footer { display: grid; grid-template-columns: 1fr 2.5fr 1fr; gap: 3mm; align-items: center; padding-top: 1mm; line-height: 1.2; white-space: nowrap; font-size: 10.5px; }
.compact-slip-footer span:last-child { text-align: right; }
.compact-purchase-table th:nth-child(1) { width: 7%; }
.compact-purchase-table th:nth-child(2) { width: 18%; }
.compact-purchase-table th:nth-child(3) { width: 12%; }
.compact-purchase-table th:nth-child(4) { width: 19%; }
.compact-purchase-table th:nth-child(5) { width: 11%; }
.compact-purchase-table th:nth-child(6) { width: 8%; }
.compact-purchase-table th:nth-child(7) { width: 13%; }
.compact-purchase-table th:nth-child(8) { width: 12%; }
.compact-purchase-slip .compact-purchase-table { font-size: 11px; }
.compact-purchase-slip .compact-purchase-table th:nth-child(1) { width: 5%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(2) { width: 12%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(3) { width: 9%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(4) { width: 15%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(5) { width: 9%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(6) { width: 7%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(7) { width: 10%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(8) { width: 11%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(9) { width: 12%; }
.compact-purchase-slip .compact-purchase-table th:nth-child(10) { width: 10%; }
.compact-purchase-footer { grid-template-columns: 1.2fr 3fr 1fr; }
.compact-slip-code-panel { position: relative; display: grid; place-items: start; box-sizing: border-box; height: 20mm; padding-bottom: 2.5mm; }
.compact-slip-code-panel > .slip-qr, .compact-slip-code-panel > .slip-qr-placeholder { width: 18mm; height: 18mm; }
.compact-slip-page-tag { position: absolute; right: 0; bottom: 0; font-size: 8.5px; }
@media print {
  @page { size: 215.9mm 93.1mm; margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; width: auto !important; min-width: 0 !important; background: white !important; }
  body > * { display: none !important; }
  body > #printDialog { display: block !important; position: static !important; inset: auto !important; width: auto !important; max-width: none !important; max-height: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; overflow: visible !important; }
  body.direct-print-active > #printDialog { display: none !important; }
  body.direct-print-active > #directPrintRoot { display: block !important; position: static !important; width: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  body > dialog:not(#printDialog), .dialog-actions, .print-settings { display: none !important; }
  #printDialog::backdrop { display: none !important; }
  #printArea { display: block !important; width: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  #directPrintArea { display: block !important; width: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  .production-slip { width: 241mm; min-height: 140mm; }
  .compact-production-slip { width: 215.9mm; min-height: 93.1mm; height: 93.1mm; margin: 0; break-after: page; page-break-after: always; }
  .compact-production-slip + .compact-production-slip { margin-top: 0 !important; }
  .compact-production-slip:last-child { break-after: auto; page-break-after: auto; }
}
.model-match-row td { background: #fff7d6; }
.model-match-row:hover td { background: #ffefb0; }
.sale-pricing-panel { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 8px 10px; border: 1px solid #d0d5dd; border-bottom: 0; background: #f8fafc; }
.sale-pricing-panel.manual { border-color: #f59e0b; background: #fffbeb; }
.sale-pricing-panel label { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #92400e; }
.sale-pricing-panel input { width: 180px; }
.sale-pricing-panel span { color: #667085; font-size: 12px; }
.sale-pricing-panel.manual span { color: #92400e; font-weight: 700; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  aside { display: flex; gap: 6px; overflow-x: auto; overflow-y: visible; }
  .brand { display: none; }
  .nav, .module-nav { width: auto; white-space: nowrap; }
  .nav-group { position: static; }
  .module-flyout { position: fixed; left: 12px; right: 12px; top: 66px; width: auto; max-height: 70vh; overflow: auto; }
  .module-flyout.wide { width: auto; }
  .flyout-grid { grid-template-columns: 1fr; }
  .module-flyout.wide .flyout-grid { grid-template-columns: 1fr; }
  .toolbar, .form-grid, .sale-order-bar, .line-editor, .sale-print-fields, .print-settings, .metrics { grid-template-columns: 1fr; }
  .print-template-toolbar, .print-template-fields, .quote-print-settings, .quote-print-field-group .print-field-list { grid-template-columns: 1fr; }
  .print-template-actions { justify-content: flex-start; }
  .sale-pricing-panel { align-items: stretch; flex-direction: column; }
  .dash-grid, .asset-row, .asset-card { grid-template-columns: 1fr; }
  .dash-side { display: grid; }
  .flow-canvas { transform: scale(.78); transform-origin: top left; width: 980px; }
}
.batch-order-bar{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:10px 12px;margin-bottom:10px;border:1px solid #bfdbfe;border-radius:9px;background:#eff6ff}.batch-order-bar label{min-width:180px}.batch-order-bar .muted{font-size:13px;color:#475569}.batch-detail-panel{margin-top:14px;padding:16px;border:1px solid #cbd5e1;border-radius:10px;background:#fff}.batch-detail-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.batch-detail-head h3,.batch-detail-panel h4{margin:0 0 10px}.batch-color-dot{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:6px;vertical-align:middle;background:#3b82f6}.batch-color-dot.red{background:#ef4444}.batch-color-dot.orange{background:#f97316}.batch-color-dot.yellow{background:#eab308}.batch-color-dot.green{background:#22c55e}.batch-color-dot.blue{background:#3b82f6}.batch-color-dot.purple{background:#8b5cf6}.batch-color-dot.pink{background:#ec4899}.batch-color-dot.gray{background:#64748b}.batch-color-dot.teal{background:#14b8a6}.notice-card{padding:10px 12px;margin-bottom:12px;border-left:4px solid #2563eb;background:#eff6ff;color:#1e3a8a}.batch-detail-panel textarea{width:100%;box-sizing:border-box;font-family:ui-monospace,Consolas,monospace}
.production-batch-scopes{display:flex;align-items:center;gap:8px;overflow-x:auto;margin-bottom:12px;padding:8px;border:1px solid #bfdbfe;border-radius:10px;background:#f8fbff}.production-batch-scopes button{display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;border:1px solid #b2ccff;border-radius:999px;background:#fff;color:#344054;font-weight:800}.production-batch-scopes button span{min-width:22px;padding:2px 6px;border-radius:999px;background:#eff4ff;color:#175cd3;font-size:11px;text-align:center}.production-batch-scopes button.active{border-color:#1677ff;background:#1677ff;color:#fff;box-shadow:0 4px 10px rgba(22,119,255,.2)}.production-batch-scopes button.active span{background:rgba(255,255,255,.2);color:#fff}.batch-readonly-banner{margin-bottom:12px;padding:10px 12px;border-left:4px solid #16a34a;background:#f0fdf4;color:#166534}.batch-metric-code{font-size:14px!important;overflow-wrap:anywhere}
.batch-detail-tabs{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:7px;overflow-x:auto;margin:14px 0 12px;padding:9px;border:1px solid #bfdbfe;border-radius:10px;background:rgba(248,251,255,.96);box-shadow:0 4px 12px rgba(15,23,42,.06);scrollbar-width:thin}.batch-detail-tabs button{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;padding:8px 12px;border:1px solid #b2ccff;border-radius:999px;background:#fff;color:#344054;font-weight:800;white-space:nowrap}.batch-detail-tabs button span{padding:2px 6px;border-radius:999px;background:#eff4ff;color:#175cd3;font-size:11px}.batch-detail-tabs button.active{border-color:#1677ff;background:#1677ff;color:#fff;box-shadow:0 4px 10px rgba(22,119,255,.22)}.batch-detail-tabs button.active span{background:rgba(255,255,255,.2);color:#fff}.batch-detail-module{min-height:150px;padding:15px;border:1px solid #dbe3ee;border-radius:10px;background:#fff}.batch-detail-module.hidden{display:none}.batch-module-metrics{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:10px}.batch-module-metrics>div{padding:12px;border:1px solid #bfdbfe;border-radius:9px;background:#eff6ff}.batch-module-metrics span{display:block;color:#64748b;font-size:12px}.batch-module-metrics strong{display:block;margin-top:4px;color:#1d4ed8;font-size:20px}.batch-module-note{margin-top:12px;padding:10px 12px;border-left:4px solid #2563eb;background:#f8fafc;color:#475569}.batch-module-title{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px}.batch-module-title h4{margin-bottom:4px}.batch-module-title p{margin:0;color:#64748b}.batch-module-empty{padding:24px;border:1px dashed #94a3b8;border-radius:9px;background:#f8fafc;color:#64748b;text-align:center}.batch-detail-module.batch-packing-plan{margin:0}
.batch-trace-filters{display:grid;grid-template-columns:minmax(280px,2fr) minmax(130px,.7fr) minmax(150px,.8fr) minmax(150px,.8fr) auto auto;align-items:end;gap:10px;margin-bottom:12px;padding:12px;border:1px solid #bfdbfe;border-radius:9px;background:#f8fbff}.batch-trace-filters label{font-size:12px;color:#475569}.batch-trace-filters label input{display:block;width:100%;margin-top:4px}.batch-trace-summary{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:9px;margin-bottom:12px}.batch-trace-summary>div{padding:10px 12px;border:1px solid #dbeafe;border-radius:8px;background:#eff6ff}.batch-trace-summary span{display:block;color:#64748b;font-size:12px}.batch-trace-summary strong{display:block;margin-top:3px;color:#1d4ed8;font-size:18px}.batch-trace-reversed{background:#fff7ed;color:#64748b}.batch-trace-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}.batch-trace-pager>div{display:flex;gap:8px}
.batch-operation-trace-filters{display:grid;grid-template-columns:minmax(260px,1.8fr) minmax(135px,.7fr) minmax(150px,.8fr) minmax(145px,.75fr) minmax(145px,.75fr) auto auto;align-items:end;gap:10px;margin-bottom:12px;padding:12px;border:1px solid #bfdbfe;border-radius:9px;background:#f8fbff}.batch-operation-trace-filters label{font-size:12px;color:#475569}.batch-operation-trace-filters label input{display:block;width:100%;margin-top:4px}.batch-operation-bad{margin-top:3px;color:#b42318;font-weight:800}
@media(max-width:1100px){.batch-module-metrics{grid-template-columns:repeat(3,minmax(120px,1fr))}.batch-trace-filters,.batch-operation-trace-filters{grid-template-columns:repeat(2,minmax(180px,1fr))}.batch-trace-summary{grid-template-columns:repeat(3,minmax(120px,1fr))}}@media(max-width:700px){.batch-detail-head,.batch-module-title{align-items:stretch;flex-direction:column}.batch-detail-head>div:last-child{display:flex;flex-wrap:wrap;gap:6px}.batch-module-metrics,.batch-trace-summary{grid-template-columns:repeat(2,minmax(110px,1fr))}.batch-trace-filters,.batch-operation-trace-filters{grid-template-columns:1fr}.batch-trace-pager{align-items:stretch;flex-direction:column}.batch-detail-tabs{top:0}}
.batch-packing-plan{border-color:#93c5fd;background:#f8fbff}.packing-plan-toolbar{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin:14px 0;padding:14px;border:1px solid #bfdbfe;border-radius:9px;background:#eff6ff}.packing-plan-toolbar p{margin:6px 0 0}.packing-plan-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.packing-plan-badges span{padding:5px 9px;border-radius:999px;background:#fff;border:1px solid #bfdbfe;font-size:13px;white-space:nowrap}.packing-plan-badges .warning{color:#9a3412;border-color:#fdba74;background:#fff7ed}.packing-plan-section{margin-top:14px;padding:14px;border:1px solid #dbe3ee;border-radius:9px;background:#fff}.packing-plan-title{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}.packing-plan-title h4{margin:0 0 4px}.packing-plan-title span{font-size:13px;color:#667085}.packing-plan-section table input,.packing-plan-section table select{min-width:110px;width:100%;box-sizing:border-box}.packing-plan-section table td{vertical-align:middle}.packing-check{display:inline-block;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}.packing-check.ok{color:#067647;background:#ecfdf3}.packing-check.pending{color:#b42318;background:#fef3f2}.packing-search-bar,.packing-box-search{display:flex;align-items:center;gap:10px;margin:0 0 12px}.packing-search-bar input,.packing-box-search>input{flex:1;min-width:260px}.packing-search-bar span{font-size:12px;color:#667085}.packing-recommendation{border-color:#93c5fd;background:linear-gradient(135deg,#eff6ff,#fff)}.packing-policy-grid{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:10px}.packing-policy-grid label{font-size:12px;color:#475467}.packing-policy-grid input{margin:4px 0;width:100%}.packing-policy-grid small{display:block;color:#667085}.packing-policy-note{margin-top:10px;padding:8px 10px;border-radius:7px;background:#fff;color:#475467;font-size:12px}.packing-recommend-preview{margin-top:12px;padding:12px;border:1px solid #84adff;border-radius:9px;background:#fff}.packing-recommend-summary{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.packing-recommend-summary span{padding:5px 8px;border-radius:999px;background:#eff6ff}.packing-recommend-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px;margin-top:10px}.packing-recommend-cards>div{display:flex;flex-direction:column;gap:3px;padding:10px;border:1px solid #d0d5dd;border-radius:8px}.packing-box-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(680px,1fr));gap:12px}.packing-box-card{padding:14px;border:1px solid #93c5fd;border-radius:10px;background:#f8fafc;box-shadow:0 1px 2px rgba(15,23,42,.05)}.packing-box-head,.packing-box-fields{display:flex;align-items:end;justify-content:space-between;gap:12px}.packing-box-head{align-items:center}.packing-box-actions{display:flex;align-items:center;gap:7px}.packing-box-fields label{flex:1}.packing-box-fields-primary{margin-top:12px}.packing-box-dimensions{display:grid;grid-template-columns:repeat(3,minmax(130px,1fr));gap:10px;margin-top:10px}.packing-box-dimensions label{font-size:12px;color:#475467}.packing-box-dimensions input{margin-top:4px}.packing-box-metrics{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:8px;margin:10px 0;padding:10px;border-radius:8px;background:#eaf2ff}.packing-box-metrics span{font-size:12px;color:#475467}.packing-box-metrics strong{display:block;margin-top:3px;color:#173b70;font-size:15px}.packing-box-search{position:relative;display:block;margin:12px 0}.packing-box-search-results{display:flex;flex-direction:column;gap:5px;margin-top:6px;max-height:210px;overflow:auto}.packing-search-result{display:grid;grid-template-columns:minmax(90px,1fr) minmax(180px,2fr) auto;align-items:center;gap:10px;width:100%;padding:8px 10px;border:1px solid #d0d5dd;border-radius:7px;background:#fff;text-align:left;color:#344054}.packing-search-result:hover{border-color:#2e6fdb;background:#eff6ff}.packing-search-result span{font-size:12px;color:#667085}.packing-search-result b{color:#175cd3}.packing-box-card table{margin-top:10px}.packing-box-card table small{display:block;margin-top:3px;color:#667085}.packing-box-validation{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.packing-empty{padding:24px;text-align:center;border:1px dashed #94a3b8;border-radius:8px;color:#64748b;background:#f8fafc}.packing-plan-errors{margin:0 0 12px;padding:10px 12px;border-left:4px solid #d92d20;background:#fef3f2;color:#b42318}.packing-plan-result{margin-top:12px;padding:12px;border-radius:8px;font-weight:700}.packing-plan-result.ok{color:#067647;background:#ecfdf3;border:1px solid #abefc6}.packing-plan-result.pending{color:#92400e;background:#fffbeb;border:1px solid #fde68a}@media(max-width:900px){.packing-plan-toolbar,.packing-plan-title,.packing-box-head,.packing-box-fields,.packing-search-bar{align-items:stretch;flex-direction:column}.packing-plan-badges{justify-content:flex-start}.packing-policy-grid{grid-template-columns:repeat(2,minmax(120px,1fr))}.packing-box-grid{grid-template-columns:1fr}.packing-box-dimensions,.packing-box-metrics{grid-template-columns:repeat(2,minmax(120px,1fr))}}

.batch-order-card {
  --batch-accent: #3b82f6;
  --batch-soft: #eff6ff;
  --batch-border: #bfdbfe;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .05);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.batch-order-card.batch-active {
  border: 2px solid var(--batch-border);
  background: linear-gradient(135deg, var(--batch-soft) 0, #fff 62%);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .10), inset 5px 0 0 var(--batch-accent);
}
.batch-order-card.color-red { --batch-accent:#e5484d; --batch-soft:#fff1f1; --batch-border:#f6b9bc; }
.batch-order-card.color-orange { --batch-accent:#f97316; --batch-soft:#fff7ed; --batch-border:#fdba74; }
.batch-order-card.color-yellow { --batch-accent:#ca8a04; --batch-soft:#fefce8; --batch-border:#fde047; }
.batch-order-card.color-green { --batch-accent:#16a34a; --batch-soft:#f0fdf4; --batch-border:#86efac; }
.batch-order-card.color-blue { --batch-accent:#2563eb; --batch-soft:#eff6ff; --batch-border:#93c5fd; }
.batch-order-card.color-purple { --batch-accent:#7c3aed; --batch-soft:#f5f3ff; --batch-border:#c4b5fd; }
.batch-order-card.color-pink { --batch-accent:#db2777; --batch-soft:#fdf2f8; --batch-border:#f9a8d4; }
.batch-card-head { min-height: 58px; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:12px 16px; }
.batch-card-identity { min-width:0; display:flex; align-items:center; gap:12px; }
.batch-card-star { width:36px; height:36px; flex:0 0 36px; display:grid; place-items:center; border-radius:10px; background:#f2f4f7; color:#98a2b3; font-size:21px; box-shadow:inset 0 0 0 1px #e4e7ec; }
.batch-active .batch-card-star { background:var(--batch-accent); color:#fff; box-shadow:0 5px 14px color-mix(in srgb, var(--batch-accent) 30%, transparent); }
.batch-card-identity strong { display:block; color:#101828; font-size:16px; line-height:1.35; }
.batch-card-identity span:last-child { display:block; margin-top:2px; color:#667085; font-size:13px; line-height:1.4; }
.batch-mode-switch { min-width:170px; min-height:38px; display:flex; align-items:center; justify-content:center; gap:8px; padding:8px 14px; border:1px solid #d0d5dd; border-radius:999px; background:#fff; color:#344054; font-weight:800; cursor:pointer; }
.batch-mode-switch input { width:auto; margin:0; }
.batch-active .batch-mode-switch { border-color:var(--batch-accent); background:var(--batch-accent); color:#fff; }
.batch-card-controls { display:grid; grid-template-columns:minmax(460px,1fr) minmax(300px,.55fr); gap:12px; padding:14px 16px 16px 21px; border-top:1px solid var(--batch-border); }
.batch-existing-block { display:grid; grid-template-columns:minmax(250px,.8fr) minmax(280px,1fr); gap:12px; align-items:end; }
.batch-existing-block label,
.batch-create-block label { color:#344054; font-weight:800; }
.batch-selection-summary { min-height:40px; display:flex; flex-direction:column; justify-content:center; padding:8px 12px; border:1px solid var(--batch-border); border-radius:8px; background:rgba(255,255,255,.82); }
.batch-selection-summary strong { color:var(--batch-accent); font-size:14px; }
.batch-selection-summary span { margin-top:2px; color:#475467; font-size:12px; }
.batch-create-block { display:grid; grid-template-columns:minmax(130px,.6fr) minmax(170px,.8fr); gap:10px; align-items:end; padding-left:12px; border-left:1px dashed var(--batch-border); }
.batch-create-block label small { display:block; min-height:16px; margin-top:3px; color:#667085; font-size:11px; font-weight:600; }
.batch-create-block select:disabled { color:var(--batch-accent); border-color:var(--batch-border); background:var(--batch-soft); font-weight:800; opacity:1; cursor:not-allowed; }
.batch-create-block button { min-height:40px; font-weight:800; background:var(--batch-accent); border-color:var(--batch-accent); box-shadow:0 5px 12px color-mix(in srgb, var(--batch-accent) 22%, transparent); }
.batch-import-block { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:11px 12px; border:1px dashed var(--batch-border); border-radius:8px; background:rgba(255,255,255,.68); }
.batch-import-block div { display:flex; flex-direction:column; gap:3px; }
.batch-import-block strong { color:var(--batch-accent); }
.batch-import-block span { color:#475467; font-size:12px; }
.batch-import-block button { flex:0 0 auto; }
.batch-card-rules { grid-column:1 / -1; display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding-top:2px; }
.batch-import-dialog-body { padding:18px; background:#fff; }
.batch-import-summary { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:10px; margin-bottom:12px; }
.batch-import-summary span { display:flex; flex-direction:column; gap:3px; padding:10px 12px; border:1px solid #d0d5dd; border-radius:8px; background:#f8fafc; color:#475467; font-size:12px; }
.batch-import-summary strong { color:#101828; font-size:19px; }
.batch-import-warning { display:flex; gap:10px; margin-bottom:12px; padding:11px 13px; border:1px solid #fdb022; border-radius:8px; background:#fffaeb; color:#7a2e0e; }
.batch-import-warning strong { flex:0 0 auto; }
.batch-import-table-wrap { max-height:52vh; }
.batch-import-table-wrap td { vertical-align:top; }
.batch-import-status-ready { color:#027a48; font-weight:800; }
.batch-import-status-error { color:#b42318; font-weight:800; }
.batch-import-row-note { max-width:300px; white-space:normal; line-height:1.45; }
.batch-import-confirm { display:flex; align-items:flex-start; gap:8px; margin-top:13px; padding:10px 12px; border-radius:8px; background:#fef3f2; color:#912018; font-weight:800; }
.batch-import-confirm input { width:auto; margin-top:2px; }
@media (max-width:900px) {
  .batch-import-summary { grid-template-columns:repeat(2,minmax(120px,1fr)); }
  .batch-import-block { align-items:stretch; flex-direction:column; }
}
.batch-rule-tag { display:inline-flex; align-items:center; min-height:25px; padding:3px 9px; border-radius:999px; background:#fff; border:1px solid var(--batch-border); color:#475467; font-size:12px; font-weight:700; }
.batch-card-rules strong { margin-left:auto; color:var(--batch-accent); font-size:13px; }
.draft-bar.batch-draft-bar { border:2px solid var(--batch-border, #93c5fd); background:linear-gradient(135deg, var(--batch-soft, #eff6ff), #fff); box-shadow:inset 5px 0 0 var(--batch-accent, #2563eb), 0 6px 18px rgba(16,24,40,.08); color:#344054; }
.draft-bar.color-red { --batch-accent:#e5484d; --batch-soft:#fff1f1; --batch-border:#f6b9bc; }
.draft-bar.color-orange { --batch-accent:#f97316; --batch-soft:#fff7ed; --batch-border:#fdba74; }
.draft-bar.color-yellow { --batch-accent:#ca8a04; --batch-soft:#fefce8; --batch-border:#fde047; }
.draft-bar.color-green { --batch-accent:#16a34a; --batch-soft:#f0fdf4; --batch-border:#86efac; }
.draft-bar.color-blue { --batch-accent:#2563eb; --batch-soft:#eff6ff; --batch-border:#93c5fd; }
.draft-bar.color-purple { --batch-accent:#7c3aed; --batch-soft:#f5f3ff; --batch-border:#c4b5fd; }
.draft-bar.color-pink { --batch-accent:#db2777; --batch-soft:#fdf2f8; --batch-border:#f9a8d4; }
.draft-bar.batch-draft-bar strong { color:var(--batch-accent, #2563eb); font-size:15px; }
.draft-bar.batch-draft-bar .batch-confirm-button { min-width:180px; min-height:40px; background:var(--batch-accent, #2563eb); border-color:var(--batch-accent, #2563eb); font-weight:800; box-shadow:0 5px 13px rgba(37,99,235,.20); }

@media (max-width: 1100px) {
  .batch-card-controls { grid-template-columns:1fr; }
  .batch-create-block { padding-left:0; padding-top:12px; border-left:0; border-top:1px dashed var(--batch-border); }
}
@media (max-width: 700px) {
  .batch-card-head { align-items:flex-start; flex-direction:column; }
  .batch-mode-switch { width:100%; }
  .batch-card-controls,
  .batch-existing-block,
  .batch-create-block { grid-template-columns:1fr; }
  .batch-card-rules strong { width:100%; margin-left:0; }
}

.packing-plan-title-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.packing-match-dialog { min-width:min(1420px,calc(100vw - 52px)); }
.packing-match-summary { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.packing-match-summary span { padding:6px 9px; border:1px solid #bfdbfe; border-radius:999px; background:#eff6ff; font-size:13px; }
.packing-match-summary span.warning { color:#9a3412; border-color:#fdba74; background:#fff7ed; }
.packing-match-note,
.packing-match-unmatched { padding:9px 11px; border-radius:7px; background:#f8fafc; color:#475467; }
.packing-match-table { max-height:58vh; overflow:auto; }
.packing-match-table input[type="radio"] { min-width:auto; width:auto; }
.packing-match-unmatched { margin-top:10px; }
@media (max-width: 900px) {
  .packing-plan-title-actions { align-items:stretch; flex-direction:column; }
  .packing-match-dialog { min-width:0; }
}

.batch-step-operation-dialog { width:min(1180px,96vw); max-width:1180px; max-height:92vh; padding:0; border:0; border-radius:14px; box-shadow:0 24px 70px rgba(15,23,42,.28); }
.batch-step-operation-shell { padding:18px; max-height:92vh; overflow:auto; }
.batch-step-operation-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.batch-step-operation-head h2 { margin:0 0 4px; }
.batch-step-operation-head p { margin:0; color:#64748b; }
.batch-step-operation-summary { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:10px; margin-bottom:10px; }
.batch-step-operation-summary > div { padding:11px 13px; border:1px solid #bfdbfe; border-radius:10px; background:#eff6ff; }
.batch-step-operation-summary span { display:block; color:#64748b; font-size:13px; }
.batch-step-operation-summary strong { display:block; margin-top:3px; font-size:20px; color:#1d4ed8; }
.batch-step-operation-policy { padding:9px 12px; margin-bottom:10px; border-left:4px solid #2563eb; background:#f8fafc; color:#475569; }
.batch-step-operation-bulk-actions { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 14px; margin-bottom:10px; border:1px solid #bfdbfe; border-radius:10px; background:linear-gradient(135deg,#eff6ff,#f8fafc); }
.batch-step-operation-bulk-actions > div:first-child { display:flex; flex-direction:column; gap:3px; }
.batch-step-operation-bulk-actions span { color:#64748b; font-size:13px; }
.batch-step-operation-bulk-actions > div:last-child { display:flex; gap:8px; flex-shrink:0; }
.batch-step-complete-all { min-width:190px; font-weight:700; }
.batch-step-outsource-mode { margin-bottom:10px; }
.batch-step-outsource-mode label { display:flex; align-items:center; gap:10px; font-weight:600; }
.batch-step-outsource-mode select { width:min(320px,100%); }
.batch-step-operation-search { width:100%; margin-bottom:10px; }
.batch-step-operation-rows { max-height:48vh; overflow:auto; border:1px solid #e2e8f0; border-radius:10px; }
.batch-step-operation-rows table { margin:0; }
.batch-step-operation-rows input[type="number"] { min-width:92px; }
.batch-step-quantity-pair { display:grid; grid-template-columns:repeat(2,minmax(80px,1fr)); gap:6px; }
.batch-step-quantity-pair label { font-size:12px; color:#64748b; }
.batch-step-quantity-pair input { display:block; width:100%; margin-top:3px; }
.batch-step-operation-remark { display:block; margin-top:10px; color:#475569; font-weight:600; }
.batch-step-operation-remark textarea { width:100%; margin-top:5px; resize:vertical; }
.batch-step-operation-shell footer { display:flex; justify-content:flex-end; margin-top:12px; }
@media (max-width:720px) {
  .batch-step-operation-summary { grid-template-columns:repeat(2,1fr); }
  .batch-step-operation-head { align-items:center; }
  .batch-step-operation-bulk-actions { align-items:stretch; flex-direction:column; }
  .batch-step-operation-bulk-actions > div:last-child { flex-wrap:wrap; }
  .batch-step-quantity-pair { grid-template-columns:1fr; }
}

.packing-box-qr-field { display:flex; align-items:center; gap:8px; margin-top:4px; }
.packing-box-qr-field input { flex:1; min-width:220px; }
.packing-box-qr-field button { flex:0 0 auto; white-space:nowrap; }
.packing-box-qr-preview { display:grid; grid-template-columns:132px 1fr; align-items:center; gap:14px; margin-top:10px; padding:12px; border:1px solid #bfdbfe; border-radius:9px; background:#fff; }
.packing-box-qr-preview img { width:132px; height:132px; padding:4px; border:1px solid #d0d5dd; border-radius:7px; background:#fff; }
.packing-box-qr-preview>div { display:flex; flex-direction:column; align-items:flex-start; gap:7px; min-width:0; }
.packing-box-qr-preview code { max-width:100%; overflow-wrap:anywhere; color:#173b70; }
.packing-box-qr-preview span { color:#667085; font-size:12px; }
.packing-box-qr-preview>div>div { display:flex; align-items:center; gap:8px; }
.packing-qr-download { display:inline-flex; align-items:center; min-height:34px; padding:0 12px; border:1px solid #cbd5e1; border-radius:6px; color:#334155; background:#f8fafc; text-decoration:none; }
.packing-box-qr-empty { margin-top:10px; padding:10px 12px; border:1px dashed #93c5fd; border-radius:8px; color:#475569; background:#eff6ff; }
@media (max-width:720px) {
  .packing-box-qr-field { align-items:stretch; flex-direction:column; }
  .packing-box-qr-preview { grid-template-columns:1fr; justify-items:center; }
}
.packing-order-summary{display:inline-block;min-width:86px;padding:7px 9px;border-radius:7px;background:#f2f4f7;color:#344054;font-weight:650;line-height:1.35}.packing-order-warehouse{display:inline-block;min-width:110px;padding:7px 9px;border-radius:7px;font-weight:750;line-height:1.35}.packing-order-warehouse.ok{color:#067647;background:#ecfdf3;border:1px solid #abefc6}.packing-order-warehouse.pending{color:#b42318;background:#fef3f2;border:1px solid #fecdca}
.batch-pack-progress-dialog {
  width: min(1480px, 96vw);
  max-width: 1480px;
  max-height: 94vh;
}
.batch-pack-progress-dialog .dialog-detail { width: 100%; min-width: 0; }
.batch-pack-progress { display: grid; gap: 14px; }
.batch-pack-progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.batch-pack-progress-actions { display: grid; grid-template-columns: auto auto; align-items: center; justify-items: end; gap: 7px 9px; }
.batch-pack-progress-actions small { grid-column: 1 / -1; color: #64748b; white-space: nowrap; }
.batch-pack-progress-head h4 { margin: 0 0 4px; font-size: 20px; }
.batch-pack-progress-head p { margin: 0; color: #64748b; }
.batch-pack-progress-warning,
.batch-pack-progress-danger { border-radius: 10px; padding: 11px 14px; font-weight: 700; }
.batch-pack-progress-warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.batch-pack-progress-danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.batch-pack-progress-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.batch-pack-progress-metrics > div { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 12px; }
.batch-pack-progress-metrics span { display: block; color: #64748b; font-size: 13px; }
.batch-pack-progress-metrics strong { display: block; color: #0f4c9a; font-size: 24px; margin-top: 4px; }
.batch-pack-progress-bars { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.batch-pack-progress-bars .batch-metric-progress { border: 1px solid #dbeafe; border-radius: 10px; padding: 10px; background: #fff; }
.batch-pack-box-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; align-items: start; }
.batch-pack-box { border: 1px solid #bfdbfe; border-radius: 12px; padding: 12px; background: #fff; min-width: 0; }
.batch-pack-box.completed { border-color: #86efac; background: #f0fdf4; }
.batch-pack-box > header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.batch-pack-box > header strong,
.batch-pack-box > header span { display: block; }
.batch-pack-box > header strong { font-size: 17px; }
.batch-pack-box > header div > span { color: #64748b; font-size: 13px; margin-top: 3px; }
.batch-pack-box-items { display: grid; gap: 8px; margin-top: 10px; max-height: 350px; overflow: auto; }
.batch-pack-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; padding: 9px; border-radius: 8px; background: #f8fafc; }
.batch-pack-item > div:first-child { min-width: 0; }
.batch-pack-item strong,
.batch-pack-item span { display: block; }
.batch-pack-item > div:first-child strong { overflow-wrap: anywhere; }
.batch-pack-item > div:first-child span,
.batch-pack-item-count span { color: #64748b; font-size: 12px; }
.batch-pack-item-count { text-align: right; white-space: nowrap; }
.batch-pack-item-count strong { font-size: 16px; color: #0f4c9a; }
.batch-pack-item .batch-progress { grid-column: 1 / -1; }
.batch-pack-receipt-detail summary { cursor: pointer; font-weight: 700; color: #1d4ed8; padding: 10px 0; }
@media (max-width: 1100px) {
  .batch-pack-box-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .batch-pack-progress-head { display: grid; }
  .batch-pack-progress-actions { justify-items: start; grid-template-columns: auto auto; }
  .batch-pack-progress-actions small { white-space: normal; }
  .batch-pack-progress-metrics,
  .batch-pack-progress-bars,
  .batch-pack-box-grid { grid-template-columns: 1fr; }
}
