/* HOSM LABEL 1.9 — UI and English-only apparel sorting footers. */
/* Beta 1.9.1: match the card edges inside the existing 1500px workspace,
   which has 18px of horizontal padding on each side. Keep this panel in place. */
.apparel-batch-panel {
  width: calc(100% - 36px);
  max-width: calc(1500px - 36px);
  margin: 0 auto 14px;
  padding: 14px 18px;
  min-width: 0;
}
.apparel-batch-heading { display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:10px; }
.apparel-batch-heading strong { font-size:12px;letter-spacing:.07em; }
#apparelBatchHint { font-size:12px;color:#64748b; }
.apparel-batch-controls { display:grid;grid-template-columns:minmax(230px,1fr) auto 130px;gap:14px;align-items:end; }
.apparel-batch-select { min-width:0; }
.apparel-batch-select > span { font-size:11px;font-weight:800;display:block;margin-bottom:5px; }
.apparel-batch-select select { width:100%;max-width:100%;font-size:13px;min-height:40px; }
.apparel-batch-actions { display:flex;gap:8px;align-items:center; }
.apparel-batch-actions button { min-height:40px;white-space:nowrap; }
.apparel-batch-assigned { border-left:1px solid #dbe3ed;padding-left:18px;text-align:center; }
.apparel-batch-assigned span { display:block;font-size:10px;font-weight:700; }
.apparel-batch-assigned strong { font-size:34px;line-height:1.04;font-weight:900; }
.apparel-batch-summary { font-size:12px;margin-top:9px; }
.apparel-batch-status { margin-top:5px;font-size:12px;color:#256048;min-height:16px; }
.apparel-batch-status.is-error { color:#b42318; }
.apparel-batch-dialog { border:1px solid #cbd5e1;border-radius:14px;padding:24px;width:min(510px,calc(100vw - 32px));max-height:90vh;overflow:auto;color:#142033;background:#fff; }
.apparel-batch-dialog::backdrop { background:rgba(15,23,42,.6); }
.apparel-batch-dialog h2 { font-size:20px;margin:0 0 12px; }
.apparel-batch-dialog p { line-height:1.5;font-size:14px; }
.apparel-batch-dialog pre { font:600 13px/1.6 Arial, sans-serif;background:#f1f5f9;padding:12px;border-radius:8px;white-space:pre-wrap;overflow-wrap:anywhere; }
.apparel-batch-dialog-actions { display:flex;justify-content:flex-end;gap:10px;margin-top:20px; }
html[data-theme="dark"] #apparelBatchHint { color:#aab9cd; }
html[data-theme="dark"] .apparel-batch-status { color:#9bd4b8; }
html[data-theme="dark"] .apparel-batch-status.is-error { color:#ffaaa2; }
html[data-theme="dark"] .apparel-batch-assigned { border-color:#334155; }
html[data-theme="dark"] .apparel-batch-dialog { background:#142033;color:#edf2f8;border-color:#40516a; }
html[data-theme="dark"] .apparel-batch-dialog pre { background:#203149;color:#edf2f8; }
@media(max-width:800px) {
  .apparel-batch-panel{padding:12px;}
  .apparel-batch-controls{grid-template-columns:minmax(0,1fr) 88px;gap:10px;}
  .apparel-batch-select{grid-column:1/-1;}
  .apparel-batch-actions{grid-column:1;flex-wrap:wrap;}
  .apparel-batch-assigned{grid-column:2;grid-row:2;}
  .apparel-batch-actions button{font-size:12px;padding:8px 10px;}
}
/* Keep the established upper identity and UPC barcode sizes on the 4x6 label.
   Compact only the customer note to create a dedicated full-width sorting zone. */
.apparel-label-46 { grid-template-rows:1.72in 1px 1.18in 1px minmax(0,1fr) 1.22in .17in; }
.apparel-label-46 .apparel46-customer-message { padding:.075in .02in 0; font-size:8pt; line-height:1.16; }
.apparel-label-46 .apparel46-customer-message p { margin:0 0 .025in; }
.apparel-sort-band { min-width:0;min-height:0;overflow:hidden;display:flex;align-items:center;justify-content:center; }
.apparel-sort-svg { display:block;width:100%;height:100%;overflow:visible; }
.apparel-batch-footer { display:flex;align-items:end;justify-content:space-between;gap:5px;min-width:0;color:#000;line-height:1; }
.apparel-batch-footer .apparel-internal-sku { font:700 9pt/1 Arial,Helvetica,sans-serif !important;margin:0;padding:0;letter-spacing:.35px; }
.apparel-batch-footer .apparel-batch-date { margin-left:auto;font:400 6.5pt/1.1 Arial,Helvetica,sans-serif !important;white-space:nowrap;color:#000; }
/* Compact 4x2 retains the same identifiers with a smaller sorting footer. */
.apparel-label-42 { display:grid;grid-template-rows:minmax(0,1fr) .49in .14in;gap:.015in;padding:.12in .16in .10in; }
.apparel-label-42 .apparel-info-grid.compact { min-height:0;overflow:hidden;gap:.10in;grid-template-columns:minmax(0,1.4fr) minmax(1.42in,1fr); }
.apparel-label-42 .apparel-info-grid.compact .apparel-primary { min-width:0;padding-right:.02in;overflow:hidden; }
.apparel-label-42 .apparel-info-grid.compact .label-caption { font-size:6.5pt; }
.apparel-label-42 .apparel-info-grid.compact .apparel-brand { font-size:16pt;max-height:.235in;margin-top:0;line-height:1; }
.apparel-label-42 .apparel-info-grid.compact .title-caption { margin-top:.018in; }
.apparel-label-42 .apparel-info-grid.compact .apparel-title { font-size:9pt;line-height:1.05;max-height:.36in;margin-top:.01in; }
.apparel-label-42 .apparel-info-grid.compact .apparel-size-color { margin-top:.025in;gap:.035in;grid-template-columns:.7fr 1.3fr; }
.apparel-label-42 .apparel-info-grid.compact .apparel-size-color > div { min-width:0; }
.apparel-label-42 .apparel-info-grid.compact .apparel-size-color > div + div { padding-left:.04in; }
.apparel-label-42 .apparel-info-grid.compact .apparel-size-color strong { font-size:8.5pt;line-height:1.05;max-height:.22in;margin-top:0;overflow:hidden; }
.apparel-label-42 .apparel-info-grid.compact .apparel-code-column { padding-left:.06in !important; }
.apparel-label-42 .apparel-info-grid.compact .apparel-code-column > strong { font-size:8pt;line-height:1.05;white-space:nowrap; }
.apparel-label-42 .apparel-info-grid.compact .code-caption { margin-top:.025in; }
.apparel-label-42 .apparel-info-grid.compact .apparel-barcode { margin-top:.01in;height:.55in;min-height:0;width:100%; }
.apparel-label-42 .apparel-info-grid.compact .apparel-barcode svg { width:100%;height:.54in; }
@media print { .apparel-batch-panel,.apparel-batch-dialog{display:none !important;} }

/* The apparel editor must not expand a grid column under long titles/UPCs. */
body[data-module="apparel"] #productForm .grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
body[data-module="apparel"] #productForm .grid > label { min-width:0; }
body[data-module="apparel"] #productForm input,
body[data-module="apparel"] #productForm textarea { min-width:0;max-width:100%; }
@media(max-width:520px){body[data-module="apparel"] #productForm .grid {grid-template-columns:minmax(0,1fr);}}

/* 1.9.4: the existing bar and controls retain their measured 1.9.2 footprint.
   Use the spare space above the right-hand number, not a taller controls row.
   Sorting and numeric quantity deliberately share one size/weight/line-height. */
.apparel-batch-assigned { position:relative;height:46.359375px; }
.apparel-sort-metrics { position:absolute;bottom:0;left:18px;right:0;--sort-metric-size:26px; }
#apparelSortCaption { display:block;font:700 10px/10px Arial,Helvetica,sans-serif;white-space:nowrap; }
#apparelSortAssigned,#apparelQuantityValue { display:block;font:900 var(--sort-metric-size)/25px Arial,Helvetica,sans-serif;font-variant-numeric:tabular-nums; }
#apparelSortQuantity { display:flex;align-items:baseline;justify-content:center;gap:3px;width:100%;min-height:0;height:25px;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:inherit;white-space:nowrap;box-shadow:none; }
#apparelQuantityCaption { display:inline;font:700 10px/12px Arial,Helvetica,sans-serif; }
#apparelSortQuantity[data-unknown="true"] #apparelQuantityValue { font-size:10px; }
#apparelSortQuantity:not(:disabled) { cursor:pointer; }
#apparelSortQuantity:not(:disabled):hover #apparelQuantityValue { text-decoration:underline;text-underline-offset:2px; }
#apparelSortQuantity:disabled { opacity:1;cursor:default; }
#apparelSortQuantity:focus-visible { outline:2px solid #2563eb;outline-offset:3px; }
/* Very large totals stay inside the bar; both values scale together. */
.apparel-sort-metrics[data-quantity-digits="5"] { --sort-metric-size:23px; }
.apparel-sort-metrics[data-quantity-digits="6"] { --sort-metric-size:20px; }
.apparel-sort-metrics[data-quantity-digits="7"] { --sort-metric-size:18px; }
.apparel-quantity-actions { flex-wrap:wrap; }
.apparel-quantity-actions button { white-space:normal; }
.apparel-quantity-error { color:#b42318;min-height:0; }
.apparel-quantity-error:empty { display:none; }
#apparelQuantityInput { display:block;width:100%;margin-top:8px; }
html[data-theme="dark"] .apparel-quantity-error { color:#ffaaa2; }
@media(max-width:800px) {
 .apparel-batch-assigned { height:57.359375px; }
 .apparel-sort-metrics { left:8px; }
 #apparelSortCaption { font-size:8px; }
 .apparel-sort-metrics[data-quantity-digits="4"] { --sort-metric-size:22px; }
 .apparel-sort-metrics[data-quantity-digits="5"] { --sort-metric-size:18px; }
 .apparel-sort-metrics[data-quantity-digits="6"] { --sort-metric-size:15px; }
 .apparel-sort-metrics[data-quantity-digits="7"] { --sort-metric-size:13px; }
}
html[data-language="zh"] .apparel-batch-assigned { height:52px; }

/* 1.9.4 — advisory current → next quantity display only. */
#apparelQuantityValue { display:inline-flex;align-items:baseline;flex:0 0 auto; }
#apparelQuantityValue .apparel-quantity-current,
#apparelQuantityValue .apparel-quantity-proposed { display:inline;font:inherit; }
#apparelQuantityValue .apparel-quantity-arrow { display:inline;font:700 .6em/1 Arial,Helvetica,sans-serif;white-space:pre; }
#apparelSortQuantity[data-state="preview"] .apparel-quantity-proposed { color:#166534; }
html[data-theme="dark"] #apparelSortQuantity[data-state="preview"] .apparel-quantity-proposed { color:#86efac; }
