@page challan { size: A4 portrait; margin: 0; }
.invoice-page { box-sizing: border-box; min-width: calc(210mm + 36px); background: #e9edef; padding: 18px; min-height: 100vh; overflow: auto; }
.invoice-toolbar { width: 210mm; margin: 0 auto 14px; display: flex; align-items: center; gap: 16px; font: 13px Arial, sans-serif; color: #37474f; }
.invoice-print-button { border: 0; border-radius: 5px; background: #2674c8; color: white; padding: 10px 18px; font-weight: bold; cursor: pointer; }
.invoice-print-button:disabled { opacity: .5; cursor: wait; }
.invoice-sheet, .challan-card, .challan-card * { box-sizing: border-box; }
.invoice-sheet { width: 210mm; height: 148.5mm; padding: 5mm; margin: 0 auto; background: white; page: challan; }
.challan-card { width: 200mm; height: 138.5mm; border: .3mm solid #111; color: #111; font: 12pt/1.2 Arial, sans-serif; display: grid; grid-template-rows: 20mm 7mm 10mm minmax(25mm, auto) minmax(28mm, 1fr) 9mm 28mm 6mm; transform-origin: top left; }
.challan-card > * { min-width: 0; }
.challan-heading { display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center; padding: 1.5mm 3mm; }
.company-heading { text-align: center; line-height: 1; }
.company-heading img { width: 5mm; height: 4mm; object-fit: contain; display: block; margin: 0 auto .3mm; }
.company-heading h1 { font: bold 22pt/1.05 Arial, sans-serif; margin: 0 0 .5mm; white-space: nowrap; }
.company-heading strong { font-size: 8.5pt; letter-spacing: .5px; }
.tax-details, .phone-details { font-size: 10pt; line-height: 1.45; }
.phone-details { text-align: right; }
.office-addresses { display: flex; justify-content: space-between; align-items: center; border-top: .25mm solid #111; padding: 0 2mm; font-size: 9pt; }
.voucher-details { display: grid; grid-template-columns: 1fr 1.3fr 1fr; border-top: .25mm solid #111; }
.voucher-details > span { padding: 2mm; border-right: .25mm solid #111; }
.voucher-details > span:last-child { border-right: 0; }
.party-details { border-top: .25mm solid #111; padding: 1.5mm 2mm; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 1mm 3mm; font-size: 11.5pt; overflow-wrap: anywhere; }
.party-wide { grid-column: 1 / -1; }
.goods-table { width: 100%; height: 100%; margin: 0; border-collapse: collapse; table-layout: fixed; font-size: 14pt; }
.goods-table th, .goods-table td { border: .25mm solid #111; padding: 2mm; text-align: center; overflow-wrap: anywhere; }
.goods-table th { height: 8mm; font-size: 11pt; font-weight: bold; background: #f1f3f4; }
.goods-table td { vertical-align: middle; }
.goods-table th:first-child, .goods-table td:first-child { border-left: 0; }
.goods-table th:last-child, .goods-table td:last-child { border-right: 0; }
.amount-details { display: flex; justify-content: space-between; align-items: center; padding: 0 3mm; font-size: 12pt; }
.payment-details { display: grid; grid-template-columns: 1fr 30mm 1fr; border-top: .25mm solid #111; font-size: 9.5pt; line-height: 1.3; }
.bank-details, .upi-details { padding: 1.5mm 2mm; display: flex; flex-direction: column; }
.bank-details { border-right: .25mm solid #111; }
.upi-details { border-left: .25mm solid #111; }
.bank-details > strong, .upi-details > strong { margin-bottom: 1mm; font-size: 8pt; }
.signature { margin-top: auto; padding-top: 2mm; border-bottom: .2mm solid #999; font-size: 10pt; }
.payment-qr { display: flex; align-items: center; justify-content: center; }
.payment-qr img { width: 26mm; height: 26mm; object-fit: contain; }
.challan-footer { border-top: .25mm solid #111; display: flex; align-items: center; justify-content: space-around; font-size: 9.5pt; font-weight: bold; }
@media print {
  .invoice-page { min-width: 0; width: 210mm; padding: 0 !important; margin: 0 !important; min-height: 0; overflow: visible; background: white; }
  .invoice-toolbar { display: none !important; }
  .invoice-sheet { margin: 0 !important; break-inside: avoid; }
  .challan-card { break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
