/* A4 portrait documents: readable rows, natural pagination. */
@page pos-report-landscape{size:A4 portrait;margin:10mm}
@page pos-report-portrait{size:A4 portrait;margin:10mm}
.report-preview-sheet.report-portrait{box-sizing:border-box;width:210mm;max-width:100%;padding:10mm;background:white;color:#111;font-family:'Noto Sans Lao',sans-serif;font-size:10pt;line-height:1.5}
.report-preview-sheet .report-print-heading{position:static;display:flex;flex-wrap:wrap;gap:3mm;align-items:center;padding-bottom:4mm;border-bottom:1px solid #173f63;margin-bottom:4mm}
.report-preview-sheet .report-print-heading img{width:14mm;height:14mm;object-fit:contain}
.report-preview-sheet .report-print-heading h1{width:100%;font-size:14pt;margin:2mm 0;text-align:center;line-height:1.5}
.report-preview-sheet .report-print-heading h2{font-size:14pt;margin:0}
.report-preview-sheet .report-print-heading p{font-size:9pt;margin:1mm 0}
.report-preview-sheet .report-print-heading aside{margin-left:auto;font-size:8pt}
.report-preview-sheet .report-print-heading section{width:100%;display:flex;justify-content:space-between;gap:3mm;font-size:9pt}
.report-preview-sheet table{width:100%;min-width:0;table-layout:fixed;border-collapse:collapse;font-size:9pt;line-height:1.5}
.report-preview-sheet th,.report-preview-sheet td{white-space:normal;overflow-wrap:anywhere;vertical-align:top;padding:2mm 1mm;border:1px solid #b3bdc5;color:#111}
.report-preview-sheet thead th{background:#eef2f5;font-weight:700}
.report-preview-sheet table:has(th:nth-child(9)):not(:has(th:nth-child(10))) th:nth-child(1){width:6mm}
.report-preview-sheet table:has(th:nth-child(9)):not(:has(th:nth-child(10))) th:nth-child(2){width:20mm}
.report-preview-sheet table:has(th:nth-child(9)):not(:has(th:nth-child(10))) th:nth-child(3){width:18mm}
.report-preview-sheet table:has(th:nth-child(9)):not(:has(th:nth-child(10))) th:nth-child(4){width:20mm}
.report-preview-sheet table:has(th:nth-child(9)):not(:has(th:nth-child(10))) th:nth-child(5){width:14mm}
.report-preview-sheet table:has(th:nth-child(9)):not(:has(th:nth-child(10))) th:nth-child(7){width:11mm}
.report-preview-sheet table:has(th:nth-child(9)):not(:has(th:nth-child(10))) th:nth-child(8),.report-preview-sheet table:has(th:nth-child(9)):not(:has(th:nth-child(10))) th:nth-child(9){width:19mm}
.report-preview-sheet .report-official-summary{display:flex;flex-wrap:wrap;gap:3mm;justify-content:space-between;margin-top:4mm;padding:3mm 0;border-top:1px solid #333;font-size:10pt}
.report-preview-sheet .report-signatures{display:flex;justify-content:space-between;gap:5mm;margin:10mm 0 5mm;font-size:9pt}
.report-preview-sheet .report-print-footer{font-size:8pt;border-top:1px solid #aaa;padding-top:2mm}
@media print{
@page{size:A4 portrait;margin:10mm}
:is(.inventory-page,.outstanding-page,.product-summary-page,.profit-summary-page,.sales-chart-page,.sales-transaction-page){page:pos-report-portrait!important}
.report-preview-sheet,.report-preview-sheet.report-portrait,.report-preview-sheet.report-landscape{page:pos-report-portrait!important;width:190mm!important;max-width:100%!important;padding:0!important;min-height:0!important;box-shadow:none!important}
.report-preview-window>header{display:none!important}
.report-preview-sheet,.report-preview-sheet *{visibility:visible!important}
.report-preview-sheet table,:is(.inventory-page,.outstanding-page,.product-summary-page,.profit-summary-page,.sales-chart-page,.sales-transaction-page) table{width:100%!important;min-width:0!important;table-layout:fixed!important;font-size:9pt!important;line-height:1.5!important}
.report-preview-sheet thead{display:table-header-group!important}
.report-preview-sheet tfoot{display:table-row-group!important}
.report-preview-sheet tr{break-inside:avoid!important;page-break-inside:avoid!important}
.report-preview-sheet :is(.report-print-heading,.report-official-summary,.report-signatures,.report-print-footer){break-inside:avoid!important;position:static!important}
.report-preview-sheet th,.report-preview-sheet td{padding:2mm 1mm!important;white-space:normal!important;overflow-wrap:anywhere!important}
.report-preview-sheet table,.report-preview-sheet tbody{break-inside:auto!important}
}
.report-preview-sheet table,.report-preview-sheet table th,.report-preview-sheet table td{font-size:9pt!important;line-height:1.5!important}
.report-preview-sheet table th,.report-preview-sheet table td{padding:1.8mm 1mm!important;white-space:normal!important;overflow-wrap:anywhere!important}
.report-preview-sheet .report-print-heading aside b:nth-of-type(2),.report-preview-sheet .report-print-heading aside span:last-child{display:none!important}
.report-preview-sheet .report-print-heading aside,.report-preview-sheet .report-official-label{display:none!important}
.report-preview-sheet .report-print-heading{gap:3mm!important;padding-bottom:2mm!important;margin-bottom:3mm!important;border-bottom:1px solid #173f63!important}
.report-preview-sheet .report-print-heading h1{font-size:13pt!important;margin:2mm 0!important}
.report-preview-sheet .report-print-heading section{padding:2mm 3mm!important;margin:1mm 0!important;background:#f2f5f7!important;border-left:0!important}
.report-preview-sheet .stock-document-table{table-layout:fixed!important;width:100%!important}
.report-preview-sheet .stock-document-table th:nth-child(1){width:6mm!important;white-space:nowrap!important}
.report-preview-sheet .stock-document-table th:nth-child(2){width:39mm!important}
.report-preview-sheet .stock-document-table th:nth-child(4){width:15mm!important}
.report-preview-sheet .stock-document-table th:nth-child(5),.report-preview-sheet .stock-document-table th:nth-child(6){width:25mm!important}
.report-preview-sheet .stock-document-table th{padding:2mm 1mm!important;font-size:9pt!important}
.report-preview-sheet .stock-document-table td{padding:3mm 1.5mm!important;font-size:10pt!important;line-height:1.6!important}
.stock-document-table .document-line{display:block;margin-top:1mm;font-size:8.5pt;line-height:1.5}
.stock-document-table .document-receipt-number{font-size:8.5pt;white-space:nowrap}
.report-preview-sheet .report-official-summary{border:0!important;border-top:2px solid #173f63!important;background:#f3f6f8!important;padding:3mm!important;margin-top:3mm!important}
.report-preview-sheet .report-signatures{margin:8mm 0 4mm!important}
@media print{.report-preview-sheet .stock-document-table td{font-size:10pt!important;padding:3mm 1.5mm!important}}
/* Keep the heading clear of the printer's top edge, including zero-margin dialogs. */
@media print {
  .report-preview-sheet.report-portrait,.report-preview-sheet.report-landscape {
    padding-top:8mm!important;
    padding-bottom:3mm!important;
  }
}
/* Debt details and receipt: scoped layout, readable Lao text. */
.debt-detail-modal{font-size:14px!important;line-height:1.7!important;padding:0!important;border:1px solid #a9c1d1!important;box-shadow:0 18px 60px #0005!important;color:#173f63!important}
.debt-detail-modal>header{position:sticky;top:0;z-index:2;background:#173f63;color:white;padding:12px 20px;align-items:center}
.debt-detail-modal>header h2{font-size:19px!important;font-weight:700;margin:0!important;color:white!important}
.debt-detail-modal button{border:1px solid #9cb4c7!important;background:#edf5fa!important;border-radius:4px!important;color:#173f63!important;cursor:pointer}
.debt-detail-modal>header button{background:#ffffff18!important;color:white!important;border-color:#ffffff70!important}
.debt-detail-modal>p,.debt-detail-modal>h3,.debt-detail-modal>table,.debt-detail-modal>article,.debt-detail-modal>.debt-summary-cards{margin:16px 20px!important}
.debt-detail-modal>table{width:calc(100% - 40px)!important;table-layout:fixed;font-size:14px!important}
.debt-detail-modal th{background:#eaf2f7!important;padding:10px!important;font-weight:700!important}
.debt-detail-modal td{padding:11px 10px!important;overflow-wrap:anywhere}
.debt-detail-modal th:first-child,.debt-detail-modal td:first-child{width:12%}
.debt-detail-modal table:first-of-type th:nth-child(2){width:40%}
.debt-detail-modal table:first-of-type td:nth-child(n+3),.debt-detail-modal table:first-of-type th:nth-child(n+3){text-align:right!important}
.debt-detail-modal tbody tr:nth-child(even){background:#f5f8fa}
.debt-detail-modal>h3{font-size:15px!important;font-weight:700!important;border-left:3px solid #c99535;padding-left:10px}
.debt-summary-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.debt-summary-cards>div{background:#f1f6fa;border:1px solid #d7e3ec;border-radius:5px;padding:12px 16px}
.debt-summary-cards span{display:block;font-size:12px;color:#62788a}
.debt-summary-cards strong{display:block;font-size:22px;color:#173f63}
.debt-summary-cards>div:last-child{background:#173f63;color:white}
.debt-summary-cards>div:last-child strong,.debt-summary-cards>div:last-child span{color:white}
.debt-receipt-preview{background:white!important;border:1px solid #d3dde5;max-width:720px;margin:18px auto!important;font-size:15px!important;line-height:1.8!important}
.debt-receipt-preview header{text-align:center;border-bottom:2px solid #173f63;padding-bottom:15px}
.debt-receipt-preview h1{font-size:22px!important;margin:12px 0!important}.debt-receipt-preview h2{font-size:20px!important}
.debt-receipt-preview p{margin:8px 0;overflow-wrap:anywhere}.debt-receipt-preview table{width:100%;margin:20px 0;border-collapse:collapse}
.debt-receipt-preview td,.debt-receipt-preview th{padding:10px!important;text-align:left!important;border-bottom:1px solid #d3dde5}.debt-receipt-preview td:last-child,.debt-receipt-preview th:last-child{text-align:right!important}
.debt-receipt-preview .sign{display:flex;justify-content:space-around;margin-top:35px}.debt-receipt-preview footer{text-align:center;border-top:1px solid #ccc;padding-top:12px}
@media(max-width:600px){.debt-summary-cards{grid-template-columns:1fr}.debt-detail-modal{max-height:94vh!important}}
.debt-detail-modal{overflow-x:hidden!important}.debt-detail-modal table{min-width:0!important}
.debt-detail-modal>table:nth-of-type(2) th:first-child,.debt-detail-modal>table:nth-of-type(2) td:first-child{width:23%}
.debt-detail-modal>.debt-receipt-preview{width:calc(100% - 40px);margin:18px auto!important}
