/* Shared preview/print work order. Black ink and hierarchy, not coloured panels. */
.wo-preview-stage{padding:24px 16px;overflow:auto;background:#edf0ee}
.work-order-sheet{box-sizing:border-box;width:210mm;min-height:148mm;padding:8mm;margin:0 auto 20px;background:#fff;color:#111;box-shadow:0 8px 30px #00000014;font:10.5pt/1.4 "PingFang SC","Microsoft YaHei",sans-serif;text-align:left;overflow-wrap:anywhere}
.work-order-sheet *{box-sizing:border-box}
.work-order-sheet h1,.work-order-sheet h2,.work-order-sheet p{margin:0;color:#111}
.work-order-sheet .wo-header{display:flex;align-items:center;gap:3mm;padding-bottom:1mm;border-bottom:.6mm solid #111;break-inside:avoid}
.work-order-sheet .wo-logo{width:9mm;height:9mm;flex:0 0 9mm;object-fit:contain;background:#fff;filter:grayscale(1) contrast(2);border:0;border-radius:0;clip-path:none}
.work-order-sheet .wo-heading{flex:1;display:flex;align-items:baseline;gap:4mm;flex-wrap:wrap;min-width:0}
.work-order-sheet .wo-brand{font-size:12pt;font-weight:650;letter-spacing:.5mm}
.work-order-sheet h1{font-size:20pt;line-height:1.2;font-weight:750;letter-spacing:.7mm}
.work-order-sheet h1 span{margin-left:2.5mm;font-size:9pt;font-weight:500;letter-spacing:0}
.work-order-sheet .wo-document-type{text-align:right;font-size:9pt;line-height:1.4;flex-shrink:0}
.work-order-sheet .wo-document-type span{display:block;font-size:7.5pt;margin-top:.5mm;color:#333}
.work-order-sheet .wo-identity{display:grid;grid-template-columns:minmax(0,1fr) 24mm 42mm;gap:3mm;padding:1.2mm 0;border-bottom:.2mm solid #888;font-size:8.5pt;line-height:1.5;break-inside:avoid}
.work-order-sheet .wo-identity>div{display:flex;gap:2mm;align-items:baseline}
.work-order-sheet .wo-identity span{color:#333;flex-shrink:0}
.work-order-sheet .wo-identity strong{font-weight:600;font-variant-numeric:tabular-nums}
.work-order-sheet .wo-plan{display:grid;grid-template-columns:minmax(0,1.3fr) 26mm minmax(0,1fr);gap:3mm;padding:1.5mm 0;align-items:center;border-bottom:.25mm solid #111;break-inside:avoid}
.work-order-sheet .wo-plan small{display:inline;font-size:8pt;color:#333;line-height:1.4;margin-right:2mm}
.work-order-sheet .wo-plan-date strong{display:inline;font-size:14pt;font-weight:750;line-height:1.4;font-variant-numeric:tabular-nums}
.work-order-sheet .wo-plan-date em{font-style:normal;font-size:12pt;padding-left:3mm;white-space:nowrap}
.work-order-sheet .wo-priority{border-left:.25mm solid #888;padding-left:3mm}
.work-order-sheet .wo-priority strong{font-size:13pt;font-weight:700}
.work-order-sheet .wo-state{text-align:right;font-size:10pt;line-height:1.4}
.work-order-sheet.wo-cancelled .wo-state strong,.work-order-sheet.wo-deleted .wo-state strong{border:.6mm double #111;padding:1mm 2mm;display:inline-block;font-weight:800}
.work-order-sheet.wo-pending .wo-state strong,.work-order-sheet.wo-review .wo-state strong{text-decoration:underline;text-underline-offset:.7mm}
.work-order-sheet .wo-customer{display:grid;grid-template-columns:minmax(0,1fr) minmax(54mm,.8fr);gap:6mm;padding:1.2mm 0 .6mm;break-inside:avoid}
.work-order-sheet .wo-customer>div{display:flex;align-items:baseline;gap:3mm;min-width:0}
.work-order-sheet .wo-customer>div:last-child{justify-content:flex-end}
.work-order-sheet .wo-customer span{font-size:8.5pt;color:#333;flex-shrink:0}
.work-order-sheet .wo-customer strong{font-size:14pt;line-height:1.4;font-weight:750}
.work-order-sheet .wo-customer>div:last-child strong{font-size:11pt;font-variant-numeric:tabular-nums}
.work-order-sheet h2{font-size:10.5pt;line-height:1.4;letter-spacing:.2mm;font-weight:700;margin:1.2mm 0 .8mm;break-after:avoid}
.work-order-sheet h2>span{font-size:8.5pt;font-weight:500;letter-spacing:0;margin-right:2mm;color:#444}
.work-order-sheet .wo-products,.work-order-sheet .wo-remarks{display:block;width:100%}
/* A blank line isolates the actual production instruction from administrative metadata. */
.work-order-sheet .wo-products{margin-top:3.5mm}
.work-order-sheet .wo-remarks{margin-top:3mm}
.work-order-sheet table{width:100%;border-collapse:collapse;table-layout:fixed;border-top:.45mm solid #111;border-bottom:.45mm solid #111;margin:0;font-size:11.5pt;line-height:1.4}
.work-order-sheet .wo-col-index{width:6%}
.work-order-sheet .wo-col-product{width:29%}
.work-order-sheet .wo-col-pack{width:30%}
.work-order-sheet .wo-col-variety{width:16%}
.work-order-sheet .wo-col-quantity{width:19%}
.work-order-sheet thead{display:table-header-group}
.work-order-sheet th,.work-order-sheet td{padding:1.2mm 2mm;background:#fff;color:#111;border:0;border-bottom:.2mm solid #888;text-align:left;vertical-align:top;font-size:inherit;line-height:inherit;white-space:normal;overflow-wrap:anywhere}
.work-order-sheet th{font-size:8.5pt;font-weight:700;border-bottom:.3mm solid #111;padding-top:1.2mm;padding-bottom:1.2mm}
.work-order-sheet tr{break-inside:avoid}
.work-order-sheet th:first-child,.work-order-sheet td:first-child{text-align:center;padding-left:1mm}
.work-order-sheet .wo-product-name{font-weight:750;font-size:12pt}
.work-order-sheet td small{display:block;margin-top:.4mm;color:#333;font-size:8pt}
.work-order-sheet .wo-quantity{text-align:right;font-variant-numeric:tabular-nums}
.work-order-sheet .wo-quantity strong{font-size:16pt;line-height:1.25;font-weight:800}
.work-order-sheet .wo-quantity span{font-size:10pt;margin-left:1.5mm}
.work-order-sheet .wo-notes{display:block;padding:.5mm 0 .5mm 2.5mm;border-left:.5mm solid #333;white-space:pre-wrap;min-height:5mm;font-size:12pt;font-weight:650;line-height:1.5;orphans:2;widows:2}
.work-order-sheet .wo-notes+.wo-notes{margin-top:1.2mm}
.work-order-sheet .wo-notes-empty{border-left:0;padding-left:0;font-weight:400}
.work-order-sheet .wo-safety-note{margin-top:1mm;font-size:9pt;font-weight:700;line-height:1.4}
.work-order-sheet .wo-records{display:grid;grid-template-columns:1fr 1fr 1.05fr;gap:.6mm 4mm;margin-top:4mm;padding:1.2mm 0 .8mm;border-top:.3mm solid #333;break-inside:avoid}
.work-order-sheet .wo-records>div{display:flex;gap:2mm;align-items:baseline;font-size:9.5pt;line-height:1.45}
.work-order-sheet .wo-records>div>span{flex-shrink:0;font-size:8.5pt;color:#333}
.work-order-sheet .wo-records>div>strong{font-weight:650}
.work-order-sheet .wo-footer{display:flex;justify-content:space-between;gap:5mm;align-items:baseline;padding-top:1.5mm;border-top:.25mm solid #333;font-size:7.5pt;line-height:1.45;break-inside:avoid}
.work-order-sheet .wo-footer>strong{font-weight:550;max-width:124mm}
.work-order-sheet .wo-footer>span{color:#444;text-align:right;max-width:68mm}
.work-order-sheet .wo-page-index{display:inline-block;white-space:nowrap}
@page hehe-work-order{size:210mm 148mm;margin:8mm}
@media(max-width:850px){.wo-preview-stage{padding:16px 10px}.work-order-sheet{margin-left:0;margin-right:0}}
@media print{
  body.printing-work-order{page:hehe-work-order;margin:0!important;padding:0!important;background:#fff!important;color:#111!important}
  #print-root.work-order-print-root{page:hehe-work-order;width:auto!important;margin:0!important;padding:0!important}
  .work-order-sheet{page:hehe-work-order;width:auto;min-height:0;max-width:none;padding:0;margin:0;box-shadow:none;border:0;print-color-adjust:economy;-webkit-print-color-adjust:economy}
  /* Start the next order on a fresh A5; do not force an empty page after the last. */
  .work-order-sheet+.work-order-sheet{break-before:page;page-break-before:always}
}
