/* Letter-sized invoice based on the customer-supplied October 2026 document. */
.reference-scroll{overflow-x:auto;padding:0 0 10px}
.reference-invoice{width:190mm;max-width:none;margin:0 auto;padding:6mm 0 0;background:#fff;color:#111;font:10.5pt/1.45 Arial,Helvetica,sans-serif;letter-spacing:0}
.reference-invoice *{box-sizing:border-box}
.reference-invoice p,.reference-invoice h2{margin:0}
.reference-brandline{display:flex;justify-content:space-between;align-items:flex-end;gap:12mm;margin:0 1mm 4mm;break-inside:avoid}
.reference-logo-filter{position:absolute;width:0;height:0;overflow:hidden}
/* Original transparent white/red brand asset; ink mapping keeps the tree red and prints the lettering black. */
.reference-logo{display:block;width:43mm;height:auto;margin:0;filter:url(#invoice-logo-ink)}
.reference-internal{text-align:right;padding-bottom:1mm;line-height:1.4}
.reference-internal span{display:block;font-size:8pt;color:#617281;letter-spacing:.4px}
.reference-internal strong{display:block;color:#2d5c7e;font-size:12pt;font-weight:700;font-variant-numeric:tabular-nums}
.reference-header{display:grid;grid-template-columns:59% 41%;gap:0;margin:0 1mm 4mm}
.reference-header h2{color:#2d5c7e;font:700 12pt/1.35 Arial,Helvetica,sans-serif;margin-bottom:2mm;letter-spacing:-.35px}
.reference-issuer h2{text-transform:uppercase}
.reference-header p{margin:1.7mm 0 0;overflow-wrap:anywhere}
.reference-number{text-align:right;padding-left:2mm}
.reference-client{border-top:2px solid #599bd2;border-bottom:2px solid #599bd2;padding:3.5mm 0;margin-bottom:3.5mm;font-size:11.5pt;line-height:1.4;overflow-wrap:anywhere}
.reference-lines{width:100%;table-layout:fixed;border-collapse:collapse;white-space:normal}
.reference-lines .col-quantity{width:6.3%}.reference-lines .col-description{width:22.4%}.reference-lines .col-unit{width:8.9%}.reference-lines .col-price{width:13.4%}.reference-lines .col-tax{width:9%}.reference-lines .col-discount{width:13.4%}.reference-lines .col-surcharge{width:13.4%}.reference-lines .col-value{width:13.2%}
.reference-lines th,.reference-lines td{border:1px solid #e4e4e4;text-align:left;vertical-align:top;padding:1mm .7mm;color:#111;font:9pt/1.5 Arial,Helvetica,sans-serif;white-space:normal;overflow-wrap:anywhere}
.reference-lines th{background:#d0cece;font-weight:700;position:static;letter-spacing:-.3px;padding:.8mm .7mm}
.reference-lines td:nth-child(n+4){font-variant-numeric:tabular-nums;white-space:nowrap}
.reference-lines tr:last-child td{border-bottom:1px solid #e4e4e4}
.reference-bottom{border-top:2px solid #599bd2;margin-top:5mm;padding-top:2.5mm;display:grid;grid-template-columns:52% 48%;gap:0;align-items:end;break-inside:avoid}
.reference-security{font-size:10pt;line-height:1.5;overflow-wrap:anywhere;padding-right:2mm}
.reference-security p{margin-top:1mm}
.reference-qr{width:30mm;height:30mm;display:block;margin:0 0 2mm;background:#fff;color:#000;flex:none;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.reference-totals{width:100%;border-collapse:collapse;white-space:normal}
.reference-totals th,.reference-totals td{color:#111;font:9.5pt/1.3 Arial,Helvetica,sans-serif;padding:1.25mm .8mm;vertical-align:middle;border:0;border-radius:0;background:none;position:static}
.reference-totals th{width:50%;text-align:right;font-weight:700;white-space:nowrap}
.reference-totals td{background:#f2f2f2;text-align:right;border:1px solid #e4e4e4;white-space:nowrap;font-variant-numeric:tabular-nums}
.reference-totals tr:last-child td{border-bottom:1px solid #e4e4e4}
.reference-comment{margin-top:2.5mm;break-inside:avoid}
.reference-comment p{border:1px solid #ddd;padding:1.4mm;min-height:8mm;white-space:pre-wrap;overflow-wrap:anywhere}
.reference-credit{border-bottom:2px solid #599bd2;padding:0 0 3mm;margin-bottom:3.5mm;font-size:10pt;line-height:1.5;overflow-wrap:anywhere;break-inside:avoid}
.reference-credit-notice{font-size:9pt;margin-top:1mm}
.reference-status,.reference-classification{font:8pt/1.4 Arial,Helvetica,sans-serif;color:#555;margin-top:3mm}
.reference-status{text-align:center}.reference-status:empty{display:none}.reference-status p+p{margin-top:1mm}.reference-validity{font-weight:700;letter-spacing:.2px}
.invoice-collection{margin-top:20px;border-top:1px solid #e1e6e9;padding-top:15px}
.invoice-line-fields{border:1px solid #e1e6e9;border-radius:6px;padding:15px;margin:15px 0}
.invoice-line-fields legend{font-size:12px;padding:0 5px;color:#3e505c}
@media screen and (max-width:800px){.reference-scroll{margin:0 -5px}.reference-invoice{margin:0}.reference-scroll:before{content:'Desliza para ver el documento completo';display:block;font-size:11px;color:#65717a;margin:0 0 10px}}
@media print{
 body[data-fiscal-print-blocked] .reference-scroll{display:none!important}
 body[data-fiscal-print-blocked]:before{content:'Impresión bloqueada: falta el QR del comprobante electrónico.';display:block!important;color:#111;background:#fff;padding:20mm;font:14pt Arial}
 @page invoice{size:Letter;margin:16mm 12mm 12mm;@top-left{content:""}@top-center{content:""}@top-right{content:""}@bottom-left{content:""}@bottom-right{content:""}@bottom-center{content:counter(page);font:10pt Arial;color:#111}}
 html:has(.reference-invoice){background:#fff!important;min-height:0}
 body:has(.reference-invoice){page:invoice;margin:0!important;padding:0!important;min-height:0;overflow:visible!important;background:#fff}
 body:has(.reference-invoice) .modal,body:has(.reference-invoice) .modal-content,body:has(.reference-invoice) .modal-overlay{margin:0;padding:0;border:0;border-radius:0;max-height:none;overflow:visible;background:#fff}
 body:has(.reference-invoice) .form-error{display:none}
 /* Only the invoice subtree is printable, including from the provider receipt. */
 body:has(.reference-invoice) .modal-content>:not(.reference-scroll):not(:has(.reference-scroll)){display:none!important}
 body:has(.reference-invoice) #billing-receipt>:not(.reference-scroll){display:none!important}
 .reference-scroll{overflow:visible;padding:0}
 .reference-invoice{page:invoice;width:100%;margin:0;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 .reference-header,.reference-client{break-inside:avoid}
 .reference-lines thead{display:table-header-group}
 .reference-lines tr{break-inside:avoid}
 .reference-lines th{background:#d0cece!important}
 .reference-totals td{background:#f2f2f2!important}
}
