/* ==========================================================================
   NoGate — Invoice & public checkout styles
   The invoice renders as a light "paper" sheet on the dark canvas (a familiar,
   trustworthy document metaphor) and prints cleanly to PDF via the browser.
   ========================================================================== */

.invoice-canvas { display: flex; justify-content: center; padding: 8px 0 40px; }

.sheet {
  --ink: #14161c;
  --ink-2: #545a68;
  --ink-3: #8b91a0;
  --sheet-line: #e6e6ec;
  --sheet-bg: #ffffff;
  --sheet-accent: #b8801f;
  width: 100%;
  max-width: 820px;
  background: var(--sheet-bg);
  color: var(--ink);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  font-family: var(--font-ui);
  position: relative;
}

.sheet__band { height: 6px; background: linear-gradient(90deg, #d69a2c, #f0c25e, #b8801f); }

.sheet__head { display: flex; justify-content: space-between; gap: 24px; padding: 34px 40px 26px; flex-wrap: wrap; }
.sheet__brand { display: flex; align-items: center; gap: 13px; }
.sheet__logo { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #f0c25e, #b8801f); color: #241706; font-weight: 700; }
.sheet__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.sheet__merchant-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.sheet__merchant-meta { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin-top: 2px; }
.sheet__title { text-align: right; }
.sheet__title h1 { font-size: 30px; letter-spacing: -0.03em; font-weight: 600; color: var(--ink); }
.sheet__inv-no { font-family: var(--font-mono); font-size: 13px; color: var(--sheet-accent); margin-top: 4px; letter-spacing: 0.04em; }

.sheet__meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0 40px 24px; }
.sheet__meta-block h4 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 6px; }
.sheet__meta-block p { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.sheet__meta-block .muted-ink { color: var(--ink-2); font-size: 12.5px; }

.sheet__items { padding: 0 40px; }
.sheet__items table { width: 100%; border-collapse: collapse; }
.sheet__items thead th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 11px 0; border-bottom: 1.5px solid var(--ink); }
.sheet__items thead th.r, .sheet__items tbody td.r { text-align: right; font-variant-numeric: tabular-nums; }
.sheet__items tbody td { padding: 13px 0; border-bottom: 1px solid var(--sheet-line); font-size: 13.5px; vertical-align: top; }
.sheet__items tbody td.r { font-family: var(--font-mono); }
.sheet__item-desc { font-weight: 500; }
.sheet__item-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.sheet__totals { display: flex; justify-content: flex-end; padding: 22px 40px 8px; }
.sheet__totals-inner { width: 300px; }
.sheet__total-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sheet__total-row .mono { font-family: var(--font-mono); color: var(--ink); }
.sheet__total-row--grand { border-top: 1.5px solid var(--ink); margin-top: 6px; padding-top: 13px; font-size: 17px; font-weight: 600; color: var(--ink); }
.sheet__total-row--grand .mono { font-size: 18px; font-weight: 700; }

.sheet__pay { margin: 20px 40px 8px; padding: 20px; border: 1px solid var(--sheet-line); border-radius: 12px; background: #faf9f6; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.sheet__pay h4 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 8px; }
.sheet__pay-bank { font-size: 14px; line-height: 1.7; }
.sheet__pay-bank b { font-weight: 600; }
.sheet__pay-amount { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--sheet-accent); margin-top: 8px; font-variant-numeric: tabular-nums; }
.sheet__qr { width: 116px; height: 116px; background: #fff; border-radius: 10px; padding: 8px; border: 1px solid var(--sheet-line); }
.sheet__qr svg { width: 100%; height: 100%; }

.sheet__note { padding: 16px 40px 34px; font-size: 12px; color: var(--ink-3); line-height: 1.7; border-top: 1px solid var(--sheet-line); margin-top: 16px; }
.sheet__note b { color: var(--ink-2); }

/* PAID / LUNAS stamp */
.stamp {
  position: absolute; top: 128px; right: 54px;
  transform: rotate(-15deg);
  border: 4px double var(--stamp-color, #1a9d63);
  color: var(--stamp-color, #1a9d63);
  border-radius: 12px; padding: 8px 20px 10px;
  font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.08em;
  text-align: center; opacity: 0.92; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.4);
}
.stamp__main { font-size: 30px; line-height: 1; }
.stamp__sub { font-size: 10px; letter-spacing: 0.14em; margin-top: 5px; opacity: 0.85; }
.stamp--paid { --stamp-color: #1a9d63; }
.stamp--expired { --stamp-color: #9aa0ad; transform: rotate(-11deg); }
.stamp--pending { --stamp-color: #c98a1a; transform: rotate(-11deg); }
.stamp--cancelled, .stamp--failed { --stamp-color: #d0464f; }

/* invoice toolbar (screen only) */
.inv-toolbar { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---- Public checkout page ---------------------------------------------- */
.checkout { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.checkout__card { width: 100%; max-width: 440px; }
.checkout__brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px; }
.checkout__amount-box { text-align: center; padding: 26px 20px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r3); }
.checkout__amount-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-2); }
.checkout__amount { font-family: var(--font-mono); font-size: 40px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 2px; }
.checkout__unique-note { font-size: 12.5px; color: var(--warn); background: var(--warn-dim); border: 1px solid rgba(224,168,62,0.3); border-radius: var(--r2); padding: 9px 12px; margin-top: 16px; line-height: 1.5; }
.checkout__bank { margin-top: 18px; }
.checkout__countdown { font-family: var(--font-mono); font-size: 13px; color: var(--text-2); text-align: center; margin-top: 16px; }
.checkout__status { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 14px; border-radius: var(--r2); margin-top: 18px; font-weight: 500; }
.checkout__status--pending { background: var(--warn-dim); color: var(--warn); }
.checkout__status--paid { background: var(--ok-dim); color: var(--ok); }
.checkout__qr { width: 150px; height: 150px; margin: 18px auto 0; background: #fff; border-radius: 12px; padding: 10px; }
.checkout__qr svg { width: 100%; height: 100%; }

/* ---- Print ------------------------------------------------------------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  body::after { display: none !important; }
  .sidebar, .topbar, .scrim, .toast-host, .inv-toolbar, .no-print { display: none !important; }
  .app-shell { display: block !important; }
  .main, .content { padding: 0 !important; max-width: none !important; }
  .invoice-canvas { padding: 0 !important; }
  .sheet { box-shadow: none !important; border-radius: 0 !important; max-width: none !important; width: 100% !important; }
  .sheet__pay { background: #faf9f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet__band, .stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
