.production-print-sheet.is-paginating {
  position: fixed;
  z-index: -1;
  top: 0;
  left: -400mm;
  display: block !important;
  width: 297mm;
  visibility: hidden;
  pointer-events: none;
}

.production-print-page {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  color: #000;
  background: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 9pt;
  line-height: 1.35;
}

.production-print-summary-page {
  width: 297mm;
  height: 210mm;
  min-height: 210mm;
  padding: 10mm;
}

.production-print-pagination-source {
  box-sizing: border-box;
  width: 210mm;
  padding: 10mm;
  visibility: hidden;
}

.production-print-detail-page {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  padding: 10mm;
  overflow: hidden;
}

.production-print-page-time,
.production-print-page-batch,
.production-print-page-section,
.production-print-page-total {
  position: absolute;
  z-index: 1;
  font-size: 7pt;
  line-height: 1;
  white-space: nowrap;
}

.production-print-page-time {
  top: 7mm;
  left: 10mm;
}

.production-print-page-batch {
  top: 6.2mm;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10pt;
  font-weight: 850;
  line-height: 1.2;
}

.production-print-page-section {
  bottom: 7mm;
  left: 50%;
  transform: translateX(-50%);
}

.production-print-page-total {
  right: 10mm;
  bottom: 7mm;
}

.production-print-header {
  display: flex;
  gap: 12mm;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 2.5mm;
  border-bottom: 1.2pt solid #111;
}

.production-print-header h1,
.production-print-header small,
.production-print-header dl,
.production-print-header dd {
  margin: 0;
}

.production-print-header h1 {
  margin-top: 0.6mm;
  font-size: 15pt;
}

.production-print-header dl {
  display: grid;
  min-width: 58mm;
  gap: 1.5mm;
}

.production-print-header dl div {
  display: grid;
  grid-template-columns: 18mm minmax(0, 1fr);
  gap: 2mm;
}

.production-print-header dt {
  color: #444;
}

.production-print-header dd {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.production-print-order-register {
  margin-top: 2.5mm;
  padding: 2mm 2.5mm;
  border: 0.6pt solid #666;
  break-inside: avoid;
}

.production-print-order-register p {
  margin: 0.8mm 0 0;
  overflow-wrap: anywhere;
  font-size: 8pt;
  line-height: 1.45;
}

.production-print-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) repeat(2, minmax(0, 2fr));
  margin: 2.5mm 0;
  border: 0.6pt solid #555;
  break-inside: avoid;
}

.production-print-overview div {
  min-width: 0;
  padding: 1.5mm 2mm;
  border-right: 0.6pt solid #777;
}

.production-print-overview div:last-child {
  border-right: 0;
}

.production-print-overview small,
.production-print-overview strong {
  display: block;
}

.production-print-overview-order-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6mm 1.4mm;
  margin: 1mm 0 0;
  font-size: 8pt;
  line-height: 1.3;
}
.production-print-overview-order-numbers > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }

.production-print-overview strong {
  margin-top: 0.5mm;
  font-size: 12pt;
}

.production-print-model-summary {
  margin: 2.5mm 0 0;
  break-inside: avoid;
}

.production-print-model-summary > h2 {
  margin: 0 0 1.2mm;
  font-size: 10pt;
}

.production-print-model-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1mm;
  align-items: start;
}

.production-print-model-group {
  min-width: 0;
  padding: 1.2mm;
  border: 0.6pt solid #8d9d97;
  border-radius: 1.8mm;
  background: #fff;
}

.production-print-model-group.support {
  border-color: #9aa8bd;
}

.production-print-model-group-heading {
  display: flex;
  gap: 1mm;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.7mm;
  border-bottom: 0.5pt solid #aebbb6;
}

.production-print-model-group-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 8pt;
}

.production-print-model-group-heading span {
  flex: 0 0 auto;
  color: #704b00;
  font-size: 7.2pt;
  font-weight: 800;
  white-space: nowrap;
}

.production-print-model-group > small {
  display: block;
  margin-top: 0.5mm;
  color: #555;
  font-size: 6.4pt;
}

.production-print-model-rows {
  display: grid;
  gap: 0.45mm;
  margin: 0.7mm 0 0;
  padding: 0;
  list-style: none;
}

.production-print-model-row {
  display: flex;
  min-width: 0;
  gap: 0.6mm;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.45mm 0.65mm;
  border: 0.45pt solid #c6d1cd;
  border-radius: 1mm;
  font-size: 6.65pt;
  line-height: 1.12;
}

.production-print-model-row > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.production-print-model-row-meta {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.6mm;
  align-items: center;
  white-space: nowrap;
}

.production-print-urgent-inline {
  padding: 0.1mm 0.45mm;
  color: #9d1e2e;
  font-size: 6.1pt;
  line-height: 1.15;
}

.production-print-classification-warning {
  margin: 2mm 0 0;
  padding: 1.8mm 2.2mm;
  border: 0.6pt solid #9a6500;
  background: #fff8e6;
  font-size: 7.5pt;
}

.production-print-section-heading {
  display: flex;
  gap: 3mm;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 2.5mm;
  padding-bottom: 2mm;
  border-bottom: 0.8pt solid #555;
}

.production-print-section-heading h2,
.production-print-section-heading p {
  margin: 0;
}

.production-print-section-heading h2 {
  font-size: 11pt;
}

.production-print-section-heading span,
.production-print-section-heading small {
  color: #555;
  font-size: 8pt;
}

.production-print-order-heading > div {
  display: grid;
  gap: 0.5mm;
}

.production-print-custom-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4mm;
  align-items: start;
}

.production-print-custom-grid-column {
  display: grid;
  min-width: 0;
  gap: 4mm;
  align-content: start;
}

.production-print-custom-card {
  display: grid;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  grid-template-rows: auto auto auto auto;
  overflow: visible;
  border: 0.7pt solid #555;
  break-inside: avoid;
  page-break-inside: avoid;
  background: #fff;
}

.production-print-custom-card > .production-print-custom-card-header {
  display: flex;
  min-width: 0;
  gap: 2mm;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2.2mm 2.6mm;
  border-top: 0.5pt solid #aaa;
  border-bottom: 0.6pt solid #777;
  background: #f0f0f0;
}

.production-print-custom-card-header h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 10.5pt;
  line-height: 1.3;
}

.production-print-custom-figure {
  display: grid;
  min-height: 0;
  grid-template-rows: none;
  gap: 0;
  margin: 0;
  padding: 2.2mm 2.6mm 1.5mm;
}

.production-print-custom-figure figure {
  display: grid;
  min-height: 0;
  margin: 0;
  place-items: center;
}

.production-print-custom-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 58mm;
  border: 0.5pt solid #aaa;
  object-fit: contain;
  object-position: center;
}

.production-print-preview-placeholder {
  display: grid;
  min-height: 28mm;
  place-items: center;
  padding: 2mm;
  border: 0.5pt dashed #aaa;
  color: #555;
  text-align: center;
  font-size: 8pt;
}

.production-print-urgent {
  flex: 0 0 auto;
  padding: 1mm 2mm;
  border: 0.6pt solid #9d1e2e;
  color: #fff;
  background: #9d1e2e;
  font-size: 8pt;
  font-weight: 800;
}

.production-print-custom-fields {
  display: grid;
  gap: 1mm;
  margin: 0;
  padding: 1.5mm 2.6mm 2.2mm;
  border-top: 0;
  font-size: 8pt;
  line-height: 1.32;
}

.production-print-custom-fields > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 12mm minmax(0, 1fr);
  gap: 1mm;
}

.production-print-custom-fields dt {
  font-weight: 800;
  white-space: nowrap;
}

.production-print-custom-fields dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.production-print-custom-note {
  display: grid;
  grid-template-columns: 12mm minmax(0, 1fr);
  gap: 1mm;
  padding: 1.6mm 2.6mm;
  border-top: 0.8pt solid #7d111a;
  color: #fff;
  background: #b4232d;
  font-size: 8pt;
  font-weight: 750;
  line-height: 1.32;
}

.production-print-custom-note > span:first-child {
  font-weight: 850;
  white-space: nowrap;
}

.production-print-order-grid {
  display: block;
}

.production-print-order-card {
  min-width: 0;
  margin: 0 0 2.2mm;
  overflow: hidden;
  border: 0.65pt solid #666;
  break-inside: avoid;
  page-break-inside: avoid;
  background: #fff;
}

.production-print-order-card.is-urgent {
  border-color: #9d1e2e;
}

.production-print-order-card.is-custom {
  border-color: #9a6500;
}

.production-print-order-card-header {
  display: flex;
  gap: 3mm;
  align-items: center;
  justify-content: space-between;
  padding: 1.8mm 2.2mm;
  border-bottom: 0.5pt solid #888;
  background: #f1f1f1;
}

.production-print-order-card-header > div {
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  gap: 0.5mm;
}

.production-print-order-quantity-alert {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8mm 3mm;
  max-width: 56%;
  margin-left: auto;
  color: #000;
  font-size: 14pt;
  font-weight: 900;
  text-align: right;
  line-height: 1.25;
}
.production-print-order-quantity-alert > span { max-width: 100%; overflow-wrap: anywhere; }
.production-print-order-card.has-quantity-alert .production-print-primary-titles { flex-basis: 100%; }

.production-print-order-card-header small {
  color: #555;
  font-size: 7pt;
}

.production-print-order-title-line {
  display: flex;
  min-width: 0;
  gap: 2mm;
  align-items: center;
  flex-wrap: wrap;
  line-height: 1.25;
}

.production-print-order-title-line > strong {
  font-size: 9pt;
}

.production-print-order-badges {
  display: inline-flex;
  gap: 1mm;
}

.production-print-order-badge {
  padding: 0.4mm 1.2mm;
  border: 0.45pt solid #999;
  color: #333;
  background: #eee;
  font-size: 6.5pt;
}

.production-print-order-badge.urgent {
  border-color: #9d1e2e;
  color: #fff;
  background: #9d1e2e;
}

.production-print-order-badge.custom {
  border-color: #9a6500;
  color: #765000;
  background: #fff6df;
}

.production-print-primary-titles {
  min-width: 0;
  flex: 1 1 100mm;
  overflow-wrap: anywhere;
  font-size: 8.5pt;
  font-weight: 800;
  line-height: 1.25;
}

.production-print-order-items {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 2.2mm;
  list-style: none;
}

.production-print-order-item {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 0.2mm 1.3mm;
  align-items: center;
  padding: 0.9mm 0;
  border-bottom: 0.45pt dotted #aaa;
  font-size: 7.5pt;
  line-height: 1.25;
}

.production-print-order-item:last-child {
  border-bottom: 0;
}

.production-print-order-kind {
  min-width: 10mm;
  grid-column: 1;
  grid-row: 1 / span 2;
  padding: 0.3mm 0.8mm;
  border: 0.4pt solid #9aa6b5;
  border-radius: 99mm;
  color: #333;
  background: #f2f2f2;
  font-size: 6.8pt;
  text-align: center;
}

.production-print-order-kind.product {
  border-color: #6f9182;
  background: #edf5f1;
}

.production-print-order-kind.chain {
  border-color: #7c94b7;
  background: #eef3fa;
}

.production-print-order-kind.accessory {
  border-color: #9d8a67;
  background: #f7f2e9;
}

.production-print-order-item-name,
.production-print-order-item small {
  min-width: 0;
  grid-column: 2;
  overflow-wrap: anywhere;
}

.production-print-order-item-name {
  grid-row: 1;
}

.production-print-order-item small {
  grid-row: 2;
  color: #555;
  font-size: 6.5pt;
}

.production-print-order-quantity {
  grid-column: 3;
  grid-row: 1 / span 2;
  font-weight: 850;
  white-space: nowrap;
}

/* The same 33 x 30 mm per-item preview as the operations workbench. */
.production-print-item-with-preview {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  grid-column: 2;
  grid-row: 1 / span 2;
  gap: 3mm;
  align-items: center;
}
.production-print-item-copy { flex: 0 1 auto; min-width: 0; }
.production-print-item-copy .production-print-order-item-name,
.production-print-item-copy small { display: block; }
.production-print-item-design-preview {
  display: grid;
  box-sizing: border-box;
  flex: 0 0 33mm;
  width: 33mm;
  height: 30mm;
  padding: 0.9mm;
  border: 0.45pt solid #aaa;
  background: #fff;
  place-items: center;
}
.production-print-item-design-preview img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.production-print-item-design-preview:has(small) { grid-template-rows: minmax(0, 1fr) auto; }
.production-print-item-design-preview small { grid-column: auto; grid-row: auto; font-size: 6.5pt; }
.production-print-custom-note > span:last-child,
.production-print-order-note > span:last-child { min-width: 0; overflow-wrap: anywhere; }

.production-print-order-note {
  display: grid;
  grid-template-columns: 10mm minmax(0, 1fr);
  gap: 1mm;
  padding: 1.5mm 2.2mm;
  border-top: 0.8pt solid #7d111a;
  color: #fff;
  background: #b4232d;
  font-size: 7.5pt;
  font-weight: 750;
  line-height: 1.3;
}

.production-print-order-note > span:first-child {
  font-weight: 800;
  white-space: nowrap;
}

@page factory-batch-summary {
  size: A4 landscape;
  margin: 0;
}

@page factory-batch-detail {
  size: A4 portrait;
  margin: 0;
}

@media print {
  .production-print-sheet {
    display: block !important;
    color: #000;
    background: #fff;
  }

  .production-print-pagination-source {
    display: none !important;
  }

  .production-print-page {
    margin: 0;
    box-shadow: none;
  }

  .production-print-summary-page {
    page: factory-batch-summary;
    break-after: page;
  }

  .production-print-detail-page {
    page: factory-batch-detail;
    break-after: page;
  }

  .production-print-order-pages:last-child {
    break-after: auto;
  }

  .production-print-page,
  .production-print-model-group,
  .production-print-model-row,
  .production-print-classification-warning,
  .production-print-custom-card,
  .production-print-custom-card-header,
  .production-print-custom-note,
  .production-print-urgent,
  .production-print-order-card,
  .production-print-order-card-header,
  .production-print-order-badge,
  .production-print-order-kind,
  .production-print-order-note {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
