/* The invoice/estimate document itself — used in the editor preview, client view and print. */
.inv { --accent:#2563eb; position:relative; background:#fff; color:#1f2937; font:14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; padding:48px; overflow:hidden; }
.inv .muted { color:#6b7280; }
.inv .lbl { text-transform:uppercase; letter-spacing:.06em; font-size:11px; font-weight:600; color:var(--accent); margin-bottom:4px; }
.inv-head { display:flex; justify-content:space-between; gap:32px; margin-bottom:32px; }
.inv-from .logo { max-height:72px; max-width:200px; display:block; margin-bottom:12px; object-fit:contain; }
.inv-from .biz { font-size:18px; font-weight:700; }
.inv-meta { text-align:right; min-width:220px; }
.inv-meta h1 { margin:0 0 12px; font-size:30px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; color:var(--accent); }
.inv table { border-collapse:collapse; }
.inv .meta { margin-left:auto; }
.inv .meta td { padding:2px 0 2px 16px; }
.inv .meta td:first-child { color:#6b7280; }
.inv .meta td:last-child { font-weight:600; text-align:right; }
.due-box { display:inline-block; margin-top:12px; padding:10px 14px; border-radius:6px; background:color-mix(in srgb, var(--accent) 9%, white); text-align:right; }
.due-box div { font-size:12px; color:#6b7280; }
.due-box strong { font-size:20px; }
.inv-to { margin-bottom:24px; }
.inv-to .cl-name { font-weight:600; font-size:15px; }
.inv .lines { width:100%; margin-bottom:16px; }
.inv .lines th { text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.05em; padding:10px 8px; border-bottom:2px solid var(--accent); }
.inv .lines td { padding:10px 8px; border-bottom:1px solid #e5e7eb; vertical-align:top; }
.inv .lines .n { text-align:right; white-space:nowrap; width:1%; }
.inv .lines th.n { text-align:right; }
.inv .ln-desc { font-weight:600; }
.inv .ln-det { color:#6b7280; font-size:12.5px; }
.totals-wrap { display:flex; justify-content:flex-end; margin-bottom:24px; }
.inv .totals { min-width:300px; }
.inv .totals td { padding:5px 8px; }
.inv .totals .n { text-align:right; white-space:nowrap; }
.inv .totals .tot td { border-top:1px solid #d1d5db; font-weight:700; }
.inv .totals .bal td { background:var(--accent); color:#fff; font-weight:700; font-size:15px; }
.inv .totals .dep td { font-weight:700; color:var(--accent); }
.inv .blk { margin-bottom:20px; }
.inv .mini td { padding:3px 12px 3px 0; }
.inv .mini .n { text-align:right; }
.inv .photos { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.inv .photos figure { margin:0; }
.inv .photos img { width:100%; border-radius:4px; border:1px solid #e5e7eb; }
.inv .photos figcaption { font-size:12px; color:#6b7280; }
.inv .sigs { display:flex; gap:40px; flex-wrap:wrap; margin-top:28px; }
.inv .sig img { height:70px; max-width:240px; object-fit:contain; display:block; }
.inv .sig-line { border-top:1px solid #9ca3af; padding-top:4px; font-size:12px; color:#6b7280; min-width:200px; }
.inv-foot { margin-top:32px; padding-top:12px; border-top:1px solid #e5e7eb; text-align:center; font-size:12px; color:#6b7280; }
.stamp { position:absolute; top:28px; left:50%; transform:translateX(-50%) rotate(-12deg); border:3px solid; border-radius:6px; padding:2px 16px; font-weight:800; font-size:22px; letter-spacing:.12em; text-transform:uppercase; opacity:.75; }
.stamp-paid, .stamp-approved { color:#16a34a; } .stamp-declined { color:#dc2626; }

/* Template: modern — coloured band */
.tpl-modern { padding-top:0; }
.tpl-modern .inv-head { margin:0 -48px 32px; padding:36px 48px; background:var(--accent); color:#fff; }
.tpl-modern .inv-head .muted, .tpl-modern .meta td:first-child { color:rgba(255,255,255,.8); }
.tpl-modern .inv-meta h1 { color:#fff; }
.tpl-modern .due-box { background:rgba(255,255,255,.16); } .tpl-modern .due-box div { color:rgba(255,255,255,.85); }
.tpl-modern .lines th { border-bottom:0; background:color-mix(in srgb, var(--accent) 10%, white); }
.tpl-modern .stamp { top:auto; bottom:40px; }
/* Template: bold — big title, solid table header */
.tpl-bold .inv-meta h1 { font-size:44px; font-weight:900; }
.tpl-bold .lines th { background:var(--accent); color:#fff; border:0; }
.tpl-bold .inv-from .biz { font-size:22px; }
.tpl-bold { border-top:10px solid var(--accent); }
/* Template: compact — tighter, quieter */
.tpl-compact { font-size:12.5px; padding:32px; }
.tpl-compact .inv-meta h1 { font-size:20px; color:#111827; }
.tpl-compact .lines th { border-bottom:1px solid #111827; }
.tpl-compact .lines td { padding:6px 8px; }
.tpl-compact .totals .bal td { background:none; color:#111827; border-top:2px solid #111827; }
.tpl-compact .due-box { background:#f3f4f6; }

@media (max-width:640px) {
  .inv { padding:22px; font-size:13px; }
  .inv-head { flex-direction:column; gap:16px; }
  .inv-meta { text-align:left; } .inv .meta { margin-left:0; } .inv .meta td { padding:2px 16px 2px 0; }
  .tpl-modern .inv-head { margin:0 -22px 24px; padding:24px 22px; }
  .inv .totals { min-width:0; width:100%; }
}
@media print {
  .inv { padding:0; }
  .tpl-modern .inv-head { margin:0 0 24px; padding:24px; }
  .inv * { -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}
