/* Shared business documents. Scoped to keep configured sales/thermal designs intact. */
@font-face{font-family:ERPDocument;src:url('../fonts/Cairo/cairo-arabic-400-normal.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:ERPDocument;src:url('../fonts/Cairo/cairo-arabic-700-normal.woff2') format('woff2');font-weight:700;font-display:swap}
@page erp-document{size:A4;margin:12mm}
.erp-document{page:erp-document;box-sizing:border-box;width:100%;max-width:210mm;margin:0 auto;padding:26px;background:#fff!important;color:#172b43!important;font-family:ERPDocument,Tahoma,Arial,sans-serif;font-size:12px;line-height:1.8;text-align:start;border:1px solid #dbe3ec;border-top:4px solid #183b56}
.erp-document *{box-sizing:border-box}
.erp-document h1,.erp-document h2,.erp-document h3,.erp-document h4,.erp-document p,.erp-document address{margin:0 0 8px;color:inherit;line-height:1.8}
.erp-document h1,.erp-document h2{font-size:23px;font-weight:700}
.erp-document h3,.erp-document h4{font-size:15px;font-weight:700}
.erp-document img{max-width:100%;height:auto}
.erp-document .doc-header{display:table;width:100%;border-bottom:2px solid #dbe3ec;padding-bottom:16px;margin-bottom:18px;break-inside:avoid}
.erp-document .doc-brand,.erp-document .doc-heading{display:table-cell;width:55%;vertical-align:top}
.erp-document .doc-heading{width:45%;text-align:end}
.erp-document .doc-logo{max-width:135px;max-height:65px;object-fit:contain;margin-bottom:8px}
.erp-document .doc-business-name{font-size:21px;font-weight:700}
.erp-document .doc-reference{font-size:18px;font-weight:700;direction:ltr;unicode-bidi:isolate;display:inline-block;overflow-wrap:anywhere}
.erp-document .doc-heading h1{margin-bottom:12px}
.erp-document .doc-date{display:flex;align-items:center;justify-content:space-between;gap:14px;width:max-content;max-width:100%;margin-top:12px;margin-inline-start:auto;padding:6px 10px;border:1px solid #dbe3ec;background:#f8fafc!important;font-size:11px;line-height:1.6}
.erp-document .doc-date .doc-ltr{white-space:nowrap;font-variant-numeric:tabular-nums}
.erp-document .doc-caption{font-size:10px;color:#52677c!important;font-weight:700}
.erp-document .doc-muted,.erp-document small{color:#52677c!important;font-size:11px}
.erp-document .doc-grid{display:table;width:100%;table-layout:fixed;margin-bottom:18px;border-spacing:10px 0}
.erp-document .doc-panel{display:table-cell;vertical-align:top;padding:12px 14px;border:1px solid #dbe3ec;background:#f8fafc!important;overflow-wrap:anywhere}
.erp-document .doc-panel strong{font-weight:700}
.erp-document .doc-panel-title{font-weight:700;font-size:11px;color:#52677c!important;margin-bottom:6px}
.erp-document table{width:100%;border-collapse:collapse;font-size:11px;line-height:1.7;background:#fff!important;color:#172b43!important}
.erp-document .doc-items{margin:16px 0;table-layout:fixed;break-after:avoid;page-break-after:avoid}
.erp-document td.text-right,.erp-document th.text-right{text-align:end!important}
.erp-document .doc-purchase-items th:nth-child(2),.erp-document .doc-purchase-items td:nth-child(2){width:24%}
.erp-document .doc-purchase-items th,.erp-document .doc-purchase-items td{padding:7px 6px!important;word-break:normal;overflow-wrap:normal!important}
.erp-document .doc-items th,.erp-document .doc-items td,.erp-document table.table th,.erp-document table.table td,.erp-document table.tpdf th,.erp-document table.tpdf td{padding:9px 10px;border:1px solid #dbe3ec;vertical-align:top;overflow-wrap:anywhere;text-align:start}
.erp-document .doc-items thead th,.erp-document table.table thead th,.erp-document table.table .bg-green th,.erp-document table.tpdf th{background:#edf2f7!important;color:#172b43!important;border-bottom:2px solid #183b56;font-weight:700}
.erp-document .doc-items tbody tr:nth-child(even) td{background:#f8fafc!important}
.erp-document .doc-items .doc-number{width:6%;text-align:center}
.erp-document .doc-items .doc-product{width:40%}
.erp-document .doc-num{font-variant-numeric:tabular-nums;text-align:end!important;overflow-wrap:anywhere}
.erp-document .doc-ltr{direction:ltr;unicode-bidi:isolate;display:inline-block}
.erp-document div.doc-ltr{display:block}
.erp-document .table>tbody>tr.success>td,.erp-document .table>tbody>tr.success>th,.erp-document .table>tbody>tr.danger>td,.erp-document .table>tbody>tr.danger>th{background:#edf2f7!important;color:#172b43!important}
.erp-document .doc-bottom{display:table;width:100%;table-layout:fixed;margin-top:18px;break-inside:avoid;page-break-inside:avoid}
.erp-document .doc-notes,.erp-document .doc-totals{display:table-cell;vertical-align:top;width:50%}
.erp-document .doc-notes{padding-inline-end:20px;overflow-wrap:anywhere}
.erp-document .doc-totals td,.erp-document .doc-totals th{padding:7px 10px;border-bottom:1px solid #dbe3ec;text-align:start;vertical-align:top}
.erp-document .doc-total th,.erp-document .doc-total td{background:#edf2f7!important;color:#172b43!important;border-top:2px solid #183b56!important;border-bottom:2px solid #183b56!important;font-size:16px;font-weight:700}
.erp-document .doc-signatures{display:table;width:100%;table-layout:fixed;margin-top:30px;break-inside:avoid;page-break-inside:avoid;border-spacing:18px 0}
.erp-document .doc-signature{display:table-cell;width:50%;height:64px;padding-top:8px;border-top:1px solid #98aabb;color:#52677c!important;font-size:11px}
.erp-document .doc-footer{margin-top:20px;padding-top:12px;border-top:1px solid #dbe3ec;text-align:center;overflow-wrap:anywhere;break-inside:avoid}
.erp-document .doc-codes{margin-top:18px;text-align:center;break-inside:avoid}
.erp-document .doc-barcode{max-width:260px;max-height:60px}
.erp-document .doc-qr{max-width:95px;max-height:95px;margin:8px}
.erp-document .doc-amount{padding:18px;margin:16px 0;border:1px solid #98aabb;border-inline-start:4px solid #183b56;background:#f8fafc!important}
.erp-document .doc-amount-value{font-size:26px;font-weight:700}
/* Legacy detail documents retain their fields and permission classes. */
.erp-document .row{display:flex;flex-wrap:wrap;margin:0 -6px 12px}
.erp-document [class*='col-']{padding:0 6px;float:none;min-width:0}
.erp-document .col-xs-12,.erp-document .col-sm-12,.erp-document .col-md-12{width:100%}
.erp-document .col-xs-6,.erp-document .col-sm-6,.erp-document .col-md-6{width:50%}
.erp-document .col-sm-4,.erp-document .col-md-4{width:33.3333%}
.erp-document .col-sm-offset-6,.erp-document .col-xs-offset-6,.erp-document .col-md-offset-6{margin:0;margin-inline-start:50%}
.erp-document .invoice-col{padding:12px;border:1px solid #dbe3ec;background:#f8fafc!important}
.erp-document .modal-header{padding:0 0 14px;border-bottom:2px solid #dbe3ec;margin-bottom:16px}
.erp-document .modal-body{padding:0}
.erp-document .modal-footer{padding:16px 0 0;margin-top:18px}
.erp-document .table-responsive{overflow:visible}
.erp-document .bg-gray,.erp-document .well{background:#f8fafc!important;color:#172b43!important}
.erp-document .well{padding:10px;border:1px solid #dbe3ec;box-shadow:none;overflow-wrap:anywhere}
.erp-document .page-header{border-bottom:2px solid #dbe3ec;margin:0 0 16px;padding:0 0 12px;font-size:21px}
.erp-document .display_currency{font-variant-numeric:tabular-nums}
.erp-document--pdf{padding:0;border:0;border-top:3px solid #183b56;font-family:DejaVu Sans,Tahoma,sans-serif;font-size:10pt}
.erp-document--pdf .box{border:1px solid #dbe3ec;padding:10px;margin-bottom:12px}
.erp-document--pdf .table-pdf td,.erp-document--pdf .table-pdf th{padding:7px;vertical-align:top;border-bottom:1px solid #dbe3ec;text-align:start}
.erp-document--pdf .table-pdf th{background:#edf2f7;color:#172b43}
.erp-document--pdf footer{position:static!important;width:100%!important;margin-top:20px;border-top:1px solid #dbe3ec;padding-top:10px}
@media(max-width:600px){.erp-document{padding:16px}.erp-document .doc-header,.erp-document .doc-brand,.erp-document .doc-heading,.erp-document .doc-grid,.erp-document .doc-panel,.erp-document .doc-bottom,.erp-document .doc-notes,.erp-document .doc-totals{display:block;width:100%}.erp-document .doc-heading{text-align:start;margin-top:12px}.erp-document .doc-panel{margin-bottom:8px}.erp-document .doc-notes{margin-bottom:14px}.erp-document .doc-items th,.erp-document .doc-items td{padding:6px;font-size:10px}}
@media print{
 .erp-document{max-width:none;padding:0;border:0;border-top:3px solid #183b56;box-shadow:none;margin:0;color:#172b43!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 .erp-document .no-print,.erp-document .modal-footer,.erp-document button,.erp-document .close{display:none!important}
 .erp-document .doc-header,.erp-document .doc-grid,.erp-document .doc-bottom,.erp-document .doc-signatures{display:table}
 .erp-document .doc-brand,.erp-document .doc-heading,.erp-document .doc-panel,.erp-document .doc-notes,.erp-document .doc-totals,.erp-document .doc-signature{display:table-cell}
 .erp-document .doc-brand{width:55%}.erp-document .doc-heading{width:45%;text-align:end}
 .erp-document .doc-panel,.erp-document .doc-notes,.erp-document .doc-totals{width:50%}
 .erp-document .doc-heading{margin:0}.erp-document .doc-items th,.erp-document .doc-items td{padding:8px;font-size:11px}
 .erp-document thead{display:table-header-group}.erp-document tfoot{display:table-footer-group}
 .erp-document tr,.erp-document .doc-panel,.erp-document .well{break-inside:avoid;page-break-inside:avoid}
 .erp-document .table-responsive{overflow:visible!important}.erp-document a{color:inherit!important;text-decoration:none}
 .erp-document a[href]:after{content:none!important}
 .modal-dialog:has(.erp-document){width:100%!important;margin:0!important}.modal-content:has(.erp-document){border:0!important;box-shadow:none!important}
 #receipt_section:has(.erp-document){padding:0!important;border:0!important;margin:0!important}
}
