/* QLH-PMS printables: folio/invoice, registration card, reservation confirmation, night audit report.
   Letter by default; A4 when the hotel's "Folio paper size" is A4 (set data-paper="a4" on <html>).
   Black on white, hotel accent only as the 3pt header rule. Body 10pt, nothing smaller than 8.5pt, rules >= 0.75pt. */

@page { size: letter; margin: 0.6in 0.65in; }
@page :first { margin-top: 0.5in; }
@page a4 { size: A4; margin: 15mm 16mm; }
html[data-paper="a4"] body { page: a4; }

@media print {
  html, body { background: #ffffff !important; color: #1a1f26 !important; }
  body { margin: 0; font-family: var(--font-sans); font-size: 10pt; line-height: 1.4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .q-shell-band, .q-topbar, .q-nav, .q-toasts, .q-pagehead-actions, .q-filterbar, .no-print { display: none !important; }
  a { color: inherit; text-decoration: none; }
}

/* Document frame — works on screen (preview) and in print */
.p-doc { box-sizing: border-box; width: 8.5in; min-height: 11in; padding: 0.6in 0.65in; margin: 0 auto; background: #ffffff; color: #1a1f26; font-family: var(--font-sans); font-size: 10pt; line-height: 1.4; display: flex; flex-direction: column; gap: 14pt; }
html[data-paper="a4"] .p-doc { width: 210mm; min-height: 297mm; }
@media print { .p-doc { width: auto; min-height: auto; padding: 0; margin: 0; } }

.p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18pt; }
.p-logo { max-width: 1.8in; max-height: 0.6in; object-fit: contain; }
.p-hotel { text-align: right; color: #4b535d; display: flex; flex-direction: column; font-size: 9.5pt; }
.p-hotel b { color: #1a1f26; }
.p-rule { height: 3pt; background: var(--accent, #1a1f26); border-radius: 1pt; }
.p-title { display: flex; justify-content: space-between; align-items: baseline; gap: 18pt; }
.p-title h1 { margin: 0; font-size: 17pt; line-height: 1.2; font-weight: 600; }
.p-num, .p-doc .num, .p-doc td.money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.p-facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6pt 12pt; padding: 8pt 0; border-top: 1pt solid #1a1f26; border-bottom: 1pt solid #1a1f26; }
.p-facts dt { color: #4b535d; font-size: 8.5pt; }
.p-facts dd { margin: 0; font-weight: 600; }

.p-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.p-table caption { text-align: left; font-weight: 600; font-size: 10.5pt; padding-bottom: 4pt; }
.p-table th { text-align: left; font-weight: 600; padding: 4pt 0; border-bottom: 1pt solid #1a1f26; }
.p-table td { padding: 3.5pt 0; border-bottom: 0.75pt solid #c9cec6; vertical-align: top; }
.p-table .r, .p-table th.r { text-align: right; }
.p-table tr { break-inside: avoid; }
.p-table thead { display: table-header-group; }          /* repeats on every printed page */
.p-table tfoot td { font-weight: 600; border-bottom: 0; border-top: 1pt solid #1a1f26; }
.p-credit::after { content: " CR"; font-size: 0.8em; font-weight: 600; }

.p-totals { margin: 0 0 0 auto; display: grid; grid-template-columns: auto auto; gap: 3pt 24pt; min-width: 2.8in; }
.p-totals dd { margin: 0; text-align: right; font-family: var(--font-mono); }
.p-totals .bal { font-weight: 600; font-size: 11pt; border-top: 1pt solid #1a1f26; padding-top: 4pt; }

.p-box { border: 1pt solid #1a1f26; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-box > div { padding: 6pt 9pt; border-bottom: 0.75pt solid #c9cec6; border-right: 0.75pt solid #c9cec6; display: flex; flex-direction: column; }
.p-box span:first-child { font-size: 8.5pt; color: #4b535d; }
.p-box span:last-child { font-weight: 600; min-height: 12pt; }

.p-sign { display: grid; grid-template-columns: 2fr 1fr; gap: 24pt; align-items: end; margin-top: auto; }
.p-sign div { border-bottom: 1pt solid #1a1f26; height: 0.5in; }
.p-sign span { font-size: 8.5pt; color: #4b535d; }

.p-foot { display: flex; justify-content: space-between; color: #4b535d; font-size: 8.5pt; border-top: 0.75pt solid #c9cec6; padding-top: 6pt; margin-top: auto; }

/* Night audit report: KPI strip */
.p-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1pt solid #1a1f26; }
.p-kpis > div { padding: 7pt 9pt; border-right: 0.75pt solid #c9cec6; }
.p-kpis > div:last-child { border-right: 0; }
.p-kpis span { display: block; font-size: 8.5pt; color: #4b535d; }
.p-kpis b { font: 600 14pt/1.3 var(--font-mono); }
.p-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18pt; }
