/* Workspace-focused navigation and tables. Kept separate from the legacy compact stylesheet. */
[hidden]{display:none!important}
.lookup-anchor{position:relative}
.lookup-results{position:absolute;z-index:20;left:0;right:0;top:100%;max-height:220px;overflow:auto;background:#fff;border:1px solid #cad4df;border-radius:7px;box-shadow:0 8px 20px #0002}
.lookup-results button{display:block;width:100%;text-align:left;background:#fff;color:#17202a;border:0;border-bottom:1px solid #edf1f4;padding:9px;cursor:pointer}
.lookup-results button:hover,.lookup-results button:focus{background:#eef5f8}
.lookup-message{padding:9px}
aside{overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#51667c transparent}
.brand{position:static;flex:0 0 auto;background:#14263d;display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:18px 16px}
.v24-brand-logo{display:block;width:154px;height:auto;object-fit:contain}
.brand small{color:#9fb0c1;font-size:.62rem;letter-spacing:.08em;white-space:nowrap}
.v24-login-logo{display:block;width:min(310px,88%);height:auto;margin:0 auto 12px}
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
nav{gap:8px}
.nav-group{border:1px solid #ffffff12;border-radius:9px;background:#ffffff05}
.nav-group[hidden]{display:none}
.nav-group summary{cursor:pointer;list-style:none;padding:10px 13px;color:#9fb0c1;font-size:.75rem;font-weight:800;letter-spacing:.08em;user-select:none}
.nav-group summary::-webkit-details-marker{display:none}
.nav-group summary::after{content:"＋";float:right;font-size:.9rem}
.nav-group[open] summary::after{content:"－"}
.nav-group>div{display:grid;gap:3px;padding:0 5px 6px}
.nav-group button{padding:9px 11px}
.panel{min-height:180px}
.content-surface{min-width:0}
.data-grid-scroll{max-height:calc(100vh - 250px);overflow:auto}
.list-chrome{position:sticky;left:0;padding:15px 16px 13px;border-bottom:1px solid #e5eaf0;background:#f9fbfc}
.operational-search{display:flex;align-items:flex-end;gap:10px}
.list-search-field{display:grid;flex:1;gap:7px;min-width:0;color:#34465a;font-size:.84rem;font-weight:750}
.list-search-field input{width:100%;height:42px;border:1px solid #c8d2dc;border-radius:8px;padding:0 13px;background:#fff;outline:none}
.list-search-field input:focus{border-color:#168b78;box-shadow:0 0 0 3px #2fc4a722}
.search-submit{height:42px;min-width:76px;border:0;border-radius:8px;padding:0 17px;background:#176f68;color:#fff;font-weight:750;cursor:pointer}
.search-submit:hover{background:#125b56}
.list-commandbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:12px}
.list-pagination,.list-bulk-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.list-pagination>span{margin-right:3px;color:#526579;font-size:.88rem;font-weight:700}
.list-commandbar .secondary{padding:8px 13px}
.list-commandbar button:disabled{cursor:not-allowed;opacity:.46}
.content-surface>.empty{display:grid;place-items:center;min-height:180px;padding:30px;border-top:0}
thead{position:sticky;top:0;z-index:2}
th{box-shadow:0 1px 0 #dce3ea}
th:last-child,td:last-child{position:sticky;right:0;background:#fff;box-shadow:-1px 0 #edf0f3}
th:last-child{background:#f7f9fb}
/* Z521 (资金记录 only): the frozen 操作 column must not cover the amounts on a laptop screen.
   Its buttons wrap inside a bounded width; long names and remarks wrap. */
.money-grid td.row-actions-cell{white-space:normal;min-width:120px;max-width:210px}
.money-grid td.row-actions-cell .row-action{margin:2px 4px 2px 0}
.money-grid td[data-col="party"]{white-space:normal;min-width:140px;max-width:240px;overflow-wrap:anywhere}
.money-grid td[data-col="remarks"]{white-space:normal;min-width:160px;max-width:320px;overflow-wrap:anywhere}
/* Mac browsers hide scroll bars until you scroll; keep this table's side-to-side bar visible. */
.money-grid::-webkit-scrollbar{width:12px;height:12px}
.money-grid::-webkit-scrollbar-track{background:#eef2f6;border-radius:6px}
.money-grid::-webkit-scrollbar-thumb{background:#b7c3cf;border-radius:6px;border:2px solid #eef2f6}
.money-grid::-webkit-scrollbar-thumb:hover{background:#8d9bab}
/* Keep the model visible while the wide inventory ledger scrolls.  The ETA text
   is allowed to wrap instead of forcing every other field off the screen. */
.inventory-grid th:first-child,.inventory-grid td:first-child{position:sticky;left:0;z-index:3;min-width:235px;max-width:300px;background:#fff;box-shadow:1px 0 #dce3ea;white-space:normal;overflow-wrap:anywhere}
/* Sticky table sections form a lower stacking context than sticky body cells in
   Safari, so the model header can disappear under the first data row.  Stick
   each header cell to the top and keep it above the frozen model column. */
.inventory-grid thead{position:static;z-index:auto}
.inventory-grid thead th{position:sticky;top:0;z-index:5;background:#f7f9fb}
.inventory-grid thead th:first-child{left:0;z-index:7}
.inventory-grid th:last-child,.inventory-grid td:last-child{position:static;box-shadow:none}
.inventory-grid td{vertical-align:top}
.inventory-eta-count{font-weight:650;color:#345b56;margin-bottom:4px}
.inventory-eta-list{max-height:112px;overflow-y:auto;overscroll-behavior:contain;min-width:260px;max-width:390px;white-space:normal;overflow-wrap:anywhere;line-height:1.45}
.inventory-eta-list>div{padding:3px 0;border-bottom:1px solid #edf0f3}
.inventory-grid th:nth-last-child(2),.inventory-grid td:nth-last-child(2){min-width:220px;max-width:390px;white-space:normal;overflow-wrap:anywhere;line-height:1.5}
.list-toolbar{position:sticky;left:0;display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid #e5eaf0;background:#fff}
.list-toolbar input{width:min(360px,100%);height:38px;border:1px solid #c8d2dc;border-radius:8px;padding:0 12px;outline:none}
.list-toolbar input:focus{border-color:#168b78;box-shadow:0 0 0 3px #2fc4a722}
.list-count{color:#718096;font-size:.84rem}
.status,.row-action{white-space:nowrap}
.price-schedule{display:grid;gap:5px;min-width:190px;white-space:normal}.price-schedule span{display:block;padding:5px 8px;border-radius:7px;border:1px solid #d8e1e9;background:#f7f9fb;color:#526579}.price-schedule .changed{border-color:#a9ddd3;background:#e8f7f3;color:#12685d;font-weight:650}.price-change-guidance{padding:11px 13px;border-left:4px solid #168b78;border-radius:7px;background:#eef9f7;color:#345b56;line-height:1.55}
.status[data-tone="success"]{background:#e8f7f3;color:#137161}
.status[data-tone="warning"]{background:#fff4e5;color:#8a5312}
.status[data-tone="danger"]{background:#fff0ee;color:#b42318}
.status[data-tone="neutral"]{background:#eef2f6;color:#526579}
.money-overview{display:grid;gap:14px;padding:16px;border-bottom:1px solid #dfe7ee;background:linear-gradient(135deg,#f6fbfa,#f8fafc)}
.money-flow{display:flex;align-items:center;flex-wrap:wrap;gap:8px;color:#526579;font-size:.84rem}
.money-flow strong{margin-right:4px;color:#162335;font-size:.9rem}
.money-flow span{padding:5px 9px;border:1px solid #cfe0dc;border-radius:999px;background:#fff;color:#176f68;font-weight:700}
.money-flow i{color:#91a2b3;font-style:normal}
.money-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.money-cards article{display:grid;gap:5px;min-height:104px;padding:14px 16px;border:1px solid #dce6eb;border-radius:11px;background:#fff;box-shadow:0 2px 7px #14263d0a}
.money-cards article:first-child{border-left:4px solid #e7a23b;background:#fffaf2}
.money-cards small{color:#68788a;font-weight:700}
.money-cards strong{color:#162335;font-size:1.25rem}
.money-cards span{color:#718096;font-size:.78rem}
.money-filters{display:flex;flex-wrap:wrap;gap:8px}
.money-filters button{border:1px solid #cbd5df;border-radius:999px;padding:7px 12px;background:#fff;color:#526579;font-size:.82rem;font-weight:700;cursor:pointer}
.money-filters button b{display:inline-grid;min-width:20px;height:20px;place-items:center;margin-left:4px;border-radius:999px;background:#eef2f6;font-size:.72rem}
.money-filters button.active{border-color:#176f68;background:#176f68;color:#fff}
.money-filters button.active b{background:#ffffff2b;color:#fff}
.money-status-pending td:first-child{box-shadow:inset 4px 0 #e7a23b}
.money-status-confirmed td:first-child{box-shadow:inset 4px 0 #1c927f}
.money-status-rejected td:first-child,.money-status-reversed td:first-child{box-shadow:inset 4px 0 #d05449}
.money-badge-pending{background:#fff4e5;color:#8a5312}
.money-badge-confirmed{background:#e8f7f3;color:#137161}
.money-badge-rejected,.money-badge-reversed{background:#fff0ee;color:#b42318}
.row-action:hover,.secondary:hover{border-color:#168b78;color:#176f68}
.row-action.reject:hover{border-color:#d92d20;background:#fff5f4;color:#b42318}
.row-more{display:inline-block;margin-left:5px;vertical-align:top}
.row-more summary{display:inline-block;cursor:pointer;list-style:none;padding:5px 8px;border:1px solid #cbd5df;border-radius:6px;color:#526579;background:#fff;font-size:.82rem;white-space:nowrap}
.row-more summary::-webkit-details-marker{display:none}
.row-more[open] summary{border-color:#168b78;color:#176f68;background:#eefaf7}
.row-more-items{display:inline-flex;flex-wrap:wrap;gap:4px;margin-left:4px}
select,textarea{font:inherit}
.fields select{height:42px;border:1px solid #cad4df;border-radius:7px;padding:0 10px;background:#fff}
.fields input,.fields select,.fields textarea{width:100%;min-width:0}
.fields select[size]{height:auto;min-height:110px}
.fields textarea:focus,.fields select:focus{outline:none;border-color:#168b78;box-shadow:0 0 0 3px #2fc4a722}
.fields>.wide{grid-column:1/-1}
.fields textarea{width:100%;min-height:92px;resize:vertical;border:1px solid #cad4df;border-radius:7px;padding:10px;background:#fff}
.content-surface>.fields,.inline-fields{display:flex;align-items:flex-end;flex-wrap:wrap;gap:14px;margin:0;padding:16px!important;border-bottom:1px solid #e5eaf0;background:#f9fbfc}
.content-surface>.fields>label,.inline-fields>label{flex:1 1 210px;max-width:320px}
.content-surface>.fields>label.wide,.inline-fields>label.wide{flex-basis:100%;max-width:none}
.content-surface>.fields>div.wide{flex:0 0 auto}
.content-surface .form-actions{display:flex;align-items:flex-end;justify-content:flex-end}
.content-surface form button[type="submit"]{min-height:40px;border:0;border-radius:8px;padding:0 16px;background:#176f68;color:#fff;font-weight:750;cursor:pointer}
.content-surface form button[type="submit"]:hover{background:#125b56}
.content-surface form button[type="submit"]:disabled{cursor:not-allowed;opacity:.5}
.inline-operation{border-bottom:1px solid #e5eaf0;background:#fff}
.inline-operation>summary{cursor:pointer;list-style:none;padding:12px 16px;color:#34465a;font-size:.88rem;font-weight:750}
.inline-operation>summary::before{content:"＋";display:inline-block;width:20px;color:#176f68}
.inline-operation[open]>summary::before{content:"－"}
.inline-operation>summary::-webkit-details-marker{display:none}

/* Shared page rhythm: controls stay compact while only the data grid scrolls. */
main{min-width:0;overflow:hidden}
header{gap:18px}
.header-actions{align-items:center;justify-content:flex-end;flex-wrap:wrap}
#price-search,#date-range{align-items:center;flex-wrap:wrap}
.panel{min-width:0}
.list-chrome,.list-toolbar{position:static}
.list-chrome{display:grid;gap:11px}
.operational-search{max-width:760px}
.list-search-field input{min-width:0}
.data-grid-scroll{width:100%;overscroll-behavior:contain;scrollbar-gutter:stable}
table{min-width:max-content}
tbody tr:hover td{background:#f8fbfd}
td{vertical-align:middle}
.empty{min-height:210px;display:grid;place-items:center;color:#718096;background:linear-gradient(180deg,#fff,#fbfcfd)}

/* Custom query pages use the same toolbar language as operational lists. */
#payroll-commission-form,#log-filter,#statement-form,#slow-stock-filter,#commission-period{display:flex;align-items:flex-end;flex-wrap:wrap;gap:14px;margin:0;padding:16px!important;border-bottom:1px solid #e5eaf0;background:#f9fbfc}
#payroll-commission-form>label,#log-filter>label,#statement-form>label,#slow-stock-filter>label,#commission-period>label{flex:1 1 190px;max-width:300px}
#payroll-commission-form>div,#log-filter>div,#statement-form>div,#slow-stock-filter>div,#commission-period>div{flex:0 0 auto}
#log-filter+div{padding:11px 16px!important;color:#526579;font-size:.88rem;font-weight:700;border-bottom:1px solid #edf0f3}
#content>.pager,#content>div:last-child:has(>[data-log-page]){display:flex;align-items:center;gap:8px;padding:12px 16px!important;border-top:1px solid #e5eaf0;background:#f9fbfc}

/* Backup controls no longer look like unstyled browser forms. */
#backup-search{display:flex;align-items:center;gap:9px;padding:14px 16px!important;border-bottom:1px solid #e5eaf0;background:#f9fbfc}
#backup-search input{width:min(420px,100%);height:40px;border:1px solid #c8d2dc;border-radius:8px;padding:0 12px;outline:none}
#backup-search button,#backup-form button,.pager button{min-height:38px;border:1px solid #c8d2dc;border-radius:8px;padding:0 14px;background:#fff;color:#26384a;font-weight:700;cursor:pointer}
#backup-search button{border-color:#176f68;background:#176f68;color:#fff}
#backup-form{margin:0!important;background:#fff}
.pager{display:flex;align-items:center;gap:9px;padding:12px 16px;border-top:1px solid #e5eaf0;background:#f9fbfc}
.pager span{color:#526579;font-size:.88rem;font-weight:700}
.pager button:disabled{cursor:not-allowed;opacity:.45}
#cost-preview-panel{overflow:auto}
#cost-preview-panel table{margin-top:10px;background:#fff}
#price-search input,#date-range input{height:40px;background:#fff;outline:none}
#part-search-button,#fields button[type="button"]{min-height:40px;border:1px solid #176f68;border-radius:8px;padding:0 14px;background:#fff;color:#176f68;font-weight:750;cursor:pointer}
#part-search-button{background:#176f68;color:#fff}
#fields button[type="button"]:hover{background:#eefaf7}

/* Dialogs remain usable for long sales/purchase forms and split orders. */
dialog{width:min(760px,calc(100% - 32px));max-height:calc(100vh - 32px);overflow:hidden}
#editor-form{display:flex;max-height:calc(100vh - 32px);flex-direction:column;padding:22px 24px 18px}
.dialog-head{flex:0 0 auto;padding-bottom:4px}
.dialog-head button{display:grid;place-items:center;width:38px;height:38px;border-radius:8px;color:#526579}
.dialog-head button:hover{background:#eef2f6;color:#162335}
#fields{min-height:0;overflow:auto;padding:2px 5px 4px 1px}
#fields>div:not(.wide){grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px;border:1px solid #dce3ea;border-radius:10px;background:#f9fbfc}
#fields>div:not(.wide)>strong{grid-column:1/-1;color:#34465a}
.dialog-actions{flex:0 0 auto;margin-top:14px;padding-top:14px;border-top:1px solid #edf0f3}
.dialog-actions button{min-height:40px}
.fields input:focus,.fields textarea:focus,.fields select:focus,#backup-search input:focus{outline:none;border-color:#168b78;box-shadow:0 0 0 3px #2fc4a722}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #2fc4a755;outline-offset:2px}

/* Cost governance is a compact diagnostic workspace, not a tall generic list form. */
.governance-page{display:grid;gap:14px;padding:16px;background:#f4f7f9}
.governance-overview,.governance-results,.governance-sync{min-width:0;border:1px solid #dce3ea;border-radius:11px;background:#fff;box-shadow:0 1px 3px #14263d0a}
.governance-overview{padding:16px}
.governance-health{display:flex;align-items:flex-start;gap:11px;padding:13px 14px;border-radius:9px;background:#eef8f5;color:#176f68}
.governance-health.danger{background:#fff1ef;color:#a33a2d}
.governance-health-dot{flex:0 0 auto;width:10px;height:10px;margin-top:5px;border-radius:50%;background:#1f9d84;box-shadow:0 0 0 4px #1f9d8420}
.governance-health.danger .governance-health-dot{background:#d04a3a;box-shadow:0 0 0 4px #d04a3a20}
.governance-health div{display:grid;gap:3px;min-width:0}
.governance-health strong{font-size:1rem}.governance-health span{font-size:.83rem;color:#526579}
.governance-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}
.governance-metric{display:grid;grid-template-columns:1fr auto;align-items:baseline;gap:3px 10px;padding:12px 13px;border:1px solid #e4e9ee;border-radius:9px;background:#fbfcfd}
.governance-metric>span{grid-column:1/-1;color:#607084;font-size:.78rem;font-weight:750}.governance-metric strong{font-size:1.08rem;color:#26384a}.governance-metric small{color:#718096;font-size:.75rem}
.governance-metric.warning{border-color:#f1d6a8;background:#fffaf2}.governance-metric.danger{border-color:#efc6c0;background:#fff7f5}
.governance-scope{margin:12px 1px 0;color:#607084;font-size:.82rem;line-height:1.55}
.governance-results{overflow:hidden}
.governance-results-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 15px;border-bottom:1px solid #e5eaf0;background:#f9fbfc}
.governance-results-head>div:first-child{display:grid;gap:2px}.governance-results-head strong{color:#34465a}.governance-results-head>div:first-child span{color:#718096;font-size:.78rem}
.governance-pagination{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:7px}.governance-pagination>span{margin-right:3px;color:#526579;font-size:.82rem;font-weight:700}.governance-pagination .secondary{padding:7px 11px}.governance-pagination button:disabled{cursor:not-allowed;opacity:.45}
.governance-results-body{min-width:0}.governance-results-body>.list-toolbar{border-top:0}.governance-results-body .data-grid-scroll{max-height:360px}.governance-results-body .empty{min-height:120px}
.governance-empty{display:grid;place-items:center;gap:4px;min-height:112px;padding:24px;text-align:center;color:#718096;background:#fff}.governance-empty strong{color:#34465a}.governance-empty span{font-size:.84rem}
.governance-sync{overflow:hidden}
.governance-sync>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 15px;cursor:pointer;list-style:none;color:#34465a}.governance-sync>summary::-webkit-details-marker{display:none}.governance-sync>summary>span:first-child{display:grid;gap:2px}.governance-sync summary small{color:#718096;font-size:.78rem;font-weight:400}.governance-sync-toggle{flex:0 0 auto;color:#176f68;font-size:.82rem;font-weight:750}.governance-sync-toggle::after{content:"＋";margin-left:7px}.governance-sync[open] .governance-sync-toggle::after{content:"－"}
.governance-sync-body{padding:14px 15px 16px;border-top:1px solid #e5eaf0;background:#fffaf2}.governance-sync-body>p{margin:0 0 12px;color:#70521d;font-size:.83rem;line-height:1.55}
#cost-sync-form{display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px;margin:0}#cost-sync-form label{display:grid;flex:0 1 320px;gap:6px;min-width:220px;color:#34465a;font-size:.83rem;font-weight:750}#cost-sync-form input{width:100%;height:40px;border:1px solid #c8d2dc;border-radius:8px;padding:0 12px;background:#fff;outline:none}#cost-sync-form input:focus{border-color:#168b78;box-shadow:0 0 0 3px #2fc4a722}#cost-sync-form button{min-height:40px;border:0;border-radius:8px;padding:0 16px;background:#176f68;color:#fff;font-weight:750;cursor:pointer}#cost-sync-form button:hover{background:#125b56}

@media(max-width:1100px) and (min-width:721px){
  .app-shell{grid-template-columns:210px 1fr}
  aside{padding:16px 12px}
  .brand{padding:14px 10px 18px}
  .v24-brand-logo{width:140px}
  main{padding:22px 20px}
  header{align-items:flex-start}
}
@media(max-width:720px){
  aside{max-height:48vh;overflow-x:hidden;overflow-y:auto}
  nav{display:grid;overflow:visible;min-width:0;width:100%}.nav-group{min-width:0;width:100%}.nav-group summary{white-space:nowrap}
  .nav-group>div{display:grid;overflow:visible}.list-toolbar{position:static}
  /* z516: phones keep a bounded table box (not max-height:none) so the sticky header stays on top
     while scrolling long lists; reaching the box end hands the scroll back to the page. */
  .data-grid-scroll{max-height:calc(100vh - 160px);overscroll-behavior-y:auto}
  th:last-child,td:last-child{position:static;box-shadow:none}
  /* z516: the 操作 header cell must keep sticking to the top (only the right-edge freeze is dropped). */
  thead th:last-child{position:sticky;top:0;right:auto}
  .operational-search{align-items:stretch}.list-search-field input{height:40px}.search-submit{height:40px;align-self:end}
  .list-commandbar{align-items:flex-start;flex-direction:column}.list-bulk-actions{width:100%}
  header{display:grid;gap:12px}.header-actions{justify-content:flex-start}
  .panel{border-radius:10px}
  #fields>div:not(.wide){grid-template-columns:1fr}
  #payroll-commission-form>label,#log-filter>label,#statement-form>label,#slow-stock-filter>label,#commission-period>label{max-width:none}
  .content-surface>.fields>label,.inline-fields>label{max-width:none}
  .money-cards{grid-template-columns:1fr}.money-flow i{display:none}.money-flow{align-items:flex-start;flex-direction:column}.money-filters{overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}.money-filters button{flex:0 0 auto}
  #backup-search{align-items:stretch;flex-direction:column}
  #backup-search input{width:100%}
  .governance-page{padding:10px;gap:10px}.governance-overview{padding:12px}.governance-metrics{grid-template-columns:1fr}.governance-results-head{align-items:flex-start;flex-direction:column}.governance-pagination{justify-content:flex-start}.governance-sync>summary{align-items:flex-start}.governance-sync-toggle{margin-top:2px}#cost-sync-form{align-items:stretch;flex-direction:column}#cost-sync-form label{flex-basis:auto;min-width:0;max-width:none}#cost-sync-form button{width:100%}
}
.boss-workflow-bar{margin:0 0 14px;padding:12px 16px;border:1px solid #d7e1ea;border-radius:12px;background:#f7fafc;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.boss-workflow-bar strong{margin-right:4px}.boss-workflow-bar button{padding:8px 12px}.boss-workflow-bar button.urgent{background:#b42318;border-color:#b42318;color:#fff}.boss-workflow-bar button.clear{background:#eef3f7;border-color:#d7e1ea;color:#536273}

/* Layout rules for dynamically rendered controls; allowed by the strict CSP. */
[data-layout="0"]{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:12px}
[data-layout="1"]{height:42px}
[data-layout="2"]{height:42px;border:1px solid #cad4df;border-radius:7px}
[data-layout="3"]{margin:0 12px 12px}
[data-layout="4"]{min-height:84px;border:1px solid #cad4df;border-radius:7px}
[data-layout="5"]{min-height:92px;padding:10px;border:1px solid #cad4df;border-radius:7px}
[data-layout="6"]{padding:0 18px 12px}
[data-layout="7"]{padding:12px}
[data-layout="8"]{padding:14px}
[data-layout="9"]{padding:18px}
[data-layout="10"]{white-space:pre-wrap;max-width:520px;max-height:260px;overflow:auto}
.inline-result{margin-left:10px}
.header-filter{display:flex;gap:6px}.header-filter-input{border:1px solid #c8d2dc;border-radius:8px;padding:8px}

.inventory-grid th:last-child,.inventory-grid td:last-child{min-width:320px;max-width:420px;white-space:normal}
.inventory-cost-layers{display:grid;gap:6px;max-height:190px;overflow:auto;text-align:left}.inventory-cost-layers>div{padding:6px 0;border-bottom:1px solid #edf0f3}.inventory-cost-layers small{display:block;color:#68788a;line-height:1.35}.inventory-cost-layers strong{color:#26384a}
.receipt-context{margin:0;padding:12px 14px;border:1px solid #cde5dd;border-radius:8px;background:#f2faf7;color:#265a4d;line-height:1.55}.receipt-context strong{overflow-wrap:anywhere}
.backorder-toolbar{display:flex;align-items:center;gap:12px;margin:0 0 14px}.backorder-toolbar input{width:min(440px,100%);padding:10px 12px;border:1px solid #cad4df;border-radius:8px}.backorder-list{display:grid;gap:12px;max-width:1100px}.backorder-card{min-width:0;padding:15px 18px;border:1px solid #d9e2eb;border-radius:10px;background:#fff}.backorder-card header{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px}.backorder-card header strong{color:#183b53}.backorder-card header small{margin-left:auto}.backorder-model{font-weight:700;overflow-wrap:anywhere;margin:10px 0}.backorder-metrics{display:flex;flex-wrap:wrap;gap:9px 20px;margin-bottom:9px}.backorder-alert{color:#b33a2b;font-weight:700}.backorder-card details{margin-top:10px;border-top:1px solid #e8edf2;padding-top:10px}.backorder-card summary{cursor:pointer;color:#176d72}.backorder-card ul{list-style:none;padding:0;margin:9px 0}.backorder-card li{display:flex;flex-wrap:wrap;gap:8px 20px;padding:7px 0;border-bottom:1px solid #edf0f3}.backorder-card li strong{overflow-wrap:anywhere}.backorder-card small{color:#607485}
.profit-board{padding:20px;display:grid;gap:18px;background:#f5f8fb}
.board-toolbar,.board-presets,#board-period,.board-reconcile,.board-attention,#board-search{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.board-toolbar{justify-content:space-between}.board-toolbar label,#board-period label{display:grid;gap:5px;font-size:.85rem;color:#526579}
.board-toolbar input,.board-toolbar select,#board-search input{padding:9px 11px;border:1px solid #cbd7e1;border-radius:7px;background:white}
.board-presets .selected{background:#176f68;color:white}.board-period-note{font-size:.85rem;color:#526579;line-height:1.6}
.board-presets button,.board-attention button{padding:9px 12px;border:1px solid #cbd7e1;border-radius:7px;cursor:pointer}.board-attention button{background:#fff;color:#6e5d32}.board-presets button:focus-visible,.board-card:focus-visible{outline:3px solid #168b78;outline-offset:2px}
.board-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.board-card{display:flex;flex-direction:column;gap:10px;text-align:left;background:white;color:#19394c;border:1px solid #dbe4ed;border-radius:12px;padding:18px 15px;box-shadow:0 2px 7px #163a5108;cursor:pointer}
.board-card strong{font-size:1.65rem;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.board-card span{font-size:.9rem;font-weight:650}.board-card small{color:#627786;font-weight:normal;line-height:1.5;min-height:3em}.board-card em{font-size:.75rem;font-style:normal;color:#176f68}.board-card.selected{border-color:#168b78;box-shadow:0 0 0 2px #168b7825}.board-card.negative strong,.board-rankings .negative{color:#b23f37}
.board-reconcile{color:#526579;font-size:.8rem}.board-attention{padding:14px 16px;border:1px solid #eadfbf;border-radius:9px;background:#fff9ec;font-size:.85rem;color:#6e5d32}
.board-detail,.board-rankings>div{padding:18px;background:white;border:1px solid #dbe4ed;border-radius:12px;min-width:0}.board-detail-head{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap}.board-detail-head h2{margin:0;font-size:1.1rem}.board-detail-head span{font-size:.8rem;color:#627786}#board-search{margin:16px 0}#board-search>input{flex:1;min-width:180px}#board-search label input{width:80px}.board-detail-total{font-size:.85rem;color:#526579;margin:10px 0}.board-detail .list-pagination{margin-top:12px}
.board-rankings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.board-rankings h3{margin:0 0 5px;font-size:1rem}.board-rankings small{color:#627786}.board-rankings ol{margin-bottom:0;padding-left:20px}.board-rankings li{padding:12px 0;border-bottom:1px solid #edf1f5}.board-rankings li span{display:inline-block;max-width:65%;overflow-wrap:anywhere}.board-rankings li strong{float:right;font-variant-numeric:tabular-nums}
@media(max-width:1100px){.board-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){.profit-board{padding:12px;gap:12px}.board-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.board-card:last-child{grid-column:1/-1}.board-rankings{grid-template-columns:1fr}.board-card{padding:14px}.board-card strong{font-size:1.4rem}.board-toolbar,#board-period{align-items:stretch}.board-detail{padding:12px}.board-reconcile{line-height:1.6}}

.purchase-payment-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.purchase-payment-cards{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin-bottom:12px}
.purchase-payment-note{color:#68788a;font-size:.82rem;line-height:1.6;margin:0}
@media(max-width:600px){.purchase-payment-cards{grid-template-columns:1fr}}
/* z412: compact order workbench and a separate order dossier. */
.order-link{border:0;background:transparent;padding:0;color:#146c63;font-weight:700;text-align:left;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.operational-search{flex-wrap:wrap}.operational-search>label:not(.list-search-field){display:grid;gap:7px;font-size:.82rem;color:#34465a}.operational-search select,.operational-search input[type=date]{height:42px;border:1px solid #c8d2dc;border-radius:8px;padding:0 10px;background:white;max-width:170px}.list-search-field{min-width:180px}
.compact-order-grid table{font-size:.82rem}.compact-order-grid th,.compact-order-grid td{padding:11px 10px}.compact-order-grid th:first-child,.compact-order-grid td:first-child{position:sticky;left:0;z-index:2;background:#fff}.compact-order-grid th:nth-child(2),.compact-order-grid td:nth-child(2){position:sticky;left:42px;z-index:2;background:#fff}.compact-order-grid th{background:#f7f9fb!important}.compact-order-grid td:last-child{white-space:normal;min-width:230px;max-width:340px}.compact-order-grid .row-note{display:block;white-space:normal;line-height:1.45;margin:6px 0}.compact-order-grid .row-action{margin-bottom:4px}.mobile-order-list,.mobile-menu{display:none}
#order-detail{width:min(1050px,calc(100% - 24px));max-height:90vh;padding:22px;overflow:auto}.order-detail-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.order-detail-head h2{font-size:1.15rem;margin:0;overflow-wrap:anywhere}.order-detail-head>button{border:0;background:none;font-size:1.7rem;cursor:pointer}.order-detail-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.order-detail-tabs button{border:1px solid #c8d2dc;border-radius:8px;background:white;padding:8px 12px;cursor:pointer}.order-detail-tabs button.active{background:#176f68;color:white;border-color:#176f68}.order-detail-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:0}.order-detail-fields>div{padding:10px;border:1px solid #e1e7ec;border-radius:8px}.order-detail-fields dt{font-size:.8rem;color:#68788a;margin-bottom:6px}.order-detail-fields dd{margin:0;overflow-wrap:anywhere;font-size:.9rem;line-height:1.5}.order-timeline{padding-left:24px}.order-timeline li{padding:10px 0;border-bottom:1px solid #e1e7ec}.order-timeline small{display:block;color:#68788a;margin-bottom:5px}.order-timeline strong,.order-timeline span{margin-right:12px}.order-timeline li{overflow-wrap:anywhere}#order-detail .data-grid-scroll{max-height:55vh}
@media(max-width:720px){
 aside{max-height:none;overflow:visible;padding:10px 14px}.brand{padding:0 0 8px}.brand small{display:none}.v24-brand-logo{width:130px}.mobile-menu{display:block;border:1px solid #ffffff40;border-radius:7px;color:white;background:#213b58;padding:8px 12px;width:100%;text-align:left}#main-nav{display:none}.mobile-nav-open #main-nav{display:grid;max-height:55vh;overflow:auto;margin-top:10px}.account{top:9px}.app-shell main{padding:14px}.compact-order-grid{display:none}.mobile-order-list{display:grid;gap:12px;padding:12px}.mobile-order-card{border:1px solid #dce6eb;border-radius:10px;padding:14px;min-width:0}.mobile-order-card header{display:flex;justify-content:space-between;gap:8px;margin:0 0 10px}.mobile-order-card .order-link,.mobile-order-card>strong,.mobile-order-card p{overflow-wrap:anywhere}.mobile-order-card p{margin:7px 0;font-size:.86rem}.mobile-order-card footer{margin-top:12px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.mobile-order-card footer>label{font-size:.82rem}.order-card-metrics{display:grid;grid-template-columns:1fr 1fr;gap:9px;font-size:.84rem}.order-card-metrics>span{overflow-wrap:anywhere}.mobile-order-card .row-more-items{position:static;max-width:100%;white-space:normal;box-shadow:none;margin-top:8px}.mobile-order-card .row-more-items button{white-space:normal}.order-detail-fields{grid-template-columns:1fr 1fr}.operational-search .list-search-field{flex-basis:100%;min-width:0}.operational-search>label:not(.list-search-field){flex:1;min-width:120px}.operational-search select,.operational-search input[type=date]{width:100%;max-width:none}.order-detail-head h2{font-size:1rem}.compact-order-grid th,.compact-order-grid td{position:static!important}.order-detail-tabs button{flex:1;min-width:120px}
}
.compact-order-grid th:not([data-order-column="order_no"]),.compact-order-grid td:not([data-order-column="order_no"]){position:static}
.compact-order-grid [data-order-column="order_no"]{position:sticky;left:0;z-index:2;background:#fff}
.compact-order-grid[data-selection="1"] [data-order-column="order_no"]{left:42px}
.compact-order-grid[data-selection="1"] th:first-child,.compact-order-grid[data-selection="1"] td:first-child{position:sticky;left:0;z-index:2;width:42px;min-width:42px;background:#fff}
.dialog-actions{flex-wrap:wrap}.dialog-actions button{min-height:40px}
#form-error[data-feedback="info"]{color:#176f68}
.compact-order-grid td[data-order-column="customer"],.compact-order-grid td[data-order-column="supplier"]{max-width:160px;white-space:normal;overflow-wrap:anywhere}
.compact-order-grid td[data-order-column="part_no"],.compact-order-grid td[data-order-column="order_no"]{max-width:200px;white-space:normal;overflow-wrap:anywhere}

/* z421: distinct fulfilment/payment states and role-safe order amounts. */
.order-status-pair{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}.order-status-pair span{padding:7px 10px;background:#edf4f7;border-radius:7px;font-size:.86rem}
.order-summary-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin-bottom:12px}.order-summary-cards article{padding:13px;border:1px solid #dbe6eb;border-radius:9px;background:#f6fafb;min-width:0}.order-summary-cards small{display:block;color:#596a7c;margin-bottom:7px}.order-summary-cards strong{font-size:1.08rem;overflow-wrap:anywhere}
.order-pending-note{display:block;font-size:.76rem;color:#675319;line-height:1.45;white-space:normal;margin-top:5px;max-width:230px}.compact-order-grid td[data-order-column="_fulfillment"],.compact-order-grid td[data-order-column="_settlement"]{white-space:normal;min-width:85px;max-width:130px}.compact-order-grid td[data-order-column="outstanding_amount"],.compact-order-grid td[data-order-column="unpaid_amount"]{white-space:normal;min-width:90px}
.mobile-order-profit{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px;margin-top:12px;border-radius:8px;background:#edf6f3}.mobile-order-profit span{min-width:0;overflow-wrap:anywhere}.mobile-order-profit small{display:block;color:#596a7c;margin-bottom:4px}.order-settlement{font-weight:600}.board-scope-title{font-size:1rem;margin:0}.board-forecast-scope{display:grid;grid-template-columns:1fr minmax(220px,300px);gap:15px;align-items:center;padding:16px;background:#f2f7fa;border:1px solid #cbdde8;border-radius:10px}.board-forecast-scope h2{margin:0 0 8px;font-size:1rem}.board-forecast-scope p{line-height:1.6;margin:0;color:#526579;font-size:.85rem}.board-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:1100px){.board-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:720px){.order-summary-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.order-summary-cards article{padding:10px}.board-forecast-scope{grid-template-columns:1fr}.board-cards .board-card:last-child{grid-column:auto}.mobile-order-profit span:last-child{grid-column:1/-1}}

/* z422: profit columns precede secondary details on narrower desktops. */
.compact-order-grid th[data-order-column="net_profit"],.compact-order-grid th[data-order-column="expected_profit"],.compact-order-grid th[data-order-column="gross_margin_pct"]{white-space:normal;min-width:75px;max-width:95px}.compact-order-grid td[data-order-column="net_profit"],.compact-order-grid td[data-order-column="expected_profit"],.compact-order-grid td[data-order-column="gross_margin_pct"]{white-space:normal;overflow-wrap:anywhere;min-width:75px;max-width:95px}

@media(min-width:721px) and (max-width:1100px){.compact-order-grid[data-role="boss"] [data-order-column="order_no"]{max-width:160px}.compact-order-grid[data-role="boss"] [data-order-column="part_no"]{max-width:140px}}

/* z423: use complete order cards where the desktop profit columns cannot fit. */
@media(min-width:721px) and (max-width:900px){
 .compact-order-grid{display:none}.mobile-order-list{display:grid;gap:12px;padding:12px}.mobile-order-card{border:1px solid #dce6eb;border-radius:10px;padding:14px;min-width:0}.mobile-order-card header{display:flex;justify-content:space-between;gap:8px;margin-bottom:10px}.mobile-order-card .order-link,.mobile-order-card>strong,.mobile-order-card p{overflow-wrap:anywhere}.mobile-order-card p{margin:7px 0;font-size:.86rem}.mobile-order-card footer{margin-top:12px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.mobile-order-card footer>label{font-size:.82rem}.order-card-metrics{display:grid;grid-template-columns:1fr 1fr;gap:9px;font-size:.84rem}.order-card-metrics>span{min-width:0;overflow-wrap:anywhere}.mobile-order-card .row-more-items{position:static;max-width:100%;white-space:normal;box-shadow:none;margin-top:8px}.mobile-order-card .row-more-items button{white-space:normal}.mobile-order-profit span:last-child{grid-column:1/-1}
}

/* z424: key figures and records stay at the order. */
.order-money-stack{display:grid;gap:6px;white-space:normal;min-width:110px}.order-money-stack small{color:#526579}.order-inline-buttons{display:flex;gap:6px;flex-wrap:wrap;margin-top:7px}.order-inline-buttons button{font-size:.78rem;padding:5px 7px}.order-inline-panel{padding:14px;background:#f4f8fb;border:1px solid #dce6eb;border-radius:8px;white-space:normal;overflow-wrap:anywhere}.order-inline-panel li{margin:9px 0}.order-inline-row td{position:static!important}.purchase-payment-cards{grid-template-columns:repeat(auto-fit,minmax(165px,1fr))}

/* z430: keep complete order identifiers and large totals readable. */
.compact-order-grid td[data-order-column="order_no"] .order-link{white-space:normal;overflow-wrap:anywhere;max-width:100%}
.money-cards article{min-width:0}
.money-cards strong{min-width:0;overflow-wrap:anywhere}
.personal-sales-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:900px){.money-cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}}
/* z431 role workbench and exact monthly values beside the trend chart. */
.home-section{margin:20px 0}.home-section h2{font-size:1rem;margin:0 0 12px}.home-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:12px}.home-tile{display:grid;gap:9px;border:1px solid #dce6eb;background:#fff;border-radius:10px;padding:16px;text-align:left;min-width:0;cursor:pointer;color:#20334b}.home-tile strong{font-size:1.15rem;overflow-wrap:anywhere}.home-tile small,.home-tile span{color:#56677a}.home-tile:hover{border-color:#176f68;background:#f5fbf9}.home-shortcuts{display:flex;gap:9px;flex-wrap:wrap}.home-shortcuts button{border:1px solid #cbd5df;background:white;padding:9px 12px;border-radius:8px;cursor:pointer}.home-recent{display:grid;gap:9px}.home-recent button{display:grid;gap:6px;text-align:left;padding:12px;background:#fff;border:1px solid #dce6eb;border-radius:8px;cursor:pointer;min-width:0}.home-recent span,.home-recent strong{overflow-wrap:anywhere}.home-recent small{color:#68788a}.home-trend-controls{display:flex;gap:12px;flex-wrap:wrap}.home-trend-controls label{display:grid;gap:5px}.home-trend-controls select{padding:8px;border:1px solid #cbd5df;border-radius:7px;max-width:100%}.home-trend-chart{display:block;width:100%;max-height:260px;background:#f7fbfa;border-radius:10px}.overview-help{margin-top:10px;font-size:.82rem;color:#68788a}.overview-help summary{cursor:pointer;color:#176f68}.overview-help p{line-height:1.6}.role-home{min-width:0}
/* z432: visible sign and zero reference for monthly financial charts. */
#home-trend .negative{color:#b42318;font-weight:700}.trend-scale{font-size:.8rem;color:#68788a;overflow-wrap:anywhere}.home-tile:focus-visible,.home-shortcuts button:focus-visible,.home-recent button:focus-visible{outline:3px solid #176f68;outline-offset:3px}

.role-home{padding:16px}
@media(max-width:720px){.role-home{padding:12px}}

/* z454: use one header-cell stacking layer across all ledgers. Safari must
   not put frozen body columns above a sticky table-section context. */
thead{position:static;z-index:auto}
thead th{position:sticky;top:0;z-index:5;background:#f7f9fb}
thead th:last-child{z-index:6}
.compact-order-grid thead th:not([data-order-column="order_no"]){position:sticky;top:0;z-index:5}
.compact-order-grid thead th[data-order-column="order_no"],
.compact-order-grid[data-selection="1"] thead th:first-child{position:sticky;top:0;z-index:7;background:#f7f9fb}
/* z455: compact orders only freeze selection and order number horizontally.
   Restoring sticky header cells must not reactivate the global right:0 rule. */
.compact-order-grid thead th:last-child{right:auto}
.inventory-grid thead th:last-child{position:sticky;top:0;right:auto;z-index:5}
/* z507: on phones the logout button sits in its own grid cell beside the logo, never on top of
   the 展开菜单 bar (an absolutely positioned button used to cover the bar's right side). */
@media(max-width:720px){
aside{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px}
aside>.brand{grid-column:1;grid-row:1}
aside>.account{position:static;grid-column:2;grid-row:1;margin:0;padding:0;border:0}
aside>.mobile-menu{grid-column:1/-1;grid-row:2}
aside>#main-nav{grid-column:1/-1;grid-row:3}
}

/* Z520: reimbursement, quotation, packing-list and delivery-date dialogs share one scrolling form. */
#biz-dialog{width:min(1000px,calc(100% - 24px))}
#biz-form{display:flex;max-height:calc(100vh - 32px);flex-direction:column;padding:22px 24px 18px}
#biz-body{min-height:0;overflow:auto;padding:2px 5px 4px 1px}
#biz-body h3{font-size:1rem;margin:18px 0 8px;color:#34465a}
#biz-body .data-grid-scroll{max-height:none}
#biz-body table input,#biz-body table select{width:100%;min-width:72px;height:36px;border:1px solid #cad4df;border-radius:6px;padding:0 8px}
#biz-body table td{vertical-align:top}
.biz-list{padding-left:20px;margin:0}
.biz-list li{padding:4px 0;overflow-wrap:anywhere}
.biz-note{margin:10px 0 0;color:#526579;font-size:.85rem}
.biz-inline{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.biz-warn{color:#b42318;font-weight:650}
.biz-status-overdue,.biz-status-needs_redo,.biz-status-rejected,.biz-status-expired,.biz-status-pending_approval{background:#fdecea;color:#b42318}
.biz-status-due,.biz-status-pending,.biz-status-draft,.biz-status-unplanned{background:#fff4e5;color:#8a5312}
.biz-status-cancelled,.biz-status-withdrawn,.biz-status-declined{background:#eef2f6;color:#526579}
@media(max-width:720px){#biz-form{padding:16px 14px 14px}#biz-body .order-detail-fields{grid-template-columns:1fr}}
.biz-primary{border:0;background:#176f68;color:#fff;padding:9px 15px;border-radius:8px;cursor:pointer;font-weight:700}
a.row-action{display:inline-block;color:inherit;text-decoration:none}
#quote-editor{table-layout:fixed;min-width:760px}#quote-editor th:nth-child(1){width:26%}#quote-editor th:nth-child(2){width:11%}#quote-editor th:nth-child(3){width:14%}#quote-editor th:nth-child(4){width:18%}#quote-editor th:nth-child(6){width:84px}
#packing-editor{table-layout:fixed;min-width:900px}#packing-editor th:nth-child(1){width:12%}#packing-editor th:nth-child(2){width:26%}#packing-editor th:nth-child(6),#packing-editor th:nth-child(7),#packing-editor th:nth-child(8){width:8%}#packing-editor th:nth-child(9){width:84px}
#delivery-editor{max-width:560px}
#biz-dialog .quote-advice-row td,#biz-dialog .quote-advice-row .inline-result{white-space:normal;overflow-wrap:anywhere}
