/* Multi-source sales: source detail is internal only; customer layout stays unchanged. */
/* A brand cell uses rowspan: never let one EAN's cost warning color the
   entire merged brand block. The warning belongs only to individual SKU cells. */
.staff-products tr.below-cost-row > td:not(.brand-cell) { background-color: rgba(205,53,53,.10); }
.staff-products tr.below-cost-row > td.brand-cell { background: #fcfaf7 !important; }
.staff-products tr.below-cost-row .barcode-cell { box-shadow: inset 3px 0 #bd3c3c; }
.price-cost-warning { color: #ac3333; font-weight: 700; font-size: 11px; white-space: normal; }
.source-breakdown { font-size: 11px; text-align: left; margin-top: 4px; }
.source-breakdown summary { cursor: pointer; color: var(--accent,#5b6b80); white-space: nowrap; }
.source-breakdown > div { padding: 3px 0; white-space: nowrap; }

/* Supplier imports: true upload and server-side processing progress. */
.supplier-import-progress {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8faf9;
}
.supplier-import-progress strong { display: block; margin-bottom: 9px; }
.supplier-import-progress progress {
  width: 100%; height: 14px; display: block;
  accent-color: #23856d;
}
.supplier-import-progress #supplierProgressPercent { display: block; margin-top: 5px; text-align: right; }
.supplier-import-progress p { margin-bottom: 0; }

/* Supplier import: advisory barcode/duplicate flags; never block upload. */
.supplier-preview-warning { background: rgba(219, 82, 72, 0.09); }
.supplier-preview-duplicate { background: rgba(226, 169, 54, 0.10); }
.supplier-preview-flag { margin-top: 4px; color: #ac5124; font-size: 12px; font-weight: 650; }
.supplier-preview-search { max-width: 370px; display: block; margin: 12px 0 8px; }
.supplier-preview-table td { vertical-align: middle; }
.supplier-preview-delete { white-space: nowrap; }

/* Excel-style per-column filters for the supplier replacement preview. */
.supplier-preview-table .supplier-column-filter {
  margin-left: 5px; min-width: 22px; padding: 1px 4px;
  border: 1px solid #d4cabd; border-radius: 4px; background: #fff;
  color: #726758; font-size: 13px; cursor: pointer;
}
.supplier-preview-table .supplier-column-filter:hover,
.supplier-preview-table .supplier-column-filter.is-active {
  color: #fff; background: #866949; border-color: #866949;
}
.supplier-filter-overlay { position: fixed; inset: 0; z-index: 19000; background: transparent; }
.supplier-filter-menu {
  position: fixed; box-sizing: border-box; z-index: 19001;
  max-height: calc(100vh - 20px); overflow-y: auto;
  padding: 12px; border: 1px solid #d8cfc2; border-radius: 9px;
  background: #fff; box-shadow: 0 12px 40px rgba(30,24,15,.2);
  color: #2e2821; font-size: 13px;
}
.supplier-filter-title { font-weight: 700; margin-bottom: 9px; }
.supplier-filter-search { box-sizing: border-box; width: 100%; padding: 8px 10px; }
.supplier-filter-tools { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0; }
.supplier-filter-tools button { padding: 5px 8px; font-size: 12px; }
.supplier-filter-options { max-height: 185px; min-height: 40px; overflow-y: auto; border: 1px solid #eee8dd; border-radius: 4px; padding: 4px; }
.supplier-filter-option { display: flex; gap: 8px; align-items: flex-start; padding: 5px; cursor: pointer; overflow-wrap: anywhere; }
.supplier-filter-option:hover { background: #f7f3eb; }
.supplier-filter-option input { margin: 3px 0 0; flex: none; }
.supplier-filter-option span { flex: 1; }
.supplier-filter-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.supplier-filter-footer button { font-size: 12px; }

/* Supplier sales workspace: status, source isolation and editable pricing hints. */
.supplier-enabled {color:#217653;font-weight:650}
.supplier-disabled {color:#925c26;font-weight:650}
.supplier-inactive-row {background:rgba(110,104,95,.06);color:#77716c}
.supplier-inactive-row .barcode-cell {color:var(--text, #2e2926)}
#globalMarkup {max-width:16rem}
.source-breakdown {max-width:25rem}
.source-breakdown div {padding:3px 0;overflow-wrap:anywhere}

/* Supplier-source quotation reuses the own-stock visual language without
   accidentally presenting source costs as the published client quotation. */
.supplier-quote-card { padding: 20px; }
.supplier-quote-wrap { margin-top: 12px; overflow-x: auto; }
.supplier-quote-table { min-width: 1510px; width: 100%; border-collapse: collapse; }
.supplier-quote-table caption { font-size: 22px; padding: 18px 12px; }
.supplier-quote-table thead th { white-space: nowrap; }
.supplier-quote-table td { vertical-align: middle; }
.supplier-quote-table .supplier-source-cell { min-width: 125px; font-weight: 600; }
.supplier-quote-table .supplier-source-cell .pill { display: block; width: max-content; margin: 5px auto 0; }
.supplier-quote-table .product-name { min-width: 255px; max-width: 350px; }
.supplier-quote-table .remark-cell { text-align: left; }
.supplier-quote-table .barcode-cell { background: #fffdfa; }
.supplier-quote-table .brand-cell { background: #fbf8f2; }
.supplier-stock-filters, .supplier-formula-controls {
  display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
}
.supplier-stock-filters label { flex: 1 1 245px; max-width: 460px; }
.supplier-stock-filters input, .supplier-stock-filters select { width: 100%; }
.supplier-formula-controls label { flex: 1 1 185px; max-width: 320px; }
.supplier-formula-controls .actions { margin: 0 0 1px; display: flex; gap: 8px; }
#globalMarkupExample { margin: 11px 0 0; }
.combined-export-details {
  border: 1px solid var(--line); border-radius: 9px; padding: 14px 18px;
  background: #fff; margin: 10px 0 18px;
}
.combined-export-details > summary {
  font-weight: 700; font-size: 14px; color: var(--wine);
  cursor: pointer; padding: 6px 0;
}
.combined-export-details .export-sources-options {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(195px,1fr));
  gap: 9px 16px; margin: 14px 0;
}
.combined-export-details .actions { margin-top: 14px; }

/* Supplier EAN-scoped quote editors; original supplier prices stay read-only. */
.supplier-quote-table { min-width: 2050px; }
.supplier-name-edit { min-width: 290px; }
.supplier-name-edit label { display:block; text-align:left; font-size:11px; color:#776e66; margin:4px 0; }
.supplier-meta-input { display:block; width:100%; min-width:210px; padding:5px 8px; margin-top:2px; border:1px solid #ddd4c9; border-radius:4px; background:#fff; color:#302725; font:inherit; font-size:13px; }
.supplier-meta-input:focus { outline:2px solid rgba(74,24,34,.22); border-color:#874856; }
.supplier-sales-cell { min-width:143px; vertical-align:middle; }
.supplier-price-edit { display:flex; gap:4px; align-items:center; justify-content:flex-end; }
.supplier-price-edit .currency-symbol { flex:none; color:#79434c; font-weight:700; }
.supplier-sales-input { width:88px; min-width:70px; padding:6px 5px; text-align:right; border:1px solid #d7cbbd; border-radius:4px; background:#fff; font:inherit; }
.supplier-save-price-actions { margin-top:8px; text-align:center; }
.supplier-save-price:disabled { opacity:.55; cursor:wait; }

.supplier-quote-table .brand-cell { min-width: 145px; white-space: normal; overflow-wrap: anywhere; }

/* Product-master categorization and cross-source review belong only to HK staff pages. */
.supplier-needs-review .barcode-cell { background: #fff0d7; border-left: 3px solid #c47e27; }
.supplier-identity-alert { color: #965613; background: #fff1d8; border: 1px solid #efcf9e; border-radius: 5px; font-size: 11px; font-weight: 700; margin-top: 5px; padding: 4px 6px; text-align: left; }
.source-identity-variants { text-align: left; max-width: 27rem; font-size: 11px; margin-top: 5px; white-space: normal; }
.source-identity-variants summary { cursor: pointer; color: #985813; }
.source-identity-variants div { padding: 3px 0; overflow-wrap: anywhere; }
.supplier-review-banner { border: 1px solid #ebcf9c; background: #fff6e7; padding: 12px 14px; border-radius: 7px; color: #875516; font-size: 13px; margin-bottom: 14px; }
.supplier-original-name { font-size: 10px; max-width: 15rem; margin-top: 5px; color: #6b625d; }
.supplier-original-name summary { cursor: pointer; }
.supplier-original-name span { display: block; margin-top: 3px; overflow-wrap: anywhere; }

/* V5: match the own-stock quote table; input controls appear only when editing. */
.supplier-quote-table { min-width: 1450px; }
.supplier-quote-table .supplier-display-name { min-width: 270px; max-width: 380px; text-align: left; }
.supplier-quote-table .supplier-display-name .chinese-name { font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.supplier-quote-table .supplier-display-name .english-name { color: #817a73; margin-top: 12px; font-size: 12px; overflow-wrap: anywhere; }
.supplier-quote-table .supplier-name-edit-button { margin-top: 5px; font-size: 11px; padding: 3px 8px; }
.supplier-quote-table .supplier-suggestion-cell { min-width: 115px; white-space: nowrap; }
.supplier-quote-table .supplier-quote-actions { margin-top: 5px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.supplier-quote-table .supplier-quote-actions button { font-size: 10px; padding: 2px 7px; }
.supplier-quote-table .supplier-inline-price { display: flex; align-items: center; justify-content: center; gap: 4px; }
.supplier-quote-table .supplier-price-entry { max-width: 85px; min-width: 65px; padding: 5px 4px; text-align: right; }
.supplier-quote-table .manual-tag { display: block; margin-top: 2px; }

/* EAN master display: click in-place like the original COM stock spreadsheet. */
.supplier-quote-table .supplier-inline-field { cursor:text; border-radius:3px; min-height:18px; }
.supplier-quote-table .supplier-inline-field:hover,
.supplier-quote-table .supplier-inline-field:focus-visible { background:#fff9e9; outline:1px solid #c69b76; }
.supplier-quote-table .supplier-field-unmatched { color:#a47645; font-weight:400; }
.supplier-quote-table .supplier-inline-name-editor {
  display:block; width:100%; min-height:37px; resize:vertical; padding:4px 6px;
  font:inherit; line-height:1.45; color:inherit; background:#fff; border:1px solid #ab8657;
  box-sizing:border-box; white-space:pre-wrap;
}
.supplier-master-status { margin:10px 0; font-size:12px; }

/* Supplier master review: raw Excel names remain distinct from verified COM/HK names. */
.supplier-quote-table { min-width: 2230px; }
.supplier-quote-table .supplier-original-cell {
  min-width: 245px; max-width: 340px; text-align: left;
  padding: 9px 12px; white-space: normal; overflow-wrap: anywhere;
}
.supplier-original-cn { font-size: 12px; line-height: 1.45; font-weight: 600; }
.supplier-original-en { font-size: 11px; color: #796f69; margin-top: 5px; line-height: 1.4; }
.supplier-legacy-tag { display: block; font-size: 10px; line-height: 1.35; margin-top: 6px; }
.supplier-legacy-tag { color: #897a73; }
.supplier-master-reference {
  margin-top: 9px; padding: 7px 9px; border-left: 2px solid #bcaaa0;
  color: #665954; background: #f8f5f0; font-size: 11px; line-height: 1.5;
  overflow-wrap: anywhere;
}
.supplier-master-reference b { display: block; font-weight: 650; margin-bottom: 3px; }
.supplier-master-reference div + div { margin-top: 3px; }
.supplier-master-review-dialog {
  width: min(1100px, 96vw); max-width: 96vw; max-height: 88vh;
  padding: 0; border-radius: 12px; border: 1px solid #d7cbc2;
}
.supplier-master-review-dialog::backdrop { background: #24171675; }
.supplier-review-head, .supplier-review-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 20px; background: #faf6f0;
}
.supplier-review-head { border-bottom: 1px solid #e0d6cd; }
.supplier-review-head h2 { font-size: 18px; margin: 0 0 6px; }
.supplier-review-head p { font-size: 12px; margin: 0; }
.supplier-review-head button { min-width: 34px; }
.supplier-review-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; }
.supplier-review-tools button.is-active { border-color: #6e2431; color: #6e2431; background: #fff3ed; font-weight: 700; }
.supplier-review-table-wrap { padding: 0 20px; max-height: min(58vh, 620px); overflow: auto; }
.supplier-review-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.supplier-review-table-wrap th { position: sticky; top: 0; background: #53202b; color: #fff; z-index: 1; }
.supplier-review-table-wrap td, .supplier-review-table-wrap th {
  padding: 10px 11px; border: 1px solid #e8e0d9; text-align: left;
  white-space: normal; overflow-wrap: anywhere; vertical-align: top;
}
.supplier-review-table-wrap .barcode-cell { white-space: nowrap; font-weight: 700; }
.supplier-review-type { display: inline-block; white-space: nowrap; border-radius: 3px; font-size: 10px; padding: 2px 5px; margin-right: 7px; }
.supplier-review-type.error { background: #ffebe8; color: #922f20; }
.supplier-review-type.missing { background: #fff1d9; color: #896017; }
.supplier-review-name-separator { height: 5px; border-bottom: 1px dotted #e3d6c7; margin-bottom: 5px; }
.supplier-review-footer { border-top: 1px solid #e0d6cd; font-size: 12px; }

/* Supplier source names are literal imported text, not a normalized display layer. */
.supplier-quote-table .supplier-original-cn,
.supplier-quote-table .supplier-original-en {
  font: inherit; font-size: 12px; font-weight: 400; line-height: 1.55;
  letter-spacing: normal; text-transform: none; white-space: pre-wrap;
  overflow-wrap: anywhere; color: inherit; text-align: left;
}
.supplier-quote-table { table-layout: fixed; }
.supplier-quote-table thead th { position:relative; overflow:visible; }
.supplier-col-resizer {
  position:absolute; right:-4px; top:0; bottom:0; width:9px;
  cursor:col-resize; touch-action:none; z-index:3;
}
.supplier-col-resizer:hover,.supplier-col-resizer:active { background:rgba(255,255,255,.35); }
.supplier-quote-table .brand-cell,
.supplier-quote-table .supplier-original-cell,
.supplier-quote-table .supplier-display-name,
.supplier-quote-table .supplier-source-cell,
.supplier-quote-table .supplier-suggestion-cell { min-width:0; max-width:none; }
.supplier-quote-table th,.supplier-quote-table td { overflow-wrap:anywhere; }
.supplier-row-qty { text-align:center; }
.supplier-qty-edit { display:block; margin:3px auto 0; }
.supplier-qty-manual { display:block; font-size:10px; color:#866139; }
.supplier-qty-entry { display:flex; gap:3px; flex-wrap:wrap; justify-content:center; }
.supplier-qty-entry input { width:76px; min-width:0; padding:3px; text-align:right; }
.supplier-match-progress { display:grid; grid-template-columns:1fr auto; gap:4px 10px; align-items:center; margin:10px 0; }
.supplier-match-progress .supplier-master-status { grid-column:1/-1; margin:0; }
.supplier-progress-track { height:11px; border-radius:9px; background:#e9dfd1; overflow:hidden; }
.supplier-progress-fill { height:100%; width:0%; background:#6d3a35; transition:width .2s ease; }
.supplier-progress-percent { font-size:12px; font-variant-numeric:tabular-nums; font-weight:600; }

/* 2026-10-15 supplier catalog refinements */
.supplier-quote-wrap {width:100%;max-width:100%;box-sizing:border-box;margin:12px 0 0;padding:0;}
.supplier-quote-wrap > .supplier-quote-table {width:100%;margin:0;}
.supplier-merge-switch {display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;cursor:pointer;padding:5px 8px;border-radius:6px;border:1px solid #b8d9c8;background:#ebf7f0;color:#246549;font-size:11px;font-weight:600;}
.supplier-merge-switch.is-off {background:#f6eae5;color:#8d5449;border-color:#e3c9c0;}
.supplier-merge-switch:disabled {opacity:.65;cursor:not-allowed;}
.supplier-merge-disabled {display:block;margin-top:4px;font-size:10px;color:#8c796a;}
.daily-diff-product-name {text-align:left;min-width:210px;max-width:370px;white-space:normal;overflow-wrap:anywhere;}

/* No unused inner gutters around the supplier table: the burgundy header reaches both card edges. */
.supplier-quote-card .supplier-quote-wrap {width:calc(100% + 40px);max-width:calc(100% + 40px);margin-left:-20px;margin-right:-20px;}
.supplier-quote-card .supplier-quote-table {border-radius:0;}

/* Explicit supplier master lookup and shared daily-FX controls. */
.supplier-pricing-heading {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-bottom:5px;}
.supplier-pricing-heading h3 {margin:0;}
.supplier-fx-overview {margin:5px 0 12px;}
.supplier-fx-rates {display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));margin:12px 0;}
.supplier-fx-rates label {display:block;}
.supplier-master-actions {display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:12px 0 5px;}
.supplier-force-match {margin:0;font-size:12px;color:#60534a;}
.supplier-force-match input {margin-right:5px;}

/* 2026-10-15: wrap long supplier breakdowns and inquiry text without changing prices. */
.staff-products .source-stock,
.staff-products .source-breakdown,
.staff-products .source-breakdown > div,
.staff-products .source-identity-variants,
.staff-products .source-identity-variants > div {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.staff-products .source-breakdown summary { white-space: normal; }
.staff-products .price.currency-cell,
.staff-products .price.currency-cell .price-number {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.staff-products .price.currency-cell .currency-amount,
.staff-products .price.currency-cell .currency-display {
  white-space: nowrap;
}

/* Stable Excel-like supplier preview filter: values remain on one readable line. */
.supplier-filter-menu { width: min(420px, calc(100vw - 24px)); max-width: calc(100vw - 24px); overflow-x: hidden; }
.supplier-filter-options { overflow-x: hidden; min-width: 0; }
.supplier-filter-option { display:flex; align-items:center; min-width:0; width:100%; box-sizing:border-box; overflow-wrap:normal; word-break:normal; }
.supplier-filter-option span { flex:1 1 0; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; word-break:normal; }
.supplier-filter-tools, .supplier-filter-footer { flex-wrap:wrap; }

/* Sales workspace pagination avoids rendering several hundred inline-editor rows at once. */
