/* Movi Invoice — HTML invoice preview. Mirrors the PDF templates (services/pdfService.js). */
.inv {
  --brand: #E8590C; --ink: #141414; --muted: #5F5A55; --line: #E4DED6; --soft: #F7F4F0;
  background: #fff; color: var(--ink); width: 100%; max-width: 820px; margin: 0 auto; padding: 44px 48px 28px;
  font-family: "Noto Sans", var(--font); font-size: 12.5px; line-height: 1.45; box-shadow: 0 6px 28px rgba(0,0,0,.08);
  position: relative; overflow: hidden; font-variant-numeric: tabular-nums;
  container-type: inline-size;
}
.inv * { box-sizing: border-box; }
.inv .wm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font-size: 110px; font-weight: 800; color: rgba(0,0,0,.05); transform: rotate(-30deg); letter-spacing: .05em; }
.inv .wm.cancelled { color: rgba(180, 35, 24, .08); }
.inv .lbl { font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.inv .muted { color: var(--muted); }
.inv .name { font-weight: 750; font-size: 14px; }
.inv .logo { max-width: 160px; max-height: 64px; object-fit: contain; }
.inv .title { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.inv .num { text-align: right; white-space: nowrap; }
.inv .head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.inv .parties { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 18px; margin: 22px 0 18px; }
.inv .details-row { display: flex; justify-content: space-between; gap: 10px; }
.inv .details-row b { font-weight: 650; text-align: right; }
.inv table.items { width: 100%; border-collapse: collapse; margin-top: 4px; }
.inv table.items th { font-size: 10.5px; font-weight: 650; text-align: left; padding: 8px 6px; }
.inv table.items td { padding: 8px 6px; vertical-align: top; border-bottom: 1px solid var(--line); }
.inv table.items .r { text-align: right; white-space: nowrap; }
.inv table.items .desc { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.inv .bottom { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; margin-top: 18px; }
.inv .totals .tr { display: flex; justify-content: space-between; padding: 3px 0; }
.inv .totals .grand { display: flex; justify-content: space-between; background: var(--ink); color: #fff; padding: 9px 12px; font-weight: 750; font-size: 14px; margin-top: 6px; }
.inv .words { font-weight: 650; }
.inv .bank .details-row { justify-content: flex-start; }
.inv .bank .details-row span { width: 96px; flex: none; color: var(--muted); }
.inv .bank .details-row b { text-align: left; }
.inv table.taxsum { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 11px; }
.inv table.taxsum th { background: var(--soft); text-align: right; padding: 6px; font-weight: 650; }
.inv table.taxsum td { text-align: right; padding: 6px; border-bottom: 1px solid var(--line); }
.inv table.taxsum th:first-child, .inv table.taxsum td:first-child { text-align: left; }
.inv table.taxsum tr.total td { font-weight: 650; border-bottom: 1.5px solid var(--ink); }
.inv .notes { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; margin-top: 18px; }
.inv .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.inv .sig { text-align: right; }
.inv .sig img { max-width: 150px; max-height: 50px; margin: 6px 0 0 auto; }
.inv .sig .line { border-top: 1px solid var(--ink); margin: 8px 0 4px 40px; }
.inv .disclaimer { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 10px; color: #8A847D; }
.inv .foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: #8A847D; }
.inv .branding { text-align: center; font-size: 9.5px; color: #8A847D; margin-top: 4px; }

/* Modern */
.inv.t-modern { padding-top: 0; }
.inv.t-modern .band { background: var(--brand); color: #fff; margin: 0 -48px; padding: 26px 48px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.inv.t-modern .band .logo-box { background: #fff; border-radius: 8px; padding: 6px 10px; }
.inv.t-modern .band .title { font-size: 26px; text-align: right; }
.inv.t-modern table.items thead th { background: var(--brand); color: #fff; }
.inv.t-modern table.items tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--brand) 7%, white); }
.inv.t-modern .totals .grand { background: var(--brand); }
/* Minimal */
.inv.t-minimal .title { font-size: 30px; text-transform: none; letter-spacing: -0.01em; text-align: right; }
.inv.t-minimal .rule { width: 56px; height: 2px; background: var(--brand); margin: 14px 0 0; }
.inv.t-minimal table.items thead th { border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink); }
/* Corporate */
.inv.t-corporate .bar { background: var(--soft); border-left: 4px solid var(--brand); padding: 10px 16px; display: flex; justify-content: space-between; margin-top: 16px; }
.inv.t-corporate .bar .title { font-size: 17px; }
.inv.t-corporate .parties > div, .inv.t-gst .parties > div { border: 1px solid var(--line); padding: 10px 12px; }
.inv.t-corporate table.items, .inv.t-gst table.items { border: 1px solid var(--ink); }
.inv.t-corporate table.items th, .inv.t-gst table.items th { background: var(--soft); border-bottom: 1px solid var(--ink); }
.inv.t-corporate table.items td + td, .inv.t-gst table.items td + td, .inv.t-corporate table.items th + th, .inv.t-gst table.items th + th { border-left: 1px solid var(--line); }
/* International */
.inv.t-international { border-left: 10px solid var(--brand); }
.inv.t-international .title { font-size: 22px; letter-spacing: .14em; }
.inv.t-international table.items thead th { border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink); }
.inv.t-international .totals .grand { background: var(--brand); }
/* India GST */
.inv.t-gst .gst-title { text-align: center; }
.inv.t-gst .gst-title .title { font-size: 19px; letter-spacing: .1em; }
.inv.t-gst .supplier-box { border: 1px solid var(--ink); padding: 12px 14px; display: flex; gap: 16px; margin-top: 8px; }
.inv.t-gst .ids { font-weight: 650; margin-top: 4px; }
.inv.t-gst .parties { margin-top: 0; gap: 0; }
.inv.t-gst .parties > div { border-color: var(--ink); border-top: 0; }
.inv.t-gst .parties > div + div { border-left: 0; }
.inv.t-gst .lbl { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 11px; }

.preview-frame, .hero-invoice { container-type: inline-size; }
@container (max-width: 640px) {
  .inv { padding: 22px 16px 16px; font-size: 11px; }
  .inv.t-modern .band { margin: 0 -16px; padding: 18px 16px; }
  .inv .parties, .inv .bottom, .inv .notes { grid-template-columns: minmax(0, 1fr); }
  .inv .head { flex-direction: column; }
  .inv.t-modern .band .title, .inv.t-minimal .title { font-size: 20px; }
  .inv .table-scroll { overflow-x: auto; }
  .inv.t-gst .parties > div + div { border-left: 1px solid var(--ink); }
}
@media (max-width: 700px) {
  .inv { padding: 22px 16px 16px; font-size: 11.5px; }
  .inv.t-modern .band { margin: 0 -16px; padding: 18px 16px; }
  .inv .parties, .inv .bottom, .inv .notes { grid-template-columns: minmax(0, 1fr); }
  .inv .head { flex-direction: column; }
  .inv.t-modern .band .title, .inv.t-minimal .title { font-size: 20px; text-align: left; }
  .inv .table-scroll { overflow-x: auto; }
  .inv table.items { min-width: 520px; }
  .inv.t-gst .parties > div + div { border-left: 1px solid var(--ink); }
}
@media print {
  body * { visibility: hidden; }
  .inv, .inv * { visibility: visible; }
  .inv { position: absolute; left: 0; top: 0; box-shadow: none; max-width: none; }
}
