/* =========================================================
   Free Hotel Receipt — what only the hotel documents need.
   The shared look is in ../base.css and the document's table, header and
   payment box in ../bill/bill.css; the page loads both FIRST.
   ========================================================= */

/* ---------- charges during the stay: date and type on top, then item, amount, remove
   (the bill's three columns, so it reads the same on a phone) ---------- */
.tbm-extra-dated > .tbm-field:nth-child(2) { grid-column: 2 / -1; }
.tbm-extra-dated + .tbm-extra-dated { padding-top: 12px; border-top: 1px solid var(--tbm-slate-200); }

/* ---------- the hotel's address, phone and tax ID under its name ---------- */
.tbm-hotel-info { font-size: 12px; color: var(--tbm-slate-500); overflow-wrap: anywhere; }
.tbm-hotel-info + .tbm-bill-title { margin-top: 8px; }

/* ---------- the folio: date column, totals, what is still owed ---------- */
.tbm-folio .tbm-date { width: 1%; white-space: nowrap; color: var(--tbm-slate-700); }
.tbm-folio tfoot td { color: var(--tbm-slate-700); }
.tbm-folio tfoot .tbm-grand td { color: var(--tbm-brand-700); }
.tbm-folio tfoot .tbm-balance td { font-weight: 700; color: var(--tbm-slate-900); border-top: 1px solid var(--tbm-slate-200); }

/* ---------- the receipt: amount in words, how it was paid, the notes under it ---------- */
.tbm-words { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--tbm-slate-50); font-size: 13px; color: var(--tbm-slate-700); }
.tbm-words b { display: block; margin-top: 2px; color: var(--tbm-slate-900); font-weight: 600; }
.tbm-paid-by { margin: 12px 0 0; font-size: 14px; color: var(--tbm-slate-700); }
.tbm-paid-by b { color: var(--tbm-slate-900); }
.tbm-doc-note { margin: 4px 0 0; font-size: 12px; color: var(--tbm-slate-500); }
.tbm-receipt tfoot td { color: var(--tbm-slate-700); }
.tbm-receipt tfoot .tbm-grand td { color: var(--tbm-brand-700); }

/* ---------- printing: a long stay runs over pages ----------
   Browsers repeat a table's <tfoot> at the foot of every printed page, which would put
   the Total on page 1 before all the charges are listed: print it once, at the end.
   Rows are tighter on paper, no row is cut in two, and the payment box, the amount in
   words and the signatures stay whole. */
@media print {
    .tbm-print-root .tbm-folio tfoot, .tbm-print-root .tbm-receipt tfoot { display: table-row-group; }
    .tbm-print-root .tbm-folio td, .tbm-print-root .tbm-receipt td { padding-top: 5px; padding-bottom: 5px; }
    .tbm-print-root tr, .tbm-print-root .tbm-pay, .tbm-print-root .tbm-words { break-inside: avoid; page-break-inside: avoid; }
}
