/* Approved local preview: keep the existing shell, simplify spacing and hierarchy. */
:root { --t3: #71717A; --ui-table-head: #FAFAF8; }
* { scrollbar-width: thin; scrollbar-color: #C9C8C1 transparent; }
.sb,.sb * { scrollbar-color: #465064 transparent; }
button:focus-visible,a:focus-visible,[role="button"]:focus-visible,summary:focus-visible {
  outline: 2px solid #2563EB; outline-offset: 3px;
}
.mn,.ct,.pg,.cd,.ins-panel,.as-card { min-width: 0; }
.order-entry-grid > * { min-width: 0; }
/* Transient messages must never intercept controls, including while transparent. */
.toast { pointer-events: none; max-width: calc(100vw - 24px); }
.ct { padding: 18px 24px 40px; }
.sb-logo { padding-bottom: 18px; }
.tb-l { min-width: 0; }
.tb-l h1 { font-size: 15px; white-space: nowrap; }
.tb-date { color: var(--t3); }
.mi { line-height: 20px; }
.mi svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.sb-u-t { min-width: 0; }
.sb-u-t > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr,.as-stats { grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); gap: 12px; margin-bottom: 14px; }
.sc { position: relative; padding: 15px 18px 13px; box-shadow: none; }
.sc:hover { transform: none; box-shadow: none; }
.sc[onclick]:hover,.as-clickable:hover { border-color: #B8C7E6; background: #FCFDFF; }
.sc-top { margin-bottom: 7px; padding-right: 40px; min-height: 18px; }
.sc-l { color: var(--t3); font-size: 11.5px; font-weight: 400; }
.sc-ic { position: absolute; top: 15px; right: 15px; width: 32px; height: 32px; border-radius: 8px; }
.sc-ic svg { width: 17px; height: 17px; }
.sc-v { font-size: 25px; line-height: 1.25; letter-spacing: -.4px; margin-bottom: 4px; }
.sc-b { color: var(--t3); line-height: 1.5; }
.cd,.ins-panel,.as-card { padding: 16px 18px; border-radius: 10px; margin-bottom: 14px; }
.cd-h { gap: 12px; margin-bottom: 12px; }
.cd-t,.ins-panel h3,.as-card h4 { font-size: 14px; font-weight: 650; }
.cd-s,.ins-muted,.as-muted { color: var(--t3); }
.tlb { align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tls { flex: 1 1 180px; min-width: 150px; max-width: 320px; border-radius: 7px; }
.tls input { min-width: 0; width: 100%; }
.tsel { max-width: 210px; min-width: 90px; border-radius: 7px; }
.tlr { gap: 7px; flex-wrap: wrap; }
.btn,.ins-btn,.as-btn { font-size: 12px; font-weight: 600; border-radius: 7px; box-shadow: none; white-space: nowrap; }
.btn:active:not(:disabled),.ins-btn:active:not(:disabled),.as-btn:active:not(:disabled) { transform: none; }
.btn-s { font-size: 11.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.ui-table-wrap { width: 100%; max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; }
.dt,.ins-table,.as-table { font-size: 12px; }
.dt th,.ins-table th,.as-table th {
  background: var(--ui-table-head); padding: 8px 12px; font-size: 11px;
  font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--t3);
  border-bottom: 1px solid var(--bdr-light); white-space: nowrap;
}
.dt td,.ins-table td,.as-table td { padding: 10px 12px; font-size: 12px; line-height: 1.55; }
.dt td:has(.btn) { white-space: nowrap; }
.ui-table-wrap .dt:has(tbody tr td:last-child .btn) tr > :last-child {
  position: sticky; right: 0; z-index: 1; background: var(--card);
  box-shadow: -1px 0 0 var(--bdr-light);
}
.ui-table-wrap .dt:has(tbody tr td:last-child .btn) thead tr > :last-child { z-index: 2; }
.dt tbody tr:hover td,.ins-table tbody tr:hover td,.as-table tbody tr:hover td { background: #FAFBFD; }
.dt th:first-child,.ins-table th:first-child,.as-table th:first-child { border-radius: 5px 0 0 0; }
.dt th:last-child,.ins-table th:last-child,.as-table th:last-child { border-radius: 0 5px 0 0; }
#csTb td:nth-child(2),#custTb td:nth-child(2) { white-space: nowrap; }
.tag,.as-status { padding: 2px 7px; font-size: 11px; font-weight: 500; border-radius: 4px; }
.pgn,.as-pager { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--bdr-light); }
.tabs { gap: 3px; padding: 3px; overflow-x: auto; max-width: 100%; }
.tab { padding: 6px 12px; white-space: nowrap; flex-shrink: 0; font-size: 12px; }
.fg label,.as-field label,.as-label,.ins-field { font-weight: 500; letter-spacing: 0; }
.fg { margin-bottom: 13px; }
.fi,.as-input,.ins-field input,.ins-field select,.ins-field textarea,
.as-field input,.as-field select,.as-field textarea { font-size: 12.5px; border-radius: 7px; }
.fr { gap: 12px; }
.fa { gap: 8px; margin-top: 17px; }
.ml { padding: 21px 22px; border-radius: 10px; }
.ml h2 { margin-bottom: 17px; font-size: 16px; }
/* Hide by the drawer's actual width, rather than a fixed desktop pixel offset. */
.dr { right: 0; transform: translateX(100%); visibility: hidden; pointer-events: none; transition: transform .3s ease,visibility .3s; }
.dr.sh { right: 0; transform: translateX(0); visibility: visible; pointer-events: auto; }
.dr-head { padding: 15px 18px; }
.dr-body { padding: 18px; }
.dr-section h3 { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--t2); }
.dr-tabs { padding: 0 18px; }
.dr-tab { padding: 10px 12px; font-size: 12px; }
.ig-item { padding: 10px 12px; }
.ig-label { font-size: 11px; letter-spacing: 0; }
.ig-value { font-size: 13px; }
.lead-card:hover { transform: none; box-shadow: none; }
.cart-summary { padding: 14px 16px; }
.cart-row { gap: 9px; }
.ui-shipping-address { font-size: 13px; line-height: 1.7; }
.ui-shipping-address strong { font-size: 15px; }
.ui-shipping-phone { font-size: 14px; color: var(--blue); }
.ins-head,.as-head { margin-bottom: 14px; }
.ins-head h2,.as-head h2 { font-size: 17px; font-weight: 650; }
.ins-panel h3 { margin-bottom: 11px; }
.ins-filters { gap: 8px; padding: 13px 15px; align-items: end; }
.ins-field { min-width: 135px; }
.ins-filters .ins-field { flex: 1 1 135px; max-width: 230px; }
.ins-filters .ins-field input,.ins-filters .ins-field select,
.as-filters .as-field input,.as-filters .as-field select { height: 34px; min-height: 34px; }
.ins-actions { gap: 7px; margin: 10px 0; }
.ins-metrics { gap: 12px; }
.ins-metric .sc-v,.as-stat .sc-v { font-size: 25px; line-height: 1.25; }
.ins-metric .sc-l,.as-stat .sc-l { color: var(--t3); font-weight: 400; }
.ins-summary { border: 0; padding: 0; margin: 15px 0; }
.ins-summary > p { margin-bottom: 9px; }
.ins-dialog { padding: 20px 22px; border-radius: 10px; }
.ins-dialog-header { top: -20px; padding-bottom: 13px; }
.ins-dialog-header h3 { font-size: 15px; }
.ins-contact-table th:first-child { width: 86px; }
.ins-contact-table th:last-child { width: 76px; }
.ins-contact-table td:first-child { white-space: nowrap; }
.ins-overlay { background: #18202F66; backdrop-filter: none; }
.ins-home-intro { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 14px; margin-bottom: 14px; }
.ins-home-intro h2 { grid-column: 1; margin-bottom: 0; }
.ins-home-intro > p { grid-column: 1; margin: 3px 0 0; }
.ins-home-intro > .ins-actions { grid-column: 2; grid-row: 1/3; align-self: center; margin: 0; }
.ins-home-filters { padding: 0; border: 0; background: transparent; gap: 7px; margin-bottom: 14px; }
.ins-home-filter-title { font-size: 12px; font-weight: 600; color: var(--t2); margin-right: 3px; }
.ins-home-shortcuts { display: flex; gap: 5px; }
.ins-home-shortcuts .ins-btn { min-height: 30px; padding: 4px 10px; font-weight: 500; }
.ins-home-shortcuts [aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: white; }
.ins-home-filters .ins-field { flex: 0 1 128px; min-width: 112px; }
.ins-home-filters .ins-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ins-home-filters .ins-field input,.ins-home-filters .ins-field select { height: 30px; padding: 3px 7px; font-size: 12px; }
.ins-home-filters .ins-home-person { flex-basis: 130px; margin-left: auto; }
.ins-home-filters > .ins-btn { min-height: 30px; padding: 4px 11px; }
.ins-home-stats { margin-bottom: 14px; }
.ins-home-stats .ins-metric { min-height: 110px; }
.ins-home-stats .ins-metric:first-child,.ins-home-stats .ins-metric:nth-child(4) { --ins-glyph: var(--ins-users); }
.ins-home-stats .ins-metric:nth-child(2) { --ins-glyph: var(--ins-money); }
.ins-home-stats .ins-metric:nth-child(3) { --ins-glyph: var(--ins-orders); }
.ins-home-stats .ins-metric small { margin-top: 5px; font-size: 11px; }
.ins-home-stats[aria-busy="true"] { opacity: .6; }
.as-home-card { padding: 13px 18px; gap: 16px; flex-wrap: nowrap; min-height: 62px; }
.as-home-card > div:first-child { flex: 1 0 auto; }
.as-home-card > div:first-child > strong { font-size: 13px; font-weight: 650; }
.as-home-card > div:first-child > p { display: none; }
.as-home-steps,.as-home-single { display: flex; gap: 17px; flex: 2 1 auto; }
.as-home-step { display: flex; flex-direction: row; align-items: baseline; gap: 7px; border: 0; padding: 0; background: transparent; box-shadow: none; }
.as-home-step .sc-l { margin: 0; white-space: nowrap; }
.as-home-step .sc-v { margin: 0; font-size: 17px; line-height: 1.4; }
.as-home-step:hover { background: transparent; color: var(--blue); }
.ins-home-alert { padding: 15px 18px; }
.ins-home-alert > strong { font-size: 14px; }
.ins-home-alert > p { margin: 4px 0 8px; }
.ins-role-home #todoList { max-height: 250px; overflow-y: auto; overscroll-behavior-block: contain; }
.ins-home-supervision { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 12px; border-left: 1px solid var(--bdr); }
.ins-home-supervision > strong { grid-column: 1; color: var(--t1); }
.ins-home-supervision > p { grid-column: 1; font-size: 11px; margin: 3px 0 0; }
.ins-home-supervision > .ins-actions { grid-column: 2; grid-row: 1/3; margin: 0; align-self: center; }
.ins-home-supervision > .ins-home-preview { grid-column: 1/-1; margin-top: 13px; }
.ins-home-preview .ins-team-metrics { background: #F9F9F6; border-radius: 7px; padding: 12px 0; gap: 0; margin-bottom: 10px; }
.ins-home-preview .ins-team-metrics .ins-metric { border: 0; border-right: 1px solid var(--bdr); border-radius: 0; background: transparent; padding: 0 16px; }
.ins-home-preview .ins-team-metrics .ins-metric:last-child { border-right: 0; }
.ins-home-preview .ins-team-metrics .sc-ic { display: none; }
.ins-home-preview .ins-team-metrics .sc-top { margin-bottom: 4px; padding-right: 0; }
.ins-home-preview .ins-team-metrics .sc-v { font-size: 23px; margin-bottom: 0; }
.ins-home-preview .ins-team-metrics .ins-metric:nth-child(2) .sc-v,
.ins-home-preview .ins-team-metrics .ins-metric:nth-child(3) .sc-v { color: var(--red); }
.ins-home-preview .ins-table-scroll { margin-top: 0; }
.ins-home-preview .ins-table th,.ins-home-preview .ins-table td { padding: 8px 12px; }
.ins-home-note { border-top: 1px solid var(--bdr-light); padding-top: 9px; margin-top: 8px; font-size: 11px; color: var(--t3); }
#pg-dash .cd:has(.ui-approval-empty) .cd-h { margin-bottom: 0; }
#dashApprovalList:has(.ui-approval-empty) { display: none; }
.ins-more-home { background: #fff; border: 1px solid var(--bdr); border-radius: 10px; padding: 0; margin-top: 14px; }
.ins-more-home > summary { padding: 12px 17px; font-size: 12px; font-weight: 500; }
.ins-more-home[open] > summary { border-bottom: 1px solid var(--bdr); margin-bottom: 14px; }
.ins-more-home > :not(summary) { margin-left: 14px; margin-right: 14px; }
.as-stats { margin-top: 0; }
.as-table-wrap { padding: 15px 18px; }
.as-filter-search { flex: 2 1 180px; }
.as-chips { gap: 6px; margin: 11px 0; }
.as-dialog { border-radius: 10px; }
.as-dialog-head,.as-dialog-foot { padding: 14px 18px; }
.as-dialog-body { padding: 18px; }
.as-dialog-head h3 { font-size: 15px; }
.as-grid { gap: 18px; }
.as-note { border-left-width: 2px; }
.as-evidence-card { padding: 8px; }
body.ui-login { --pri: #2563EB; --pri-light: #3B82F6; --pri-glow: #2563EB1A; background: #F3F2ED; }
.ui-login .right { background: #F3F2ED; }
.ui-login .form-box { max-width: 380px; }
.ui-login .fi { background: #fff; border-radius: 8px; font-size: 14px; }
.ui-login .btn-login { border-radius: 8px; box-shadow: none; background: #2563EB; }
.ui-login .btn-login:hover { background: #1D4ED8; }
.ui-login .eye-toggle:focus-visible { outline-offset: 0; }
@media(max-width:1100px) {
  .order-entry-grid { grid-template-columns: minmax(0,1fr) !important; }
  .ins-home-filters .ins-home-person { margin-left: 0; }
  .as-home-card { gap: 12px; flex-wrap: wrap; }
  .as-home-steps { flex: 2 1 280px; }
}
@media(max-width:768px) {
  /* mobile.css sets top; clear the desktop bottom so the toast cannot stretch. */
  .toast { bottom: auto; height: auto; transform: translateY(-12px); }
  .toast.show { transform: translateY(0); }
  .order-customer-picker,.order-product-tools { flex-wrap: wrap; }
  .order-customer-picker .fi { flex: 1 1 100% !important; max-width: none !important; min-width: 0; }
  .order-product-tools .tls { flex: 1 1 175px !important; min-width: 0; }
  .order-entry-grid > div:last-child > .cd { position: static !important; }
  #pg-neworder #prodGrid { max-height: 50vh; max-height: 50dvh; overflow-y: auto; }
  .mob-menu { flex-direction: column; gap: 4px; }
  .mob-menu span { flex-shrink: 0; margin: 0; }
  .ct { padding: 16px 14px 72px !important; }
  .sr,.as-stats,.ins-metrics { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 9px !important; }
  #todayStrip { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 9px !important; }
  .sc { padding: 12px !important; }
  .sc-v,.ins-metric .sc-v,.as-stat .sc-v { font-size: 22px !important; }
  .sc-l { font-size: 11px !important; }
  .cd { padding: 14px !important; }
  .tls { max-width: none; }
  .tsel { max-width: none; min-width: 0; }
  .tlr .btn { min-height: 32px; }
  .ui-table-wrap { margin: 0; padding: 0; }
  .dt th,.ins-table th,.as-table th { font-size: 11px !important; padding: 8px 10px !important; }
  .dt td,.ins-table td,.as-table td { font-size: 12px !important; padding: 9px 10px !important; }
  .ins-panel,.as-card { padding: 14px; }
  .ins-summary { padding: 0; }
  .ins-head h2,.as-head h2 { font-size: 16px; }
  .ins-home-intro { column-gap: 9px; }
  .ins-home-intro > p { font-size: 11px; }
  .ins-home-intro > .ins-actions { flex-wrap: wrap; max-width: 150px; justify-content: flex-end; gap: 5px; }
  .ins-home-intro .ins-btn { padding: 6px 9px; font-size: 11px; min-height: 30px; }
  .ins-home-filters { gap: 8px; padding: 0; }
  .ins-home-filter-title { flex-basis: 100%; font-size: 11px; }
  .ins-home-filters .ins-field { flex: 1 1 130px; max-width: none; }
  .ins-home-shortcuts { flex-basis: 100%; }
  .ins-home-filters > .ins-btn { flex: 0 0 auto; margin: 0; min-width: 55px; }
  .ins-home-filters .ins-home-person { flex-basis: calc(100% - 75px); }
  .ins-home-stats .ins-metric { min-height: 106px; }
  .as-home-card { padding: 12px 14px; gap: 10px; }
  .as-home-card > div:first-child { flex: 1 1 100%; }
  .as-home-card:has(.as-home-single) > div:first-child { flex: 1 1 auto; }
  .as-home-steps,.as-home-single { flex: 1 1 100%; gap: 18px; flex-wrap: wrap; }
  .as-home-step { padding: 0 !important; flex: 0 1 auto; }
  .as-home-single { flex: 0 1 auto; }
  .as-home-step .sc-v { font-size: 17px !important; }
  .as-home-card > .as-btn { flex: 1 1 100%; }
  .ins-home-alert { padding: 14px; }
  .ins-home-supervision { grid-template-columns: minmax(0,1fr) auto; }
  .ins-home-supervision > .ins-actions { max-width: 130px; }
  .ins-home-supervision > .ins-actions .ins-btn { font-size: 11px; padding: 6px 9px; }
  .ins-home-supervision > .ins-home-preview { margin-top: 12px; }
  .ins-home-preview .ins-team-metrics { padding: 0; gap: 0 !important; }
  .ins-home-preview .ins-team-metrics .ins-metric { padding: 10px 12px !important; border-right: 0; }
  .ins-home-preview .ins-team-metrics .ins-metric:nth-child(odd) { border-right: 1px solid var(--bdr); }
  .ins-home-preview .ins-team-metrics .ins-metric:nth-child(-n+2) { border-bottom: 1px solid var(--bdr); }
  .ins-home-preview .ins-team-metrics .sc-l { white-space: normal; }
  .ins-home-alert:not(.ins-home-supervision) .ins-table { table-layout: fixed; white-space: normal; }
  .ins-home-alert:not(.ins-home-supervision) .ins-table th:first-child { width: 41%; }
  .ins-home-alert:not(.ins-home-supervision) .ins-table th:nth-child(2) { width: 27%; }
  .ins-home-alert:not(.ins-home-supervision) .ins-table th:last-child { width: 32%; }
  .ins-home-alert:not(.ins-home-supervision) .ins-table :is(th,td) { padding: 8px 6px !important; }
  .ins-home-alert:not(.ins-home-supervision) .ins-table td:first-child .ins-btn { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
  .ins-home-alert:not(.ins-home-supervision) .ins-table td:last-child .ins-btn { padding: 6px 8px; font-size: 11px; }
  .ins-more-home > :not(summary) { margin-left: 10px; margin-right: 10px; }
  .ins-dialog { padding: 17px; border-radius: 10px; }
  .ins-dialog-header { top: -17px; }
  .as-dialog-head,.as-dialog-foot { padding: 13px 14px; }
  .as-dialog-body { padding: 14px; }
  .ins-filters .ins-field { max-width: none; }
  .ui-login .right { padding: 24px 20px; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* Small refinements for the existing role workspaces. */
[hidden]{display:none!important}
.profit-card{padding:14px;background:var(--bg);border:1px solid var(--bdr);border-radius:10px;text-align:center;min-width:0}
.profit-card span{display:block;color:var(--t3);font-size:11px;margin-bottom:6px}
.profit-card strong{font-size:20px;overflow-wrap:anywhere}
#profitPager{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:14px}
#profitNotice{line-height:1.7;color:var(--t2)}
.as-history{margin-top:12px;border-top:1px solid var(--bdr);padding-top:8px}
.as-history>summary{cursor:pointer;font-size:12px;color:var(--t2);padding:8px 0}
.as-progress-summary{margin-bottom:14px}
.review-checklist{border:1px solid var(--bdr);border-radius:10px;background:var(--bg);padding:14px!important;margin-bottom:16px}
.review-checklist p{font-size:12px;line-height:1.7;overflow-wrap:anywhere;margin:6px 0}
@media(max-width:768px){
 button.btn,.as-btn,.as-btn-link,.ins-btn,.tab,.as-chip,.va{min-height:44px!important}
 .ib,.mob-menu,.dr-close,.customer-tag-list .btn{min-width:44px!important;min-height:44px!important}
 .fi,.tsel,.ins-field input,.ins-field select,.as-field input,.as-field select{min-height:44px!important}
 input[type=checkbox],input[type=radio]{min-height:0!important}
 .customer-directory-filters .fi,.customer-directory-filters .tsel{height:44px!important}
 #pg-cust .dt :is(th,td):first-child{width:calc(100% - 88px)!important}
 #pg-cust .dt :is(th,td):nth-child(8){width:88px!important}
 #pg-cust td:nth-child(8) .btn{width:100%;white-space:normal}
 .customer-release{color:var(--t2)!important;border-color:var(--bdr)!important}
 #profitSummaryCards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #finTab_profit .cd-h{align-items:flex-start;gap:10px;flex-wrap:wrap}
 .profit-card strong{font-size:18px}
 .as-progress-summary .as-key-values{grid-template-columns:repeat(2,minmax(0,1fr))}
 .as-history>summary{min-height:44px;display:flex;align-items:center}
 .mo.sh,.ins-overlay,.as-overlay{padding-bottom:env(safe-area-inset-bottom,0)}
 .ml,.ins-dialog,.as-dialog{max-height:calc(100dvh - 16px)!important;overflow-y:auto}
 .review-checklist{padding:12px!important}
}
.sidebar-close{display:none}
@media(max-width:768px){.sidebar-close{display:flex;position:absolute;top:16px;right:12px;min-height:44px;color:#E5E7EB;background:#253046;border-color:#465064}.sb-logo{padding-right:76px!important}}
@media(max-width:768px){
 #pg-orders .tlb,#pg-leads .tlb{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #pg-orders .tlb>.tls,#pg-leads .tlb>.tls,#pg-orders .tlb>.tlr,#pg-leads .tlb>.tlr{grid-column:1/-1;width:100%;min-width:0}
 #pg-orders .tlb>select,#pg-orders .tlb>input,#pg-leads .tlb>select{width:100%!important;max-width:none!important;min-width:0}
 #pg-orders .tlb>span{display:none}
 .ui-table-wrap.can-scroll::before{content:'左右滑动查看更多';display:block;position:sticky;left:0;width:max-content;font-size:11px;color:var(--t3);padding:5px 0 8px}
}
.order-date-control{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:11px;color:var(--t2)}
.order-date-control input{width:100%!important;min-width:0}
