/*
 * PI template styles, copied from https://lbypackaging-proforma.pages.dev/ so the preview,
 * PDF, and print output look the same. Change the template here only on purpose.
 */
.invoice, .invoice *, .invoice *::before, .invoice *::after { box-sizing:border-box; }
.invoice { font-family:"Microsoft YaHei","Segoe UI",Arial,sans-serif; color:#222; -webkit-font-smoothing:auto; }
.invoice { background:#fff; padding:28px 32px; border:1px solid #c9d6e3; border-radius:8px; font-size:var(--invoice-font-size,14px); line-height:1.55; }
.invoice .pi-title { text-align:center; font-size:22px; font-weight:bold; letter-spacing:2px; margin:0 0 4px; color:#111; }
.invoice-brand { display:flex; align-items:center; justify-content:center; margin-bottom:4px; min-height:96px; }
.invoice-brand img { display:block; width:230px; height:120px; object-fit:contain; }
.invoice .pi-file { text-align:center; font-size:11px; color:#444; margin-bottom:12px; word-break:break-all; }
.invoice table { border-collapse:collapse; width:100%; }
.invoice table.info td { border:1px solid #444; padding:4px 7px; vertical-align:middle; overflow-wrap:anywhere; }
.invoice table.info td.lbl { width:150px; font-weight:600; background:#f6f8fa; white-space:normal; font-size:12px; line-height:1.3; }
.invoice table.info td.val { width:26%; }
.invoice .pre { white-space:pre-line; }
.invoice .thanks { margin:10px 0 6px; }
.invoice table.inv-table th, .invoice table.inv-table td { border:1px solid #444; padding:4px 4px; vertical-align:middle; text-align:center; }
.invoice table.inv-table th { background:#eef2f6; font-weight:600; font-size:11px; line-height:1.2; text-align:center; }
.invoice table.inv-table th small { display:block; color:#555; font-size:9px; font-weight:400; line-height:1.2; }
.invoice .mname { font-weight:600; text-align:center; }
.invoice .mdesc { font-size:11px; color:#444; margin-top:2px; text-align:center; }
.invoice .inv-image { display:block; width:72px; height:52px; object-fit:contain; margin:auto; }
.invoice .muted { color:#999; }
.invoice .right { text-align:center; }
.invoice .center { text-align:center; }
.invoice tr.allfee td { font-weight:700; font-size:14px; }
.invoice .bank { margin-top:12px; }
.invoice .bank table td { border:1px solid #444; padding:4px 7px; }
.invoice .bank table td.label { width:38%; background:#f6f8fa; font-weight:600; }
.invoice .price-stack { line-height:1.45; white-space:nowrap; }
.invoice .price-stack small { color:#666; }

/* ===== v2 template additions (the rules above stay identical to the reference) ===== */
.invoice.tpl-v2 td.settle, .invoice.tpl-v2 .price-stack .settle { font-weight:700; color:#111; }
.invoice.tpl-v2 .price-stack .ref { color:#6b6b6b; font-weight:400; }
.invoice.tpl-v2 .rate-note { margin-top:8px; font-size:11px; line-height:1.5; color:#444; }
.invoice.tpl-v2 tr.sumrow td { font-weight:400; }
.invoice.tpl-v2 .section-title { margin:14px 0 6px; font-size:13px; font-weight:700; color:#111; }
.invoice.tpl-v2 .pack-table td small { display:block; color:#666; font-size:10px; line-height:1.3; }
.invoice.tpl-v2 .pack-table tr.pack-total td { font-weight:700; background:#f6f8fa; }
.invoice.tpl-v2 .terms ol { margin:0; padding-left:20px; font-size:12px; line-height:1.5; }
.invoice.tpl-v2 .terms li + li { margin-top:3px; }
.invoice.tpl-v2 .terms .vi { color:#555; }
.invoice.tpl-v2 table.sign { margin-top:20px; table-layout:fixed; }
.invoice.tpl-v2 table.sign td { width:50%; vertical-align:top; padding:0 28px 0 0; border:none; }
.invoice.tpl-v2 table.sign td + td { padding:0 0 0 28px; }
.invoice.tpl-v2 .sign-title { font-size:12px; font-weight:700; }
.invoice.tpl-v2 .sign-name { min-height:18px; margin-top:2px; font-size:12px; }
.invoice.tpl-v2 .sign-space { position:relative; height:86px; }
.invoice.tpl-v2 .sign-stamp { position:absolute; left:12px; top:4px; max-width:170px; max-height:84px; object-fit:contain; }
.invoice.tpl-v2 .sign-line { padding-top:3px; border-top:1px solid #444; font-size:11px; color:#444; }
.invoice.tpl-v2 .sign-date { margin-top:8px; font-size:11px; color:#444; }

@media print {
  .invoice { border:none; padding:0; font-size:12px; }
  .invoice .pi-title { font-size:20px; }
  @page { size:A4 portrait; margin:10mm; }
}
