/* Print36T: the printed document. Six templates (classic, modern, minimal, bold, compact, bilingual) and the
   thermal-receipt layout for 80 mm and 58 mm rolls. Plain CSS (no color-mix, no logical shorthand surprises) so
   html2canvas draws it the same way the browser does. --accent, --dfont and --fs come from the document. */
.p36doc{position:relative;font-family:var(--dfont);font-size:var(--fs);line-height:1.4;color:#1d1d1f;background:#fff;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.p36doc *{box-sizing:border-box}
.p36doc p{margin:0}
.p36doc h1,.p36doc h3,.p36doc h4{margin:0;font-family:var(--dfont);font-variant:normal;text-wrap:wrap;color:inherit}
.p36doc table{border-collapse:collapse;width:100%}
.p36doc .num{text-align:right}
.p36doc.is-rtl .num{text-align:left}
.p36doc .l2{display:block;font-size:.82em;font-weight:400;opacity:.8}
.p36doc .d-head{display:flex;justify-content:space-between;align-items:flex-start;gap:6mm;margin-bottom:7mm}
.p36doc .d-head.logo-right{flex-direction:row-reverse}
.p36doc .d-head.logo-center{flex-direction:column;align-items:center;text-align:center}
.p36doc .d-head.logo-center .d-brand{align-items:center}
.p36doc .d-brand{display:flex;flex-direction:column;gap:3mm;max-width:58%}
.p36doc .d-logo{max-width:62mm;object-fit:contain;align-self:flex-start}
.p36doc .logo-center .d-logo{align-self:center}
.p36doc.is-rtl .d-logo{align-self:flex-end}
.p36doc .d-brand .d-party h3{display:none}
.p36doc .d-brand .pn{font-size:1.15em}
.p36doc .d-titlebox{text-align:right;min-width:38%}
.p36doc.is-rtl .d-titlebox{text-align:left}
.p36doc .logo-right .d-titlebox{text-align:left}
.p36doc.is-rtl .logo-right .d-titlebox{text-align:right}
.p36doc .logo-center .d-titlebox{text-align:center}
.p36doc .d-title{font-size:2.3em;font-weight:700;letter-spacing:.02em;color:var(--accent);line-height:1.1;margin-bottom:3mm}
.p36doc .d-meta{width:auto;margin-left:auto}
.p36doc.is-rtl .d-meta{margin-left:0;margin-right:auto}
.p36doc .logo-right .d-meta{margin-left:0}
.p36doc .logo-center .d-meta{margin:0 auto}
.p36doc .d-meta th{font-weight:600;color:#555;text-align:right;padding:.5mm 3mm .5mm 0;white-space:nowrap}
.p36doc.is-rtl .d-meta th{text-align:left;padding:.5mm 0 .5mm 3mm}
.p36doc .d-meta td{text-align:right;padding:.5mm 0}
.p36doc.is-rtl .d-meta td{text-align:left}
.p36doc .d-parties{display:flex;gap:6mm;margin-bottom:6mm;flex-wrap:wrap}
.p36doc .d-parties .d-party{flex:1 1 0;min-width:40mm}
.p36doc .d-party h3{font-size:.82em;text-transform:uppercase;letter-spacing:.06em;color:var(--accent);margin-bottom:1.2mm;font-weight:700}
.p36doc .tid{color:#444}
.p36doc .d-items{margin-bottom:5mm}
.p36doc .d-items th{font-size:.85em;text-align:left;font-weight:700;padding:2mm 2mm;border-bottom:.5mm solid #1d1d1f}
.p36doc.is-rtl .d-items th{text-align:right}
.p36doc .d-items th.num{text-align:right}
.p36doc.is-rtl .d-items th.num{text-align:left}
.p36doc .d-items td{padding:1.8mm 2mm;border-bottom:.2mm solid #ddd;vertical-align:top}
.p36doc .d-items .c-no{width:7mm;color:#777}
.p36doc .d-items .c-desc .desc{white-space:normal;word-break:break-word}
.p36doc .inote{display:block;color:#666}
.p36doc .d-hrow td{font-weight:700;background:#f4f4f4}
.p36doc .d-empty td{height:12mm}
.p36doc .d-sum{display:flex;justify-content:space-between;gap:8mm;align-items:flex-start;margin-bottom:6mm}
.p36doc .d-sumleft{flex:1;display:flex;flex-direction:column;gap:3mm}
.p36doc .d-totals{width:auto;min-width:62mm}
.p36doc .d-totals th{text-align:left;font-weight:500;padding:1mm 4mm 1mm 0;color:#444;white-space:nowrap}
.p36doc.is-rtl .d-totals th{text-align:right;padding:1mm 0 1mm 4mm}
.p36doc .d-totals td{padding:1mm 0;white-space:nowrap}
.p36doc .d-totals tr.grand th,.p36doc .d-totals tr.grand td{font-weight:700;font-size:1.15em;color:#1d1d1f;border-top:.4mm solid #1d1d1f;padding-top:2mm}
.p36doc .d-totals tr.due td{color:var(--accent)}
.p36doc .d-totals tr.sub th,.p36doc .d-totals tr.sub td{font-size:.88em;color:#666}
.p36doc .d-totals tr.paid th,.p36doc .d-totals tr.paid td{font-weight:700}
.p36doc .d-words{font-size:.92em}
.p36doc .d-qr{margin:0;display:flex;flex-direction:column;align-items:flex-start;gap:1mm}
.p36doc .d-qr img{width:28mm;height:28mm;image-rendering:pixelated}
.p36doc .d-qr figcaption{font-size:.78em;color:#555}
.p36doc .d-qr.top{align-items:flex-end;margin-top:2mm}
.p36doc .d-block{margin-bottom:4mm}
.p36doc .d-block h4{font-size:.85em;text-transform:uppercase;letter-spacing:.05em;color:#555;margin-bottom:1mm}
.p36doc .d-legal{font-weight:600;margin-bottom:3mm}
.p36doc .d-reason{margin-bottom:4mm}
.p36doc .d-signs{display:flex;gap:10mm;flex-wrap:wrap;margin-top:6mm}
.p36doc .d-sig{flex:1 1 50mm;max-width:80mm}
.p36doc .d-sigart{height:20mm;position:relative;display:flex;align-items:flex-end}
.p36doc .d-sigimg{max-height:18mm;max-width:60mm}
.p36doc .d-sigtype{font-size:2em;line-height:1;color:#1a2a6c}
.p36doc .d-stamp{position:absolute;right:0;bottom:-4mm;max-height:26mm;max-width:30mm;opacity:.9}
.p36doc.is-rtl .d-stamp{right:auto;left:0}
.p36doc .d-sigline{border-top:.3mm solid #1d1d1f;margin:1mm 0}
.p36doc .d-aging{margin-bottom:5mm}
.p36doc .d-aging h4{margin-bottom:1.5mm}
.p36doc .d-foot{margin-top:6mm;padding-top:3mm;border-top:.2mm solid #ddd;text-align:center;color:#666;font-size:.9em}
.p36doc .d-wm{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:0;overflow:hidden}
.p36doc .d-wm.pos-top{align-items:flex-start;padding-top:20%}
.p36doc .d-wm.pos-bottom{align-items:flex-end;padding-bottom:20%}
.p36doc .d-wm span{font:700 6em/1 'Work Sans',Arial,sans-serif;color:#c0392b;transform:rotate(var(--wmrot));white-space:nowrap;letter-spacing:.06em}
.p36doc .d-wm img{max-width:60%;max-height:50%;transform:rotate(var(--wmrot))}
.p36doc>*:not(.d-wm){position:relative;z-index:1}

/* ---- modern: colored band header ---- */
.tpl-modern .d-head{background:var(--accent);color:#fff;margin:-2mm -2mm 7mm;padding:6mm;border-radius:2mm}
.tpl-modern .d-title{color:#fff}
.tpl-modern .d-meta th{color:rgba(255,255,255,.85)}
.tpl-modern .tid{color:rgba(255,255,255,.9)}
.tpl-modern .d-items thead th{background:#1d1d1f;color:#fff;border:0}
.tpl-modern .d-items tbody tr:nth-child(even) td{background:#f6f7f9}
.tpl-modern .d-totals tr.grand th,.tpl-modern .d-totals tr.grand td{background:var(--accent);color:#fff;border:0;padding:2mm 3mm}

/* ---- minimal: thin lines, quiet labels ---- */
.tpl-minimal .d-title{color:#1d1d1f;font-weight:300;font-size:2.6em;letter-spacing:.08em;text-transform:uppercase}
.tpl-minimal .d-party h3{color:#888}
.tpl-minimal .d-items th{border-bottom:.2mm solid #999;font-weight:500;color:#777;text-transform:uppercase;font-size:.75em;letter-spacing:.06em}
.tpl-minimal .d-items td{border-bottom:.1mm solid #eee}
.tpl-minimal .d-totals tr.grand th,.tpl-minimal .d-totals tr.grand td{border-top:.2mm solid #999;color:var(--accent)}

/* ---- bold: heavy top rule, dark table head ---- */
.tpl-bold{border-top:4mm solid var(--accent);padding-top:5mm}
.tpl-bold .d-title{font-size:3em;color:#1d1d1f;text-transform:uppercase;font-weight:800}
.tpl-bold .d-items thead th{background:var(--accent);color:#fff;border:0}
.tpl-bold .d-party h3{color:#1d1d1f;border-bottom:.6mm solid var(--accent);padding-bottom:1mm;display:inline-block}
.tpl-bold .d-totals tr.grand th,.tpl-bold .d-totals tr.grand td{background:#1d1d1f;color:#fff;padding:2.2mm 3mm;border:0}

/* ---- compact: small type, tight rows; long item lists ---- */
.tpl-compact{font-size:calc(var(--fs) * .85)}
.tpl-compact .d-head{margin-bottom:4mm}
.tpl-compact .d-title{font-size:1.8em}
.tpl-compact .d-items th,.tpl-compact .d-items td{padding:1mm 1.5mm}
.tpl-compact .d-parties{margin-bottom:3mm}
.tpl-compact .d-items tbody tr:nth-child(even) td{background:#fafafa}

/* ---- bilingual: labels in two languages ---- */
.tpl-bilingual .d-title .l2{font-size:.62em;color:#1d1d1f;opacity:.9}
.tpl-bilingual .d-items th .l2,.tpl-bilingual .d-meta th .l2,.tpl-bilingual .d-totals th .l2{font-size:.78em}
.tpl-bilingual .d-items thead th{background:#f2f2f2;border-bottom:.5mm solid var(--accent)}
.tpl-bilingual .d-head{border-bottom:.6mm solid var(--accent);padding-bottom:4mm}

/* ---- thermal receipt (80 mm / 58 mm): one column, centered head ---- */
.tpl-thermal{font-size:8.5pt;line-height:1.3;font-family:var(--dfont)}
.tpl-thermal .d-head{flex-direction:column;align-items:center;text-align:center;gap:1.5mm;margin-bottom:3mm}
.tpl-thermal .d-brand{max-width:100%;align-items:center}
.tpl-thermal .d-logo{max-width:40mm;max-height:16mm!important;align-self:center}
.tpl-thermal .d-titlebox{text-align:center;min-width:0}
.tpl-thermal .d-title{font-size:1.4em;color:#000}
.tpl-thermal .d-meta{margin:0 auto}
.tpl-thermal .d-meta th,.tpl-thermal .d-meta td{text-align:left;padding:.2mm 1mm}
.tpl-thermal .d-parties{flex-direction:column;gap:1.5mm;margin-bottom:2mm}
.tpl-thermal .d-party{min-width:0!important}
.tpl-thermal .d-items th,.tpl-thermal .d-items td{padding:.8mm .6mm;border-bottom:.1mm dashed #999;font-size:.95em}
.tpl-thermal .d-items .c-no,.tpl-thermal .d-items .c-sku,.tpl-thermal .d-items .c-unit,.tpl-thermal .d-items .c-hsn,.tpl-thermal .d-items .c-disc{display:none}
.tpl-thermal .d-sum{flex-direction:column-reverse;gap:2mm;align-items:stretch}
.tpl-thermal .d-totals{width:100%;min-width:0}
.tpl-thermal .d-qr{align-items:center}
.tpl-thermal .d-qr img{width:30mm;height:30mm}
.tpl-thermal .d-signs{margin-top:3mm}
.tpl-thermal .d-sigart{height:12mm}
.paper-t58 .tpl-thermal{font-size:7.5pt}
.paper-t58 .tpl-thermal .d-qr img{width:26mm;height:26mm}

/* html2canvas draws letter by letter when letter-spacing is set, which breaks Arabic and Urdu joining: none for those scripts */
.p36doc.is-rtl,.p36doc.is-rtl *,.p36doc [lang=ar],.p36doc [lang=ur],.p36doc [lang=hi]{letter-spacing:0!important}
.p36doc .ltr{direction:ltr;unicode-bidi:isolate;display:inline-block}
.p36doc .tid .l1,.p36doc .tid .l2{display:inline;font-size:1em;opacity:1}
.p36doc .tid .l2::before{content:" / "}
