.report-print-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; margin: 0 0 18px; padding: 15px 18px; border: 1px solid #dfe5e1; border-radius: 14px; background: #fff; }
.report-print-controls > div { display: grid; gap: 3px; flex: 1 1 240px; }
.report-print-controls strong { color: #253229; font-size: .91rem; }
.report-print-controls small { color: #59675d; font-size: .78rem; line-height: 1.4; }
.report-print-controls label { display: inline-flex; align-items: center; gap: 7px; color: #34463a; font-size: .82rem; font-weight: 650; cursor: pointer; }
.report-print-controls input { accent-color: #3a5944; width: 17px; height: 17px; }
.report-print-controls button { min-height: 38px; border-color: #bfcbbf!important; color: #27382c!important; background: #fff!important; }
.master-report-sheet { display: none; }
.master-print-dialog { width: min(1000px, 94vw); max-height: 92vh; max-height: 92svh; padding: 0; border: 1px solid #dfe5e1; border-radius: 16px; color: #253229; background: #fff; }
.master-print-dialog::backdrop { background: #14201999; }
.master-print-card { display: grid; gap: 14px; padding: 22px; }
.master-print-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.master-print-dialog .master-print-header { position: sticky; top: 0; z-index: 1; background: #fff; }
.master-print-dialog .master-print-actions { position: sticky; bottom: 0; padding: 8px 0; background: #fff; }
.master-print-header h2 { margin: 0; font-size: 1.25rem; }
.master-print-include { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.master-print-include input { width: 19px; height: 19px; accent-color: #3a5944; }
.master-print-help, .master-print-status { margin: 0; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.master-print-help { color: #59675d; }
.master-print-selection { margin: 0; font-size: .87rem; font-weight: 650; line-height: 1.5; }
.master-print-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.master-print-actions a, .master-print-header button, .master-print-actions button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border: 1px solid #bfcbbf; border-radius: 9px; font: inherit; text-decoration: none; cursor: pointer; }
.master-pdf-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.master-pdf-toolbar button, .master-pdf-toolbar select { min-height: 38px; padding: 7px 10px; border: 1px solid #bfcbbf; border-radius: 8px; color: #253229; background: #fff; font: inherit; font-size: .85rem; }
.master-pdf-toolbar button { cursor: pointer; }
.master-pdf-toolbar button:disabled { opacity: .5; cursor: default; }
.master-pdf-counter { font-size: .85rem; }
.master-pdf-zoom { margin-left: auto; }
.master-pdf-message { margin: 8px 0; font-size: .83rem; line-height: 1.5; color: #59675d; }
.master-pdf-stage { height: clamp(180px, calc(92svh - 300px), 52vh); overflow: auto; padding: 12px; border: 1px solid #dfe5e1; border-radius: 8px; background: #e8ede9; box-sizing: border-box; }
.master-pdf-canvas { display: block; margin: 0 auto; background: #fff; box-shadow: 0 2px 8px #2030261a; }
.master-print-actions .primary { background: #3a5944; border-color: #3a5944; color: #fff; }
.master-pdf-print-sheet { display: none; }
.master-pdf-viewer-body { margin: 0; padding: 24px; background: #f2f5f2; color: #253229; font-family: Arial, sans-serif; }
.master-pdf-viewer-page { max-width: 1100px; margin: 0 auto; padding: 24px; border: 1px solid #dfe5e1; border-radius: 16px; background: #fff; }
.master-pdf-viewer-page h1 { margin: 0; font-size: 1.5rem; }
.master-pdf-brand { margin: 0 0 5px; font-size: .78rem; letter-spacing: .08em; color: #59675d; }
.master-pdf-viewer-page .master-print-actions { margin: 16px 0; }
.master-pdf-viewer-page .master-pdf-stage { height: 65vh; }
.master-pdf-file { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid #bfcbbf; border-radius: 9px; font-size: .9rem; }
.master-pdf-file input { max-width: 240px; font: inherit; }
.master-pdf-viewer-page [hidden] { display: none!important; }
.master-print-dialog [hidden] { display: none!important; }
@media (max-width: 600px) { .master-print-card { padding: 16px; } .master-print-header { align-items: flex-start; } .master-pdf-stage { height: 45vh; } .master-pdf-zoom { margin-left: 0; } .master-pdf-viewer-body { padding: 10px; } .master-pdf-viewer-page { padding: 16px; } }
@media print {
  @page { size: A4; margin: 15mm 12mm; }
  @page master-pdf-page { size: A4; margin: 10mm; }
  body.printing-master-pdf > :not(#master-pdf-print-sheet) { display: none!important; }
  body.printing-master-pdf { display: block!important; padding: 0!important; margin: 0!important; background: #fff!important; }
  body.printing-master-pdf #master-pdf-print-sheet { display: block!important; margin: 0; padding: 0; }
  .master-pdf-print-page { page: master-pdf-page; width: 190mm; height: 275mm; margin: 0; padding: 0; break-after: page; break-inside: avoid; }
  .master-pdf-print-page:last-child { break-after: auto; }
  .master-pdf-print-page img { display: block; width: 100%; height: 100%; object-fit: contain; }
  body.printing-master-report > :not(#master-print-report) { display: none!important; }
  body.printing-master-report { display: block!important; padding: 0!important; margin: 0!important; color: #1d2921!important; background: #fff!important; }
  body.printing-master-report #master-print-report { display: block!important; width: 100%; margin: 0; font-family: Arial, sans-serif; font-size: 9pt; }
  .master-report-heading { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #ccd5ce; padding-bottom: 12px; }
  .master-report-heading img { max-width: 58px; max-height: 58px; object-fit: contain; }
  .master-report-heading div { display: grid; gap: 3px; }
  .master-report-heading strong { font-size: 14pt; }
  .master-report-heading small { color: #526158; }
  .master-report-sheet h1 { margin: 18px 0 8px; font-size: 17pt; }
  .master-report-meta { line-height: 1.5; color: #39483e; }
  .master-report-total { font-weight: bold; }
  .master-report-group { break-inside: auto; margin-top: 20px; }
  .master-report-group h2 { break-after: avoid; font-size: 12pt; }
  .master-person-print { break-inside: avoid; margin-top: 12px; border-bottom: 1px solid #d5ddd6; padding-bottom: 10px; }
  .master-person-print h3 { margin: 0 0 8px; font-size: 10pt; }
  .master-person-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; margin: 0; }
  .master-person-fields dt { font-weight: bold; }
  .master-person-fields dd { margin: 2px 0 0; line-height: 1.4; overflow-wrap: anywhere; }
  .master-report-group table { border-collapse: collapse; width: 100%; table-layout: fixed; }
  .master-report-group th,.master-report-group td { padding: 6px; border-bottom: 1px solid #d5ddd6; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
  .master-report-group th { background: #f2f5f2; }
  .master-report-group tr { break-inside: avoid; }
  .master-report-group th:nth-child(1) { width: 16%; }
  .master-report-group th:nth-child(2) { width: 21%; }
  .master-report-group th:nth-child(3) { width: 30%; }
  .master-report-group th:nth-child(4) { width: 18%; }
  .master-report-group th:nth-child(5) { width: 15%; }
  .master-report-limit { color: #775728; }
  .master-receipt-print-details { margin-top: 18px; }
  .master-receipt-print-details h2 { font-size: 12pt; break-after: avoid; }
  .master-receipt-print-details h3 { font-size: 10pt; break-after: avoid; overflow-wrap: anywhere; }
  .master-receipt-print-details pre { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
}
