/* Screen-only business identity; document/status/alert colours remain semantic. */
@media screen {
 :root{--business-accent:#315e91;--business-soft:#e5edf8;--business-border:#c2cfdf;--business-nav:#142d5c;--business-nav-text:#d0dcf0;--business-nav-active:#2d4976}
 html[data-business-theme] body .sidebar{background:var(--business-nav)!important;border-color:var(--business-nav-active)!important;color:var(--business-nav-text)!important}
 html[data-business-theme] body .sidebar :is(.nav-item,.nav-group-title,.user-info,.nav-sub-item,.logout.operator-switch){color:var(--business-nav-text)!important;border-color:var(--business-nav-active)!important}
 html[data-business-theme] body .sidebar :is(.nav-group-items,.nav-sub-item){background-color:var(--business-nav)!important}
 html[data-business-theme] body .sidebar :is(.nav-item.active,.nav-item:hover,.nav-group-title:hover){background-color:var(--business-nav-active)!important;color:#fff!important}
 html[data-business-theme] body :is(.tab.active,.tab-item.active){background:var(--business-soft)!important;color:var(--business-accent)!important;border-bottom-color:var(--business-accent)!important}
 html[data-business-theme] body :is(.btn-primary,.status-settings-primary,.quick-upload-auto-sync,.quotation-btn[data-action=special]):not(:disabled){background:var(--business-accent)!important;border-color:var(--business-accent)!important;color:#fff!important}
 html[data-business-theme] body :is(.quotation-btn,.btn):not(.btn-primary):not(.btn-danger):not(:disabled):hover{background-color:var(--business-soft)!important;border-color:var(--business-border)!important}
 /* Editable focus rings are shared by editable-focus.css; retain validation shadows. */
 html[data-business-theme] body :is(input,select,textarea):not([aria-invalid="true"]):focus-visible{border-color:var(--business-accent)!important}
 html[data-business-theme] body :is(.tab-content,dialog) :is(a,.sales-business-doc-link,.huihuang-doc-link):not(.doc-status-ui){color:var(--business-accent)}
 html[data-business-theme] body #mainWrap #tabContent :is(.quotation-line-table,.oa-inquiry-query-table,.comparison-query-table,.quotation-query-table,.sales-business-table,.invoice-data-table,.huihuang-query-table,.op-table) thead th,
 html[data-business-theme] body dialog table thead th{background:var(--business-soft)!important;border-color:var(--business-border)!important;color:var(--business-accent)!important}
 html[data-business-theme] body #mainWrap #tabContent :is(.quotation-footer,.quotation-footer-coltotal,.quotation-footer-coltotal>div,.op-draft-footer,.op-draft-totals-scroll,.op-draft-totals-table){background:var(--business-soft)!important;border-color:var(--business-border)!important;color:var(--business-accent)!important}
 html[data-business-theme] body :is(#mobilePageNavigation button,.nav-mobile-toggle){background:var(--business-soft)!important;color:var(--business-accent)!important;border-color:var(--business-border)!important}
 html[data-business-theme] body #mainWrap .preview-tile-icon{background:var(--business-soft)!important;color:var(--business-accent)!important}
 html[data-business-theme=SUZHOU] body :is(.main-wrap,.tab-content){background-color:#f4f1f2!important}
}
@media screen{
 html[data-business-theme] body #mainWrap .sales-workflow>button[aria-pressed=true]{border-color:var(--business-border)!important;background:var(--business-soft)!important}
}
@media screen{
 html[data-business-theme] body #mainWrap #tabContent .tab-page:not(.status-settings) table thead th,
 html[data-business-theme] body .tab-content .tab-page:not(.status-settings) table tfoot td{background:var(--business-soft)!important;border-color:var(--business-border)!important;color:var(--business-accent)!important}
}
@media screen{
}

@media screen{
 html[data-business-theme] body .sidebar :is(.logo,.sidebar-brand,.sidebar-time,.sidebar-clock,#currentTime,.operator-avatar,.sidebar-collapse-btn){color:var(--business-nav-text)!important}
 html[data-business-theme] body .sidebar-flyout{background:var(--business-nav)!important;color:var(--business-nav-text)!important;border-color:var(--business-nav-active)!important}
 html[data-business-theme] body .sidebar-flyout-heading{color:var(--business-nav-text)!important}
 html[data-business-theme] body .sidebar-flyout-option:is(:hover,:focus-visible,.active){background:var(--business-nav-active)!important;color:#fff!important}
}
/* Default navigation backgrounds distinguish levels; selected and hover use one colour. */
@media screen{
 html[data-business-theme] body .sidebar #navMenu>.nav-item,
 html[data-business-theme] body .sidebar #navMenu>.nav-group-title{background:var(--business-nav)!important;color:var(--business-nav-text)!important}
 html[data-business-theme] body .sidebar #navMenu :is(.nav-group-items,.nav-sub-item){background:var(--business-nav-active)!important;color:var(--business-subnav-text,#fff)!important}
 html[data-business-theme] body .sidebar #navMenu :is(.nav-item.active,.nav-item:hover,.nav-group-title:hover),
 html[data-business-theme] body .sidebar #navMenu>.nav-group-title:has(+.nav-group-items .nav-item.active),
 html[data-business-theme] body .sidebar-flyout-option:is(.active,:hover,:focus-visible){background:var(--business-soft)!important;color:var(--business-accent)!important}
 html[data-business-theme] body .sidebar-flyout[data-nav-level=secondary]{background:var(--business-nav-active)!important;color:var(--business-subnav-text,#fff)!important}
 html[data-business-theme] body .sidebar-flyout[data-nav-level=secondary] .sidebar-flyout-heading{color:var(--business-subnav-text,#fff)!important}
}

/* The same selection colour for navigation and ordinary detail/query rows. */
@media screen{
html[data-business-theme] body #mainWrap #tabContent .tab-page:not(.status-settings) table>tbody:not(:is(.document-fill-space,.huihuang-detail-fill-space,.ed-receipt-fill-space,.inventory-detail-fill-space,.ed-fill-space,.si-document-fill))>tr:not(:is(.jn-sap-payment-ready,.jn-sap-payment-duplicate,.jn-sap-payment-existing,.jn-sap-payment-excluded,.jn-sap-payment-skip,.jn-sap-payment-skipped,.jn-sap-payment-review,.jn-sap-payment-invalid,.jn-sap-payment-failed,.jn-sap-order-matched,.jn-sap-order-missing,.jn-sap-order-duplicate,.jn-sap-order-invalid,.jn-sap-order-difference,.jn-sap-requisition-matched,.si-source-unavailable,.is-unavailable,.is-buyer-matched)):is(:hover,.selected,.is-selected),
html[data-business-theme] body dialog table>tbody:not(:is(.document-fill-space,.huihuang-detail-fill-space,.ed-receipt-fill-space,.inventory-detail-fill-space,.ed-fill-space,.si-document-fill))>tr:not(:is(.jn-sap-payment-ready,.jn-sap-payment-duplicate,.jn-sap-payment-existing,.jn-sap-payment-excluded,.jn-sap-payment-skip,.jn-sap-payment-skipped,.jn-sap-payment-review,.jn-sap-payment-invalid,.jn-sap-payment-failed,.jn-sap-order-matched,.jn-sap-order-missing,.jn-sap-order-duplicate,.jn-sap-order-invalid,.jn-sap-order-difference,.jn-sap-requisition-matched,.si-source-unavailable,.is-unavailable,.is-buyer-matched)):is(:hover,.selected,.is-selected),
html[data-business-theme] body #mainWrap #tabContent .tab-page:not(.status-settings) table>tbody:not(:is(.document-fill-space,.huihuang-detail-fill-space,.ed-receipt-fill-space,.inventory-detail-fill-space,.ed-fill-space,.si-document-fill))>tr:not(:is(.jn-sap-payment-ready,.jn-sap-payment-duplicate,.jn-sap-payment-existing,.jn-sap-payment-excluded,.jn-sap-payment-skip,.jn-sap-payment-skipped,.jn-sap-payment-review,.jn-sap-payment-invalid,.jn-sap-payment-failed,.jn-sap-order-matched,.jn-sap-order-missing,.jn-sap-order-duplicate,.jn-sap-order-invalid,.jn-sap-order-difference,.jn-sap-requisition-matched,.si-source-unavailable,.is-unavailable,.is-buyer-matched)):is(:hover,.selected,.is-selected)>td:not([data-inquiry-price-difference],.suzhou-combination-product-warning),
html[data-business-theme] body dialog table>tbody:not(:is(.document-fill-space,.huihuang-detail-fill-space,.ed-receipt-fill-space,.inventory-detail-fill-space,.ed-fill-space,.si-document-fill))>tr:not(:is(.jn-sap-payment-ready,.jn-sap-payment-duplicate,.jn-sap-payment-existing,.jn-sap-payment-excluded,.jn-sap-payment-skip,.jn-sap-payment-skipped,.jn-sap-payment-review,.jn-sap-payment-invalid,.jn-sap-payment-failed,.jn-sap-order-matched,.jn-sap-order-missing,.jn-sap-order-duplicate,.jn-sap-order-invalid,.jn-sap-order-difference,.jn-sap-requisition-matched,.si-source-unavailable,.is-unavailable,.is-buyer-matched)):is(:hover,.selected,.is-selected)>td:not([data-inquiry-price-difference],.suzhou-combination-product-warning){background-color:var(--business-soft)!important}
}

/* OA/business identity colours are emitted per owning business by sliderCss. */
@media screen{
 html[data-business-theme] body .source-manual{--source-text:var(--business-accent)!important;--source-bg:var(--business-soft)!important;--source-border:var(--business-border)!important}
}

/* Workbench document creation uses its own primary class, shared by every stage. */
@media screen{
 html[data-business-theme] body :is(.sales-business-toolbar,.suzhou-combination-inline) button.sales-business-primary:not(:disabled){background:var(--business-accent)!important;border-color:var(--business-accent)!important;color:#fff!important}
 html[data-business-theme] body :is(.sales-business-toolbar,.suzhou-combination-inline) button.sales-business-primary:not(:disabled):hover{filter:brightness(.94)}
 html[data-business-theme] body :is(.sales-business-toolbar,.suzhou-combination-inline) button.sales-business-primary:not(:disabled):focus-visible{outline:2px solid var(--business-accent);outline-offset:2px}
 html[data-business-theme] body :is(.sales-business-toolbar,.suzhou-combination-inline) button.sales-business-primary:disabled{background:#f0f3f7!important;border-color:#d6dde7!important;color:#8c99aa!important;cursor:default;filter:none;box-shadow:none}
}

/* Flow icons share the business palette; inquiry, estimate and receipts retain their own colours. */
@media screen{
 html[data-business-theme] body #mainWrap .sales-business-flow .sales-business-stage:not([data-sales-stage="inquiry"]):not([data-sales-stage="comparison"]):not([data-sales-stage="receipt"]) .sales-business-stage-icon{
   background:var(--business-soft);
   color:var(--business-accent);
 }
 html[data-business-theme] body #mainWrap .sales-business-flow :is(.sales-business-loop-links,.sales-business-arrow){color:var(--business-accent)}
 html[data-business-theme] body #mainWrap .sales-business-flow .sales-business-arrow::before{border-top-color:currentColor}
 html[data-business-theme] body #mainWrap .sales-business-flow .sales-business-separator::before{border-left-color:var(--business-border)}
 html[data-business-theme] body #mainWrap .sales-business-flow .sales-business-association-divider{border-left-color:var(--business-border)}
}

/* Inquiry and all SAP/OA launchers share one orange gradient palette. */
@media screen{
 html body #mainWrap :is(.jn-sap-launch-tile,.jn-archive-launch-tile) :is(.cost-tile-icon,.preview-tile-icon){background:var(--jiangnan-icon-background)!important;color:var(--jiangnan-icon-accent)!important}
}

/* Layout cells keep their geometry for flow routing; only the icon gets a frame. */
@media screen{
 .sales-business-flow .sales-business-stage:focus-visible{outline:none}
 .sales-business-flow .sales-business-stage>.sales-business-stage-icon{position:relative}
 .sales-business-flow .sales-business-stage>.sales-business-stage-name{color:#000}
 .sales-business-flow .sales-business-stage:is(:hover,:focus-visible):not([aria-disabled="true"]):not(:disabled)>.sales-business-stage-icon{
   outline:2px solid var(--sales-stage-accent,currentColor);
   outline-offset:1px;
 }
 .sales-business-flow .sales-business-stage.is-active:not([aria-disabled="true"]):not(:disabled)>.sales-business-stage-icon{
   outline:4px solid var(--sales-stage-accent,currentColor);
   outline-offset:1px;
 }
 .sales-business-flow .sales-business-stage.is-active:not([aria-disabled="true"]):not(:disabled)>.sales-business-stage-icon::after{
   content:"";position:absolute;top:-6px;right:-6px;width:18px;height:18px;box-sizing:border-box;border:2px solid #fff;border-radius:50%;
   background:var(--sales-stage-accent,currentColor) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8 2.5 2.5L12 5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px 12px no-repeat;
   pointer-events:none;
 }
 .sales-business-flow .sales-business-stage.is-active:not([aria-disabled="true"]):not(:disabled)>.sales-business-stage-name{
   font-weight:700;
 }
 html body #mainWrap :is(.jn-sap-launch-tile,.jn-archive-launch-tile),
 html body #mainWrap :is(.jn-sap-launch-tile,.jn-archive-launch-tile)[data-outline-preview]:is(:hover,:focus-visible){
   background:transparent!important;border-color:transparent!important;box-shadow:none!important;outline:none;transform:none!important;
 }
 html body #mainWrap :is(.jn-sap-launch-tile,.jn-archive-launch-tile):is(:hover,:focus-visible):not(:disabled)>:is(.cost-tile-icon,.preview-tile-icon){
   outline:2px solid var(--jiangnan-icon-accent,currentColor);outline-offset:1px;
 }
}
@media screen and (max-width:768px){
 .sales-business-flow .sales-business-stage.is-active:not([aria-disabled="true"]):not(:disabled)>.sales-business-stage-icon::after{
   top:-4px;right:-4px;width:16px;height:16px;background-size:10px 10px;
 }
}
/* Mouse users click the artwork or caption, not the empty layout cell. Touch keeps its full target. */
@media screen and (hover:hover) and (pointer:fine){
 .sales-business-flow .sales-business-stage,
 #mainWrap :is(.jn-sap-launch-tile,.jn-archive-launch-tile){pointer-events:none;cursor:default}
 .sales-business-flow .sales-business-stage .sales-business-stage-label,
 .sales-business-flow .sales-business-stage>.sales-business-stage-icon,
 #mainWrap :is(.jn-sap-launch-tile,.jn-archive-launch-tile)>span{pointer-events:auto;cursor:pointer}
 #mainWrap :is(.jn-sap-launch-tile,.jn-archive-launch-tile)>span:not(.cost-tile-icon){width:max-content;max-width:100%}
 .sales-business-flow .sales-business-stage:is([aria-disabled="true"],:disabled) :is(.sales-business-stage-icon,.sales-business-stage-label),
 #mainWrap :is(.jn-sap-launch-tile,.jn-archive-launch-tile):disabled>*{pointer-events:none;cursor:default}
}

/* Business, query, basic-data and settings launchers share the flow's icon-only
   interaction. Existing artwork and desktop/mobile dimensions stay in place. */
@media screen{
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile){
   --business-entry-accent:var(--business-accent,#315e91);
   --business-entry-background:linear-gradient(135deg,#fff 0%,var(--business-soft,#e5edf8) 100%);
   --business-entry-active-background:linear-gradient(135deg,var(--business-soft,#e5edf8) 0%,var(--business-border,#c2cfdf) 100%);
   background:transparent!important;border-color:transparent!important;box-shadow:none!important;color:#000!important;outline:none;transform:none!important;
 }
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile):is(:hover,:focus-visible){background:transparent!important;border-color:transparent!important;box-shadow:none!important}
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile):is(:disabled,[aria-disabled="true"]){opacity:.5!important;cursor:default}
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile):is(:disabled,[aria-disabled="true"])>:is(span,div){cursor:default}
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile)[data-document-entry="inquiry-query"]{
   --business-entry-accent:var(--jiangnan-icon-accent,#ed6d00);
   --business-entry-background:var(--jiangnan-icon-background);
   --business-entry-active-background:var(--jiangnan-icon-active-background);
 }
 html body #mainWrap .business-launcher-tile[data-business-entry-tone="history"]{
   --business-entry-accent:#c78b18;
   --business-entry-background:linear-gradient(135deg,#fffaf0 0%,#ffe2a1 100%);
   --business-entry-active-background:linear-gradient(135deg,#fff1cf 0%,#f4ce72 100%);
 }
 html body #mainWrap .business-launcher-tile[data-business-entry-tone="jiangnan"]{
   --business-entry-accent:var(--jiangnan-icon-accent,#ed6d00);
   --business-entry-background:var(--jiangnan-icon-background);
   --business-entry-active-background:var(--jiangnan-icon-active-background);
 }
 html body #mainWrap .business-launcher-tile[data-business-entry-tone="estimate"]{
   --business-entry-accent:#9e7412;
   --business-entry-background:linear-gradient(135deg,#fff8dc 0%,#f5d878 100%);
   --business-entry-active-background:linear-gradient(135deg,#fff2bf 0%,#e9c45f 100%);
 }
 html body #mainWrap .business-launcher-tile[data-business-entry-tone="estimate"].is-active{--business-entry-accent:#8d650e}
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile):is([data-document-entry="receipt"],[data-business-entry-tone="receipt"]){
   --business-entry-accent:#2f8c58;
   --business-entry-background:linear-gradient(135deg,#f0faf3 0%,#b8dec7 100%);
   --business-entry-active-background:linear-gradient(135deg,#e4f5eb 0%,#9fceb3 100%);
 }
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile):is([data-document-entry="receipt"],[data-business-entry-tone="receipt"]).is-active{--business-entry-accent:#2b7f4f}
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile)>:is(.cost-tile-icon,.sales-business-stage-icon,.preview-tile-icon){
   position:relative;background:var(--business-entry-background)!important;color:var(--business-entry-accent)!important;
 }
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile)>:not(.cost-tile-icon):not(.sales-business-stage-icon):not(.preview-tile-icon){color:#000!important}
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile):is(:hover,:focus-visible):not(:disabled):not([aria-disabled="true"])>:is(.cost-tile-icon,.sales-business-stage-icon,.preview-tile-icon){
   outline:2px solid var(--business-entry-accent);outline-offset:1px;
 }
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile).is-active:not(:disabled):not([aria-disabled="true"])>:is(.cost-tile-icon,.sales-business-stage-icon,.preview-tile-icon){
   background:var(--business-entry-active-background)!important;outline:4px solid var(--business-entry-accent);outline-offset:1px;
 }
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile).is-active:not(:disabled):not([aria-disabled="true"])>:is(.cost-tile-icon,.sales-business-stage-icon,.preview-tile-icon)::after{
   content:"";position:absolute;top:-6px;right:-6px;width:18px;height:18px;box-sizing:border-box;border:2px solid #fff;border-radius:50%;
   background:var(--business-entry-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8 2.5 2.5L12 5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px 12px no-repeat;pointer-events:none;
 }
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile).is-active:not(:disabled):not([aria-disabled="true"])>:not(.cost-tile-icon):not(.sales-business-stage-icon):not(.preview-tile-icon){font-weight:700!important}
}
@media screen and (max-width:768px){
 html body #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile).is-active:not(:disabled):not([aria-disabled="true"])>:is(.cost-tile-icon,.sales-business-stage-icon,.preview-tile-icon)::after{
   top:-4px;right:-4px;width:16px;height:16px;background-size:10px 10px;
 }
}
@media screen and (hover:hover) and (pointer:fine){
 #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile){pointer-events:none;cursor:default}
 #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile)>:is(span,div){pointer-events:auto;cursor:pointer}
 #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile)>:not(.cost-tile-icon):not(.sales-business-stage-icon):not(.preview-tile-icon){width:max-content;max-width:100%}
 #mainWrap #baseInfoContent .business-launcher-tile>:not(.preview-tile-icon){margin-inline:auto}
 #mainWrap :is(.business-entry-shell .business-entry-tile,.business-launcher-tile):is(:disabled,[aria-disabled="true"])>*{pointer-events:none;cursor:default}
}

@media screen{
 html body #mainWrap .business-launcher-tile>:not(.cost-tile-icon):not(.sales-business-stage-icon):not(.preview-tile-icon){font-weight:400!important}
 html body #mainWrap .business-launcher-tile.is-active>:not(.cost-tile-icon):not(.sales-business-stage-icon):not(.preview-tile-icon){font-weight:700!important}
}

/* Estimate totals follow the same business palette as other document totals. */
@media screen {
 html[data-business-theme] body #mainWrap #tabContent #page-comparison #compItemTable :is(tfoot,tfoot td) {
  background:var(--business-soft)!important;
 }
}

/* Detached funds footers retain the table frame, while empty space after the
   final column inherits the ordinary document background. */
@media screen {
 .erp-document-design.sv-funds-split .sv-pane-footer,
 .erp-document-design.wrs-split .wrs-pane-footer {background:transparent!important}
}
/* Inquiry drafts use a separate, horizontally synchronized totals table.
   Match the quotation footer while keeping each total under its own column. */
@media screen {
 html[data-business-theme] body #mainWrap #tabContent .op-inquiry-draft-page .op-document-shell>.op-draft-footer {
  height:38px;
  min-height:38px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent!important;
 }
 html[data-business-theme] body #mainWrap #tabContent .op-inquiry-draft-page .op-draft-totals-scroll {
  min-height:0;
  background:transparent!important;
  border-bottom:0;
 }
 html[data-business-theme] body #mainWrap #tabContent .op-draft-totals-table {
  min-height:0;
  font-size:14px;
  font-weight:600;
 }
 html[data-business-theme] body #mainWrap #tabContent .op-draft-totals-table tfoot td {
  box-sizing:border-box;
  height:37px;
  padding:8px;
  border-right:1px solid var(--business-border);
  border-bottom:1px solid var(--business-border);
  line-height:20px;
  white-space:nowrap;
 }
 html[data-business-theme] body #mainWrap #tabContent .op-draft-totals-table :is([data-draft-column="quantity"],[data-draft-column="amount"],[data-draft-column="weight_kg"],[data-draft-column="freight_amount"]) {
  text-align:right;
 }
 html[data-business-theme] body #mainWrap #tabContent .op-draft-unit-list {
  max-height:20px;
 }
}
