/* Shared document styles: the dashboard preview and isolated print frame. */
#previewCard, .hr-document-print {
  box-sizing: border-box; color: #1a1a1a; background: white;
  font: 13px/1.6 Arial, sans-serif; overflow-wrap: anywhere;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
#previewCard {
  display: flex; flex-direction: column; isolation: isolate;
  width: 210mm; max-width: none; min-height: 297mm; aspect-ratio: auto;
  padding: 14mm; border-radius: 0; overflow: visible;
}
.gen-preview-panel { overflow: auto; }
#previewCard > :not(.doc-watermark) { position: relative; z-index: 1; }
.doc-running-header { padding-bottom: 5mm; margin-bottom: 5mm; border-bottom: 2px solid #b59b55; break-inside: avoid; }
.drh-brand { display: flex; align-items: center; gap: 5mm; }
.doc-brand-mark { position: relative; flex: 0 0 auto; }
.doc-company-logo { display: block; max-width: 42mm; max-height: 19mm; object-fit: contain; }
.doc-brand-mark:has(.doc-company-logo) .doc-logo-placeholder { display: none; }
.doc-logo-placeholder { display: grid; place-items: center; min-width: 18mm; height: 18mm; padding: 2mm; border: 1px solid #b59b55; color: #796226; font-size: 18px; font-weight: bold; box-sizing: border-box; }
.doc-company-name { font-size: 20px; line-height: 1.25; font-weight: bold; color: #202b3b; }
.doc-company-address, .drh-trn { font-size: 10px; line-height: 1.4; margin-top: 2mm; }
.doc-watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 0; overflow: hidden; }
.doc-watermark span { display: block; transform: rotate(-35deg); width: 80%; text-align: center; font-size: 46px; line-height: 1.25; font-weight: bold; color: rgba(70, 85, 110, .09); }
.doc-foot-block { margin-top: auto; padding-top: 8mm; break-inside: avoid; }
.doc-signatory { margin: 0 0 5mm; break-inside: avoid; }
.doc-sig-line { width: 52mm; border-top: 1px solid #555; margin: 6mm 0 2mm; }
.doc-sig-name { font-weight: bold; }
.doc-sig-title { font-size: 11px; }
.doc-running-footer { border-top: 1px solid #b59b55; padding-top: 3mm; font-size: 9px; line-height: 1.45; color: #555; break-inside: avoid; }
.drf-name { font-weight: bold; }
.doc-date-line { text-align: right; margin-bottom: 5mm; }
.doc-subject { font-size: 15px; font-weight: bold; margin: 0 0 5mm; text-align: center; }
.doc-salutation { margin-bottom: 4mm; }
.doc-body p { margin: 0 0 4mm; orphans: 3; widows: 3; }
.doc-table { border-collapse: collapse; width: 100%; margin: 4mm 0; font-size: 12px; }
.doc-table td, .doc-table th { border: 1px solid #ddd; padding: 2mm 3mm; text-align: left; }
.doc-table th { background: #f4f2ed; font-weight: bold; }
.doc-table tr { break-inside: avoid; }
.hr-document-print { margin: 0; }
.doc-print-layout { width: 100%; height: 268mm; border-collapse: collapse; position: relative; z-index: 1; }
.doc-print-layout > thead { display: table-header-group; height: 1px; }
.doc-print-layout > tfoot { display: table-footer-group; height: 1px; }
.doc-print-layout > :is(thead, tbody, tfoot) > tr > td { padding: 0; vertical-align: top; }
.hr-document-print .doc-watermark { position: fixed; }
.hr-document-print .doc-foot-block { margin-top: 0; padding-top: 4mm; }
@page { size: A4; margin: 14mm; }
@media print {
  .hr-document-print { width: auto; overflow: visible; }
  .doc-print-layout > thead > tr > td { padding-bottom: 3mm; }
  .doc-print-layout > tfoot > tr > td { padding-top: 3mm; }
}
