/* KINGREE ERP: shares structural tokens; the scoped blue theme below never overrides CRM/CUSTOM globals. */
/* Boss/profit statement layout: only rendering and query controls, never accounting rules. */
#erpPage .rep-statement-view { display:flex; flex-direction:column; height:calc(100dvh - 194px); min-height:440px; padding:7px; border:1px solid #d4dde4; background:#fff; }
#erpPage .rep-statement-view [hidden] { display:none !important; }
#erpPage .rep-statement-top { display:flex; align-items:center; justify-content:space-between; gap:10px; flex:none; padding:0 0 7px; }
#erpPage .rep-statement-top h2 { font-size:14px; font-weight:400; margin:0; }
#erpPage .rep-statement-controls { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
#erpPage .rep-statement-controls label { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:400; white-space:nowrap; }
#erpPage .rep-statement-view button, #erpPage .rep-statement-view select, #erpPage .rep-statement-view .rep-export { font-size:13px; padding:4px 9px; min-height:29px; border-radius:2px; }
#erpPage .rep-statement-controls select { max-width:180px; }
#erpPage .rep-statement-period { display:flex; justify-content:space-between; gap:10px; flex:none; padding:4px 1px 9px; color:#5b6c7b; font-size:12px; flex-wrap:wrap; }
#erpPage .rep-statement-period [data-statement-basis] { font-size:11px; color:#7c8792; }
#erpPage .rep-statement-view .rep-body { flex:1 1 200px; min-height:180px; display:flex; flex-direction:column; border:1px solid #becbd8; }
#erpPage .rep-statement-scroll { flex:1; min-height:100px; overflow:auto; }
#erpPage .rep-statement-table { border-collapse:separate; border-spacing:0; table-layout:fixed; width:100%; min-width:780px; }
#erpPage .rep-statement-table thead { position:sticky; top:0; z-index:2; }
#erpPage .rep-statement-table th { position:relative; background:#2881c7; border:0; border-right:1px solid #7ab1d5; color:#fff; height:34px; padding:5px 9px; font-size:13px; line-height:20px; font-weight:400; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#erpPage .rep-statement-table th.gjp-code { width:auto; }
#erpPage .rep-statement-table th.gjp-amt { width:auto; text-align:right; }
#erpPage .rep-statement-table td { height:32px; line-height:22px; padding:4px 9px; font-size:13px; border:0; border-right:1px solid #e5e8eb; border-bottom:1px solid #e5e8eb; background:#fff; color:#263746; font-weight:400; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
#erpPage .rep-statement-table tr:nth-child(even) td { background:#f8f8f8; }
#erpPage .rep-statement-table tr.gjp-l0 td { background:#fff; font-weight:400; }
#erpPage .rep-statement-table tr.gjp-l1 td.gjp-name { padding-left:24px; }
#erpPage .rep-statement-table tr.gjp-l2 td.gjp-name { padding-left:44px; }
#erpPage .rep-statement-table tr.gjp-profit td { border-top:1px solid #b8d0e5; background:#eef5fc; font-size:13px; font-weight:600; }
#erpPage .rep-statement-table tr:hover td { background:#edf5fc; }
#erpPage .rep-statement-view .rep-statement-table tr.selected td { background:#fffbe4; }
#erpPage .rep-statement-table .rep-statement-index { width:38px; padding:0; text-align:center; color:#3e637e; background:#f3fafc; }
#erpPage .rep-statement-table th.rep-statement-index { background:#2881c7; color:white; }
#erpPage .rep-statement-table th button { padding:0; min-height:28px; width:100%; border:0; background:transparent; color:inherit; }
#erpPage .rep-statement-table tr.selected .rep-statement-index { color:#ff8a00; }
#erpPage .rep-statement-table .erp-num { font:inherit; }
#erpPage .rep-statement-table [data-statement-resize] { position:absolute; right:0; top:0; bottom:0; width:7px; cursor:col-resize; touch-action:none; }
#erpPage .rep-statement-row-note { flex:none; min-height:25px; max-height:52px; overflow:auto; font-size:12px; padding:4px 8px; background:#fffce8; color:#607181; border-top:1px solid #dfdfcb; }
#erpPage .rep-statement-pager { flex:none; display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:9px; padding:4px 6px; border-top:1px solid #dce4eb; font-size:12px; color:#5e7181; }
#erpPage .rep-statement-pager label { display:flex; align-items:center; gap:6px; font-weight:400; }
#erpPage .rep-statement-actions { display:flex; align-items:center; gap:7px; padding-top:7px; flex:none; }
#erpPage .rep-statement-actions .rep-export { margin-left:auto; border:1px solid #c8d3dd; color:#36576b; background:#f7f8f9; text-decoration:none; }
#erpPage .rep-statement-help { flex:none; max-height:240px; overflow:auto; padding:10px; margin-top:7px; border:1px solid #d7e1e9; font-size:12px; line-height:1.6; color:#566c7f; }
.rep-columns-dialog .modalbox { width:min(410px,90vw); }
.rep-columns-dialog label { display:flex; align-items:center; gap:8px; font-weight:400; }
.rep-columns-dialog input[type=checkbox] { width:16px; height:16px; }
@media(max-width:800px) { #erpPage .rep-statement-top { align-items:flex-start; flex-wrap:wrap; } #erpPage .rep-statement-view { height:calc(100dvh - 190px); min-height:500px; } }
/* Inventory presentation only: existing queries/ledgers and ERP financial rules are unchanged. */
#erpPage .inv-gjp { display:flex; gap:0; height:calc(100dvh - 195px); min-height:440px; background:#fff; color:#263746; border:1px solid #d4dce3; }
#erpPage .inv-gjp [hidden] { display:none !important; }
#erpPage .inv-gjp button, #erpPage .inv-gjp input, #erpPage .inv-gjp select { border-radius:2px; font-size:13px; min-height:30px; padding:4px 8px; }
#erpPage .inv-sidebar { flex:0 0 234px; width:234px; overflow:auto; background:#fff; }
#erpPage .inv-locate { display:flex; gap:5px; padding:7px 5px; }
#erpPage .inv-locate input { width:0; min-width:0; flex:1; }
#erpPage .inv-locate button { flex:none; }
#erpPage .inv-category-tree { border-top:1px solid #d8e0e8; }
#erpPage .inv-category-tree button { display:block; border:0; border-radius:0; background:transparent; width:100%; text-align:left; font-weight:400; padding:6px 12px; color:inherit; }
#erpPage .inv-category-children button { padding-left:40px; }
#erpPage .inv-category-tree button:hover { background:#fff0e0; color:#d97905; }
#erpPage .inv-category-tree button.selected { background:#dff4fc; color:#175877; }
#erpPage .inv-category-root { font-weight:600; }
#erpPage .inv-class-note { padding:8px 12px; font-size:11px; color:#7c8995; }
#erpPage .inv-sidebar-toggle { flex:0 0 12px; width:12px; min-width:12px; padding:0; border:0; border-left:1px solid #d4dce3; border-right:1px solid #d4dce3; color:#fff; background:linear-gradient(to bottom,#f5f8fa 42%,#2881c7 42%,#2881c7 56%,#f5f8fa 56%); }
#erpPage .inv-sidebar-closed .inv-sidebar { display:none; }
#erpPage .inv-main { flex:1; min-width:0; display:flex; flex-direction:column; padding:7px; overflow:auto; }
#erpPage .inv-query { flex:none; }
#erpPage .inv-query-top, #erpPage .inv-query-options { display:flex; align-items:center; gap:7px; flex-wrap:wrap; padding:0 0 7px; }
#erpPage .inv-query-top label, #erpPage .inv-query-options label { display:flex; align-items:center; gap:6px; font-weight:400; white-space:nowrap; font-size:13px; }
#erpPage .inv-query-top [data-f=warehouse_id] { max-width:240px; }
#erpPage .inv-query-top [data-f=group_id] { max-width:180px; }
#erpPage .inv-query-top input { flex:1; min-width:160px; max-width:300px; }
#erpPage .inv-query-options { justify-content:flex-end; color:#425362; }
#erpPage .inv-query-options input[type=checkbox] { width:15px; height:15px; min-height:0; margin:0; padding:0; }
#erpPage .inv-query-options select { max-width:125px; }
#erpPage .inv-view-label { margin-right:auto; color:#768592; font-size:12px; }
#erpPage .inv-search-btn { color:#fff; background:#2881c7; border-color:#2881c7; }
#erpPage .inv-query-error { color:#b2302a; font-size:13px; flex:none; }
#erpPage .inv-query-error:not(:empty) { border:1px solid #edc4bf; background:#fff5f3; padding:8px; margin-bottom:5px; }
#erpPage .inv-body { flex:1 1 240px; min-height:180px; display:flex; flex-direction:column; border:1px solid #bdcbd8; }
#erpPage .inv-grid-scroll { flex:1; min-height:100px; overflow:auto; }
#erpPage .inv-table { table-layout:fixed; width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; margin:0; }
#erpPage .inv-table thead { position:sticky; top:0; z-index:2; }
#erpPage .inv-table th { position:relative; padding:0; height:35px; background:#2881c7; color:white; border-right:1px solid #6eafd6; }
#erpPage .inv-table th button { display:block; width:100%; border:0; color:inherit; background:transparent; font-weight:400; text-align:left; height:35px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#erpPage .inv-table th button:disabled { opacity:1; cursor:default; }
#erpPage .inv-table td { height:34px; padding:5px 7px; font-size:13px; line-height:22px; font-weight:400; border-bottom:1px solid #e5e8eb; border-right:1px solid #e5e8eb; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; background:#fff; }
#erpPage .inv-table tr:nth-child(even) td { background:#f8f8f8; }
#erpPage .inv-table tr:hover td { background:#edf7fc; }
#erpPage .inv-table tr.selected td { background:#fffbe4; }
#erpPage .inv-table .inv-row-index { color:#3d617d; text-align:center; background:#f4fafc; padding:0; }
#erpPage .inv-table tr.selected .inv-row-index { color:#ff8a00; }
#erpPage .inv-table .erp-link { display:block; width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:13px; font-weight:400; color:inherit; padding:0; min-height:0; text-decoration:none; }
#erpPage .inv-table .erp-link:hover { color:#1764a1; text-decoration:underline; }
#erpPage .inv-table .inv-numeric { text-align:right; font-variant-numeric:tabular-nums; }
#erpPage .inv-unavailable { color:#87929c; font-size:12px; }
#erpPage .inv-resize { position:absolute; right:0; top:0; bottom:0; width:7px; cursor:col-resize; touch-action:none; }
#erpPage .inv-table tfoot { position:sticky; bottom:0; z-index:1; }
#erpPage .inv-table tfoot td { background:#fffce6; border-top:1px solid #d8d6bd; height:28px; padding:2px 6px; }
#erpPage .inv-subtotal { display:flex; align-items:center; gap:24px; }
#erpPage .inv-subtotal strong { font-weight:400; }
#erpPage .inv-pager { flex:none; display:flex; flex-wrap:wrap; gap:6px; padding:5px 6px; min-height:36px; margin:0; border-top:1px solid #dbe3eb; color:#3d5264; }
#erpPage .inv-pager label { display:flex; align-items:center; gap:5px; font-weight:400; }
#erpPage .inv-pager input { width:55px; text-align:center; }
#erpPage .inv-pager button { padding:2px 7px; min-width:25px; min-height:27px; }
#erpPage .inv-pager select { min-height:27px; }
#erpPage .inv-filter-total { margin-right:auto; }
#erpPage .inv-bottom { flex:none; display:flex; flex-wrap:wrap; gap:7px; padding-top:7px; align-items:center; }
#erpPage .inv-readonly { margin-left:auto; font-size:11px; color:#7a8791; }
#erpPage .inv-data-note { flex:none; font-size:12px; color:#70808e; margin-top:5px; }
#erpPage .inv-data-note p { padding:6px; margin:0; line-height:1.7; }
#erpPage .inv-group-overview { flex:none; padding-top:7px; }
#erpPage .inv-group-overview .erp-panel { border-radius:2px; padding:10px; }
.inv-column-dialog .modalbox { width:min(460px,90vw); }
.inv-column-list { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:10px 0; }
.inv-column-list label { display:flex; align-items:center; gap:8px; font-weight:400; }
.inv-column-list input { width:16px; height:16px; }
@media (max-width:1000px) { #erpPage .inv-sidebar { width:185px; flex-basis:185px; } #erpPage .inv-gjp { min-height:520px; height:calc(100dvh - 190px); } }
@media (max-width:650px) { #erpPage .inv-sidebar { width:140px; flex-basis:140px; } #erpPage .inv-query-top select { max-width:160px; } #erpPage .inv-gjp { height:auto; min-height:650px; } #erpPage .inv-grid-scroll { max-height:420px; } }
.erp-page { display: block; }
.erp-page.hidden { display: none !important; }
.erp-workspace .erp-header { margin-bottom: 8px; }
.erp-workspace-bar { display:flex; align-items:center; gap:8px; margin-bottom:14px; border-bottom:1px solid var(--line); min-width:0; }
.erp-workspace-tabs { display:flex; flex:1; min-width:0; overflow-x:auto; overscroll-behavior-x:contain; gap:3px; padding:3px 0 0; scrollbar-width:thin; }
.erp-workspace-tab { display:flex; flex:0 0 auto; align-items:stretch; max-width:300px; border:1px solid var(--line); border-bottom:0; border-radius:7px 7px 0 0; background:#f7f9f8; }
.erp-workspace-tab.active { background:#eaf3ee; border-color:#a3bcae; box-shadow:inset 0 -2px var(--primary); }
.erp-workspace-tab [role=tab] { min-width:90px; max-width:262px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border:0; border-radius:0; background:transparent; padding:8px 11px; color:#46574f; }
.erp-workspace-tab.active [role=tab] { color:var(--primary); font-weight:700; }
.erp-workspace-tab .erp-tab-close { border:0; border-radius:0; background:transparent; min-width:28px; padding:4px; color:var(--muted); }
.erp-tab-close:hover { color:#273d30; background:#dce9e1; }
.erp-tab-status { font-size:11px; margin-left:4px; }
.erp-workspace-panel[hidden] { display:none !important; }
.erp-workspace-bar > button { flex:none; padding:5px 9px; font-size:12px; }
.erp-workspace-bar > button[hidden] { display:none !important; }
.erp-loading, .erp-empty { color: var(--muted); padding: 36px 0; text-align: center; display: grid; gap: 14px; justify-items: center; }
.erp-muted { color: var(--muted); }
.rep-date-dialog .rep-date-box { width:min(436px,calc(100vw - 28px)); padding:0; overflow:hidden; }
.rep-date-dialog .modalhead { margin:0; padding:16px 18px; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:space-between; }
.rep-date-dialog .modalhead h2 { margin:0; font-size:20px; color:inherit; }
.rep-date-dialog [aria-label="关闭日期查询"] { border:0; background:transparent; color:inherit; font-size:26px; padding:0 3px; line-height:1; }
.rep-date-content { padding:16px 18px 4px; }
.rep-date-content > p { margin:0 0 12px; }
.rep-date-range { display:flex; align-items:center; gap:9px; }
.rep-date-range input { min-width:0; width:0; flex:1; }
.rep-date-remember { display:flex; align-items:center; gap:7px; margin-top:14px; font-weight:400; }
.rep-date-remember input { width:16px; height:16px; margin:0; flex:none; }
.rep-date-dialog .modalactions { padding:10px 18px 16px; margin:0; justify-content:flex-end; }
.rep-date-error { color:#a8322b; margin-top:10px !important; }
.erp-mono, .erp-code { font-variant-numeric: tabular-nums; font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 13px; }
.erp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.erp-notice { max-width: 520px; margin: 64px auto; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.erp-notice h2 { margin: 12px 0 8px; font-size: 20px; }
.erp-notice p { margin: 0; color: var(--muted); line-height: 1.6; }
.erp-notice-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: #eef5f1; color: var(--primary); font-weight: 800; }

.erp-header { display: flex; align-items: center; gap: 22px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; position: relative; z-index: 20; }
.erp-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; white-space: nowrap; }
.erp-badge { padding: 3px 8px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 12px; letter-spacing: .06em; }
.erp-topnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.erp-topnav-group { position: relative; }
.erp-topnav-item { border-color: transparent; background: transparent; min-height: 34px; padding: 6px 12px; border-radius: 8px; color: #33413d; }
.erp-topnav-item:hover { background: #f1f6f3; border-color: transparent; }
.erp-topnav-item.active { background: #eef5f1; color: var(--primary); font-weight: 700; }
.erp-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .55; margin-left: 2px; }
.erp-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 188px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(18, 31, 28, .14); }
.erp-topnav-group.open .erp-menu { display: grid; gap: 2px; }
.erp-favorites-menu { max-height:min(65dvh,480px); overflow-y:auto; }
.erp-favorites-menu [data-workspace-open="home"] { border-top:1px solid #d5dfe7; }
.erp-favorites-dialog .modalbox { width:min(610px,calc(100vw - 32px)); }
.erp-favorite-columns { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:12px 0; }
.erp-favorite-columns section { min-width:0; display:grid; grid-template-rows:auto minmax(100px,1fr) auto; align-items:end; gap:6px; }
.erp-favorite-columns input, .erp-favorite-columns select { width:100%; box-sizing:border-box; }
.erp-favorite-columns select { height:min(36dvh,250px); }
.erp-favorite-columns input { display:block; margin-top:4px; }
.erp-favorite-columns button { justify-self:start; }
.erp-menu-link { justify-content: space-between; border-color: transparent; background: transparent; min-height: 34px; padding: 6px 10px; border-radius: 7px; width: 100%; }
.erp-menu-link:hover:not(:disabled) { background: #f1f6f3; border-color: transparent; }
.erp-menu-link.active { color: var(--primary); font-weight: 700; background: #eef5f1; }
.erp-menu-link:disabled, .erp-shortcut:disabled { cursor: not-allowed; color: #93a19c; }
.erp-menu-link:disabled:hover { color: #93a19c; border-color: transparent; }
.erp-dev-tag { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: #f2f4f3; color: #8a9793; font-weight: 400; }

.erp-home { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.erp-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 18px; }
.erp-panel-head h3 { margin: 0 0 12px; font-size: 15px; }
.erp-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.erp-shortcut { position: relative; display: grid; justify-items: start; justify-content: stretch; align-content: start; gap: 4px; min-height: 78px; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; white-space: normal; }
.erp-shortcut strong { font-size: 15px; }
.erp-shortcut small { color: var(--muted); font-size: 12px; }
.erp-shortcut:not(:disabled):hover { background: #f1f6f3; border-color: #a9c6ba; }
.erp-shortcut .erp-dev-tag { position: absolute; top: 10px; right: 10px; }

.erp-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.erp-page-head h2 { margin: 0 0 4px; font-size: 20px; }
.erp-page-head p { margin: 0; font-size: 13px; }
.erp-readonly-tag { padding: 4px 10px; border-radius: 999px; background: #f2f4f3; color: var(--muted); font-size: 12px; }
.erp-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.erp-search { flex: 1 1 280px; max-width: 420px; }
.erp-segment { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.erp-segment button { border: 0; min-height: 30px; padding: 4px 14px; border-radius: 6px; background: transparent; }
.erp-segment button.active { background: #eef5f1; color: var(--primary); font-weight: 700; }
.erp-products-body.is-loading { opacity: .55; transition: opacity .15s; }

.erp-tablewrap { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.erp-table { min-width: 900px; }
.erp-table th, .erp-table td.erp-code, .erp-table td.erp-mono, .erp-table td.erp-actions { white-space: nowrap; }
.erp-aux small { display: block; }
.erp-table th, .erp-table td { padding: 10px 12px; font-size: 13.5px; }
.erp-table th { background: #f6f8f7; color: #5b6964; font-weight: 600; font-size: 12.5px; }
.erp-table tbody tr:hover { background: #fafcfb; }
/* ADR021 customer drawer: scope the ERP grid to the embedded, read-only summary. */
[data-efficiency-customer] .erp-table { width:100%; min-width:580px; }
[data-efficiency-customer] .erp-table th { background:#2881c7; color:#fff; }
[data-efficiency-customer] .erp-table th, [data-efficiency-customer] .erp-table td { padding:7px 8px; font-size:13px; }
[data-efficiency-customer] > .erp-table { display:block; overflow-x:auto; }
.erp-table td.erp-name { min-width: 220px; max-width: 360px; }
.erp-link { border: 0; background: none; padding: 0; min-height: 0; color: var(--text); font-weight: 600; text-align: left; white-space: normal; }
.erp-link:hover { color: var(--primary); text-decoration: underline; }
.erp-actions { white-space: nowrap; }
.erp-btn-sm { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
.erp-btn-warn { color: #9a5b12; }
.erp-cat { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: #f2f4f3; color: #50605b; white-space: nowrap; }
.erp-cat-raw_material { background: #f4f1e8; color: #7a6127; }
.erp-cat-component { background: #eef1f7; color: #3f557f; }
.erp-cat-regular_finished_goods { background: #eef5f1; color: var(--primary); }
.erp-cat-custom_finished_goods { background: #f5eff5; color: #7a4677; }
.erp-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.erp-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa6a2; }
.erp-status-active::before { background: #3a9a6c; }
.erp-status-inactive { color: var(--muted); }
.erp-pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 2px 0; color: var(--muted); font-size: 13px; }
.erp-pager button { min-height: 30px; padding: 4px 12px; }

.erp-dialog .modalbox.erp-editor { width: min(980px, calc(100vw - 28px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.erp-editor-head { display: flex; align-items: center; gap: 12px; }
.erp-editor-body { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; min-width: 0; }
.erp-product-master .erp-editor-body { grid-template-columns: minmax(0, 1fr); }
.erp-editor-body:disabled input, .erp-editor-body:disabled select, .erp-editor-body:disabled textarea { background: #f8faf9; color: var(--text); }
.erp-editor-main label { align-content: start; }
.erp-editor-main input[readonly] { background: #f5f7f6; color: #53615c; }
.erp-inline { display: flex; align-items: center; gap: 8px; color: #53615c; }
.erp-inline input { flex: 1; min-width: 0; }
.erp-money span { font-weight: 700; color: #53615c; }
.erp-hint { color: #8a9793; font-size: 12px; }
.erp-field-error { color: var(--danger); font-size: 12px; min-height: 0; }
.erp-field-error:empty { display: none; }
input.erp-invalid, select.erp-invalid { border-color: var(--danger); background: #fff8f7; }
.erp-editor-image { display: grid; gap: 8px; align-content: start; }
.erp-image-box { width: 200px; height: 200px; border: 1px dashed #c9d4cf; border-radius: 10px; display: grid; place-items: center; background: #fbfcfb; overflow: hidden; }
.erp-image-box img { width: 100%; height: 100%; object-fit: contain; }
.erp-image-pick { justify-content: center; }
.erp-confirm-text { color: #4b5753; line-height: 1.6; margin: 4px 0 8px; }
.erp-confirm-target { margin: 0 0 16px; padding: 10px 12px; background: #f6f8f7; border-radius: 8px; }

@media (max-width: 1100px) {
  .erp-home { grid-template-columns: 1fr; }
  .erp-editor-body { grid-template-columns: 1fr; }
}

/* ERP-2 往来单位 */
.erp-customers-body.is-loading { opacity: .55; transition: opacity .15s; }
.erp-customers-table { min-width: 1080px; }
.erp-block { display: block; }
.erp-warn { color: #b45309; }   /* a reminder that never blocks (e.g. 资金调拨 leaves the from account negative) */
.erp-legal { max-width: 260px; color: #4b5753; font-size: 12.5px; }
.erp-settle { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: #f2f4f3; color: #50605b; white-space: nowrap; }
.erp-settle-cash { background: #eef5f1; color: var(--primary); }
.erp-settle-weekly, .erp-settle-monthly { background: #eef1f7; color: #3f557f; }
.erp-settle-flooring { background: #f4f1e8; color: #7a6127; }
.erp-settle-consignment { background: #f5eff5; color: #7a4677; }
.erp-flooring { display: inline-block; margin-left: 4px; font-size: 11.5px; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.erp-flooring-pending { background: #fff4e5; color: #9a5b12; }
.erp-flooring-completed { background: #eef5f1; color: var(--primary); }
.erp-editor-single { grid-template-columns: minmax(0, 1fr); }
.erp-section-title { margin: 8px 0 2px; font-size: 14px; color: #33413d; }
.erp-check { display: flex !important; align-items: center; gap: 8px; align-self: end; min-height: 38px; }
.erp-check input { width: auto; }
.erp-links-panel { border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 14px; }
.erp-links { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 6px; }
.erp-links li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #f8faf9; border-radius: 8px; }
.erp-links li .erp-btn-sm { margin-left: auto; }
.erp-link-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.erp-link-add select { min-width: 160px; flex: 0 1 240px; }

/* ERP-2.1 Excel 批量导入 */
.erp-head-actions { display: flex; align-items: center; gap: 10px; }
.erp-head-link { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.erp-head-link:hover { color: var(--primary); }
.erp-dialog .modalbox.erp-import { width: min(1080px, calc(100vw - 28px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.erp-import-template { margin-left: auto; font-size: 13px; color: var(--primary); }
.erp-import-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.erp-import-pick .filebtn { cursor: pointer; }
.erp-import-pick input[type="file"] { display: none; }
.erp-import-defaults { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; padding: 12px; background: #f8faf9; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.erp-import-defaults label { display: grid; gap: 4px; }
.erp-import-file { font-size: 13px; color: #4b5753; margin-bottom: 8px; }
.erp-import-mapping { display: grid; gap: 6px; margin-bottom: 10px; font-size: 13px; }
.erp-map { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: 6px; background: #eef5f1; color: #2f4a3f; font-size: 12px; }
.erp-map b { color: var(--primary); font-weight: 600; }
.erp-map-ignored { background: #f2f4f3; color: #8a9793; }
.erp-import-ignored summary { cursor: pointer; color: var(--muted); }
.erp-import-stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; }
.erp-import-stats .erp-segment { margin-left: auto; }
.erp-imp-ok-text b { color: #2f7d57; } .erp-imp-error-text b { color: var(--danger); } .erp-imp-warn-text b { color: #9a5b12; }
.erp-import-alert { padding: 8px 12px; border-radius: 8px; background: #fff4f2; color: var(--danger); font-size: 13px; margin: 8px 0; }
.erp-import-ok { padding: 8px 12px; border-radius: 8px; background: #eef5f1; color: #2f7d57; font-size: 13px; margin: 8px 0; }
.erp-import-warning-confirm { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin: 8px 0; border-radius: 4px; background: #fff4e5; color: #7c4b10; font-size: 13px; cursor: pointer; }
.erp-import-warning-confirm input { flex: none; }
.erp-import-table { max-height: 46vh; }
.erp-import-table .erp-table { min-width: 960px; }
.erp-imp-row-error { background: #fffafa; }
.erp-imp-row-warning { background: #fffcf5; }
.erp-imp-tag { font-size: 12px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.erp-imp-ok { background: #eef5f1; color: #2f7d57; } .erp-imp-error { background: #fdecea; color: var(--danger); } .erp-imp-warn { background: #fff4e5; color: #9a5b12; }
.erp-imp-msg { min-width: 220px; font-size: 12.5px; }
.erp-imp-e { color: var(--danger); } .erp-imp-w { color: #9a5b12; }
.erp-import-note { font-size: 12px; margin-top: 6px; }
.erp-import-table th, .erp-import-table td { white-space: nowrap; }
.erp-import-table td.erp-imp-msg { white-space: normal; }
.erp-import-defaults input { width: 100%; }
.erp-imp-default { padding: 0 5px; border-radius: 4px; background: #eef1f7; color: #3f557f; font-size: 11px; }

/* ERP-3 仓库 */
#erpPage .wh-layout.erp-ui-master-page { max-height:none; }
#erpPage .wh-categories { display:flex; align-self:stretch; }
#erpPage .wh-list .erp-ui-grid-scroll { max-height:48vh; }
#erpPage .wh-list tbody tr { cursor:pointer; }
#erpPage .asm-page tfoot { position:sticky; bottom:0; z-index:1; }
#erpPage .asm-page tfoot td { background:#fffbe4; font-weight:600; }
#erpPage .fin-expense-payment { padding:8px; border-top:1px solid var(--line); flex-wrap:wrap; }
#erpPage .fin-expense-payment label { display:flex; align-items:center; gap:6px; }
#erpPage .fin-expense-payment input { width:110px; }
.wh-icon { width: 22px; height: 22px; flex: none; border-radius: 6px; display: inline-grid; place-items: center; }
.wh-icon-group { background: #eef1f7; box-shadow: inset 0 0 0 1.5px #8fa0c2; }
.wh-icon-group::before { content: ""; width: 10px; height: 8px; border: 1.5px solid #5b6f9b; border-radius: 2px; }
.wh-icon-warehouse { background: #eef5f1; box-shadow: inset 0 0 0 1.5px #8fbfa6; }
.wh-icon-warehouse::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--primary); }
.wh-node, .wh-type { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; flex: none; }
.wh-node-group { background: #eef1f7; color: #3f557f; }
.wh-type-company { background: #eef5f1; color: var(--primary); }
.wh-type-consignment { background: #f5eff5; color: #7a4677; }
.wh-type-flooring { background: #f4f1e8; color: #7a6127; }
.wh-type-other { background: #f2f4f3; color: #50605b; }
.wh-detail { max-width:930px; background:#fff; border-top:1px solid var(--line); padding:8px 8px 4px; margin-top:6px; }
.wh-detail-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:6px; }
.wh-detail-head h3 { margin: 0; font-size: 17px; }
.wh-note { margin: 0 0 10px; padding: 8px 10px; background: #f6f8fb; border-radius: 8px; color: #4b5b7a; font-size: 12.5px; }
.wh-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),280px)); column-gap:14px; }
.wh-field { display:grid; grid-template-columns:80px minmax(0,1fr); align-items:baseline; gap:8px; padding:5px 0; border-bottom:1px dashed #edf1ef; font-size:13px; }
.wh-field > span { color: var(--muted); }
.wh-field > div { overflow-wrap:anywhere; }
.wh-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.erp-dialog .modalbox { max-width: 100%; }
.wh-editor .wh-customer-block { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wh-editor .wh-customer-block[hidden] { display: none; }
.wh-rec { margin: 0 0 12px; padding: 9px 12px; border: 1px dashed #d9c9a3; border-radius: 8px; background: #fffaf0; font-size: 13px; }
.wh-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; padding: 9px 12px; border-radius: 8px; background: #fff4e5; color: #9a5b12; font-size: 13px; }
.wh-confirm[hidden] { display: none; }
.wh-create-from-customer { margin-left: auto; }
@media (max-width: 980px) { .wh-editor .wh-customer-block { grid-template-columns: 1fr; } }
@media (max-width: 630px) {
  #erpPage .wh-layout.erp-ui-master-page { flex-direction:column; }
  #erpPage .wh-categories .erp-ui-category { flex:1; width:auto; max-height:207px; }
}

/* ERP-4 库存状况 / 单据 */
.inv-body.is-loading, .doc-body.is-loading { opacity: .55; transition: opacity .15s; }
.inv-toolbar select, .doc-toolbar select { max-width: 240px; }
.inv-table { min-width: 1180px; }
.inv-row { cursor: pointer; }
.inv-zero td { color: var(--muted); }
.inv-qty { font-weight: 700; }
.inv-summary, .doc-summary { max-width: 260px; }
.inv-group-overview { margin-bottom: 16px; min-width: 0; }
.inv-group-overview h3 { margin: 0 0 8px; }
.inv-group-overview summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.inv-group-overview .erp-table { min-width: 560px; }
.inv-dir { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.inv-dir-in { background: #eef5f1; color: var(--primary); }
.inv-dir-out { background: #f4f1e8; color: #7a6127; }
.doc-search { flex: 0 1 220px; }
.doc-custom { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.doc-custom.hidden { display: none; }
.doc-table { min-width: 1080px; }
.doc-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.doc-badge-draft { background: #fff4e5; color: #9a5b12; }
.doc-badge-posted { background: #eef5f1; color: var(--primary); }
/* 红冲: clearly different, not loud (red text + faint red background) */
.erp-red-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #fbeceb; color: #b3261e; white-space: nowrap; }
.erp-red-soft { background: #fdf5f4; color: #c0564f; }
.erp-red-text { color: #b3261e; }
.erp-table tr.erp-doc-reversal td { background: #fdf6f5; color: #a8322b; }
.erp-table tr.erp-doc-reversed td { color: #7d8783; }
.doc-detail.is-reversal .modalhead h2 { color: #a8322b; }
.doc-reversal-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: #fdf6f5; color: #a8322b; }
.doc-links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.doc-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 18px; margin-bottom: 14px; }
.doc-field { display: grid; gap: 2px; }
.doc-field span { color: var(--muted); font-size: 12px; }
.doc-field strong { font-weight: 600; font-size: 13.5px; word-break: break-all; }
.doc-lines, .doc-moves { min-width: 760px; }
.doc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.doc-spacer { flex: 1; }
.doc-reason { display: grid; gap: 6px; margin-bottom: 12px; }
.docf-no { font-size: 15px; font-weight: 600; color: #53615c; margin-left: 6px; }
.docf-error { margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; background: #fff4f2; color: #b3261e; border: 1px solid #f3d3cf; }
.docf-leave-dialog { width: min(480px, calc(100vw - 28px)); }
.docf-leave-dialog .modalactions { flex-wrap: wrap; }
.docf-leave-dialog .modalactions button { white-space: normal; }
.docf-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.docf-head label { display: grid; gap: 6px; }
.docf-party-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.docf-party-choice { display: flex; align-items: center; gap: 8px; min-height: 36px; flex-wrap: wrap; }
.docf-party-choice[hidden] { display: none; }
.docf-party-choice strong { overflow-wrap: anywhere; }
.docf-party-choice button:first-of-type { margin-left: auto; }
.docf-wide { grid-column: span 2; }
.docf-lines-panel { padding: 12px; }
.docf-lines { overflow-x: auto; }
.docf-lines .erp-table { min-width: 980px; }
.docf-lines td { vertical-align: top; }
.docf-product { min-width: 260px; }
.docf-lines select { min-width: 90px; max-width: 170px; }
.docf-product input { width: 100%; }
.docf-lookup { min-width: 0; width: 100%; box-sizing: border-box; }
.docf-party-choice .docf-lookup { flex: 1; width: auto; }
.docf-product .docf-lookup { border-color: transparent; background: transparent; }
.docf-product .docf-lookup:focus { border-color: var(--line); background: #fff; }
.docf-results { margin-top: 4px; max-height: 240px; overflow: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 28px rgba(18, 31, 28, .14); padding: 4px; }
.docf-results button { display: block; width: 100%; text-align: left; border: 0; background: transparent; min-height: 32px; padding: 6px 8px; border-radius: 6px; white-space: normal; }
.docf-results button:hover { background: #f1f6f3; }
.docf-noresult { padding: 8px; }
.docf-num { width: 110px; text-align: right; }
.docf-default { color: #53615c; background: #f7faf8; }
.docf-add { margin-top: 10px; }
.docf-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
@media (max-width: 760px) { .docf-wide { grid-column: auto; } .doc-search { flex: 1 1 100%; } }
.erp-link.erp-mono, .inv-dir, .doc-badge { white-space: nowrap; }

/* ERP-5 进货 / 供应商 */
.docf-head label { min-width: 0; }
.docf-head select, .docf-head input { min-width: 0; width: 100%; box-sizing: border-box; }
.docf-head [data-docf-picker], .fin-head [data-fin-account] { min-width: 0; width: 100%; min-height: 36px;
  text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-picker-field { min-width: 0; width: 100%; min-height: 34px; text-align: left; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.erp-inline .erp-picker-field { flex: 1; width: auto; }
.docf-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.docf-foot .docf-add { margin-top: 0; }
.docf-total { display: inline-flex; align-items: baseline; gap: 8px; color: #4b5753; }
.docf-total strong { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.docf-amount { font-weight: 600; }
.docf-note { margin: 8px 2px 0; }
.sup-table { min-width: 980px; }
.sup-remark { max-width: 240px; color: #4b5753; }
.sup-editor { width: min(640px, calc(100vw - 28px)); }

/* ERP-6 销售 */
.docf-effect-box:empty,
.docf-effect.fin-preview:empty,
.docf-effect.fin-transfer-hint:empty { display: none; }
.docf-effect-box { margin: 0 0 14px; }
.docf-effect { padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid #9aa6a2; border-radius: 8px; background: #fbfcfb; line-height: 1.6; }
.docf-effect strong { font-size: 15px; }
.docf-effect small { color: #4b5753; }
.docf-effect-sale { border-left-color: var(--primary); background: #f3f8f5; }
.docf-effect-transfer { border-left-color: #c77800; background: #fdf7ec; }
.docf-effect-transfer strong { color: #8a4b00; }
.docf-effect-error { border-left-color: #b3261e; background: #fdf2f1; }
.docf-effect-error strong { color: #b3261e; }
.doc-detail .docf-effect { margin: 0 0 12px; }
.doc-effect { color: var(--primary); font-weight: 600; }
.doc-effect-transfer { color: #8a4b00; }

/* ---------------- ERP-7 生产模板 / 香型原料映射 / 生产组装单 ---------------- */
.pt-tabs { margin-right: 6px; }
.pt-scent-hint { font-size: 12.5px; }
.pt-empty { display: grid; gap: 12px; justify-items: center; }
.pt-dyn { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #fff6e8; color: #8a4b00; font-size: 12px; }
.pt-fixed { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef5f1; color: var(--primary); font-size: 12px; }
.pt-unlinked { color: #b3261e; font-size: 12.5px; }
.pt-dynamic-text { color: #8a4b00; }
.pt-material { min-width: 240px; }
.pt-material input, .pt-material select { width: 100%; box-sizing: border-box; }
.pt-lines .erp-table { min-width: 860px; }
.pt-lines .erp-actions { white-space: nowrap; }
.pt-lines .docf-num { width: 80px; }
.pt-lines input[data-ptl="note"] { width: 130px; }
.pt-lines td:nth-child(5) { white-space: nowrap; }
.pt-capacity { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pt-link .pt-material { margin: 10px 0; }
.asm-page .erp-section-title { margin: 0 0 10px; }
.asm-page .docf-lines-panel { margin-bottom: 14px; }
.asm-inputs .erp-table, .asm-outputs .erp-table { min-width: 960px; }
.asm-group td { background: #f5f8f6; }
.asm-add-in { margin-left: 10px; }
.asm-unresolved td { background: #fdf2f1; }
.asm-unresolved input.asm-psearch { border-color: #d9534f; }
.asm-reason { color: #b3261e; font-size: 12px; }
.asm-dynamic { margin-bottom: 10px; }
@media (max-width: 720px) {
  .pt-capacity select { width: 100%; }
  .asm-add-in { margin: 6px 0 0; display: block; }
}

/* ---------------- ERP-8 资金账户 / 收付款 / 费用 / 其它收入 / 往来 ---------------- */
.fin-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.fin-badge-customer { background: #eef5f1; color: var(--primary); }
.fin-badge-supplier { background: #eef1f8; color: #34518a; }
.fin-negative { color: #b3261e; font-weight: 600; }
.fin-acc { font-weight: 600; }
.fin-head .fin-modes { display: grid; gap: 6px; }
.fin-party { position: relative; display: grid; gap: 6px; justify-items: start; }
.fin-party input { width: 100%; box-sizing: border-box; }
.fin-party .fin-results, .fin-party .docf-party-choice { width: 100%; }
.fin-amount { width: 100%; box-sizing: border-box; }
.fin-preview strong { color: var(--text); }
.fin-arrow { margin: 0 6px; color: var(--muted); }
.fa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fa-grid .wide { grid-column: 1 / -1; }
.fa-history .erp-table, .pb-statement .erp-table { min-width: 860px; }
@media (max-width: 720px) {
  .fa-grid { grid-template-columns: minmax(0, 1fr); }
  .pb-page .erp-toolbar .erp-segment { flex-wrap: wrap; }
}
.erp-dialog .modalbox.pb-statement, .erp-dialog .modalbox.fa-history { width: min(1180px, calc(100vw - 28px)); }

/* ---------------- ERP-9 套餐设置 / 销售出库单「添加套餐」 ---------------- */
.pk-tabs { margin-right: 6px; }
.pk-scent-hint { font-size: 12.5px; }
.pk-empty { display: grid; gap: 12px; justify-items: center; }
.pk-rec { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #fff4e5; color: #9a5b12; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pk-warn { color: #b3261e; font-size: 12.5px; }
.pk-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; display: inline-grid; place-items: center; background: #f2f4f3; color: var(--muted); font-size: 13px; vertical-align: middle; }
.pk-thumb-cell { width: 52px; }
.pk-table .erp-actions { white-space: nowrap; }
.pk-scents .erp-table, .pk-scents { min-width: 900px; }
.pk-mains { max-width: 360px; }
.pk-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px 6px 0; padding: 2px 4px 2px 8px; border-radius: 999px; background: #eef5f1; font-size: 12.5px; }
.pk-chip-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.pk-cell-actions { display: inline-flex; gap: 4px; margin-left: 6px; }
.pk-head .pk-check { display: flex; align-items: center; gap: 8px; }
.pk-head .pk-check input { width: auto; }
.pk-image-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pk-lines .erp-table { min-width: 880px; }
.pk-lines .erp-actions { white-space: nowrap; }
.pk-lines .docf-num { width: 80px; }
.pk-linked-cfg { display: flex; gap: 6px; margin-bottom: 6px; }
.pk-linked-cfg select { flex: 1; min-width: 0; }
.pk-kind-scent_linked td { background: #fbfaf5; }
.pk-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pk-kind, .docf-kind { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #f2f4f3; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pk-kind-tag-main_product, .docf-kind-main_product { background: #eef5f1; color: var(--primary); }
.pk-kind-tag-scent_linked, .docf-kind-scent_linked { background: #fff6e8; color: #8a4b00; }
.pk-role { font-size: 12px; color: #8a4b00; }
.pk-detail-top { display: flex; gap: 16px; align-items: flex-start; }
.pk-detail-top .doc-fields { flex: 1; }
.pk-detail-img { width: 120px; height: 120px; border-radius: 8px; object-fit: cover; }
.docf-bundle-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; }
.docf-bundle { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #eef1f8; color: #34518a; font-size: 12px; white-space: nowrap; }
.docf-linked-row td.docf-product { padding-left: 22px; }
.docf-row-pending td { background: #fdf2f1; }
.docf-pending { color: #b3261e; font-size: 12px; }
.docf-foot-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.docf-bundle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 12px; max-height: 260px; overflow: auto; }
.docf-bundle-opt { display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border: 1px solid var(--line, #dfe5e2); border-radius: 8px; background: #fff; cursor: pointer; }
.docf-bundle-opt.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(58, 154, 108, .18); }
.docf-bundle-opt img, .docf-bundle-noimg { width: 40px; height: 40px; flex: none; border-radius: 6px; object-fit: cover; display: grid; place-items: center; background: #f2f4f3; color: var(--muted); }
.docf-bundle-name { min-width: 0; }
.docf-bundle-groups { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.docf-bundle-groups input { width: 90px; }
.docf-bundle-preview .erp-table { min-width: 760px; }
@media (max-width: 720px) {
  .pk-detail-top { flex-direction: column; }
  .pk-linked-cfg { flex-direction: column; }
  .docf-bundle-list { grid-template-columns: minmax(0, 1fr); }
}

/* ---- ERP-10: CRM custom project -> ERP automatic drafts ---- */
.doc-badge-auto { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eef2fb; color: #3653a3; white-space: nowrap; }
.int-table td { vertical-align: top; }
.int-info { max-width: 420px; line-height: 1.6; }
.int-warn { color: #9a5b12; }
.int-wh { max-width: 140px; margin-right: 4px; }
.int-reminder { display: grid; gap: 4px; justify-items: start; width: 100%; padding: 12px 14px; text-align: left; border: 1px solid #f3d2a6; border-radius: 10px; background: #fff8ee; color: #7a4a0e; white-space: normal; }
.int-reminder small { color: #9a5b12; }
.custom-erp-panel { margin-top: 18px; padding-top: 12px; border: 0; border-top: 1px solid var(--line); background: transparent; display: block; }
.custom-erp-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.custom-erp-panel > summary::-webkit-details-marker { display: none; }
.custom-erp-panel > summary::after { content: ""; width: 7px; height: 7px; margin-right: 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); flex: 0 0 7px; }
.custom-erp-panel[open] > summary::after { transform: rotate(225deg); }
.custom-erp-panel > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.custom-erp-body { display: grid; gap: 10px; padding-top: 10px; }
.custom-erp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.custom-erp-head h4 { margin: 0; font-size: 15px; }
.custom-erp-template { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.custom-erp-template select { min-width: 220px; max-width: 100%; }
.custom-erp-skus { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.custom-erp-row { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.custom-erp-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.custom-erp-row p { margin: 0; line-height: 1.6; font-size: 13px; }
.custom-erp-status { padding: 1px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: #f2f4f3; color: var(--muted); }
.custom-erp-status.done { background: #eef5f1; color: var(--primary); }
.custom-erp-status.danger { background: #fdecec; color: #b42318; }
.custom-erp-status.warn, .custom-erp-status.pending { background: #fff4e5; color: #9a5b12; }
.custom-erp-message { color: #b42318; }
.custom-erp-warning { color: #9a5b12; }
.custom-erp-note { color: var(--muted); }
@media (max-width: 720px) {
  .custom-erp-template select { min-width: 0; width: 100%; }
}
/* ERP-10-R1: settlement-customer backfill in the CRM custom-project ERP 草稿 panel */
.custom-erp-customer { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.custom-erp-customer p { margin: 0; line-height: 1.6; font-size: 13px; }
.custom-erp-customer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.custom-erp-customer-head strong { color: var(--text, #1f2937); }
.custom-erp-missing { color: #9a5b12 !important; }
.custom-erp-customer-edit { display: grid; gap: 6px; }
.custom-erp-customer-edit input[type="search"] { max-width: 420px; width: 100%; }

/* ERP-11 报表 */
.rep-toolbar .rep-custom:not(.hidden) { display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; }
.rep-toolbar .rep-custom :is(.smart-date-wrap,input[data-rep-f]) { width:142px; }
.rep-period { font-size: 12.5px; }
.rep-export { font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); text-decoration: none; background: #fff; white-space: nowrap; }
.rep-export:hover { border-color: var(--primary); color: var(--primary); }
.rep-body.is-loading { opacity: .55; transition: opacity .15s; }
.rep-cards { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.rep-card { display: grid; align-content: start; gap: 3px; padding: 6px 9px; background: #fff; border: 1px solid var(--line); border-radius: 2px; min-width: 124px; max-width: min(100%, 255px); }
.rep-card span { color: var(--muted); font-size: 12.5px; }
.rep-card strong { font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-card small { color: var(--muted); font-size: 12px; }
.rep-card-main { border-color: #cfe3d8; background: #fbfdfc; }
.rep-card-main strong { color: var(--primary); }
.rep-neg { color: #b42318 !important; }
.rep-h { margin: 12px 0 5px; font-size: 15px; }
.rep-h small { font-weight: 400; font-size: 12px; }
.rep-table { width: max-content; min-width: 760px; }
.rep-table td.rep-rank { font-weight: 700; width: 48px; }
.rep-empty { padding: 12px; text-align: center; }
.rep-notes { margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.rep-section { margin-bottom: 14px; }
.rep-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rep-section-head h3 { margin: 0 0 6px; font-size: 16px; }
.rep-sub { margin: 14px 0 8px; font-size: 13.5px; color: #33413d; }
.rep-current { border-color: #d7e2f2; background: #fcfdff; }
.rep-now { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #eef1f7; color: #3f557f; font-size: 12px; font-weight: 600; }
.rep-current-note { margin: 4px 0 8px; padding: 8px 10px; border-radius: 8px; background: #f4f6fb; color: #3f557f; font-size: 12.5px; line-height: 1.6; }
.rep-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 10px; }
.rep-two .rep-table { min-width: 0; }
.rep-disclaimer { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #fff7eb; color: #7a5212; font-size: 13px; line-height: 1.6; }
.rep-statement { min-width: 560px; }
.rep-statement tr.rep-total td { font-weight: 600; }
.rep-statement tr.rep-profit td { background: #f3f9f5; font-size: 15px; }
.rep-cum-note { margin: 8px 0 0; font-size: 12.5px; }
@media (max-width: 720px) {
  .rep-toolbar { gap: 8px; }
  .rep-toolbar .erp-segment { flex-wrap: wrap; }
  .rep-toolbar select, .rep-toolbar .doc-search { flex: 1 1 140px; min-width: 0; }
  .rep-card strong { font-size: 16px; }
  .rep-two { grid-template-columns: 1fr; }
}
.rep-table.rep-small { min-width: 0; }
.rep-table td { white-space: nowrap; }
.rep-body > .erp-tablewrap { width:fit-content; max-width:100%; }
#erpPage :is(.sup-table,.pt-table,.pk-table,.stk-table,.scent-results .erp-table,.hq-results .erp-table,.fa-history .erp-table) { width:max-content; }
#erpPage .erp-tablewrap:has(> :is(.sup-table,.pt-table,.pk-table,.stk-table)),
#erpPage :is(.scent-results,.hq-results,.fa-history) .erp-tablewrap { width:fit-content; max-width:100%; }
.rep-body .erp-tablewrap:has(.rep-customer-ranking) { max-height:65vh; overflow:auto; }
.rep-customer-ranking thead { position:sticky; top:0; z-index:2; }
.rep-customer-ranking tfoot { position:sticky; bottom:0; z-index:1; }
#erpPage .rep-customer-ranking tfoot :is(th,td) { background:var(--erp-ui-subtotal, #fffbe4); color:var(--erp-ui-text, #25465d); font-weight:600; border-top:1px solid #d9d8c3; }
#erpPage .rep-customer-ranking tfoot td:nth-child(5) { font-weight:700; color:#175f97; }
.rep-statement td { white-space: normal; }

/* ---- ERP-16 老板表 / 利润表: 管家婆式科目表 (display only) ---- */
.rep-gjp .erp-page-head { margin-bottom: 6px; align-items: center; }
.rep-gjp .erp-page-head h2 { font-size: 17px; margin: 0; }
.rep-gjp .erp-page-head p { font-size: 12px; }
.rep-gjp .rep-export { border-radius: 2px; padding: 4px 12px; }
.rep-gjp .rep-toolbar { gap: 8px; margin-bottom: 6px; padding: 5px 8px; border: 1px solid #c9d6e6; background: #f4f7fb; }
.rep-gjp .rep-period { color: #1f3b63; font-size: 13.5px; font-weight: 600; margin-right: 6px; }
.rep-gjp .erp-segment { padding: 0; border-radius: 2px; border-color: #b9c8db; }
.rep-gjp .erp-segment button { min-height: 26px; padding: 2px 10px; border-radius: 0; font-size: 13px; border-right: 1px solid #d5dfeb; }
.rep-gjp .erp-segment button:last-child { border-right: 0; }
.rep-gjp .erp-segment button.active { background: #2f6db5; color: #fff; }
.rep-gjp .rep-custom input { height: 28px; border-radius: 2px; }
.rep-gjp .rep-disclaimer { margin: 0 0 6px; padding: 5px 10px; border-radius: 0; border: 1px solid #ecd9b0; font-size: 12.5px; }
.rep-gjp .rep-empty { padding: 10px; }
.gjp-wrap { overflow-x: auto; border: 1px solid #b9c8db; background: #fff; margin-bottom: 8px; }
.gjp-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.gjp-table th { height: 34px; padding: 4px 10px; background: #2f6db5; color: #fff; font-weight: 600; text-align: left; border: 1px solid #285f9e; line-height: 1.3; }
.gjp-table td { height: 36px; padding: 0 10px; border: 1px solid #dde3ea; vertical-align: middle; }
.gjp-table tbody tr:hover td { background: #f3f8fd; }
.gjp-table th.gjp-code { width: 92px; }
.gjp-table th.gjp-amt { width: 260px; text-align: right; }
.gjp-table th.gjp-desc { width: 280px; }
.gjp-table td.gjp-code { font-family: Consolas, "Courier New", monospace; color: #3d4f66; }
.gjp-table td.gjp-amt { text-align: right; font-family: Consolas, "Segoe UI", monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gjp-table td.gjp-desc { color: #56657a; font-size: 13px; }
.gjp-table .gjp-hint { display: block; color: #6b7a8c; font-size: 12px; line-height: 1.3; }
.gjp-table tr.gjp-l0 td { background: #fff8dc; font-weight: 700; color: #1f2d3d; }
.gjp-table tr.gjp-l1 td.gjp-name { padding-left: 26px; }
.gjp-table tr.gjp-l2 td.gjp-name { padding-left: 46px; color: #33475f; }
.gjp-table tr.gjp-key td { font-weight: 600; }
.gjp-table tr.gjp-profit td { background: #e6f0fb; font-weight: 700; font-size: 15px; border-top: 2px solid #2f6db5; }
.gjp-table tr.gjp-note-row td { height: 30px; background: #f4f7fb; color: #1f3b63; font-size: 12.5px; }
.gjp-current { border-color: #9fb4cf; }
.gjp-current tr.gjp-l0 td { background: #eef3fa; }
.rep-gjp .rep-notes { margin-top: 6px; }

/* ---- ERP-18 生产模板两层 ---- */
.pt-locked { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #fff3e0; color: #9a5b00; font-size: 12px; font-weight: 600; }
.pt-lock-note { padding: 6px 10px; border-left: 3px solid #e6a23c; background: #fffaf2; }
.pt-producible { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: #eef3fa; color: #2f5d94; font-size: 12px; }
.pt-structure-table tr.pt-s2 td { background: #fafbfc; color: #4b5b6e; font-size: 12.5px; }
.pt-structure-table .pt-s2-mark { color: var(--muted); margin-left: 14px; }
.pt-structure-table tfoot td { font-weight: 600; background: #f6f8f7; }
.pt-bound { display: inline-flex; align-items: center; gap: 4px; margin: 0 10px 4px 0; }
.pt-bind { position: relative; margin: 8px 0; display: grid; gap: 4px; }

/* ---- ADR-V110-006 盘点单 ---- */
.stk-head { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 10px 14px; font-size: 13.5px; }
.stk-head b { margin-right: 6px; color: var(--muted); font-weight: 600; }
.stk-head input { height: 30px; }
.stk-head .stk-wide { flex: 1 1 320px; display: flex; align-items: center; }
.stk-head .stk-wide input { flex: 1; }
.stk-toolbar { gap: 12px; }
.stk-add { position: relative; flex: 1 1 320px; }
.stk-add .stk-psearch { width: 100%; }
.stk-lines { min-width: 980px; font-size: 13.5px; }
.stk-lines td { padding-top: 5px; padding-bottom: 5px; }
.stk-lines input.stk-qty, .stk-lines input.stk-cost { width: 110px; text-align: right; }
.stk-lines tr.stk-gain td.stk-diff, .stk-lines tr.stk-gain td.stk-kind { color: #1f6f43; font-weight: 600; }
.stk-lines tr.stk-loss td.stk-diff, .stk-lines tr.stk-loss td.stk-kind { color: #b42318; font-weight: 600; }
.stk-lines tr.stk-uncounted td.stk-kind { color: var(--muted); }
.stk-doc { white-space: nowrap; }
.stk-scope { border: 0; padding: 0; margin: 4px 0; display: grid; gap: 4px; }
.stk-form > label { display: grid; gap: 4px; margin-bottom: 10px; }

/* ---- ERP-12 期初初始化 ---- */
.op-page { display: grid; gap: 14px; }
.op-page .erp-page-head { margin-bottom: 0; }
.op-scope { margin: 0; padding: 10px 12px; border-radius: 8px; background: #f4f7f5; color: #3b4a45; font-size: 13px; line-height: 1.6; }
.op-state { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #eef1f0; color: #4a5753; }
.op-state-uploaded { background: #fff4e5; color: #8a5a12; }
.op-state-validated, .op-state-ready { background: #e8f3ee; color: var(--primary); }
.op-state-opened { background: #e6eefb; color: #2f4f86; }
.op-cutover { font-size: 13px; color: var(--muted); }
.op-step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.op-step-head h3 { margin: 0; font-size: 15px; }
.op-step-no { color: var(--primary); font-size: 16px; font-weight: 700; }
.op-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.7; }
.op-ready { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.op-ready-item { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.op-ready-item div { display: grid; gap: 2px; min-width: 0; }
.op-ready-item strong { font-size: 13px; }
.op-ready-item .erp-num { font-size: 18px; font-weight: 700; }
.op-ready-item small, .op-ready-item em { color: var(--muted); font-size: 12px; font-style: normal; }
.op-ready-item.missing { border-color: #f1d3a8; background: #fffaf2; }
.op-ready-item.missing em { color: #8a5a12; }
.op-ready-mark { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #e8f3ee; color: var(--primary); }
.op-ready-item.missing .op-ready-mark { background: #fbe7c8; color: #8a5a12; }
.op-ready-item.hint .op-ready-mark { background: #eef1f0; color: var(--muted); }
.op-upload { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.op-field { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.op-field input { min-height: 36px; }
.op-file input { max-width: 100%; }
.op-file-info { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #f7f9f8; font-size: 12.5px; color: #3b4a45; overflow-wrap: anywhere; }
.op-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.op-template { display: inline-block; margin-top: 10px; }
.op-alert { margin: 8px 0; padding: 9px 12px; border-radius: 8px; background: #fdecec; color: #9b1c1c; font-size: 13px; line-height: 1.6; }
.op-ok { margin: 8px 0; padding: 9px 12px; border-radius: 8px; background: #edf7f1; color: var(--primary); font-size: 13px; }
.op-wait { margin: 0; padding: 9px 12px; border-radius: 8px; background: #f4f6fb; color: #3f557f; font-size: 13px; }
.op-issues-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; }
.op-count-error b { color: #b42318; }
.op-count-warn b { color: #8a5a12; }
.op-issues { margin: 6px 0 12px; padding: 0 0 0 18px; max-height: 280px; overflow: auto; font-size: 12.5px; line-height: 1.8; }
.op-issues.errors li { color: #9b1c1c; }
.op-issues.warnings li { color: #7a5212; }
.op-tabs { margin: 8px 0; }
.op-table { min-width: 640px; }
.op-table td { white-space: nowrap; }
.op-commit p { margin: 0 0 12px; font-size: 13px; line-height: 1.7; }
.op-danger { background: #fff; color: #b42318; border: 1px solid #e3a3a0; border-radius: 8px; padding: 8px 16px; font-weight: 600; cursor: pointer; }
.op-danger:hover:not(:disabled) { background: #fdf1f0; border-color: #b42318; }
.op-danger:disabled { opacity: .5; cursor: not-allowed; }
.op-confirm { max-width: 520px; }
.op-confirm-warn { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: #fff4e5; color: #7a4a0c; font-size: 13px; line-height: 1.6; }
.op-confirm-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 13px; }
.op-confirm-grid span { color: var(--muted); }
.op-confirm-grid strong { font-weight: 600; overflow-wrap: anywhere; }
.op-done { margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; background: #e6eefb; color: #2f4f86; font-weight: 700; }
.op-result-grid { grid-template-columns: max-content 1fr max-content 1fr; }
@media (max-width: 720px) {
  .op-upload { flex-direction: column; align-items: stretch; }
  .op-result-grid { grid-template-columns: max-content 1fr; }
  .op-ready { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.op-upload button { min-height: 36px; padding: 6px 16px; font-size: 14px; }
.op-page { grid-template-columns: minmax(0, 1fr); }
.op-page > * { min-width: 0; }
.op-tabs { flex-wrap: wrap; max-width: 100%; }

/* ERP financial UAT: predictable document navigation and an editable paper-like grid. */
.docf-lines { max-height:420px; overflow:auto; scrollbar-gutter:stable; }
.docf-lines thead { position:sticky; top:0; z-index:2; background:#edf2ef; }
.docf-lines tbody tr { height:45px; }
.docf-lines input, .docf-lines select, .asm-page input, .fin-page input { border:1px solid #aabbb0; background:#fff; border-radius:3px; min-height:30px; }
.docf-lines input:focus, .fin-page input:focus, .asm-page input:focus { outline:2px solid #3e8060; outline-offset:1px; }
.docf-lines input:disabled, .docf-lines select:disabled, .fin-page input:disabled { background:#edf0ee; border-color:#d7ddd9; color:#7a857e; cursor:not-allowed; }
.docf-lines input[readonly], .fin-page input[readonly] { background:#f4f6f4; border-style:dashed; color:#526158; }
.docf-lines button[data-docf-source], .docf-lines input[data-lf="refund_price_reason"] { font-size:12px; }
.master-picker-dialog.master-picker-compact { width:min(920px, calc(100vw - 40px)); max-width:920px; height:min(580px, calc(100vh - 60px)); max-height:calc(100vh - 60px); }
.master-picker-compact .master-picker-shell { height:100%; min-height:0; }
.master-picker-compact .master-picker-table-wrap { min-height:140px; flex:1; overflow:auto; }
.master-picker-compact td, .master-picker-compact th { padding:6px 8px; font-size:13px; }
.master-picker-compact tr.is-already-selected { background:#e8f3ec; color:#35634a; }
.master-picker-compact tr.is-already-selected td:first-child::before { content:"✓ "; }

.docf-lines .docf-product .docf-lookup { border:1px solid #aabbb0; background:#fff; }
.docf-lines .erp-table td { padding:5px 6px; }
.master-picker-dialog.master-picker-compact { width:min(820px, calc(100vw - 40px)); height:min(460px, calc(100vh - 80px)); }

/* Entry canvas: only the header fields and detail grid scroll; totals/actions stay outside. */
.erp-entry-active { height:var(--erp-entry-height); display:flex; flex-direction:column; min-height:440px; }
.erp-entry-active > .erp-header { flex:none; padding:7px 12px; margin-bottom:6px; }
.erp-entry-active > .erp-workspace-bar { flex:none; }
.erp-entry-active > .erp-content { flex:1; min-height:0; }
.erp-entry-active .erp-workspace-panel:not([hidden]) { height:100%; min-height:0; }
.erp-entry-active .docf-page { height:100%; min-height:0; display:flex; flex-direction:column; gap:7px; }
.erp-entry-active .docf-page > * { flex:none; margin:0; }
.erp-entry-active .docf-page > .docf-lines-panel { flex:1; min-height:0; display:flex; flex-direction:column; padding:8px; }
.erp-entry-active .docf-page .docf-lines { flex:1; min-height:100px; max-height:370px; scroll-padding-top:40px; }
.erp-entry-active .docf-page .docf-head { max-height:130px; overflow:auto; scrollbar-gutter:stable; }
.erp-entry-active .docf-page:has(.docf-effect-box:not(:empty)) .docf-head { max-height:95px; }
.erp-entry-active .docf-effect { padding:7px 10px; margin:0; font-size:12px; }
.erp-entry-active .docf-effect-box { max-height:54px; overflow:auto; }
.docf-lines .erp-lookup-control { scroll-margin-top:40px; }
.erp-entry-active .docf-head { gap:7px 12px; padding:9px 12px; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); }
.erp-entry-active .docf-head label, .erp-entry-active .docf-party-field { gap:3px; }
.erp-entry-active .erp-page-head { margin-bottom:0; align-items:center; }
.erp-entry-active .erp-page-head h2 { font-size:17px; margin:0; }
.erp-entry-help { font-size:12px; color:var(--muted); }
.erp-entry-help summary { cursor:pointer; width:fit-content; }
.erp-entry-help[open] { max-width:700px; }
.erp-entry-help p { margin-top:4px; }
.erp-entry-active .docf-actions { background:#fff; padding:8px 10px; border:1px solid var(--line); border-radius:8px; flex-wrap:wrap; }
.erp-entry-active .docf-note, .erp-entry-active .docf-foot { margin-top:6px; font-size:12px; }
.erp-entry-active .docf-total small { display:none; }
.erp-entry-active .docf-error { max-height:80px; overflow:auto; }
.erp-entry-active .fin-page { max-height:100%; display:flex; flex-direction:column; gap:10px; overflow:auto; }
.erp-entry-active .fin-page .docf-actions { margin-top:auto; position:sticky; bottom:0; z-index:3; }
.erp-lookup-control { display:flex; align-items:stretch; width:100%; min-width:0; gap:0; }
.erp-lookup-control > input.docf-lookup { flex:1; min-width:0; width:0; border-radius:5px 0 0 5px; }
.erp-lookup-control > button { flex:none; min-height:32px; padding:3px 8px; border:1px solid #9eb4a7; border-left:0; border-radius:0 5px 5px 0; color:var(--primary); background:#f1f6f3; }
.erp-lookup-control:has(> .form-field-error) { flex-wrap:wrap; }
.erp-lookup-control > .form-field-error { flex-basis:100%; order:3; }
.docf-party-choice > .erp-lookup-control { flex:1; }
.docf-head button[data-docf-picker], .fin-head button[data-fin-account], .erp-picker-field { display:flex; align-items:center; gap:8px; justify-content:space-between; border-color:#9eb4a7; }
.docf-head button[data-docf-picker]::after, .fin-head button[data-fin-account]::after, .erp-picker-field::after { content:'⌄'; color:#526c5c; flex:none; }
.erp-workspace-panel > .doc-detail, .erp-workspace-panel > .fa-history { padding:12px 16px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.fa-history-scroll { max-height:55vh; }
.doc-table tr[data-document-row]:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
@media(max-width:760px) {
  .erp-entry-active .docf-head { grid-template-columns:repeat(2,minmax(0,1fr)); max-height:130px; }
  .erp-entry-active .erp-head-actions { gap:4px; }
  .erp-entry-active .erp-page-head { gap:6px; flex-wrap:wrap; }
  .erp-entry-active .docf-actions { gap:5px; padding:6px; }
  .erp-entry-active .docf-actions button { padding:6px 9px; }
  .erp-entry-active .docf-foot { gap:4px; }
}
/* Local DEV book identity stays outside all mounted business tabs. */
.dev-book-select{display:flex;gap:8px;align-items:center;font-weight:600}
.dev-book-select select{max-width:min(360px,80vw);min-height:34px;background:white;color:#214b3e}
.dev-parallel-warning{padding:6px 10px;border:1px solid #b87d20;border-radius:5px;color:#754a00;background:#fff8df}
/* DEV source mirror inside the existing document workspace. */
.source-doc-stats{display:flex;gap:12px;flex-wrap:wrap;margin:10px 0}.source-doc-stats>div{padding:8px 13px;background:#f0f5f2;border:1px solid #dae5de;border-radius:6px;min-width:95px}.source-doc-stats span{display:block;font-size:12px;color:#53675b}.source-doc-stats strong{font-size:22px}.source-doc-comparison{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}.source-doc-comparison article{min-width:0;border:1px solid #d7e3db;padding:12px;border-radius:6px}.source-doc-comparison dl{display:grid;grid-template-columns:120px minmax(0,1fr);gap:5px}.source-doc-comparison dd{margin:0;overflow-wrap:anywhere}.source-raw{white-space:pre-wrap;overflow-wrap:anywhere;max-height:55vh;overflow:auto;background:#f6f8f6;padding:10px}.source-center tr[data-source-row]{cursor:pointer}.source-center tr[data-source-row]:focus{outline:2px solid #36624c}@media(max-width:1000px){.source-doc-comparison{grid-template-columns:1fr}}

/* 2026-11-05: familiar GJP blue, sampled from the user's reference (#2881c7).
 * ERP surface + ERP-owned dialogs only. Status, danger and financial semantics stay independent. */
#erpPage, .erp-dialog, body:has(#erpPage:not(.hidden)) .master-picker-dialog {
  --primary:#2881c7; --primary-dark:#1d6eaf; --line:#dbe3eb;
  --text:#213547; --muted:#607184; --bg:#f5f7fa;
  --erp-blue-soft:#e3f3ff; --erp-blue-hover:#f0f7fd;
  accent-color:var(--primary); color:var(--text);
}
body[data-erp-prefix] { background:#f5f7fa; }
#erpPage { background:var(--bg); }
body[data-erp-prefix] .dev-erp-banner a, .dev-book-select select { color:#185c92; }
#erpPage .erp-header { background:var(--primary); border-color:var(--primary); border-radius:0; color:#fff; }
#erpPage .erp-title { color:#fff; }
body[data-erp-runtime="unified-v1"] > .erp-runtime-header[hidden],
body[data-erp-prefix="/dev-erp-workspace"] > .dev-erp-banner[hidden] { display:none; }
.erp-workspace-context {
  display:flex; flex:none; align-items:center; flex-wrap:wrap; gap:4px 10px;
  margin-inline-start:auto; font-size:13px; white-space:nowrap;
}
.erp-workspace-context a { color:inherit; text-underline-offset:3px; }
.erp-workspace-context #unifiedOpening:empty { display:none; }
.erp-workspace-context :is(.dev-book-select select,.dev-parallel-warning) { min-height:24px; padding:2px 6px; font-size:12px; }
.erp-workspace-context .dev-book-select select { max-width: min(180px, 35vw); }
@media (max-width:1100px) {
  #erpPage .erp-header:has(> .erp-workspace-context) { column-gap:10px; }
  #erpPage .erp-header:has(> .erp-workspace-context) .erp-topnav { gap:2px; }
  #erpPage .erp-header:has(> .erp-workspace-context) .erp-topnav-item { padding-inline:5px; }
  .erp-workspace-context .dev-book-select select { max-width:min(124px, 35vw); }
}
@media (max-width:860px) {
  #erpPage .erp-header:has(> .erp-workspace-context) { flex-wrap:wrap; gap:4px 10px; }
  .erp-workspace-context { max-width:100%; }
}
#erpPage .erp-badge { background:#1d6eaf; color:#fff; }
#erpPage .erp-topnav-item { background:transparent; color:#fff; }
#erpPage .erp-topnav-item:hover, #erpPage .erp-topnav-item.active,
#erpPage .erp-topnav-group.open > .erp-topnav-item { background:var(--primary-dark); color:#fff; }
#erpPage .erp-menu { border-color:#bdd4e6; border-radius:3px; }
#erpPage .erp-menu-link { color:var(--text); }
#erpPage .erp-menu-link:hover:not(:disabled), #erpPage .erp-menu-link.active { background:var(--erp-blue-soft); color:#1765a3; }
#erpPage .erp-menu-link:disabled { color:#93a0ad; }
#erpPage .erp-menu-branch { position:relative; }
#erpPage .erp-menu-branch > summary { display:flex; cursor:pointer; align-items:center; list-style:none; }
#erpPage .erp-menu-branch > summary::-webkit-details-marker { display:none; }
#erpPage .erp-menu-children {
  position:absolute; top:0; left:100%; min-width:136px; padding:4px; z-index:2;
  background:white; border:1px solid #bdd4e6; border-radius:3px; box-shadow:0 4px 14px #24385026;
}
#erpPage .erp-menu-children button { white-space:nowrap; }
#erpPage .pb-adjust-menu > summary { border:1px solid var(--line); border-radius:3px; gap:6px; }
#erpPage .pb-adjust-menu .erp-menu-children { top:auto; left:0; bottom:100%; }
#erpPage .erp-workspace-bar { background:#f2f2f2; border-color:#d7dfe6; }
#erpPage .erp-workspace-tab { background:#eee; border-color:#d7dfe6; border-radius:0; }
#erpPage .erp-workspace-tab [role=tab] { color:#425466; }
#erpPage .erp-workspace-tab.active { background:#e1f3ff; border-color:#bdd7e9; box-shadow:inset 0 -2px var(--primary); }
#erpPage .erp-workspace-tab.active [role=tab] { color:#1675be; }
#erpPage .erp-tab-close:hover { background:#d2eafb; color:#1765a3; }
#erpPage table thead th, .erp-dialog table thead th { background:var(--primary); color:#fff; border-color:#5a9dd0; }
#erpPage .erp-tablewrap, #erpPage .gjp-wrap, .erp-dialog .erp-tablewrap { border-color:#c9d8e4; border-radius:2px; }
#erpPage .erp-table tbody tr:hover, .erp-dialog .erp-table tbody tr:hover { background:var(--erp-blue-hover); }
#erpPage .gjp-table tr.gjp-profit td { border-top-color:var(--primary); background:#e6f2fc; }
#erpPage .rep-gjp .rep-toolbar { background:#f4f8fc; border-color:#c9dced; }
#erpPage .rep-gjp .rep-period { color:#20577f; }
#erpPage .erp-segment button.active { background:var(--erp-blue-soft); color:#1765a3; }
#erpPage .erp-shortcut { background:#fbfcfe; }
#erpPage .erp-shortcut:not(:disabled):hover { background:var(--erp-blue-hover); border-color:#9fc5e1; }
#erpPage .erp-notice-mark, #erpPage .rep-card-main { background:#f0f7fd; border-color:#c9dced; }
#erpPage .wh-row:hover { background:var(--erp-blue-hover); }
#erpPage .wh-row.selected { background:var(--erp-blue-soft); box-shadow:inset 3px 0 0 var(--primary); }
#erpPage .wh-icon-warehouse { background:#e6f3fc; box-shadow:inset 0 0 0 1.5px #91bbda; }
#erpPage .wh-type-company, #erpPage .erp-cat-regular_finished_goods { background:#eaf4fc; }
#erpPage .source-doc-stats > div, #erpPage .source-raw { background:#f2f7fc; border-color:#d3e1ed; }
#erpPage .source-doc-stats span { color:#587187; }
#erpPage .source-doc-comparison article { border-color:#d3e1ed; }
#erpPage .source-center tr[data-source-row]:focus { outline-color:var(--primary); }
#erpPage .erp-lookup-control > button { background:#f1f7fc; border-color:#aac9df; }
#erpPage .erp-picker-field, #erpPage .docf-head button[data-docf-picker], #erpPage .fin-head button[data-fin-account] { border-color:#aac9df; }
.erp-dialog .modalhead { background:var(--primary); color:#fff; padding:12px; border-radius:3px; }
.erp-dialog .modalhead h2 { color:inherit; }
.erp-dialog.rep-date-dialog .modalhead { padding:16px 18px; border-radius:0; }
.erp-dialog .doc-detail.is-reversal .modalhead { background:#fff0ee; color:#a8322b; }
body:has(#erpPage:not(.hidden)) .master-picker-shell header { background:var(--primary); color:#fff; border-color:var(--primary); }
body:has(#erpPage:not(.hidden)) .master-picker-shell header h2 { color:inherit; }
body:has(#erpPage:not(.hidden)) .master-picker-table-wrap th { background:var(--primary); color:#fff; }
body:has(#erpPage:not(.hidden)) .master-picker-table-wrap tbody tr:hover { background:var(--erp-blue-hover); }
body:has(#erpPage:not(.hidden)) .master-picker-table-wrap tbody tr[aria-selected="true"] { background:var(--erp-blue-soft); outline-color:#8bbbe0; }
#erpPage :is(input,select,textarea):focus:not(.erp-invalid):not([aria-invalid=true]),
.erp-dialog :is(input,select,textarea):focus:not(.erp-invalid):not([aria-invalid=true]) { border-color:var(--primary); outline:2px solid #a4cfee; outline-offset:1px; }
/* Completion/inbound badges remain green; red/amber exceptions are never repainted as navigation. */
#erpPage .doc-badge-posted, #erpPage .erp-flooring-completed, #erpPage .inv-dir-in { color:#276546; }

/* ERP-UI-001: shared list/query/grid primitives, based on the accepted inventory view.
   Never use these selectors to restyle CRM/CUSTOM or to hide permission/status errors. */
#erpPage {
  --erp-ui-header:#2881c7; --erp-ui-border:#d4dce3; --erp-ui-cell:#e3e8ed;
  --erp-ui-hover:#edf7fc; --erp-ui-selected:#fffbe4; --erp-ui-stripe:#f8f8f8;
  --erp-ui-text:#263746; --erp-ui-subtotal:#fffce5;
}
/* ERP master data: category/identity sidebar uses existing filters, never new master records. */
#erpPage .erp-ui-master-page { display:flex; max-height:max(490px,calc(100dvh - 195px)); border:1px solid #d4dce3; background:#fff; color:#263746; }
#erpPage .erp-ui-master-page [hidden] { display:none !important; }
#erpPage .erp-ui-master-page :is(button,input,select) { border-radius:2px; min-height:30px; padding:4px 8px; font-size:13px; }
#erpPage .erp-ui-category { flex:0 0 234px; width:234px; overflow:auto; background:#fff; display:flex; flex-direction:column; }
#erpPage .erp-ui-category h2 { font-size:14px; font-weight:400; padding:9px 8px 0; margin:0; }
#erpPage .erp-ui-category form { display:flex; gap:5px; padding:7px 5px; }
#erpPage .erp-ui-category input { flex:1; width:0; min-width:0; }
#erpPage .erp-ui-category-tree { display:block; flex:1; border:1px solid #d4dce3; margin:0 5px; padding:0; }
#erpPage .erp-ui-category-root { display:flex; align-items:center; background:#fff0e0; color:#e77d00; }
#erpPage .erp-ui-category-tree button { border:0; border-radius:0; background:transparent; text-align:left; color:inherit; font-weight:400; }
#erpPage .erp-ui-category-root [data-ui-tree-toggle] { flex:none; min-width:23px; padding:4px; }
#erpPage .erp-ui-category-root [data-ui-category] { flex:1; display:block; padding-left:0; }
#erpPage [data-ui-category-children] button { display:block; width:100%; padding:7px 10px 7px 40px; }
#erpPage .erp-ui-category-tree button:hover { background:#fff0e0; color:#d97905; }
#erpPage .erp-ui-category-tree [data-ui-category][aria-pressed=true] { background:#dff4fc; color:#175877; }
#erpPage .erp-ui-category-root.selected { background:#dff4fc; color:#175877; }
#erpPage .erp-ui-category-note { padding:8px 12px; color:#7c8995; font-size:11px; line-height:1.5; }
#erpPage .erp-ui-category-toggle { flex:0 0 12px; min-width:12px; width:12px; padding:0; border:0; border-left:1px solid #d4dce3; border-right:1px solid #d4dce3; color:#fff; background:linear-gradient(to bottom,#f5f8fa 42%,#2881c7 42%,#2881c7 56%,#f5f8fa 56%); }
#erpPage .erp-ui-category-closed .erp-ui-category { display:none; }
#erpPage .erp-ui-master-main { flex:1; min-width:0; display:flex; flex-direction:column; padding:7px; overflow:hidden; }
#erpPage .erp-ui-master-heading { flex:none; }
#erpPage .erp-ui-master-heading h2 { font-size:14px; font-weight:400; }
#erpPage .erp-ui-master-current { flex:none; padding:0 0 7px; font-size:13px; }
#erpPage .erp-ui-master-query .erp-toolbar { display:flex; flex-wrap:wrap; }
#erpPage .erp-ui-master-page .erp-search { width:270px; min-width:150px; flex:0 1 270px; }
#erpPage .erp-ui-master-page .erp-segment { border-radius:2px; }
#erpPage .erp-ui-master-page .erp-segment button { font-weight:400; }
#erpPage .erp-ui-master-page .erp-segment .active { color:#126cb0; background:#e1f3ff; }
#erpPage .erp-ui-master-page .erp-ui-pager { margin:0; padding:5px; }
#erpPage .erp-ui-master-page .erp-name .erp-link, #erpPage .erp-ui-master-page .erp-ui-table .erp-link { color:inherit; font-weight:400; padding:0; min-height:0; }
#erpPage .erp-ui-master-empty-action { flex:none; padding:5px; }
@media(max-width:1000px) { #erpPage .erp-ui-category { width:185px; flex-basis:185px; } }
@media(max-width:650px) { #erpPage .erp-ui-category { width:150px; flex-basis:150px; } #erpPage .erp-ui-master-page { max-height:none; } #erpPage .erp-ui-master-page .erp-ui-grid-scroll { max-height:420px; } }
/* Existing ERP modules inherit the same basics without replacing their layouts or controls.
   Inventory and statement grids retain their individually accepted sizing. */
#erpPage .erp-workspace .erp-panel { border-radius:2px; border-color:var(--erp-ui-border); }
#erpPage .erp-workspace .erp-toolbar :is(button,input,select) { border-radius:2px; }
#erpPage .erp-workspace .erp-table:not(.inv-table):not(.rep-statement-table):not(.erp-ui-table) { border-collapse:separate; border-spacing:0; }
#erpPage .erp-workspace .erp-table:not(:where(.inv-table,.rep-statement-table,.erp-ui-table)) :is(th,td) { font-size:13px; padding:5px 8px; height:32px; border-right:1px solid var(--erp-ui-cell); border-bottom:1px solid var(--erp-ui-cell); }
#erpPage .erp-workspace .erp-table:not(.inv-table):not(.rep-statement-table):not(.erp-ui-table) th { font-weight:400; }
#erpPage .erp-workspace .erp-table:not(.inv-table):not(.rep-statement-table):not(.erp-ui-table) tbody tr:nth-child(even) { background:var(--erp-ui-stripe); }
#erpPage .erp-workspace .erp-table:not(.inv-table):not(.rep-statement-table):not(.erp-ui-table) tbody tr:hover { background:var(--erp-ui-hover); }
#erpPage .erp-ui-list-page { display:flex; flex-direction:column; max-height:max(490px,calc(100dvh - 195px)); padding:7px; border:1px solid var(--erp-ui-border); background:#fff; color:var(--erp-ui-text); }
#erpPage .erp-ui-list-page [hidden] { display:none !important; }
#erpPage .erp-ui-list-page :is(button,input,select) { border-radius:2px; font-size:13px; min-height:30px; padding:4px 8px; }
#erpPage .erp-ui-head { flex:none; align-items:center; gap:10px; margin:0 0 7px; }
#erpPage .erp-ui-head h2 { margin:0; font-size:14px; font-weight:400; }
#erpPage .erp-ui-head .erp-head-actions { margin-left:auto; gap:7px; flex-wrap:wrap; }
#erpPage .erp-ui-help { flex:none; font-size:12px; line-height:1.6; color:#687f91; margin:0 0 5px; }
#erpPage .erp-ui-help summary { cursor:pointer; width:fit-content; }
#erpPage .erp-ui-help p { margin:4px 0; }
#erpPage .erp-ui-help[open] { max-height:160px; overflow:auto; padding:5px 7px; border:1px solid var(--erp-ui-border); background:#f7fafc; }
#erpPage .erp-ui-query { flex:none; margin:0; }
#erpPage .erp-ui-query .erp-toolbar { margin:0 0 7px; gap:7px; padding:0; align-items:center; }
#erpPage .erp-ui-query label { display:inline-flex; align-items:center; gap:6px; font-weight:400; font-size:13px; white-space:nowrap; }
#erpPage .erp-ui-query input[type=search] { width:280px; min-width:150px; max-width:100%; }
#erpPage .erp-ui-query select { max-width:215px; }
#erpPage .erp-ui-query input[type=date] { width:145px; }
#erpPage .erp-ui-query input[type=checkbox] { min-height:0; width:15px; height:15px; margin:0; }
#erpPage .erp-ui-query .erp-segment button { min-height:30px; }
#erpPage .erp-draft-head { flex-wrap:wrap; border-bottom:1px solid var(--erp-ui-border); }
#erpPage .erp-draft-head h2 { margin:0 14px 0 0; font-size:16px; font-weight:500; }
#erpPage .erp-draft-head [data-doc-refresh] { margin-left:auto; }
#erpPage .erp-draft-list .erp-toolbar { flex-wrap:wrap; }
#erpPage .erp-draft-list .erp-ui-query input[type=search] { width:100px; min-width:70px; }
#erpPage .erp-draft-list .erp-draft-head select { width:145px; }
#erpPage .erp-draft-list .erp-ui-table tfoot td:first-child { padding-inline:2px; text-align:center; }
#erpPage .erp-ui-metrics { display:flex; flex:none; flex-wrap:wrap; gap:0; margin:0 0 7px; border:1px solid var(--erp-ui-border); background:#f7fafc; }
#erpPage .erp-ui-metrics > div { display:inline-flex; align-items:baseline; gap:6px; min-width:0; padding:3px 8px; border:0; border-right:1px solid #dde6ed; border-radius:0; background:transparent; }
#erpPage .erp-ui-metrics span { display:inline; font-size:12px; color:#5e7488; }
#erpPage .erp-ui-metrics strong { font-size:13px; color:#254d6d; white-space:nowrap; }
#erpPage .erp-ui-scope { flex:none; font-size:12px; color:#637d90; padding:0 0 4px; }
#erpPage .source-review-bar { display:flex; align-items:center; gap:10px; flex:none; min-height:24px; }
#erpPage [data-source-failure] { color:#a8322a; font-size:12px; }
#erpPage .source-review-records { flex:none; margin:0 0 6px; color:#60778a; font-size:12px; }
#erpPage .source-review-records > summary { width:fit-content; cursor:pointer; }
#erpPage .source-review-records[open] { max-height:32vh; overflow:auto; padding:5px 7px; border:1px solid #d4dce3; }
#erpPage .erp-ui-results { display:flex; flex-direction:column; border:1px solid #bdcbd8; overflow:hidden; }
#erpPage :is(.erp-ui-list-page .erp-ui-results,.fa-body .erp-ui-grid-scroll,.wh-list .erp-ui-grid-scroll) { width:fit-content; max-width:100%; }
#erpPage .erp-ui-grid-scroll { flex:1; min-height:0; overflow:auto; }
#erpPage .erp-ui-list-page .erp-ui-grid-scroll { max-height: max(280px, calc(100dvh - 300px)); }
#erpPage .erp-ui-table { table-layout:fixed; width:max-content; min-width:0; border-collapse:separate; border-spacing:0; margin:0; }
#erpPage .fa-table tbody tr { cursor:pointer; }
#erpPage .fa-table .erp-actions button { min-height:24px; padding:2px 6px; }
#erpPage .erp-ui-table thead { position:sticky; top:0; z-index:2; }
#erpPage .erp-ui-table th { position:relative; padding:0; height:35px; border:0; border-right:1px solid #75acd2; background:var(--erp-ui-header); color:#fff; font-size:13px; font-weight:400; }
#erpPage .erp-ui-table th button, #erpPage .erp-ui-column-label { display:block; box-sizing:border-box; width:100%; padding:5px 9px; text-align:inherit; color:inherit; background:transparent; border:0; font-size:inherit; font-weight:inherit; }
#erpPage .erp-ui-table th button:hover { background:#2074b6; }
#erpPage .erp-ui-table td { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; height:32px; padding:5px 8px; font-size:13px; font-weight:400; color:var(--erp-ui-text); background:#fff; border:0; border-right:1px solid var(--erp-ui-cell); border-bottom:1px solid var(--erp-ui-cell); }
#erpPage .erp-ui-table tbody tr:nth-child(even) td { background:var(--erp-ui-stripe); }
#erpPage .erp-ui-table tbody tr:hover td { background:var(--erp-ui-hover); }
#erpPage .erp-ui-table tr.erp-doc-reversal td { color:#a8322b; }
#erpPage .erp-ui-table tr.erp-doc-reversed td { color:#7d8783; }
#erpPage .erp-ui-table tbody tr.selected td { background:var(--erp-ui-selected); }
#erpPage .erp-ui-table tbody tr:focus { outline:2px solid #8bbbe0; outline-offset:-2px; }
#erpPage .erp-ui-table tbody tr[aria-selected=true] .erp-ui-index { color:#f38a00; }
#erpPage .erp-ui-table td.erp-ui-index { padding:0; text-align:center; color:#466b89; background:#f4fafc; }
#erpPage .erp-ui-table th.erp-ui-index { font-size:11px; text-align:center; }
#erpPage .erp-ui-table .erp-link { font:inherit; white-space:inherit; text-align:inherit; }
#erpPage .erp-ui-table .erp-num { font-variant-numeric:tabular-nums; text-align:right; }
#erpPage .erp-ui-table .erp-ui-empty { height:52px; text-align:center; color:#718394; }
#erpPage .erp-ui-table tfoot { position:sticky; bottom:0; z-index:1; }
#erpPage .erp-ui-table tfoot td { background:var(--erp-ui-subtotal); border-top:1px solid #d9d8c3; }
#erpPage .erp-ui-subtotal { display:flex; align-items:center; flex-wrap:wrap; gap:24px; }
#erpPage .erp-ui-resize { position:absolute; top:0; right:0; bottom:0; width:7px; cursor:col-resize; touch-action:none; }
#erpPage .erp-ui-pager { flex:none; margin:0; padding:5px 7px; border-top:1px solid #d4dce3; justify-content:flex-end; gap:8px; font-size:12px; flex-wrap:wrap; }
#erpPage .erp-ui-pager .erp-ui-filter-total { margin-right:auto; }
#erpPage .erp-ui-pager label { display:flex; align-items:center; gap:6px; font-weight:400; }
#erpPage .erp-ui-pager input { width:55px; padding:3px; text-align:center; }
#erpPage .erp-ui-list-page .erp-ui-bottom { display:flex; align-items:center; gap:7px; flex:none; padding-top:7px; }
#erpPage .erp-ui-bottom-note { margin-left:auto; font-size:12px; color:#76899a; }
#erpPage .erp-ui-detail { border-radius:0; padding:7px; }
#erpPage .erp-ui-detail > .modalhead { background:var(--erp-ui-header); color:#fff; padding:10px; border-radius:0; }
#erpPage .erp-ui-detail.is-reversal > .modalhead { background:#fff0ee; color:#a8322b; }
#erpPage .erp-ui-detail :is(h3,h4) { font-size:14px; }
#erpPage .erp-ui-detail .source-doc-comparison article { border-radius:0; padding:9px; }
.erp-dialog.erp-ui-dialog .modalbox { width:min(1300px,calc(100vw - 38px)); border-radius:2px; }
.erp-dialog.erp-ui-dialog .erp-tablewrap { max-height:55vh; overflow:auto; }
.erp-dialog.erp-ui-dialog .erp-table { border-collapse:separate; border-spacing:0; }
.erp-dialog.erp-ui-dialog .erp-table th { position:sticky; top:0; height:34px; font-weight:400; z-index:1; }
.erp-dialog.erp-ui-dialog .erp-table :is(th,td) { font-size:13px; padding:5px 8px; border-right:1px solid #dfe7ee; border-bottom:1px solid #dfe7ee; }
.erp-dialog.erp-ui-dialog .erp-table tbody tr:nth-child(even) { background:#f8f8f8; }
@media(max-width:800px) {
  #erpPage .erp-ui-list-page { max-height:none; }
  #erpPage .erp-ui-list-page .erp-ui-grid-scroll, #erpPage .erp-ui-grid-scroll { max-height:55vh; }
  #erpPage .erp-ui-head { align-items:flex-start; flex-wrap:wrap; }
}
/* ERP-UI-001: flat entry sheets. Inputs/events/data contracts remain the original ones. */
#erpPage :is(.docf-page,.fin-page,.asm-page,.stk-page){background:#fff;padding:0;gap:0}
#erpPage :is(.docf-page,.asm-page,.stk-page){max-width:100%;min-width:0}
#erpPage .fin-page{max-width:1010px}
#erpPage :is(.docf-page,.fin-page,.asm-page,.stk-page) .erp-panel{box-shadow:none;border-radius:0}
#erpPage :is(.docf-page,.fin-page,.asm-page) .erp-page-head{padding:8px 10px;margin:0;border-bottom:1px solid #d6dee6}
#erpPage :is(.docf-page,.fin-page,.asm-page) .erp-page-head h2{font-size:16px;font-weight:400}
#erpPage :is(.docf-page,.fin-page,.asm-page) .docf-head{display:flex;flex-wrap:wrap;align-items:start;gap:6px 16px;padding:9px 10px;border:0;border-bottom:1px solid #d4dce5;max-height:none;overflow:visible;flex:none}
#erpPage :is(.docf-page,.fin-page,.asm-page) .docf-head>label,#erpPage .docf-party-field,#erpPage .fin-party{display:flex;flex-direction:row;align-items:center;gap:6px;flex:0 1 285px;min-width:240px;position:relative}
#erpPage .docf-head .docf-wide{flex-basis:380px}
#erpPage .docf-head .field-label-text{white-space:nowrap;font-size:13px;flex:none}
#erpPage .docf-head :is(input,button.erp-picker-field,button[data-docf-picker],button[data-fin-account],.erp-lookup-control){min-width:0;min-height:30px;height:30px;flex:1;border-radius:0;font-size:13px}
#erpPage .docf-head .erp-lookup-control input{width:100%}
#erpPage .docf-head button[data-lookup-open],#erpPage .docf-head button[data-fin-pick-open]{flex:none;width:27px;min-height:28px;padding:0}
#erpPage .docf-head :is(.form-field-error,.erp-field-error){font-size:12px;white-space:normal}
#erpPage :is(.docf-page,.asm-page) .docf-lines-panel{padding:0;border:0;margin:0}
#erpPage .docf-page .docf-lines{min-height:307px;max-height:none;flex:1}
#erpPage :is(.docf-lines,.stk-lines) :is(th,td){height:34px;padding:2px 7px;font-size:13px;vertical-align:middle}
#erpPage :is(.docf-lines,.stk-lines) th{height:35px;background:#2881c7;color:#fff}
#erpPage :is(.docf-lines,.stk-lines) :is(input,select,button.erp-picker-field){width:100%;min-height:28px;height:28px;border:1px solid transparent!important;box-shadow:none;border-radius:0!important;background:transparent!important;padding:2px 3px;font-size:13px;color:inherit;outline:none}
#erpPage :is(.docf-lines,.stk-lines) input:not(:focus)::placeholder{color:transparent}
#erpPage :is(.docf-lines,.stk-lines) :is(input,select,button.erp-picker-field):focus{outline:1px solid #2881c7!important;background:#fff!important;outline-offset:0}
#erpPage :is(.docf-lines,.stk-lines) tr:focus-within{background:#edf5ff}
#erpPage .docf-lines .erp-lookup-control{height:29px;display:flex;border:0;background:transparent}
#erpPage .docf-lines .erp-lookup-control input{flex:1;min-width:0}
#erpPage .docf-lines .erp-lookup-control button{flex:none;width:24px;height:27px;min-height:0;border:0;border-radius:0;padding:0;background:transparent;color:#2881c7;opacity:0}
#erpPage .docf-lines tr:hover .erp-lookup-control button,#erpPage .docf-lines tr:focus-within .erp-lookup-control button{opacity:1}
#erpPage .docf-product-controls { display:flex; align-items:center; gap:4px; min-width:0; }
#erpPage .docf-product-controls > .erp-lookup-control { flex:1; min-width:0; }
#erpPage .docf-product-controls > [data-docf-gift] { flex:none; white-space:nowrap; }
#erpPage .docf-lines td>.erp-btn-sm{min-height:24px;padding:1px 5px;border:0;background:transparent;color:#2874ad;font-size:12px}
#erpPage .docf-lines td>.erp-btn-sm:disabled{color:#9aa4b0}
#erpPage :is(.docf-page,.fin-page,.asm-page,.stk-page) .docf-actions{border:0;border-top:1px solid #d6dee6;border-radius:0;margin:0;padding:8px 10px;background:#fff;flex:none}
#erpPage .docf-foot{padding:6px 10px;border-top:1px solid #d6dee6}
#erpPage .asm-page .docf-foot{justify-content:flex-start;gap:8px}
#erpPage .asm-page :is(.asm-outputs,.asm-inputs){max-height:min(420px,42dvh)}
#erpPage .erp-entry-table{width:max-content;min-width:0;table-layout:fixed}
#erpPage .erp-entry-table :is(th,td){overflow-wrap:anywhere}
#erpPage .erp-entry-table :is(.docf-product,select){min-width:0}
#erpPage .erp-entry-table:not([data-doc-columns]) :is(th,td.erp-mono){white-space:normal}
#erpPage .erp-tablewrap:has(> .erp-entry-table){width:fit-content;max-width:100%}
:is(#erpPage,.erp-dialog) :is(.erp-tablewrap,.erp-payroll-panel):has(> [data-doc-columns]){width:fit-content;min-width:0;max-width:100%;overflow:auto}
:is(#erpPage,.erp-dialog) table[data-doc-columns]{min-width:0;table-layout:fixed}
:is(#erpPage,.erp-dialog) [data-doc-columns] :is(th,td){white-space:nowrap;overflow-wrap:normal;overflow:hidden;text-overflow:ellipsis}
:is(#erpPage,.erp-dialog) [data-doc-columns] th{position:relative;padding-right:12px}
.erp-dialog.erp-ui-dialog table[data-doc-columns] th{position:sticky}
:is(#erpPage,.erp-dialog) [data-doc-columns] th .erp-ui-resize{position:absolute;inset:0 0 0 auto;width:9px;cursor:col-resize;touch-action:none}
:is(#erpPage,.erp-dialog) [data-doc-columns] th .erp-ui-resize:is(:focus-visible,:hover,.is-resizing){background:#fff7;outline:none}
:is(#erpPage,.erp-dialog) [data-doc-columns] :is(.erp-doc-cell-text,input,select,[data-fin-account]){box-sizing:border-box;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
:is(#erpPage,.erp-dialog) [data-doc-columns] :is(.erp-block,.docf-pending){white-space:normal;overflow-wrap:anywhere}
#erpPage .erp-workspace table[data-doc-columns]:not(.erp-ui-table) th{padding-right:12px}
#erpPage .erp-workspace .docf-lines table[data-doc-columns] th,#erpPage .erp-workspace .stk-lines[data-doc-columns] th{padding-right:12px!important}
#erpPage .asm-page .erp-section-title{margin:0;padding:5px 10px;font-size:13px}
#erpPage .fin-lines-panel{margin:0;border:0}
#erpPage .fin-lines{width:fit-content;max-width:100%}
#erpPage .fin-lines table{width:max-content;min-width:0;table-layout:fixed}
#erpPage .fin-col-item{width:240px}
#erpPage .fin-col-row{width:42px}
#erpPage .fin-col-amount{width:138px}
#erpPage .fin-col-note{width:310px}
#erpPage .fin-lines .field-label-text{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
#erpPage .fin-lines button[data-fin-account]{width:100%;height:28px;min-height:28px;padding:2px 4px;background:transparent;border:0;border-radius:0;text-align:left;font-size:13px}
#erpPage .fin-lines button[data-fin-account]::after{content:'…';float:right;color:#2881c7}
#erpPage .fin-page .fin-preview,#erpPage .fin-page .fin-transfer-hint{border-radius:0;border:0;margin:0;padding:6px 10px}
#erpPage .fin-page .fin-selected-party{font-size:12px;flex-basis:100%}
#erpPage .stk-head{border:0;border-bottom:1px solid #d6dee6;padding:8px 10px;border-radius:0}
#erpPage .stk-form :is(input,button){border-radius:0;font-size:13px;min-height:30px}
@media(max-width:760px){#erpPage :is(.docf-page,.fin-page,.asm-page) .docf-head>label,#erpPage .docf-party-field,#erpPage .fin-party{flex-basis:100%;min-width:0}}
#erpPage :is(.docf-lines,.stk-lines) :is(th,td){height:34px!important;padding:2px 7px!important;line-height:20px!important}
#erpPage .docf-head>.docf-more{flex:1 0 100%;font-size:12px;margin:0;color:#4f6576}
#erpPage .docf-more summary{cursor:pointer;width:fit-content;padding:0 2px}
#erpPage .docf-more-fields{display:flex;flex-wrap:wrap;gap:6px 14px;padding-top:6px}
#erpPage .docf-more-fields>label{display:flex;align-items:center;gap:6px;flex:1 1 250px}
#erpPage :is(.docf-lines,.stk-lines) tbody tr{height:34px}
#erpPage .docf-page .docf-lines{min-height:322px}

.erp-print-preview { overflow:hidden; }
.erp-print-preview .modalbox { display:flex; flex-direction:column; gap:8px; width:min(1120px,calc(100vw - 28px)); max-height:calc(100dvh - 48px); padding:10px; overflow:hidden; }
.erp-print-preview .modalbox > :not(.erp-print-scroll,.erp-print-controls) { flex:none; }
.erp-print-controls, .erp-print-browser-controls { display:flex; flex-direction:column; gap:8px; }
.erp-print-controls { flex:0 1 auto; min-height:0; max-height:45dvh; overflow:auto; }
.erp-print-controls > *, .erp-print-browser-controls > * { flex:none; }
.erp-print-preview-modes { display:flex; flex-wrap:wrap; gap:6px; }
.erp-print-preview-modes button[aria-pressed="true"] { border-color:#206ea6; background:#e6f2fb; color:#124f7a; font-weight:600; }
.erp-print-needle-info { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 14px; font-size:12px; color:#536978; }
.erp-print-device { margin:0; font-size:12px; color:#536978; }
.erp-print-preview [hidden] { display:none !important; }
.erp-print-options, .erp-print-custom { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.erp-print-options label { display:inline-flex; align-items:center; gap:5px; font-size:13px; }
.erp-print-options :is(select,input) { min-height:30px; padding:4px 7px; font-size:13px; border-radius:2px; }
.erp-print-custom input { width:76px; }
.erp-print-size { font-size:12px; color:#536978; font-variant-numeric:tabular-nums; }
.erp-print-error { margin:0; font-size:13px; color:#b3261e; }
.erp-print-scroll { flex:1 1 auto; overflow:auto; overflow-anchor:none; min-height:80px; padding:10px; border:1px solid #d3dde5; background:#eef3f7; }
.erp-print-scroll iframe { display:block; margin-inline:auto; border:0; background:#fff; box-shadow:0 1px 4px #9aa8b4; }
.erp-print-needle-scroll { height:min(58dvh,550px); }
.erp-print-needle-scroll img { display:block; width:min(100%,var(--erp-needle-sheet-width,912px)); height:auto; margin:0 auto 12px; border:1px solid #d4e0ea; background:white; }
.erp-print-needle-scroll img:last-child { margin-bottom:0; }
.erp-print-preview .modalactions { margin:0; flex-wrap:wrap; }
.erp-print-command { display:inline-flex; align-items:stretch; vertical-align:middle; white-space:nowrap; }
.erp-print-menu { position:relative; display:flex; align-items:center; }
.erp-print-menu > summary { display:grid; place-items:center; min-width:23px; height:100%; padding:0 4px; border:1px solid #bdcad5; border-left:0; border-radius:0 3px 3px 0; background:#f3f7fb; color:#1e5e90; cursor:pointer; list-style:none; box-sizing:border-box; }
.erp-print-menu > summary::-webkit-details-marker { display:none; }
.erp-print-command:has(.erp-print-menu) > button { border-radius:3px 0 0 3px; }
.erp-print-menu-items { position:absolute; right:0; top:calc(100% + 3px); z-index:8; display:grid; min-width:112px; padding:4px; background:#fff; border:1px solid #bdcad5; border-radius:4px; box-shadow:0 3px 10px #12334d26; }
.erp-print-menu-items > button { width:100%; text-align:left; border:0; background:#fff; }
.erp-print-menu-items > button:hover,.erp-print-menu-items > button:focus-visible { background:#e7f2fc; }
.erp-ui-bottom .erp-print-menu-items,.inv-bottom .erp-print-menu-items,.docf-actions .erp-print-menu-items,.modalactions .erp-print-menu-items,.rep-statement-actions .erp-print-menu-items { top:auto; bottom:calc(100% + 3px); }
.erp-doc-print-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:4px 0 6px; }
.erp-doc-print-bar > label { display:inline-flex; align-items:center; gap:4px; font-size:12px; }
.erp-doc-print-bar output { font-size:12px; color:#536978; }
.doc-table [data-doc-print-select] { margin-inline-end:4px; vertical-align:middle; }
.erp-print-advanced { border:1px solid #d4e0ea; border-radius:4px; background:#f8fafc; padding:5px 9px; }
.erp-print-advanced > summary { cursor:pointer; font-size:13px; color:#1e5e90; }
.erp-print-advanced .erp-print-options { margin-block:7px 3px; }
.erp-print-advanced input[type=number] { width:66px; }
.erp-print-advanced input[name=profileName] { width:148px; }
[data-print-style-status], [data-print-table-message] { font-size:12px; color:#536978; }

/* 生产组装单：上下两张明细表使用相同的数量和金额列。 */
#erpPage .asm-title, .asm-identifiers, .asm-identifiers label, .asm-identifiers > span {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}
#erpPage .asm-title { justify-content:space-between; }
.asm-identifiers input, .asm-number { padding:5px 8px; border:1px solid #bccbd7; }
.asm-number { display:inline-block; min-width:90px; font-weight:400; }
#erpPage .asm-page .asm-fields {
  display:grid; grid-template-columns:minmax(220px,300px) minmax(260px,480px);
  gap:6px 20px; padding:8px 10px;
}
#erpPage .asm-fields > label { min-width:0; }
#erpPage .asm-fields > label > span:first-child { flex:none; min-width:62px; }
#erpPage .asm-fields :is(input,.erp-picker-field) { flex:1; min-width:0; }
#erpPage .asm-page .erp-section-title { color:#32485b; font-weight:500; padding:4px 8px; }
#erpPage .asm-page .asm-blank td { height:27px; }
#erpPage .asm-page .asm-group td { padding:2px 8px; background:#f1f6fa; }
#erpPage .asm-page tfoot td { background:#fffae2; }
#erpPage .asm-page .docf-actions { justify-content:flex-end; flex-wrap:wrap; }
#erpPage .asm-page .asm-template-trigger { color:#12588c; border-color:#76a7cf; }
.asm-template-dialog .modalbox.large {
  width:min(1110px,calc(100vw - 24px)); max-height:calc(100dvh - 24px);
  display:flex; flex-direction:column; overflow:auto; padding:0; gap:0;
}
.asm-template-dialog .modalhead { display:flex; align-items:center; justify-content:space-between; padding:10px 16px; }
.asm-template-dialog .modalhead h2 { margin:0; }
.asm-template-dialog .modalhead button { color:white; background:transparent; border:0; font-size:24px; padding:0 4px; }
.asm-template-dialog .asm-filter { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; margin:12px; }
.asm-template-dialog .asm-filter label { display:flex; align-items:center; gap:6px; }
.asm-template-dialog .asm-filter input { width:138px; min-width:0; }
.asm-template-dialog .asm-template-grid { margin:0 10px; max-height:52dvh; min-height:min(220px,28dvh); overflow:auto; }
.asm-template-grid th { position:sticky; top:0; z-index:1; }
.asm-template-grid :is(th,td) { padding:5px 8px; border:1px solid #dae3eb; }
.asm-template-grid tr:has(input:checked) td { background:#ffe2cf; }
.asm-template-grid input[aria-label="生产数量"] { width:100%; text-align:right; }
.asm-template-dialog .asm-list-status { text-align:right; padding:6px 12px; color:#515f6d; }
.asm-template-dialog .modalactions { padding:8px 10px; margin:0; display:flex; flex-wrap:wrap; gap:6px; border-top:1px solid #d6dee6; }
.asm-template-dialog .doc-spacer { flex:1; }
@media (max-width:680px) {
  #erpPage .asm-page .asm-fields { grid-template-columns:minmax(0,1fr); }
  .asm-template-dialog .asm-filter { gap:6px; }
}

/* ERP sheets and lists retain the existing controls at a consistent visual density. */
#erpPage .erp-sheet-heading {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 12px;
}
#erpPage .erp-sheet-heading > label {
  display:inline-flex;
  align-items:center;
  gap:6px;
}
#erpPage .erp-sheet-heading .field-label-text { white-space:nowrap; }
#erpPage :is(.fin-page,.erp-review-sheet) .erp-page-head { flex-wrap:wrap; gap:6px; }
#erpPage .fin-page { width:100%; max-width:none; min-width:0; }
#erpPage .fin-page .fin-head { padding:8px 10px; gap:6px 12px; }
#erpPage .fin-page .fin-head > label.docf-wide { flex:1 1 260px; }
#erpPage .fin-page .fin-lines-panel { max-width:100%; }
#erpPage .fin-page .fin-lines { width:100%; overflow:auto; max-height:clamp(280px,56dvh,550px); }
#erpPage .fin-lines table { min-width:100%; }
#erpPage .fin-lines .fin-col-row { width:42px; }
#erpPage .fin-lines .fin-col-item { width:290px; }
#erpPage .fin-lines .fin-col-amount { width:104px; }
#erpPage .fin-lines .fin-col-note { width:500px; }
#erpPage .fin-lines button[data-fin-account] { display:flex; align-items:center; justify-content:space-between; }
#erpPage .fin-lines thead { position:sticky; top:0; z-index:2; }
#erpPage .fin-lines tr > :first-child { text-align:center; }
#erpPage .fin-lines tbody tr > :first-child { background:#f1f7fa; color:#4a647c; }
#erpPage .fin-lines tbody tr:nth-child(even) td:not(:first-child) { background:#fafbfc; }
#erpPage .fin-lines .fin-blank-row td { cursor:default; }
/* The receipt/payment sample sets the density of the shared ERP workspace. */
@media screen {
  body[data-erp-prefix] {
    & > .dev-erp-banner { padding:3px 8px; gap:4px 12px; font-size:13px; }
    & > .dev-erp-banner :is(select,.dev-parallel-warning) { min-height:26px; padding:2px 6px; font-size:13px; }
    & > #erpPage { padding:4px 6px; }
  }
  #erpPage .erp-workspace {
    & > .erp-header { padding:3px 8px; margin-bottom:2px; }
    & .erp-topnav-item { min-height:30px; padding:3px 9px; font-size:14px; }
    & > .erp-workspace-bar { margin-bottom:4px; }
    & .erp-workspace-tab button { min-height:30px; padding-block:3px; font-size:13px; }
  }
  #erpPage .erp-workspace-panel :is(.docf-page,.asm-page,.fin-page) {
    & > .erp-page-head { padding:4px 8px; }
    & .docf-head { padding:5px 8px; gap:4px 12px; }
    & :is(.erp-sheet-heading,.docf-actions) :is(button,input) { min-height:28px; padding:3px 7px; font-size:13px; }
  }
  #erpPage .erp-workspace-panel :is(.erp-ui-table,.pt-table,.pk-table,.stk-table,.pb-table,.fa-table,.inv-table,.rep-table) :is(thead:has(> tr:only-child) th,tbody td) {
    box-sizing:border-box; height:30px; padding-block:0;
  }
  #erpPage .erp-workspace-panel :is(.erp-toolbar,.erp-ui-pager,.erp-ui-bottom) :is(button,select:not([multiple]),input:not([type=checkbox],[type=radio])) {
    box-sizing:border-box; min-height:28px; padding-block:3px; font-size:13px;
  }
  #erpPage .erp-workspace-panel :is(.docf-lines,.stk-lines,.fin-lines) :is(thead th,tbody td) {
    box-sizing:border-box; height:30px!important; padding-block:0!important;
  }
  #erpPage .erp-workspace-panel :is(.docf-lines,.stk-lines,.fin-lines) tbody tr { height:30px; }
  #erpPage .asm-page .docf-lines.asm-inputs { max-height:clamp(155px,36dvh,370px); }
  #erpPage .asm-page .docf-lines.asm-outputs { max-height:clamp(125px,27dvh,300px); }
  #erpPage .asm-page .docf-lines tfoot td {
    position:sticky; bottom:0; height:21px!important; padding-block:0!important;
  }
  #erpPage .fin-page.fin-cash-voucher {
    height:100%;
    & > .erp-page-head { padding:4px 8px; }
    & :is(.erp-sheet-heading,.docf-actions) :is(button,input) { min-height:28px; padding:3px 7px; font-size:13px; }
    & > .fin-head { padding:5px 8px; gap:4px 12px; border-bottom:0; }
    & .fin-head > .docf-wide { flex:0 1 310px; }
    & > .fin-preview {
      display:flex; flex-wrap:wrap; align-items:baseline; gap:3px 16px;
      min-height:26px; padding:3px 8px; background:white; font-size:13px;
    }
    & .fin-balance-field { overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
    & .fin-balance-field strong { margin-inline-start:3px; font-weight:500; }
    & > .fin-lines-panel { flex:1 0 auto; border-inline:1px solid var(--erp-ui-border); }
    & .fin-lines { max-height:none; border:0; }
    & .fin-col-row { width:36px; }
    & .fin-col-item { width:235px; }
    & .fin-col-amount { width:88px; }
    & .fin-col-note { width:clamp(200px,calc(100vw - 385px),1600px); }
    & .fin-lines :is(th,td) { height:30px!important; padding-block:0!important; }
    & .fin-lines tbody tr { height:30px; }
    & > .docf-actions { padding:5px 8px; }
  }
}
#erpPage .fin-page .fin-preview { min-height:30px; background:#f9fbfd; border-bottom:1px solid #d6dee6; }
#erpPage .fin-page .fin-preview small { display:inline; margin-left:10px; }
#erpPage .fin-adjustment .fin-lines { max-height:clamp(240px, 53dvh, 480px); }
#erpPage .fin-adjustment .fin-col-code { width:128px; }
#erpPage .fin-adjustment .fin-col-action { width:72px; }
#erpPage .fin-lines table[data-doc-columns="expenses"] .fin-col-code { width:122px; }
#erpPage .fin-lines table[data-doc-columns="expenses"] .fin-col-action { width:66px; }
#erpPage .fin-lines [data-expense-picker-cell] { cursor:pointer; }
#erpPage .fin-lines [data-expense-pick] { width:100%; min-height:1.35em; text-align:left; }
#erpPage .erp-expense-subjects .erp-ui-master-main { min-width:0; }
#erpPage .erp-expense-subjects .erp-table { width:100%; }
#erpPage .doc-expense-filters:not([hidden]) { display:inline-flex; gap:8px; flex-wrap:wrap; }
#erpPage .fin-adjustment .fin-adjustment-bar { justify-content:space-between; padding:3px 8px; border-bottom:1px solid #d6dee6; }
#erpPage .fin-adjustment .fin-lines tbody input { width:100%; min-width:0; }
#erpPage .fin-page :is(.fin-settlement,.fin-expense-payment) {
  margin:0;
  padding:6px 10px;
  flex-wrap:wrap;
  background:#f5f8fb;
}
#erpPage .fin-settlement > label { display:inline-flex; align-items:center; gap:8px; }
#erpPage .erp-review-sheet .docf-lines { max-height:max(306px,calc(100dvh - 360px)); }
#erpPage .erp-review-sheet .docf-foot { background:#fffbea; font-variant-numeric:tabular-nums; }
#erpPage .erp-review-sheet .docf-lines-panel { border-inline:1px solid #d6dee6; }

#erpPage .erp-review-list,
#erpPage :is(.erp-review-accounts,.erp-review-report) {
  background:#fff;
  border:1px solid #d6dee6;
  box-sizing:border-box;
  width:100%;
  min-width:0;
}
#erpPage .erp-review-list :is(.erp-ui-results,.erp-tablewrap) { width:100%; max-width:100%; }
#erpPage .erp-review-list :is(.erp-ui-grid-scroll,.erp-tablewrap),
#erpPage .erp-review-parties .erp-ui-grid-scroll,
#erpPage .erp-review-accounts .erp-ui-grid-scroll {
  min-height:min(345px,47dvh);
  max-height:max(345px,calc(100dvh - 310px));
  overflow:auto;
}
#erpPage .erp-review-list :is(.pt-table,.pk-table,.stk-table) { min-width:100%; }
#erpPage .erp-review-list :is(.pt-table,.pk-table,.stk-table) thead { position:sticky; top:0; z-index:1; }
#erpPage .erp-review-list :is(.pt-table,.pk-table,.stk-table) td { height:32px; }
#erpPage .erp-review-list .pb-filters { align-items:center; flex-wrap:wrap; gap:5px 9px; }
#erpPage .pb-filters > label { display:inline-flex; align-items:center; gap:6px; }
#erpPage .pb-filter-label { padding-left:4px; }
#erpPage .erp-review-documents .erp-doc-print-bar { padding:5px 8px; border-top:1px solid #d6dee6; }
#erpPage .erp-review-parties .erp-ui-bottom { margin-top:0; }

#erpPage :is(.erp-review-accounts,.erp-review-report) {
  display:grid;
  grid-template-columns:clamp(155px,15vw,198px) minmax(0,1fr);
  align-content:start;
  gap:0 8px;
}
#erpPage :is(.erp-review-accounts,.erp-review-report) > :is(.erp-page-head,.erp-ui-bottom) {
  grid-column:1/-1;
  margin:0;
  padding:7px 10px;
}
#erpPage .erp-review-sidebar {
  grid-column:1;
  grid-row:2 / span 2;
  padding:8px;
  background:#f7fafc;
  border-right:1px solid #d6dee6;
  min-width:0;
}
#erpPage .erp-review-sidebar :is(label,select,input) {
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}
#erpPage .erp-review-sidebar label > select { margin-top:7px; }
#erpPage .erp-review-sidebar .fa-type { height:auto; }
#erpPage .erp-review-sidebar .rep-toolbar { padding:0; gap:6px; flex-direction:column; align-items:stretch; }
#erpPage .erp-review-sidebar :is(.erp-segment,.rep-custom:not(.hidden)) { flex-wrap:wrap; }
#erpPage .erp-review-sidebar .rep-period { white-space:normal; }
#erpPage :is(.erp-review-report-main,.erp-review-accounts > .erp-toolbar,.erp-review-accounts > .fa-body) { grid-column:2; min-width:0; }
#erpPage .erp-review-report .rep-body { min-height:min(410px,52dvh); overflow:auto; }
#erpPage .erp-review-report .rep-body > .erp-tablewrap { width:100%; }
#erpPage .erp-review-report :is(.rep-table thead, .rep-table tfoot) { position:sticky; z-index:1; }
#erpPage .erp-review-report .rep-table thead { top:0; }
#erpPage .erp-review-report .rep-table tfoot { bottom:0; }
#erpPage .erp-review-report .rep-cards {
  display:flex;
  flex-wrap:wrap;
  gap:4px 12px;
  padding:5px 8px;
  border-bottom:1px solid #d6dee6;
}
#erpPage .erp-review-report .rep-card { border:0; box-shadow:none; padding:4px; background:transparent; }
#erpPage .erp-review-report .rep-card strong { font-size:14px; }
@media (max-width:760px) {
  #erpPage :is(.erp-review-accounts,.erp-review-report) { display:block; }
  #erpPage .erp-review-sidebar { border-right:0; border-bottom:1px solid #d6dee6; }
  #erpPage .erp-review-sidebar .rep-toolbar { flex-flow:row wrap; }
  #erpPage .erp-review-sidebar :is(input,select) { max-width:100%; width:auto; }
}

/* Screen dimensions are in CSS pixels, using the receipt/payment workspace as reference. */
@media screen {
  #erpPage .erp-workspace-panel :is(.erp-table,.rep-statement-table,.gjp-table) :is(thead:has(> tr:only-child) th,tbody td) {
    box-sizing:border-box; height:30px; padding-block:2px; font-size:13px;
  }
  #erpPage .erp-workspace-panel :is(.erp-ui-table,.inv-table,.rep-table) tfoot td {
    box-sizing:border-box; height:21px; padding-block:1px; line-height:18px;
  }
  #erpPage .erp-workspace-panel .erp-ui-grid-scroll { scroll-padding-block:32px 22px; }
  #erpPage .erp-ui-table tbody :is(.erp-btn-sm,.erp-link) {
    min-height:24px; padding-block:1px; vertical-align:middle;
  }
  #erpPage .erp-ui-table input[type=checkbox] { height:14px; min-height:0; vertical-align:middle; }
  #erpPage .doc-table [data-doc-open] {
    max-width:100%; padding-inline:0; overflow:hidden; text-overflow:ellipsis;
  }
  #erpPage .doc-table [data-doc-print-select] + [data-doc-open] { max-width:calc(100% - 24px); }
  #erpPage .erp-ui-table thead .erp-ui-column-label { padding-block:3px; }
  #erpPage .erp-workspace-panel :is(.erp-ui-table,.inv-table,.rep-statement-table) thead:has(> tr:only-child) th { padding-block:0; }
  #erpPage .erp-workspace-panel :is(.erp-ui-table,.inv-table,.rep-statement-table) thead th button {
    height:28px; min-height:0; padding-block:2px;
  }
  #erpPage .erp-workspace-panel :is(.erp-page-head,.erp-panel-head) :is(h2,h3) {
    margin-block:0; font-size:14px; line-height:22px;
  }
  #erpPage .erp-workspace-panel :is(.erp-panel-head,.erp-page-head,.erp-ui-list-head) :is(button,select) {
    min-height:28px; padding-block:3px; font-size:13px;
  }
  #erpPage :is(.erp-home,.op-page) { gap:8px; }
  #erpPage .erp-home .erp-panel { padding:8px 10px; }
  #erpPage .erp-home .erp-panel-head { margin-bottom:6px; }
  #erpPage .erp-workspace-panel > :is(.erp-panel,.erp-ui-list-page) > h2,
  #erpPage .erp-home .erp-panel > h3 { font-size:14px; line-height:22px; margin:0 0 6px; }
  #erpPage .erp-workspace-panel > .fa-history {
    box-sizing:border-box; width:100%; max-width:none; margin:0;
    border:1px solid var(--erp-ui-border); border-radius:0; box-shadow:none;
  }
  #erpPage .fa-history .modalhead { padding:5px 8px; }
  #erpPage .fa-history .modalhead h2 { font-size:14px; }
  #erpPage .fa-history .fa-history-scroll { max-height:calc(100dvh - 290px); overflow:auto; }
  #erpPage .pt-table th:nth-child(2) { min-width: min(338px,43vw); }
  #erpPage .rep-product-summary th:nth-child(2) { min-width:200px; }
  #erpPage :is(.rep-customer-ranking,.rep-product-ranking) th:nth-child(3) { min-width:240px; }
  #erpPage .rep-product-ranking th:nth-child(5) { min-width:90px; }
  .rep-date-dialog .rep-date-box { width:min(320px,calc(100vw - 24px)); }
  .rep-date-dialog .modalhead { padding:6px 10px; }
  .rep-date-dialog .modalhead h2 { font-size:15px; }
  .rep-date-dialog .rep-date-content { padding:8px 10px 4px; }
  .rep-date-dialog .modalactions { padding:6px 10px; }
  .asm-template-dialog .modalbox.large {
    width:min(850px,calc(100vw - 24px)); height:min(500px,calc(100dvh - 24px));
    box-sizing:border-box;
  }
  .asm-template-dialog .asm-template-grid { flex:1 1 auto; min-height:90px; max-height:none; }
  .asm-template-dialog .asm-filter { margin:6px 10px; gap:4px 10px; }
  .asm-template-dialog .modalhead { padding:5px 10px; }
  .asm-template-dialog .modalhead h2 { font-size:15px; }
  .asm-template-dialog .asm-template-grid :is(th,td) { height:30px; box-sizing:border-box; padding-block:1px; }
  .master-picker-dialog[data-erp-size] {
    --picker-width:700px; --picker-height:450px;
    width:min(var(--picker-width),calc(100vw - 24px)); height:min(var(--picker-height),calc(100dvh - 24px));
    box-sizing:border-box; max-height:calc(100dvh - 24px);
  }
  .master-picker-dialog[data-erp-size="warehouse"] { --picker-width:450px; --picker-height:410px; }
  .master-picker-dialog[data-erp-size="account"] { --picker-width:450px; --picker-height:400px; }
  .master-picker-dialog.master-picker-floating[data-erp-size] { max-height:calc(100dvh - 136px); }
  .master-picker-dialog[data-erp-size] .master-picker-shell { height:100%; min-height:0; overflow:auto; }
  .master-picker-dialog[data-erp-size] :is(header,footer,.master-picker-toolbar) { padding:5px 8px; gap:5px; }
  .master-picker-dialog[data-erp-size] h2 { font-size:15px; }
  .master-picker-dialog[data-erp-size] :is(button,select,input[type=search]) { font-size:13px; min-height:28px; padding-block:3px; }
  .master-picker-dialog[data-erp-size] .master-picker-table-wrap { min-height:60px; }
  .master-picker-dialog[data-erp-size] .master-picker-table-wrap :is(tr,td,th) { height:30px; box-sizing:border-box; }
  .master-picker-dialog[data-erp-size] .master-picker-table-wrap :is(th,td) { padding:2px 6px; }
  .erp-dialog :is(.modalhead,.modalactions) :is(button,select),
  .erp-print-preview .erp-print-options :is(button,select,input:not([type=checkbox],[type=radio])) {
    box-sizing:border-box; min-height:28px; font-size:13px; padding-block:3px;
  }
  .erp-dialog .modalhead h2 { font-size:15px; }
  .erp-dialog .erp-tablewrap .erp-table :is(thead:has(> tr:only-child) th,tbody td) {
    box-sizing:border-box; height:30px; padding-block:2px; font-size:13px;
  }
  .erp-print-preview .modalbox { gap:5px; }
  .erp-dialog .modalhead button[aria-label^="关闭"] { padding-block:0; }
}
@media screen and (min-width:1001px) {
  #erpPage :is(.erp-ui-category,.inv-sidebar) { width:clamp(215px,17.3vw,244px); flex-basis:clamp(215px,17.3vw,244px); }
  #erpPage .erp-review-accounts { grid-template-columns:clamp(215px,17.3vw,244px) minmax(0,1fr); }
  /* Grid space includes its header; let the viewport and the existing footer limit it. */
  #erpPage [data-sheet-layout=purchase_in] { --detail-height:362px; }
  #erpPage [data-sheet-layout=purchase_return] { --detail-height:426px; }
  #erpPage [data-sheet-layout=sales_out] { --detail-height:333px; }
  #erpPage [data-sheet-layout=sales_return] { --detail-height:361px; }
  #erpPage .erp-review-sheet[data-sheet-layout] .docf-lines {
    min-height:150px;
    max-height:clamp(150px,calc(var(--detail-height,443px) + 100dvh - 773px),70dvh);
  }
  #erpPage :is(.docf-page[data-sheet-layout^=sales_],.docf-page[data-sheet-layout^=purchase_],.erp-draft-list) {
    display:flex;
    flex-direction:column;
    height:max(420px,calc(100dvh - var(--erp-sheet-top,100px) - 24px));
    box-sizing:border-box;
  }
  #erpPage :is(.docf-page[data-sheet-layout^=sales_],.docf-page[data-sheet-layout^=purchase_],.erp-draft-list) > * { flex:none; }
  #erpPage :is(.docf-page[data-sheet-layout^=sales_],.docf-page[data-sheet-layout^=purchase_]) > .docf-lines-panel,
  #erpPage .erp-draft-list > .doc-body {
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:0;
    width:100%;
  }
  #erpPage :is(.docf-page[data-sheet-layout^=sales_],.docf-page[data-sheet-layout^=purchase_]) .docf-lines,
  #erpPage .erp-draft-list .erp-ui-grid-scroll {
    flex:1;
    min-height:0;
    max-height:none;
  }
  #erpPage .erp-draft-list :is(.erp-ui-pager,.erp-doc-print-bar), #erpPage .docf-lines-panel > .docf-foot { flex:none; }
}

[data-party-supplier][hidden] { display:none !important; }
#erpPage [data-sales-owner-filter][hidden] { display:none; }
#erpPage .docf-sales-owner { display:flex; align-items:center; gap:6px; min-height:30px; }
#erpPage .docf-sales-owner output { color:#245371; font-size:13px; }
#erpPage [data-docf-lookup=product-code] { width:100%; min-width:0; }
#erpPage [data-docf-price-cell] { cursor:context-menu; }
#erpPage [data-shipping-totals] { font-size:12px; color:#486278; }

.erp-dialog .modalbox.product-move-box {
  box-sizing:border-box; display:block; width:min(380px,calc(100vw - 28px));
  max-height:calc(100dvh - 28px); overflow:auto; padding:0;
  background:white; color:#263b4a; font-size:13px;
}
.product-move-box header, .product-move-box footer {
  display:flex; align-items:center; padding:6px 12px; gap:6px;
}
.product-move-box header { justify-content:space-between; background:#2881c7; color:white; }
.product-move-box header h2 { margin:0; color:inherit; font-size:15px; }
.product-move-box header button { border:0; background:transparent; color:white; padding:0 4px; font-size:20px; }
.product-move-box .move-source { margin:9px 12px 0; color:#41596c; overflow-wrap:anywhere; }
.product-move-box .move-source summary { cursor:pointer; }
.product-move-box .move-source ul { max-height:80px; overflow:auto; margin:4px 0; padding-left:18px; }
.product-move-box fieldset { min-width:0; margin:0; border:0; padding:8px 12px; }
.product-move-box .move-row {
  display:grid; grid-template-columns:max-content minmax(0,1fr) max-content;
  align-items:center; gap:6px; min-height:32px;
}
.product-move-box label { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.product-move-box input:is([type=checkbox],[type=radio]) { width:14px; height:14px; min-height:0; margin:0; }
.product-move-box .move-row [data-target] { display:flex; align-items:center; justify-content:space-between; gap:4px; min-width:0; }
.product-move-box .move-row [data-target] span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.product-move-box .move-row :is(button,select), .product-move-box footer button { min-height:28px; padding:3px 8px; font-size:13px; }
.product-move-box .move-jump { margin-top:7px; }
.product-move-box [role=alert] { margin:0 12px 6px; color:#ab2727; }
.product-move-box [role=alert]:empty { display:none; }
.product-move-box footer { border-top:1px solid #d5dee5; justify-content:flex-end; }
.master-picker-dialog[data-erp-size="move-folder"] { --picker-width:450px; --picker-height:370px; }

/* The ERP has its own editor proportions even when the same master is available in CRM. */
@media screen {
  body:has(#erpPage:not(.hidden) .erp-workspace)
    :is(.erp-dialog .modalbox, #erpPage dialog .modalbox):has(.formgrid,.party-fields) {
    box-sizing:border-box; max-height:calc(100dvh - 24px); overflow:auto;
    padding:10px 12px; font-size:13px;
  }
  body:has(#erpPage:not(.hidden) .erp-workspace) :is(.erp-dialog,#erpPage dialog) :is(.formgrid,.party-fields,.pt-head,.pk-head) {
    gap:6px 12px; min-width:0;
  }
  body:has(#erpPage:not(.hidden) .erp-workspace) :is(.erp-dialog,#erpPage dialog)
    :is(.formgrid,.party-fields,.pt-head,.pk-head) label { min-width:0; gap:3px; font-size:13px; }
  body:has(#erpPage:not(.hidden) .erp-workspace) :is(.erp-dialog,#erpPage dialog)
    :is(.formgrid,.party-fields,.pt-head,.pk-head) :is(input:not([type=checkbox],[type=radio],[type=file],[type=hidden]),select) {
    box-sizing:border-box; min-width:0; max-width:100%; min-height:28px; height:28px;
    padding:2px 6px; font-size:13px; line-height:20px;
  }
  #erpPage .erp-workspace dialog :is(.hq-modalbox,.party-modalbox) :is(.modalhead,.modalactions) { margin-block:4px; gap:6px; }
  #erpPage .erp-workspace dialog :is(.hq-modalbox,.party-modalbox) :is(h2,h3) { font-size:14px; margin-block:5px; }
  #erpPage .erp-workspace dialog :is(.hq-modalbox,.party-modalbox) :is(.modalhead,.modalactions) button {
    min-height:28px; padding-block:3px; font-size:13px;
  }
  body:has(#erpPage:not(.hidden) .erp-workspace) :is(#efficiencyDialog,.erp-payroll-payment-dialog) form > label {
    display:grid; grid-template-columns:minmax(84px,auto) minmax(0,1fr); align-items:center; gap:6px;
    font-size:13px;
  }
  body:has(#erpPage:not(.hidden) .erp-workspace) :is(#efficiencyDialog,.erp-payroll-payment-dialog)
    :is(select,input:not([type=file],[type=checkbox],[type=radio]),button) {
    box-sizing:border-box; min-width:0; min-height:28px; height:28px; padding:2px 6px; font-size:13px;
  }
  #erpPage .op-page .erp-panel,
  #erpPage :is([data-workspace-page=opening_vouchers],[data-workspace-page=legacy_residues]) > .erp-panel {
    padding:6px 8px; min-width:0;
  }
  #erpPage .op-page :is(.op-step-head,.op-meta) { gap:6px; margin-bottom:5px; }
  #erpPage .op-page .op-ready-item { padding:5px 8px; border-radius:2px; }
  #erpPage .op-page .op-upload { gap:6px 10px; }
  #erpPage .op-upload :is(button,input:not([type=file])) { min-height:28px; font-size:13px; padding-block:3px; }
  #erpPage :is([data-workspace-page=opening_vouchers],[data-workspace-page=legacy_residues],
    [data-workspace-page=reviewed_source_intake],[data-workspace-page=source_masters]) p {
    margin-block:5px; line-height:1.5; font-size:13px;
  }
  #erpPage :is([data-workspace-page=opening_vouchers],[data-workspace-page=legacy_residues],
    [data-workspace-page=source_masters],.int-page) .erp-tablewrap {
    max-height:63dvh; overflow:auto;
  }
  #erpPage :is([data-workspace-page=opening_vouchers],[data-workspace-page=legacy_residues],
    [data-workspace-page=source_masters],.int-page) thead th { position:sticky; top:0; z-index:1; }
  #erpPage :is(.source-center,.int-page,[data-workspace-page=source_masters]) .erp-toolbar {
    margin-block:0 4px; gap:4px 8px;
  }
  #erpPage :is(.source-center,.int-page,[data-workspace-page=source_masters]) .erp-toolbar
    :is(button,select,input:not([type=checkbox],[type=radio])) { min-height:28px; padding-block:3px; font-size:13px; }
  #erpPage [data-workspace-page=source_masters] [data-source-dialog] {
    box-sizing:border-box; width:min(680px,calc(100vw - 24px)); max-height:85dvh;
    background:white; padding:8px 12px; border:1px solid var(--erp-ui-border);
  }
  #erpPage [data-source-dialog] .modal-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
  #erpPage [data-source-dialog] pre { white-space:pre-wrap; overflow-wrap:anywhere; }
  #erpPage .source-doc-comparison { gap:8px; }
  #erpPage .erp-ui-detail .source-doc-comparison article { padding:6px 8px; }
  #erpPage [data-workspace-page=reviewed_source_intake] details { flex:none; max-height:36dvh; overflow:auto; }
  #erpPage [data-workspace-page=replenishments] .erp-ui-list-page {
    display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto minmax(0,1fr) auto auto;
    align-items:center; gap:5px 8px;
  }
  #erpPage [data-workspace-page=replenishments] .erp-ui-list-page > :is(div,p) { grid-column:1/-1; }
  #erpPage [data-workspace-page=replenishments] .erp-tablewrap { overflow:auto; }
  #erpPage [data-workspace-page=replenishments] .erp-tablewrap + div { text-align:right; }
}
:is(.erp-table,.gjp-table)[data-grid-options] :is(th,td,col)[hidden] { display:none !important; }
:is(#erpPage,.erp-dialog) :is(.erp-table,.gjp-table)[data-grid-options] th > :is(.erp-grid-gear,.erp-grid-sort) {
  border:0; color:inherit; background:transparent; padding:0 3px; min-height:0; font:inherit; cursor:pointer;
}
:is(#erpPage,.erp-dialog) :is(.erp-table,.gjp-table)[data-grid-options] th > .erp-grid-gear {
  display:inline-grid; place-items:center; width:22px; height:20px; padding:0; vertical-align:middle;
}
:is(#erpPage,.erp-dialog) :is(.erp-table,.gjp-table)[data-grid-options] th[data-grid-index]
  > :is(.erp-ui-column-label,.erp-grid-label) { display:none; }
:is(#erpPage,.erp-dialog) :is(.erp-table,.gjp-table)[data-grid-options] th:has(> .erp-grid-gear):not([data-grid-index])
  > :is(.erp-ui-column-label,.erp-grid-label,.erp-grid-sort,[data-ui-sort]) {
  display:inline-block; width:auto; max-width:calc(100% - 22px); padding:0 3px;
  vertical-align:middle; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.erp-grid-context {
  position:fixed; z-index:2000; display:grid; min-width:116px; padding:4px;
  background:#fff; border:1px solid #bdcad5; border-radius:4px; box-shadow:0 3px 10px #12334d26;
}
.erp-grid-context button { text-align:left; border:0; background:#fff; color:#223754; padding:7px 10px; cursor:pointer; }
.erp-grid-context button:is(:hover,:focus-visible) { background:#e6f2fb; }
.erp-grid-options .modalbox { width:min(760px,calc(100vw - 30px)); }
.erp-grid-options h2 { margin:0 0 10px; font-size:16px; }
.erp-grid-option-list { display:grid; gap:3px; max-height:55vh; overflow:auto; }
.erp-grid-option { display:grid; grid-template-columns:24px minmax(100px,1fr) minmax(110px,1.4fr) repeat(4,auto); gap:5px; align-items:center; }
.erp-grid-option input[type=text] { width:100%; min-width:0; }
.erp-grid-option input[type=checkbox] { justify-self:center; }
@media(max-width:600px) { .erp-grid-option { grid-template-columns:24px 1fr 1.3fr; } }

#erpPage .erp-entry-table{width:max-content;min-width:0;table-layout:fixed}
#erpPage .erp-entry-table :is(th,td){overflow-wrap:anywhere}
#erpPage .erp-entry-table :is(.docf-product,select){min-width:0}
#erpPage .erp-entry-table:not([data-doc-columns]) :is(th,td.erp-mono){white-space:normal}
#erpPage .erp-tablewrap:has(> .erp-entry-table){width:fit-content;max-width:100%}

.master-picker-dialog.master-picker-compact[data-erp-size="sales-stock"] {
  width: min(1030px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  height: min(670px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
}
.master-picker-dialog[data-erp-size="sales-stock"] .master-picker-shell { height: 100%; min-height: 0; }
.master-picker-dialog[data-erp-size="sales-stock"] :is(header, footer, .master-picker-toolbar) { padding-block: 5px; gap: 6px; }
.master-picker-dialog[data-erp-size="sales-stock"] .master-picker-toolbar input[type="search"] { flex-basis: 210px; }
.master-picker-dialog[data-erp-size="sales-stock"] .master-picker-toolbar select { min-width: 104px; }
.master-picker-dialog[data-erp-size="sales-stock"] [data-picker-context] { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.master-picker-dialog[data-erp-size="sales-stock"] .master-picker-notice { padding: 4px 8px; }
.master-picker-dialog[data-erp-size="sales-stock"] .master-picker-table-wrap { min-height: 60px; }
.master-picker-dialog[data-erp-size="sales-stock"] .master-picker-table-wrap :is(tr, th, td) { height: 30px; box-sizing: border-box; }
.master-picker-dialog[data-erp-size="sales-stock"] .master-picker-table-wrap :is(th, td) { padding: 2px 6px; }
.master-picker-dialog[data-erp-size="sales-stock"] th[data-grid-key="selection"]:has(> .erp-grid-gear) .erp-grid-label { display: none; }
.master-picker-dialog[data-erp-size="sales-stock"] td.master-picker-check { text-align: center; }
.master-picker-dialog[data-erp-size="sales-stock"] input[data-picker-check] {
  width: 14px; height: 14px; min-width: 0; min-height: 0; margin: 0; padding: 0; vertical-align: middle;
}
.master-picker-dialog[data-erp-size="sales-stock"] tr.is-already-selected td:first-child::before { content: none; }

dialog[open][data-erp-positioned] {
  position: fixed;
  inset: var(--erp-dialog-y) auto auto var(--erp-dialog-x);
  margin: 0;
  max-width: calc(100vw - var(--erp-dialog-x) - 8px);
  max-height: calc(100dvh - var(--erp-dialog-y) - 8px);
}
dialog[open][data-erp-resized],
dialog.master-picker-dialog.master-picker-compact[data-erp-size="sales-stock"][data-erp-resized] {
  box-sizing: border-box;
  width: var(--erp-dialog-width);
  height: var(--erp-dialog-height);
}
dialog.master-picker-dialog.master-picker-compact[data-erp-size="sales-stock"][data-erp-positioned] {
  max-width: calc(100vw - var(--erp-dialog-x) - 8px);
  max-height: calc(100dvh - var(--erp-dialog-y) - 8px);
}
dialog [data-erp-drag-title] { cursor: move; touch-action: none; }
dialog [data-erp-drag-title] :is(button, a, input) { cursor: revert; }
dialog button[data-erp-resize-dialog] {
  position: absolute;
  inset: auto 0 0 auto;
  z-index: 2;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent linear-gradient(135deg, transparent 56%, #7a9cb7 57%, #7a9cb7 62%, transparent 63%, transparent 73%, #7a9cb7 74%, #7a9cb7 79%, transparent 80%);
  cursor: nwse-resize;
  touch-action: none;
}
dialog:has(> [data-erp-resize-dialog]) :is(.master-picker-shell > footer, .modalactions) { padding-inline-end: 24px; }
dialog.master-picker-dialog[data-erp-resized] .master-picker-shell { height: 100%; min-height: 0; overflow: auto; }
dialog:is(.asm-template-dialog,.inv-distribution-dialog)[data-erp-resized] .modalbox {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
}
dialog:is(.asm-template-dialog,.inv-distribution-dialog)[data-erp-resized] :is(.asm-template-grid,.erp-tablewrap) {
  flex: 1 1 auto;
  min-height: 60px;
  max-height: none;
  overflow: auto;
}

#erpPage .docf-lines .docf-sales-totals { position:sticky; bottom:0; z-index:1; }
#erpPage .docf-lines .docf-sales-totals td { background:var(--erp-ui-subtotal, #fffbe4); border-top:1px solid #d9d8c3; white-space:normal; }
#erpPage .docf-lines td.docf-amount input { font-weight:600; }

#erpPage .docf-page[data-sheet-layout="sales_out"],
#erpEntryPriceDialog {
  font: 13px/1.45 Arial, "Microsoft YaHei", sans-serif;
}
#erpPage .docf-page[data-sheet-layout="sales_out"] :is(input, select, button) { font-family: inherit; }
#erpPage .docf-page[data-sheet-layout="sales_out"] .docf-lines :is(th, td) {
  height: 31px !important;
  padding-block: 1px !important;
}
#erpPage .docf-page[data-sheet-layout="sales_out"] .docf-lines tbody tr { height: 31px; }
#erpPage .docf-page[data-sheet-layout="sales_out"] .docf-lines :is(input, select, .erp-lookup-control) {
  min-height: 0;
  height: 26px;
}
#erpPage .docf-sales-empty select { visibility: hidden; }
#erpPage .docf-sales-empty [data-docf-remove][hidden] { display: none; }
#erpPage .docf-sales-empty input:not(:focus)::placeholder { color: transparent; }
#erpPage .docf-lines .docf-sales-totals td { font-weight: 600; font-variant-numeric: tabular-nums; }
#erpPage .docf-line-status { color: #245371; }
#erpPage .docf-gift-menu { inset: auto; margin: 0; padding: 3px; }
#erpPage .docf-gift-menu:not(:popover-open) { display: none; }
#erpPage .docf-gift-menu button { min-width: 92px; }
#erpEntryPriceDialog .docf-price-box { inline-size: min(330px, calc(100vw - 32px)); }
#erpEntryPriceDialog .erp-table { width: 100%; margin: 0; }
#erpEntryPriceDialog .erp-table :is(th, td) { padding: 0; }
#erpEntryPriceDialog .erp-table th { padding: 5px 10px; }
#erpEntryPriceDialog .erp-table label { display: flex; align-items: center; gap: 8px; min-height: 30px; padding-inline: 10px; }
#erpEntryPriceDialog .erp-table .erp-num label { justify-content: end; }
#erpEntryPriceDialog .erp-table tr:has(input:checked) td { background: #e9f4fd; }
#erpEntryPriceDialog .erp-table tr:has(input:enabled) label { cursor: pointer; }
#erpEntryPriceDialog [data-price-error] { padding: 6px 10px; }

:is(#erpPage, .erp-dialog) .doc-sheet {
  --doc-sheet-row: 30px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #c9d8e4;
  border-radius: 2px;
  background: #fff;
  color: #253b50;
  font: 13px/1.5 Arial, "Microsoft YaHei", sans-serif;
}
#erpPage .erp-workspace-panel > .doc-sheet-workspace {
  width: 100%;
  min-height: 430px;
  height: calc(100dvh - var(--erp-sheet-top, 128px) - 12px);
  padding: 0;
}
#erpPage .doc-sheet-workspace:not(:has(.doc-sheet-body)) { min-height: 0; height: auto; }
.erp-dialog .doc-sheet.modalbox { width: min(1270px, calc(100vw - 32px)); padding: 0; }
.doc-sheet > :not(.doc-sheet-body) { flex: none; }
.doc-sheet .doc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  flex-wrap: wrap;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #d5dfe8;
  background: #fff;
  color: inherit;
}
.doc-sheet .doc-sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0; }
.doc-sheet-title, .doc-sheet-meta { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.doc-sheet-meta { font-variant-numeric: tabular-nums; }
.doc-sheet-fields {
  display: flex;
  align-items: start;
  flex-wrap: wrap;
  gap: 5px 16px;
  padding: 8px 12px;
}
.doc-sheet-field { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
.doc-sheet-fields > .doc-sheet-field { flex: 0 1 auto; max-width: 100%; }
.doc-sheet-label { color: #526879; white-space: nowrap; }
.doc-sheet-value { min-width: 0; padding: 2px 7px; background: #f3f6f9; overflow-wrap: anywhere; }
.doc-sheet :is(.doc-reversal-note, .doc-links, .docf-effect, .erp-hint) { margin: 5px 12px; }
.doc-sheet-body, .doc-sheet-grid-section { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; min-width: 0; }
.doc-sheet-body { gap: 6px; padding: 0 7px; }
.doc-sheet-grid-section h3 { margin: 3px 0; font-size: 13px; }
:is(#erpPage, .erp-dialog) .doc-sheet .doc-sheet-grid {
  flex: 1 1 0;
  width: 100%;
  min-height: 145px;
  border-radius: 0;
  scrollbar-gutter: stable;
}
.doc-sheet-workspace .doc-sheet-grid:only-child { min-height: 200px; }
.erp-dialog .doc-sheet-body { min-height: min(410px, 53dvh); }
.erp-dialog .doc-sheet-body:has(.doc-sheet-grid-section) { min-height: min(490px, 65dvh); }
:is(#erpPage, .erp-dialog) .doc-sheet .doc-sheet-grid > table[data-doc-columns] {
  min-width: 100%;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
.doc-sheet .doc-sheet-grid thead { position: sticky; top: 0; z-index: 2; }
.doc-sheet .doc-sheet-grid tfoot { position: sticky; bottom: 0; z-index: 1; }
:is(#erpPage, .erp-dialog) .doc-sheet .doc-sheet-grid :is(th, td) {
  box-sizing: border-box;
  height: var(--doc-sheet-row);
  padding: 3px 8px;
  line-height: 20px;
  font-size: 13px;
}
.doc-sheet .doc-sheet-grid th { background: var(--erp-ui-header, #2881c7); color: #fff; font-weight: 400; }
.doc-sheet .doc-sheet-grid td { border-right: 1px solid #e1e8ee; }
.doc-sheet .doc-sheet-grid tbody tr:not(.doc-sheet-spacer) td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-sheet .doc-sheet-grid tfoot td { background: var(--erp-ui-subtotal, #fffbe4); font-weight: 600; border-top: 1px solid #d9d8c3; }
:is(#erpPage, .erp-dialog) .doc-sheet .doc-sheet-grid tfoot td:first-child {
  padding-inline: 4px;
  text-overflow: clip;
  white-space: nowrap;
}
:is(#erpPage, .erp-dialog) .doc-sheet .doc-sheet-spacer td {
  height: auto;
  padding: 0;
  background: repeating-linear-gradient(
    to bottom,
    #fafbfd 0 calc(var(--doc-sheet-row) - 1px),
    #e3e9ef calc(var(--doc-sheet-row) - 1px) var(--doc-sheet-row),
    #fff var(--doc-sheet-row) calc(var(--doc-sheet-row) * 2 - 1px),
    #e3e9ef calc(var(--doc-sheet-row) * 2 - 1px) calc(var(--doc-sheet-row) * 2)
  );
}
.doc-sheet-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 18px;
  padding: 5px 12px;
}
.doc-sheet-footer .doc-sheet-value { padding-inline: 0; background: none; }
.doc-sheet-settlement { margin-left: auto; display: flex; gap: 5px 16px; flex-wrap: wrap; }
.doc-sheet-settlement .doc-sheet-value { font-weight: 600; }
.doc-sheet-more { border-block: 1px solid #d5dfe8; }
.doc-sheet-more > summary { padding: 5px 12px; color: #245b86; cursor: pointer; }
.doc-sheet-more-content { padding: 0 12px 8px; max-height: min(35dvh, 310px); overflow: auto; }
.doc-sheet-more-content > .doc-sheet-fields { padding: 3px 0; }
.doc-sheet-more-content h3 { margin: 7px 0 4px; font-size: 13px; }
.doc-sheet .doc-actions {
  margin: 0;
  padding: 6px 12px;
  background: #f8fafc;
  border-top: 1px solid #d5dfe8;
}
.doc-sheet .doc-actions button { font-family: inherit; }
@media (max-width: 760px), (max-height: 620px) {
  #erpPage .erp-workspace-panel > .doc-sheet-workspace { height: auto; min-height: 0; }
  .doc-sheet-workspace .doc-sheet-body { flex: auto; min-height: 270px; }
  .doc-sheet-workspace .doc-sheet-grid { flex: auto; max-height: 45dvh; }
}
