/* v334 - Fertilizer report pagination + Field/Word export stability */
:root { --amspec-red: #8A2A2B; }

.fert-report-output {
  --fert-a4-h: 297mm;
}
.fert-report-page {
  height: 297mm !important;
  min-height: 297mm !important;
  max-height: 297mm !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  break-after: page;
  page-break-after: always;
}
.fert-report-page .fert-sheet-header,
.fert-report-page .fert-sheet-footer {
  flex: 0 0 auto !important;
}
.fert-report-packed-page .fert-page-body,
.fert-page-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: grid !important;
  align-content: start !important;
  gap: 2.5mm !important;
}
.fert-block,
.fert-hold-block,
.fert-summary-block,
.fert-quantity-block,
.fert-draft-block {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
.fert-report-page table {
  break-inside: auto !important;
  page-break-inside: auto !important;
}
.fert-report-page tr,
.fert-summary-sheet tr,
.fert-cargo-sheet-table tr,
.fert-quantity-sheet tr {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}
.fert-section-title,
.fert-sheet-band,
.fert-report-page th,
.fert-sheet-update-switch span.is-active {
  background: var(--amspec-red) !important;
  background-color: var(--amspec-red) !important;
  background-image: none !important;
}
.fert-report-measure {
  position: absolute !important;
  left: -20000px !important;
  top: 0 !important;
  width: 210mm !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -999 !important;
  transform: none !important;
}
.fert-report-measure .fert-report-page {
  margin: 0 !important;
  transform: none !important;
  box-shadow: none !important;
}
.fert-summary-sheet {
  table-layout: fixed !important;
}
.fert-summary-sheet td,
.fert-summary-sheet th {
  line-height: 1.16 !important;
  padding: 2.2px 4px !important;
}
.fert-summary-sheet .fert-summary-comment-cell,
.fert-report-page .fert-summary-sheet td.fert-summary-comment-cell {
  text-align: left !important;
  white-space: normal !important;
}
.fert-cargo-sheet-table .fert-visual-cell,
.fert-visual-cell {
  line-height: 1.17 !important;
}
@media print {
  .fert-report-page {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    overflow: hidden !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
  }
  .fert-report-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
}
