/* Read-only configured-account queries; intentionally scoped away from ERP sales. */
.tab-content:has(>.huihuang-query-page.active),
.tab-content:has(>.huihuang-detail-page.active){padding:8px;min-height:0}
.huihuang-query-page,.huihuang-detail-page{height:100%;min-height:0;overflow:hidden}
.huihuang-query-shell,.huihuang-detail-shell{height:100%;min-height:0;display:flex;flex-direction:column;gap:6px;color:#303640;font-size:14px}
.huihuang-toolbar.quotation-toolbar{flex:none;margin:0;gap:6px;align-items:center}
.huihuang-toolbar .quotation-btn{flex:none}
.huihuang-query-shell>.huihuang-toolbar.quotation-toolbar{padding:7px 10px;min-height:48px}
.huihuang-query-shell>.huihuang-toolbar .quotation-btn{flex-direction:row;justify-content:center;gap:6px;min-width:65px;min-height:32px;padding:5px 9px;line-height:20px}
.huihuang-query-shell>.huihuang-toolbar .quotation-btn svg{width:16px;height:16px;flex:none}
.huihuang-query-shell>.huihuang-toolbar .quotation-btn:disabled{opacity:1;color:#949ca8;border-color:#e0e4e9;background:#f7f8fa}
.huihuang-query-shell>.huihuang-toolbar .quotation-btn:disabled svg{opacity:1}
.huihuang-query-shell .huihuang-toolbar-meta{flex:none;flex-direction:column;align-items:flex-start;justify-content:center;flex-wrap:nowrap;gap:0;margin-left:4px;max-width:174px;line-height:16px}
.huihuang-query-shell .huihuang-time-range{font-size:11px}
.huihuang-query-shell .huihuang-updated{font-size:10px;line-height:14px}
.huihuang-toolbar-filters{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-left:auto}
.huihuang-toolbar-filters .huihuang-source{margin-left:0}
.huihuang-toolbar-status select{height:30px;min-width:104px}
.huihuang-toolbar-meta{display:flex;align-items:center;flex-wrap:wrap;gap:5px 14px;margin-left:8px;min-width:0;color:#7b8594;font-size:12px;line-height:20px}
.huihuang-time-range,.huihuang-updated{white-space:nowrap}
.huihuang-source{margin-left:auto;display:flex;align-items:center;gap:10px;min-width:0;color:#687385;font-size:13px}
.huihuang-source:empty{display:none}
.huihuang-source>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.huihuang-source select{max-width:260px}
.huihuang-filter{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:13px}
.huihuang-filter select,.huihuang-pager-settings select{height:32px;min-width:105px;padding:4px 24px 4px 8px;border:1px solid #d9dfe7;background:#fff;border-radius:4px;color:#303640;font:inherit}
.huihuang-filter select:disabled{color:#657080;background:#f4f5f7;opacity:1}
.huihuang-feedback{flex:none;min-height:18px;font-size:12px;line-height:18px;color:#7b8594;overflow-wrap:anywhere}
.huihuang-feedback:empty{display:none}
.huihuang-feedback.is-error,.huihuang-dialog-error{color:#c73636}
.huihuang-query-scroll{flex:1;min-height:0;overflow:auto;border:1px solid #e0e0e0;border-radius:8px;background:#fff}
.huihuang-query-table{table-layout:fixed;border-collapse:separate;border-spacing:0;min-width:0;background:#fff;font-size:13px}
.huihuang-query-table th,.huihuang-query-table td{box-sizing:border-box;padding:11px 10px;height:43px;border-right:1px solid #e9edf1;border-bottom:1px solid #e9edf1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font-weight:400}
.huihuang-query-table th{position:sticky;top:0;z-index:2;background:#f5f7fa;color:#526173;font-weight:600;text-align:center;padding-right:15px}
/* The native select covers its header cell without a nested frame or an arrow. */
.huihuang-query-table th.has-filter{padding:0}
.huihuang-header-filter{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0 8px;border:0;border-radius:0;white-space:nowrap;cursor:pointer}
.huihuang-header-filter-caption{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.huihuang-header-filter-select{position:absolute;inset:0;width:100%;height:100%;margin:0;border:0;border-radius:0;appearance:none;opacity:0;cursor:pointer;z-index:1}
.huihuang-query-table th.has-filter:hover{background:#eaf0f8}
.huihuang-query-table th.is-filtered{color:#2863b5;background:#eaf2ff;box-shadow:inset 0 -2px #8bacdf}
.huihuang-header-filter:focus-within{outline:2px solid #a1bfee;outline-offset:-2px}
.huihuang-query-table td:last-child,.huihuang-query-table th:last-child{border-right:0}
.huihuang-query-table tbody tr:hover td{background:#f6f9ff}
.huihuang-query-table tbody tr.is-selected td{background:#edf4ff}
.huihuang-query-table tbody tr:focus{outline:2px solid #a1bfee;outline-offset:-2px}
.huihuang-query-table tbody tr.huihuang-reversal-pair td:first-child{box-shadow:inset 3px 0 #dfa8a8}
.huihuang-query-table tbody tr[data-reversal-role=original] td{border-bottom-style:dashed}
.huihuang-query-table .huihuang-center{text-align:center}
.huihuang-query-table .huihuang-number,.huihuang-detail-table .huihuang-number{text-align:right;font-variant-numeric:tabular-nums}
.huihuang-document-link{border:0;background:transparent;color:#2863b5;max-width:100%;padding:0;font:inherit;text-align:left;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
.huihuang-document-link:hover{text-decoration:underline}
.huihuang-query-table td.huihuang-empty,.huihuang-empty{padding:35px 15px;text-align:center;color:#8a929e;font-size:13px}
.huihuang-status{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
/* Same palette as inquiry reviewed/draft badges and stamps. */


/* An offset entry is red throughout its query row, not just in the status badge. */
.huihuang-query-table tbody tr:has(.huihuang-status.is-red) td,
.huihuang-query-table tbody tr:has(.huihuang-status.is-red) td *,
.huihuang-query-table tbody tr:has(.huihuang-status.is-red) td::before{color:#842b2b}
.huihuang-col-resizer{position:absolute;right:0;top:0;width:6px;height:100%;cursor:col-resize;touch-action:none;user-select:none;z-index:3}
.huihuang-col-resizer:hover{background:#1677c826}
.huihuang-query-table.is-resizing,.huihuang-query-table.is-resizing *{cursor:col-resize;user-select:none}
.huihuang-query-footer{flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;min-height:35px}
.huihuang-footer-hint{color:#88919d;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.huihuang-pager-navigation,.huihuang-pager-settings{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px}
.huihuang-pager-settings{justify-self:end}
.huihuang-pager-navigation .btn{padding:6px 10px;font-size:12px}
.huihuang-query-dialog{box-sizing:border-box;position:fixed;inset:0;width:min(640px,calc(100vw - 32px));max-height:85dvh;margin:auto;padding:20px 24px;border:1px solid #e0e0e0;border-radius:10px;box-shadow:0 12px 40px #0003;overflow:auto;color:#303640}
.huihuang-query-dialog:not([open]){display:none}
.huihuang-query-dialog::backdrop{background:#0006}
.huihuang-query-dialog h3{margin:0 0 16px;font-size:18px}
.huihuang-query-fields{display:flex;flex-direction:column;gap:12px}
.huihuang-query-field-group{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 16px}
.huihuang-query-field-group+.huihuang-query-field-group{border-top:1px solid #e9edf1;padding-top:12px}
.huihuang-query-fields label{display:flex;flex-direction:column;gap:5px;font-size:14px;min-width:0}
.huihuang-query-fields label.is-wide{grid-column:1/-1}
.huihuang-query-fields input,.huihuang-query-fields select{box-sizing:border-box;width:100%;min-width:0;height:33px;padding:5px 8px;border:1px solid #d9dfe7;border-radius:4px;background:#fff;font:inherit;color:#303640}
.huihuang-dialog-error{font-size:13px;line-height:20px;margin-top:10px}
.huihuang-dialog-error:empty{display:none}
.huihuang-dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}
.huihuang-detail-content{flex:1;min-height:0;overflow:auto;border:1px solid #e0e0e0;border-radius:8px;background:#fff;padding:20px}
.huihuang-detail-heading{display:flex;justify-content:center;align-items:center;gap:15px;margin:0 0 20px}
.huihuang-detail-heading h2{font-size:22px;font-weight:600;margin:0}
.huihuang-detail-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 22px;margin:0 0 24px}
.huihuang-detail-field{display:flex;align-items:baseline;min-width:0;gap:10px;padding-bottom:6px;border-bottom:1px solid #e9edf1}
.huihuang-detail-field.is-wide{grid-column:span 2}
.huihuang-detail-field dt{flex:none;font-size:13px;color:#778191}
.huihuang-detail-field dd{margin:0;min-width:0;min-height:20px;overflow-wrap:anywhere;font-size:14px}
.huihuang-detail-section{margin:0 0 22px;min-width:0}
.huihuang-detail-section h3{font-size:14px;margin:0 0 9px;font-weight:600}
.huihuang-detail-table-scroll{overflow:auto;border:1px solid #e0e0e0;border-radius:6px}
.huihuang-detail-table{min-width:100%;border-collapse:separate;border-spacing:0;font-size:13px;white-space:nowrap}
.huihuang-detail-table th,.huihuang-detail-table td{padding:9px 12px;border-right:1px solid #e9edf1;border-bottom:1px solid #e9edf1;text-align:left}
.huihuang-detail-table th{background:#f5f7fa;color:#526173;font-weight:600}
.huihuang-detail-table :is(th,td):last-child{border-right:0}
.huihuang-notices{font-size:12px;line-height:1.6;color:#7b8594}
.huihuang-notices p{margin:5px 0}
/* Native Huihuang offset documents retain the existing document layout. */
.huihuang-detail-page .erp-document-design:has(.ed-status.is-red),
.huihuang-detail-page .erp-document-design:has(.ed-status.is-red) *:not(.doc-status-ui):not(.doc-status-ui *):not(.doc-status-badge):not(.doc-status-badge *){color:#842b2b!important;-webkit-text-fill-color:#842b2b!important}
.huihuang-detail-page .erp-document-design:has(.ed-status.is-red) .ed-btn:disabled{opacity:1}
.huihuang-detail-page .erp-document-design.is-huihuang-compact .ed-table tfoot td{position:sticky;bottom:0;z-index:2;background:#ddd7e6;border-top:1px solid #c9cdd4;font-weight:600;white-space:nowrap}
/* Covers native types that have not yet been adapted to the shared shell. */
.huihuang-detail-page .huihuang-detail-content:has(.huihuang-status.is-red),
.huihuang-detail-page .huihuang-detail-content:has(.huihuang-status.is-red) *{color:#842b2b}
@media(max-width:1100px){.huihuang-detail-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.huihuang-query-footer{grid-template-columns:auto 1fr}.huihuang-footer-hint{display:none}.huihuang-pager-settings{justify-self:end}}
@media(max-width:768px){
 .huihuang-query-page,.huihuang-detail-page{height:auto;min-height:100%;overflow:visible}
 .huihuang-query-shell,.huihuang-detail-shell{height:auto;min-height:100%;gap:8px}
 .huihuang-toolbar.quotation-toolbar{flex-wrap:wrap;padding:8px;gap:5px}
 .huihuang-toolbar .quotation-btn{min-width:45px;padding:5px 7px;font-size:13px;touch-action:manipulation}
 .huihuang-toolbar .quotation-btn svg{width:18px;height:18px}
 .huihuang-toolbar-meta{margin-left:3px;gap:2px 8px;font-size:11px;line-height:18px}
 .huihuang-source{max-width:calc(100% - 155px);font-size:12px}
 .huihuang-query-shell>.huihuang-toolbar .quotation-btn{min-width:58px;padding:4px 7px;font-size:13px}
 .huihuang-toolbar-filters{gap:8px}
 .huihuang-toolbar-filters .huihuang-source{max-width:180px}
 .huihuang-source .huihuang-filter{flex-wrap:wrap;gap:3px;min-width:0}
 .huihuang-source select{width:100%;max-width:180px;min-width:0}
 .huihuang-filter{font-size:12px;gap:5px}
 .huihuang-filter select{min-width:90px;max-width:160px;font-size:12px}
 .huihuang-query-scroll{overflow:visible;border:0;border-radius:0;background:transparent}
 .huihuang-query-table{display:block;width:100%!important;min-width:0;background:transparent}
 .huihuang-query-table colgroup,.huihuang-query-table thead{display:none}
 .huihuang-query-table tbody{display:block}
 .huihuang-query-table tbody tr:not(.huihuang-empty-row){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 14px;padding:13px;margin-bottom:9px;border:1px solid #e0e5ed;border-radius:8px;background:#fff;touch-action:manipulation}
 .huihuang-query-table tbody tr td{display:block;width:auto!important;height:auto;min-width:0;padding:0;border:0;white-space:normal;overflow-wrap:anywhere;text-align:left}
 .huihuang-query-table tbody tr:not(.huihuang-empty-row) td::before{content:attr(data-label);display:block;font-size:11px;color:#8a929e;margin-bottom:3px;font-weight:400}
 .huihuang-query-table tbody tr td[data-key=sequence]{display:none}
 .huihuang-query-table tbody tr td[data-key=customerName]{grid-column:1/-1;font-weight:600;font-size:15px}
 .huihuang-query-table tbody tr td[data-key=number],.huihuang-query-table tbody tr td[data-key=summary]{grid-column:1/-1}
 .huihuang-query-table tbody tr td:is([data-key=managerName],[data-key=salesCompany],[data-key=staffName]){text-align:center}
 .huihuang-query-table tbody tr.is-selected{border-color:#91b5e6}
 .huihuang-query-table tbody tr:hover td,.huihuang-query-table tbody tr.is-selected td{background:transparent}
 .huihuang-query-table tbody tr.huihuang-empty-row,.huihuang-query-table tbody tr.huihuang-empty-row td{display:block;text-align:center}
 .huihuang-document-link{white-space:normal;overflow-wrap:anywhere}
 .huihuang-query-footer{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-bottom:8px}
 .huihuang-pager-settings{margin-left:auto}
 .huihuang-pager-navigation{margin-right:auto}
 .huihuang-query-dialog{padding:18px;max-height:85dvh}
 .huihuang-query-fields{gap:10px}
 .huihuang-query-field-group{gap:10px 12px}
 .huihuang-query-fields input,.huihuang-query-fields select{font-size:16px}
 .huihuang-detail-content{overflow:visible;padding:13px}
 .huihuang-detail-heading h2{font-size:18px}
 .huihuang-detail-fields{gap:12px;margin-bottom:20px}
 .huihuang-detail-field{display:block;padding-bottom:5px}
 .huihuang-detail-field dt{font-size:11px;margin-bottom:4px}
 .huihuang-detail-field dd{font-size:13px}
 .huihuang-detail-table-scroll{max-width:100%}
}
/* Only Huihuang source details use the ten-row viewport; ERP document editors
   retain their existing layout. Short screens can scroll the document shell. */
#mainWrap .huihuang-detail-page :is(.sales-document-shell,.erp-document-design).is-huihuang-compact{overflow-y:auto;overflow-x:hidden}
#mainWrap .huihuang-detail-page .is-huihuang-compact :is(.sales-document-body-scroll,.ed-sections){flex:none;min-height:0;overflow:visible}
#mainWrap .huihuang-detail-page .is-huihuang-compact :is(.quotation-lines-card,.ed-section){flex:none;min-height:0;height:auto;overflow:hidden}
#mainWrap .huihuang-detail-page .is-huihuang-compact .huihuang-fixed-detail-scroll{display:block;box-sizing:border-box;flex:none;min-height:0;height:480px;max-height:none;overflow:auto;overscroll-behavior:contain}
#mainWrap .huihuang-detail-page .huihuang-fixed-detail-table{border-collapse:separate;border-spacing:0}
#mainWrap .huihuang-detail-page .huihuang-fixed-detail-table :is(th,td){box-sizing:border-box;height:40px;padding-top:0;padding-bottom:0;line-height:20px;white-space:nowrap}
#mainWrap .huihuang-detail-page .huihuang-fixed-detail-table thead th{position:sticky;top:0;z-index:3;background:#f2f3f5}
#mainWrap .huihuang-detail-page .huihuang-fixed-detail-table tfoot td{position:sticky;bottom:0;z-index:3;background:#ddd7e6}
#mainWrap .huihuang-detail-page .huihuang-fixed-detail-table :is(.ed-empty,.sales-document-empty){height:40px;padding:0 8px!important;white-space:nowrap!important}
#mainWrap .huihuang-detail-page .huihuang-detail-blank-row td{background:#fff}
#mainWrap .huihuang-detail-page .huihuang-fixed-detail-table .huihuang-detail-fill-space td{height:var(--huihuang-detail-fill-height,0px);line-height:0;border:0;padding:0;background:#fff}
/* Align the three source-header rows to the same label and input columns. */
#mainWrap .huihuang-detail-page .is-huihuang-compact .sales-document-field label{width:70px;flex:none}
#mainWrap .huihuang-detail-page .is-huihuang-compact [data-header-key=receivable_balance]{text-align:right;font-variant-numeric:tabular-nums}
/* Keep both ends of source-document toolbars visible; middle actions may fold. */
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar{display:flex;flex-wrap:nowrap;align-items:center;min-width:0;overflow-x:auto;overflow-y:hidden}
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar>*{flex:none}
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar>.quotation-spacer{display:none!important}
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar .huihuang-toolbar-hidden,
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar.is-condensed>:is(.quotation-sep,.ed-separator){display:none!important}
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar :is(.quotation-info,.ed-document-info){display:grid;grid-template-columns:70px var(--huihuang-toolbar-input-width,190px);gap:6px 8px;flex:none;width:auto;margin:0 0 0 auto;padding:0;align-items:center}
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar .ed-document-info{grid-template-columns:1fr}
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar .ed-document-info label{display:grid;grid-template-columns:70px var(--huihuang-toolbar-input-width,190px);gap:8px;align-items:center}
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar :is(.quotation-info,.ed-document-info) input{box-sizing:border-box;width:var(--huihuang-toolbar-input-width,190px)!important;min-width:0!important;max-width:none!important;flex:none}
#mainWrap .huihuang-detail-page .huihuang-detail-toolbar .quotation-close-status{display:flex;align-items:center;flex:none;gap:4px}
@media(max-width:1100px){
 #mainWrap .huihuang-detail-page .huihuang-detail-toolbar{--huihuang-toolbar-input-width:140px}
}
@media(max-width:768px){
 #mainWrap .huihuang-detail-page .huihuang-detail-toolbar{--huihuang-toolbar-input-width:100px;gap:2px;padding:6px}
 #mainWrap .huihuang-detail-page .huihuang-detail-toolbar :is(.quotation-info,.ed-document-info label){grid-template-columns:50px var(--huihuang-toolbar-input-width);gap:4px}
 #mainWrap .huihuang-detail-page .huihuang-detail-toolbar :is(.quotation-info label,.ed-document-info label){font-size:12px}
 #mainWrap .huihuang-detail-page .huihuang-detail-toolbar .quotation-close-status{gap:2px}
 #mainWrap .huihuang-detail-page .huihuang-detail-toolbar .quotation-status{margin:2px 3px}
}
@media(min-width:1101px){
 #mainWrap .huihuang-detail-page .is-huihuang-compact:is([data-document-kind=purchase],[data-document-kind=purchase-return],[data-document-kind=sale-return]) .ed-field-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media(max-width:768px){
 #mainWrap .huihuang-detail-page .is-huihuang-compact .sales-document-field:is([data-field=buyer_invoice_name],[data-field=source_document_number]){grid-column:span 1}
}
.huihuang-invoice-dialog { width:min(1000px, calc(100vw - 32px)); max-width:calc(100vw - 32px); }
.huihuang-invoice-dialog > p { color:#64748b; font-size:12px; }
.huihuang-invoice-record-scroll { overflow:auto; max-height:55vh; }
.huihuang-invoice-record-scroll table { width:100%; min-width:680px; }
.huihuang-invoice-record-link { border:0; background:none; color:#165dff; cursor:pointer; font:inherit; text-align:left; padding:0; }
/* History identity stays visible above tables without blocking selection or scrolling. */
.huihuang-query-page.is-history-query,.huihuang-detail-page.is-history-query{position:relative;isolation:isolate}
.huihuang-query-page.is-history-query::after,.huihuang-detail-page.is-history-query::after{content:attr(data-history-watermark);position:absolute;inset:35% 12px auto;text-align:center;transform:rotate(-18deg);color:rgba(180,50,50,.18);font-size:clamp(24px,4vw,58px);font-weight:700;letter-spacing:3px;pointer-events:none;z-index:20;white-space:normal;overflow-wrap:anywhere}
.huihuang-history-database select{min-width:145px;max-width:220px}

.huihuang-history-error{width:min(460px,calc(100vw - 32px))}.huihuang-history-error p{white-space:normal;overflow-wrap:anywhere;line-height:1.7;color:#475569}
