@page { size: A4; margin: 5mm; }
* { box-sizing: border-box; }
body.print-invoice { width: 200mm; min-height: 287mm; margin: 0 auto; color: #111; font: 10px/1.2 Arial, sans-serif; }
.print-invoice .invoice-title { margin: 0; height: 8mm; text-align: center; font-size: 15px; line-height: 8mm; font-weight: 700; }
.print-invoice .invoice-frame { min-height: 266mm; border: 1px solid #555; display: flex; flex-direction: column; justify-content: space-between; }
.print-invoice table { border-collapse: collapse; width: 100%; }
.print-invoice .top-grid { display: grid; grid-template-columns: 57% 43%; border-bottom: 1px solid #777; }
.print-invoice .seller { padding: 4px; min-height: 50mm; }
.print-invoice .seller .company-name { margin: 0 0 2px; font-size: 12px; font-weight: 700; }
.print-invoice .seller p { margin: 0; white-space: pre-line; }
.print-invoice .party { border-top: 1px solid #777; padding-top: 3px; margin-top: 3px; }
.print-invoice .party p { margin: 1px 0 0; }
.print-invoice .customer-name { font-weight: 700; }
.print-invoice .metadata { border-left: 1px solid #777; }
.print-invoice .metadata td { border-right: 1px solid #777; border-bottom: 1px solid #777; padding: 3px; width: 50%; height: 6mm; vertical-align: top; }
.print-invoice .metadata tr:last-child td { border-bottom: 0; }
.print-invoice .metadata td:last-child { border-right: 0; }
.print-invoice .metadata strong { display: block; font-size: 10px; }
.print-invoice .delivery-box { min-height: 14mm; padding: 3px; border-top: 1px solid #777; }
.print-invoice .items { table-layout: fixed; flex-grow: 1; }
.print-invoice .items th, .print-invoice .items td { border-right: 1px solid #777; border-bottom: 1px solid #777; padding: 3px 2px; vertical-align: top; }
.print-invoice .items th:last-child, .print-invoice .items td:last-child { border-right: 0; }
.print-invoice .items th { text-align: center; font-size: 9px; font-weight: 700; }
.print-invoice .items tbody tr:not(.filler) td { border-bottom: 0; }
.print-invoice .items .number, .print-invoice .items .money, .print-invoice .items .qty { text-align: right; }
.print-invoice .items .description { font-size: 10px; }
.print-invoice .items .item-name { font-weight: 700; }
.print-invoice .items .filler td { height: 95mm; border-bottom: 1px solid #777; }
.print-invoice .items tfoot td { font-weight: 700; vertical-align: middle; }
.print-invoice .summary { display: grid; grid-template-columns: 58% 42%; border-bottom: 1px solid #777; }
.print-invoice .words { padding: 4px; min-height: 25mm; }
.print-invoice .words b { display: block; margin-bottom: 2px; }
.print-invoice .balances { border-left: 1px solid #777; padding: 4px; }
.print-invoice .balance-row { display: flex; justify-content: flex-end; gap: 12mm; margin-bottom: 2px; }
.print-invoice .balance-row span:first-child { min-width: 33mm; }
.print-invoice .footer-grid { display: grid; grid-template-columns: 50% 18% 32%; }
.print-invoice .terms { padding: 4px; min-height: 39mm; }
.print-invoice .terms b { display: block; margin-bottom: 3px; }
.print-invoice .terms ol { margin: 0; padding-left: 16px; }
.print-invoice .terms li { min-height: 3.4mm; }
.print-invoice .scan-pay { border-left: 1px solid #777; padding: 4px; text-align: center; min-height: 39mm; }
.print-invoice .scan-pay b { display: block; margin-bottom: 2px; }
.print-invoice .scan-pay p { margin: 1px 0; white-space: pre-line; }
.print-invoice .qr-wrap { text-align: center; padding: 2px; }
.print-invoice .qr-wrap img { display: block; width: 30mm; height: 27mm; object-fit: contain; margin: 1px auto 0; }
.print-invoice .qr-placeholder { width: 30mm; height: 27mm; border: 1px dashed #888; margin: 1px auto 0; display: grid; place-items: center; color: #666; font-size: 8px; }
/* Signatory-er padding ebong width fix kora holo jate left border porjonto line match kore */
.print-invoice .signatory { border-left: 1px solid #777; display: grid; grid-template-rows: 1fr 7mm; align-items: start; padding: 4px 0 0 0; min-height: 39mm; }
.print-invoice .signatory b { display: block; width: 100%; margin: 0; padding: 0 4px 3px; border-bottom: 1px solid #777; }
.print-invoice .signatory span { display: flex; align-items: center; justify-content: flex-end; border-top: 1px solid #777; font-weight: 400; padding-right: 4px; }
.print-invoice .computer-note { margin: 2px 0 0; text-align: center; font-size: 8px; }
@media print { body.print-invoice { margin: 0; } }