/* =============================================================================
   NoGate design system
   -----------------------------------------------------------------------------
   Dark, precise, "data product" aesthetic for a direct-to-bank payment gateway.
   Design read: product UI + developer docs for Indonesian merchants. One locked
   accent (acid lime), mono numerals for money, hairline structure over heavy
   cards, restrained motion. No purple glow, no generic card grids, no emoji.
   ========================================================================== */

/* ----------------------------------------------------------------- Tokens -- */
:root {
  /* Surfaces: deep charcoal, never pure black */
  --bg: #0a0a0f;
  --bg-2: #0e0e15;
  --surface: #12121b;
  --surface-2: #17172130;
  --elevated: #16161f;
  --overlay: rgba(6, 6, 10, 0.72);

  /* Hairlines */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --line-faint: rgba(255, 255, 255, 0.045);

  /* Text */
  --text: #f4f4f6;
  --text-2: #b6b7c2;
  --text-3: #7c7d8a;
  --text-4: #55565f;

  /* Signature accent: acid lime. Locked across the whole product. */
  --accent: #c3f53b;
  --accent-soft: rgba(195, 245, 59, 0.14);
  --accent-line: rgba(195, 245, 59, 0.32);
  --on-accent: #0a0a0f;

  /* Semantic status (functional, not decorative) */
  --paid: #46d18a;
  --paid-soft: rgba(70, 209, 138, 0.13);
  --pending: #eab649;
  --pending-soft: rgba(234, 182, 73, 0.13);
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, 0.13);
  --info: #5aa9f0;
  --info-soft: rgba(90, 169, 240, 0.13);

  /* Type */
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  /* Radius scale: containers/controls = 12, small = 8, pills = full */
  --r-lg: 16px;
  --r: 12px;
  --r-sm: 8px;
  --r-pill: 999px;

  /* Spacing rhythm */
  --gap: 16px;
  --pad: 22px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.22s;

  --sidebar-w: 244px;
  --topbar-h: 64px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.75);
}

/* ------------------------------------------------------------------ Reset -- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  font-feature-settings: "ss01" 1, "cv01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Ambient backdrop: fixed, cheap, no scroll repaints. A single tinted glow
   anchored off-canvas, plus a hairline grid. Not a purple mesh blob. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 60rem at 82% -10%, rgba(195, 245, 59, 0.06), transparent 60%),
    radial-gradient(50rem 50rem at -8% 8%, rgba(90, 169, 240, 0.045), transparent 55%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
  opacity: 0.6;
  pointer-events: none;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: padding-box; }

/* ------------------------------------------------------------- Typography -- */
h1, h2, h3, h4 { font-weight: 560; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem); letter-spacing: -0.03em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1, "zero" 1; }
.num { font-family: var(--mono); font-feature-settings: "tnum" 1, "zero" 1; letter-spacing: -0.01em; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.tny { font-size: 12px; }
.label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  font-weight: 500;
}

/* ---------------------------------------------------------------- Buttons -- */
.btn {
  --bt: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--bt);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  user-select: none;
}
.btn:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .icon { width: 17px; height: 17px; }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 600;
}
.btn-primary:hover { background: #d3ff56; border-color: transparent; }

.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

.btn-danger { border-color: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------- Inputs and forms -- */
.field { display: grid; gap: 7px; }
.field > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.textarea { height: auto; padding: 11px 13px; min-height: 92px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--surface);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237c7d8a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .prefix {
  position: absolute; left: 13px; color: var(--text-3); font-family: var(--mono); font-size: 13px;
  pointer-events: none;
}
.input-group .input { padding-left: 40px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.switch {
  position: relative; width: 42px; height: 24px; flex: none;
  background: var(--line-strong); border-radius: 999px; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #ececed; border-radius: 999px; transition: transform var(--dur) var(--ease);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--on-accent); }

.seg {
  display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.seg button {
  border: 0; background: transparent; color: var(--text-3); height: 32px; padding: 0 14px;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* -------------------------------------------------------- Panels and cards -- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.panel-pad { padding: var(--pad); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--pad); border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 15px; letter-spacing: -0.01em; }

/* Status pills */
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 550; letter-spacing: 0.01em;
  border: 1px solid transparent; text-transform: uppercase; font-family: var(--mono);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.status.paid { color: var(--paid); background: var(--paid-soft); }
.status.pending { color: var(--pending); background: var(--pending-soft); }
.status.expired, .status.failed, .status.cancelled { color: var(--danger); background: var(--danger-soft); }
.status.plain { color: var(--text-3); background: rgba(255,255,255,0.05); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: var(--r-pill); font-size: 12px; color: var(--text-2);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}

/* --------------------------------------------------------------- App shell -- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; align-self: start;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand b { font-size: 16px; letter-spacing: -0.02em; font-weight: 600; }
.brand small { display: block; color: var(--text-3); font-size: 11px; letter-spacing: 0.02em; }

.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 11px;
  border-radius: var(--r-sm); color: var(--text-3); font-size: 14px; font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav a .icon { width: 18px; height: 18px; }
.nav a:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active .icon { color: var(--accent); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.nav-foot { margin-top: auto; display: grid; gap: 4px; }

.backend-chip {
  display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg-2); font-size: 12.5px; color: var(--text-2);
}
.backend-chip .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--paid); flex: none; box-shadow: 0 0 0 3px var(--paid-soft); }
.backend-chip .dot.off { background: var(--text-4); box-shadow: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; height: var(--topbar-h); z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 0 clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar .crumbs { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.topbar .crumbs h1 { font-size: 18px; letter-spacing: -0.02em; font-weight: 560; }
.topbar .spacer { flex: 1; }
.hamburger { display: none; }

.view { padding: clamp(18px, 3vw, 34px); display: grid; gap: var(--gap); align-content: start; max-width: 1240px; width: 100%; }
.view-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.view-intro p { color: var(--text-3); max-width: 62ch; margin-top: 6px; }

/* --------------------------------------------------------------- Stat row -- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.stat {
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  display: grid; gap: 6px; position: relative; overflow: hidden;
}
.stat .k { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.stat .k .icon { width: 15px; height: 15px; color: var(--text-3); }
.stat .v { font-family: var(--mono); font-size: 27px; letter-spacing: -0.03em; font-weight: 500; }
.stat .d { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.stat .d.up { color: var(--paid); }
.stat .d.down { color: var(--danger); }

/* ------------------------------------------------------------------ Table -- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-weight: 500; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--text-3); padding: 12px 16px; white-space: nowrap;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface);
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--line-faint); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--dur) var(--ease); cursor: default; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
table.data td .num { font-size: 13.5px; }
.cell-strong { color: var(--text); font-weight: 500; }
.cell-sub { color: var(--text-3); font-size: 12.5px; }
.t-right { text-align: right; }

/* -------------------------------------------------------------- Utilities -- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grow { flex: 1; min-width: 0; }
.gap-sm { gap: 8px; }
.mt { margin-top: 10px; }
.mt-l { margin-top: 20px; }
.center { text-align: center; }
.hide { display: none !important; }
@media (max-width: 560px) { .hide-sm { display: none !important; } }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn { cursor: pointer; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 12px 18px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { color: var(--text); }

/* ---------------------------------------------------------------- Toolbar -- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.toolbar .search .input { padding-left: 36px; height: 40px; }

/* ------------------------------------------------------------ Empty/skel -- */
.empty { display: grid; justify-items: center; gap: 12px; padding: 56px 24px; text-align: center; }
.empty .icon { width: 30px; height: 30px; color: var(--text-4); }
.empty h3 { color: var(--text-2); font-weight: 500; }
.empty p { color: var(--text-3); max-width: 42ch; }

.skel { background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04)); background-size: 200% 100%; border-radius: 6px; animation: shimmer 1.3s var(--ease) infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-line { height: 13px; }
.skel-row { height: 48px; border-radius: var(--r-sm); }

/* ---------------------------------------------------------------- Toasts --- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; max-width: min(92vw, 380px); }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px;
  background: var(--elevated); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow); animation: toastin var(--dur) var(--ease);
}
.toast .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok .icon { color: var(--paid); }
.toast.err .icon { color: var(--danger); }
.toast.info .icon { color: var(--info); }
.toast b { font-size: 13.5px; font-weight: 550; }
.toast p { font-size: 12.5px; color: var(--text-3); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- Modal ---- */
.modal-scrim {
  position: fixed; inset: 0; z-index: 80; background: var(--overlay);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px; animation: fade var(--dur) var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: 88dvh; overflow: auto;
  background: var(--elevated); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow); animation: pop var(--dur) var(--ease);
}
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------- Code box -- */
.code {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: #d7e9c8;
  background: #0c0c12; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px 16px; overflow-x: auto; white-space: pre; tab-size: 2;
}
.code .c-key { color: var(--accent); }
.code .c-str { color: #9ad4ff; }
.code .c-num { color: #f2b0b3; }
.code .c-com { color: var(--text-4); font-style: italic; }
.codeblock { position: relative; }
.codeblock .copy-btn { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity var(--dur); }
.codeblock:hover .copy-btn { opacity: 1; }

/* ----------------------------------------------------- Onboarding / setup -- */
.setup { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.setup-aside {
  position: relative; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: linear-gradient(200deg, var(--bg-2), var(--bg));
  overflow: hidden;
}
.setup-aside .brand { padding: 0 0 40px; }
.setup-aside h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); max-width: 14ch; }
.setup-aside .lead { color: var(--text-2); font-size: 1.02rem; max-width: 46ch; margin-top: 18px; }
.setup-facts { margin-top: auto; display: grid; gap: 18px; padding-top: 40px; }
.setup-fact { display: flex; gap: 13px; align-items: flex-start; }
.setup-fact .icon { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; flex: none; }
.setup-fact b { font-weight: 550; font-size: 14.5px; }
.setup-fact p { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.setup-main { padding: clamp(28px, 5vw, 64px); display: grid; align-content: center; }
.setup-form { width: min(440px, 100%); display: grid; gap: 18px; }
.setup-steps { display: flex; gap: 8px; margin-bottom: 4px; }
.setup-steps span { flex: 1; height: 3px; border-radius: 999px; background: var(--line-strong); }
.setup-steps span.on { background: var(--accent); }

.choice { display: grid; gap: 10px; }
.choice button {
  text-align: left; display: flex; gap: 13px; align-items: flex-start; padding: 15px 16px;
  border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--r); cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.choice button:hover { border-color: var(--line-strong); background: var(--surface); }
.choice button[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.choice .icon { width: 22px; height: 22px; color: var(--accent); margin-top: 1px; flex: none; }
.choice b { font-weight: 550; }
.choice p { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

/* ---------------------------------------------------------------- Invoice -- */
.invoice-shell { max-width: 860px; margin: 0 auto; width: 100%; }
.invoice {
  background: #ffffff; color: #14141b; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow); position: relative;
}
.invoice .inv-top { display: flex; justify-content: space-between; gap: 24px; padding: 34px 38px 26px; border-bottom: 1px solid #ececf1; }
.invoice .inv-brand { display: flex; gap: 13px; align-items: center; }
.invoice .inv-brand .mark { width: 40px; height: 40px; }
.invoice .inv-brand b { font-size: 19px; letter-spacing: -0.02em; display: block; }
.invoice .inv-brand small { color: #6a6b78; font-size: 12px; display: block; margin-top: 2px; }
.invoice .inv-meta { text-align: right; font-size: 13px; color: #45464f; }
.invoice .inv-meta .num { color: #14141b; }
.invoice .inv-title { padding: 26px 38px 6px; }
.invoice .inv-title .label { color: #8a8b96; }
.invoice .inv-title h2 { font-size: 26px; letter-spacing: -0.03em; color: #14141b; }
.invoice .inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px 38px 8px; }
.invoice .inv-parties .label { color: #8a8b96; }
.invoice .inv-parties b { color: #14141b; }
.invoice .inv-parties p { font-size: 13px; color: #55565f; }
.invoice table.items { width: 100%; border-collapse: collapse; margin: 16px 0 0; }
.invoice table.items th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #8a8b96; padding: 12px 38px; border-bottom: 1px solid #ececf1; font-weight: 600; }
.invoice table.items td { padding: 14px 38px; border-bottom: 1px solid #f2f2f6; font-size: 14px; }
.invoice table.items .num { font-family: var(--mono); color: #14141b; }
.invoice .inv-total { display: flex; justify-content: flex-end; padding: 20px 38px; }
.invoice .inv-total .box { width: 300px; display: grid; gap: 9px; }
.invoice .inv-total .line { display: flex; justify-content: space-between; font-size: 13.5px; color: #55565f; }
.invoice .inv-total .grand { display: flex; justify-content: space-between; padding-top: 11px; border-top: 1px solid #ececf1; font-size: 17px; font-weight: 650; color: #14141b; }
.invoice .inv-pay { margin: 0 38px 30px; padding: 18px 20px; background: #f7f8f4; border: 1px solid #eceecd; border-radius: 12px; }
.invoice .inv-pay .label { color: #7c8452; }
.invoice .inv-pay .amt { font-family: var(--mono); font-size: 22px; font-weight: 600; color: #3a4d13; letter-spacing: -0.02em; }
.invoice .inv-pay .bank { font-size: 13px; color: #55565f; }
.invoice .inv-foot { padding: 18px 38px 30px; border-top: 1px solid #ececf1; font-size: 12px; color: #8a8b96; display: flex; justify-content: space-between; gap: 16px; }
.invoice .qr { width: 108px; height: 108px; flex: none; background: #fff; padding: 6px; border: 1px solid #ececf1; border-radius: 8px; }
.invoice .qr canvas, .invoice .qr svg { width: 100%; height: 100%; }

/* Paid stamp: rotated seal, sits over the invoice body */
.stamp {
  position: absolute; top: 132px; right: 46px; transform: rotate(-13deg);
  border: 3px solid var(--paid); color: var(--paid); border-radius: 12px;
  padding: 8px 18px; font-family: var(--mono); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; opacity: 0.92; text-align: center; line-height: 1.1;
}
.stamp b { font-size: 26px; display: block; }
.stamp small { font-size: 10px; letter-spacing: 0.14em; color: var(--paid); }

.invoice-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ------------------------------------------------------------------ Docs ---- */
.docs { display: grid; grid-template-columns: 210px 1fr; gap: 30px; align-items: start; }
.docs-nav { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 3px; }
.docs-nav a { padding: 7px 11px; border-radius: 7px; font-size: 13.5px; color: var(--text-3); }
.docs-nav a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.docs-nav a.active { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.docs-nav .grp { margin-top: 14px; color: var(--text-4); }
.prose { max-width: 74ch; }
.prose h2 { margin: 30px 0 12px; scroll-margin-top: 90px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 22px 0 8px; color: var(--text); }
.prose p { color: var(--text-2); margin: 10px 0; line-height: 1.7; }
.prose ul, .prose ol { color: var(--text-2); margin: 10px 0; padding-left: 22px; line-height: 1.7; }
.prose li { margin: 5px 0; }
.prose code:not(.code) { font-family: var(--mono); font-size: 0.9em; background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 5px; color: #d7e9c8; }
.prose .code { margin: 14px 0; }
.prose a.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.method { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; text-transform: uppercase; }
.method.get { color: var(--info); background: var(--info-soft); }
.method.post { color: var(--paid); background: var(--paid-soft); }
.method.patch, .method.put { color: var(--pending); background: var(--pending-soft); }
.method.delete { color: var(--danger); background: var(--danger-soft); }
.endpoint-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-faint); }
.endpoint-row .path { font-family: var(--mono); font-size: 13px; }

/* --------------------------------------------------------- Log detail ----- */
.parse-preview { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; }
.parse-preview .amt { color: var(--accent); }
.parse-preview .none { color: var(--text-4); }

/* ------------------------------------------------------------- Responsive -- */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .docs { grid-template-columns: 1fr; }
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .setup { grid-template-columns: 1fr; }
  .setup-aside { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 264px; transform: translateX(-100%);
    transition: transform var(--dur) var(--ease); box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .scrim-mob { position: fixed; inset: 0; z-index: 39; background: var(--overlay); }
  .hamburger { display: inline-flex; }
  .invoice .inv-top, .invoice .inv-parties { flex-direction: column; grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 4px 0; }
  .kv dt { margin-top: 8px; }
}
@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .invoice .inv-top, .invoice .inv-title, .invoice .inv-parties, .invoice table.items th, .invoice table.items td, .invoice .inv-total, .invoice .inv-foot { padding-left: 22px; padding-right: 22px; }
  .invoice .inv-pay { margin-left: 22px; margin-right: 22px; }
  .stamp { right: 24px; top: 120px; }
}

/* --------------------------------------------------------- Reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* --------------------------------------------------------------- Printing -- */
@media print {
  body::before, body::after { display: none; }
  .app, .sidebar, .topbar, .invoice-actions, .toasts { display: none !important; }
  body { background: #fff; }
  .print-invoice { display: block !important; }
  .invoice { box-shadow: none; border-radius: 0; }
  @page { margin: 14mm; }
}
