/* ============================================================
   pay.root.co.id — mockup design system
   Satu stylesheet untuk landing, checkout, docs, dan admin.
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f9;
  --ink: #0b1220;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e4e9f2;
  --line-2: #d3dbe8;
  --brand: #2f5bff;
  --brand-2: #1f41d6;
  --brand-soft: #eef2ff;
  --accent: #0ea5a4;
  --ok: #0e9f6e;
  --ok-soft: #e7f8f0;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --err: #d92d20;
  --err-soft: #fdeceb;
  --violet: #7c3aed;
  --violet-soft: #f3eeff;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .05);
  --shadow: 0 10px 30px -12px rgba(11, 18, 32, .18);
  --shadow-lg: 0 30px 70px -30px rgba(11, 18, 32, .35);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: 44px; font-weight: 750; }
h2 { font-size: 28px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 650; }
h4 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 20px; }
button { font: inherit; }
::selection { background: #c7d4ff; }

.container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 13px; }
.strong { font-weight: 650; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hide { display: none !important; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: .15s ease; text-decoration: none;
}
.btn:hover { border-color: #b9c6dd; background: var(--surface-2); text-decoration: none; }
.btn:focus-visible { outline: 3px solid #c3d0ff; outline-offset: 2px; }
.btn svg { flex: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(47, 91, 255, .8); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #1b2637; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-2); }
.btn-soft:hover { background: #e2e9ff; }
.btn-danger { background: var(--err-soft); border-color: #f7cdc9; color: var(--err); }
.btn-danger:hover { background: #fbdcd9; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 9px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- badges & pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid transparent;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-outline { background: transparent; border-color: var(--line-2); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-paid, .status-active, .status-delivered, .status-success { background: var(--ok-soft); color: var(--ok); }
.status-expired { background: var(--surface-3); color: var(--muted); }
.status-failed, .status-inactive, .status-gagal { background: var(--err-soft); color: var(--err); }
.status-processing, .status-queued { background: var(--brand-soft); color: var(--brand-2); }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; transition: .15s ease;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #e0e7ff; }
.input::placeholder, .textarea::placeholder { color: #9aa8bd; }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.input-group { display: flex; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group .btn { border-radius: 0 10px 10px 0; border-left: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 40px; height: 23px; border-radius: 999px; background: #cbd5e1; position: relative; transition: .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .15s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(17px); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); background: var(--surface-2);
  padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafcff; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl-empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table-tools .input, .table-tools .select { min-height: 36px; padding: 7px 11px; font-size: 13px; }
.table-tools .search { min-width: 240px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button { min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; cursor: pointer; }
.pager .pages button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- code ---------- */
.code {
  background: #0d1526; color: #d7e2f5; border-radius: 12px; overflow: hidden;
  border: 1px solid #1b2740; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
}
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: #111c31; border-bottom: 1px solid #1b2740; color: #8fa3c4; font-family: var(--font); font-size: 12px; }
.code pre { margin: 0; padding: 15px 16px; overflow: auto; }
.code .c { color: #7d8fae; } .code .k { color: #8ab4ff; } .code .s { color: #7fe0b0; }
.code .n { color: #ffc46b; } .code .p { color: #c7a4ff; }
.code .copy { color: #8fa3c4; }
.code .copy:hover { color: #fff; background: #1b2740; }

/* ---------- landing ---------- */
.topnav { position: sticky; top: 0; z-index: 40; background: rgba(244, 246, 251, .82); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(228, 233, 242, .8); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(145deg, #2f5bff, #1b2f8f); display: grid; place-items: center; box-shadow: 0 6px 14px -6px rgba(47, 91, 255, .8); flex: none; }
.brand-mark svg { width: 18px; height: 18px; }
.brand small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 550; }
.nav-links a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.nav-cta { display: flex; align-items: center; gap: 8px; }

.hero { position: relative; padding: 76px 0 56px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 620px; background: radial-gradient(600px 300px at 25% 20%, rgba(47, 91, 255, .16), transparent 70%), radial-gradient(500px 260px at 80% 10%, rgba(14, 165, 164, .13), transparent 70%); pointer-events: none; }
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.eyebrow .chip { background: var(--ok-soft); color: var(--ok); padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.hero h1 { margin: 18px 0 16px; font-size: 52px; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.proof { font-size: 12.5px; color: var(--muted); }
.proof b { display: block; font-size: 15px; color: var(--ink); font-weight: 650; }

.hero-art { position: relative; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 20px; }
.hero-card .hc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.hero-card .hc-row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.hero-card .hc-row b { font-variant-numeric: tabular-nums; }
.hero-float { position: absolute; right: -18px; bottom: -22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.hero-float .tick { width: 26px; height: 26px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }

.section { padding: 62px 0; }
.section-head { max-width: 640px; margin-bottom: 34px; }
.section-head .eyebrow { margin-bottom: 12px; }
.section-head p { margin-top: 10px; color: var(--muted); }

.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; align-items: stretch; }
.flow-node { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-right: 26px; }
.flow-node:last-child { margin-right: 0; }
.flow-node::after { content: "→"; position: absolute; right: -21px; top: 50%; transform: translateY(-50%); color: #b6c2d8; font-size: 18px; }
.flow-node:last-child::after { display: none; }
.flow-node .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand-2); margin-bottom: 10px; }
.flow-node h4 { font-size: 14px; margin-bottom: 4px; }
.flow-node p { font-size: 12.5px; color: var(--muted); }

.feature { padding: 22px; }
.feature .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); margin-bottom: 14px; }
.feature h3 { font-size: 15.5px; margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--muted); }

.cta-band { border-radius: var(--radius-lg); padding: 40px; background: linear-gradient(135deg, #101b36, #1b2f6b 60%, #2447c9); color: #fff; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.cta-band h2 { max-width: 560px; }
.cta-band p { color: #c3cff0; margin-top: 10px; max-width: 56ch; }
.cta-band .btn-primary { background: #fff; border-color: #fff; color: #14224b; box-shadow: none; }
.cta-band .btn-primary:hover { background: #e8edff; border-color: #e8edff; }
.cta-band .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff; }

.footer { padding: 40px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 24px; }
.footer a { color: var(--ink-2); }

/* ---------- checkout ---------- */
.checkout-top { border-bottom: 1px solid var(--line); background: var(--surface); }
.checkout-top .inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.secure-note { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.checkout-wrap { width: min(1020px, calc(100% - 32px)); margin: 30px auto 60px; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 20px; align-items: start; }
.pay-card { padding: 26px; }
.pay-merchant { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--violet-soft); color: var(--violet); flex: none; }
.amount-big { font-size: 34px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.amount-big span { font-size: 16px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.kv { display: grid; gap: 9px; }
.kv-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; }
.kv-row dt { color: var(--muted); }
.kv-row dd { margin: 0; text-align: right; font-weight: 550; }
.kv-row dd.mono { font-weight: 400; font-size: 12.5px; }

.qr-card { padding: 22px; text-align: center; }
.qr-frame { position: relative; width: min(260px, 100%); margin: 14px auto; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.qr-frame canvas { width: 100%; height: auto; border-radius: 6px; }
.qr-frame .qr-badge { position: absolute; inset: auto 0 -11px; display: flex; justify-content: center; }
.qr-badge span { background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .12em; padding: 3px 10px; border-radius: 999px; }
.countdown { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.countdown.warn { background: var(--warn-soft); border-color: #f6dfc0; color: var(--warn); }
.steps-mini { display: grid; gap: 10px; text-align: left; margin-top: 18px; }
.steps-mini .step { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.steps-mini .step .n { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.qr-string { margin-top: 14px; }
.qr-string .input { font-family: var(--mono); font-size: 11px; min-height: 36px; color: var(--muted); }
.checkout-note { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.result { padding: 34px 26px; text-align: center; }
.result .mark { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; }
.result .mark.ok { background: var(--ok-soft); color: var(--ok); }
.result .mark.warn { background: var(--warn-soft); color: var(--warn); }
.result .mark.err { background: var(--err-soft); color: var(--err); }
.result h2 { font-size: 24px; margin-bottom: 8px; }
.result p { color: var(--muted); max-width: 44ch; margin: 0 auto; }
.receipt { margin: 22px auto 0; max-width: 380px; text-align: left; border: 1px dashed var(--line-2); border-radius: 12px; padding: 16px; background: var(--surface-2); }
.mock-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; background: var(--surface); border: 1px dashed #c6d2e8; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.mock-banner .mb-text b { display: block; font-size: 12.5px; }
.mock-banner .mb-text span { font-size: 11.5px; color: var(--muted); }
.mock-banner .mb-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.mock-banner .btn { min-height: 32px; padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }

/* ---------- docs ---------- */
.docs-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 38px; align-items: start; }
.docs-nav { position: sticky; top: 84px; display: grid; gap: 2px; font-size: 13.5px; }
.docs-nav a { color: var(--ink-2); padding: 7px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.docs-nav a:hover { background: var(--surface); text-decoration: none; }
.docs-nav a.active { border-left-color: var(--brand); background: var(--surface); color: var(--brand-2); font-weight: 600; }
.docs-nav .grp { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px; }
.docs-body { display: grid; gap: 22px; min-width: 0; }
.doc-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; scroll-margin-top: 86px; }
.doc-section h2 { font-size: 22px; margin-bottom: 6px; }
.doc-section h3 { font-size: 15px; margin: 22px 0 8px; }
.doc-section p { color: var(--ink-2); }
.doc-section > p { margin-top: 8px; }
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.verb { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-2); }
.verb.post { background: #e6f7f0; color: #0b7a55; }
.verb.get { background: #e8f1ff; color: #1b4fbf; }
.verb.del { background: var(--err-soft); color: var(--err); }
.endpoint code { font-family: var(--mono); font-size: 13px; }

/* ---------- admin shell ---------- */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #0c1424; color: #c6d2e6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; }
.side-brand > span:not(.brand-mark) { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; white-space: nowrap; }
.side-brand:hover { text-decoration: none; }
.side-brand .brand-mark { width: 30px; height: 30px; }
.side-brand small { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: .02em; color: #7f92b2; }
.side-nav { padding: 6px 12px; display: grid; gap: 2px; }
.side-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5f7292; padding: 14px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: #b9c7dd; font-size: 13.5px; font-weight: 500; }
.side-nav a:hover { background: #16213a; color: #fff; text-decoration: none; }
.side-nav a.active { background: #1b2a4a; color: #fff; box-shadow: inset 0 0 0 1px #27395c; }
.side-nav a .ico { width: 17px; height: 17px; opacity: .85; flex: none; }
.side-nav a .count { margin-left: auto; font-size: 11px; background: #223154; color: #a9bada; padding: 1px 7px; border-radius: 999px; }
.side-nav a.active .count { background: var(--brand); color: #fff; }
.side-foot { margin-top: auto; padding: 14px; }
.side-help { background: #131f36; border: 1px solid #1f2d49; border-radius: 11px; padding: 12px; font-size: 12px; color: #94a7c6; }
.side-help strong { color: #e4ecfa; display: block; margin-bottom: 3px; }
.side-help a { color: #9db5ff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 13px 26px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .search { position: relative; width: min(340px, 40vw); }
.topbar .search .input { min-height: 36px; padding-left: 34px; font-size: 13px; background: var(--surface-2); }
.topbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .who { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.topbar .who .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; background: var(--brand-soft); color: var(--brand-2); }
.content { padding: 26px; width: 100%; max-width: 1320px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: -.02em; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }
.stat { padding: 18px; }
.stat .label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 720; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--err); } .delta.flat { color: var(--muted); }
.stat .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); }

.chart { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 18px 20px 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bars { display: flex; gap: 4px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart .bar { width: 45%; max-width: 18px; border-radius: 5px 5px 2px 2px; background: var(--brand); opacity: .9; min-height: 3px; transition: height .3s; }
.chart .bar.alt { background: #b9c8ff; }
.chart .cap { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); padding: 0 20px 16px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--brand); display: inline-block; }
.chart-legend i.alt { background: #b9c8ff; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-size: 13.5px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--brand-2); border-bottom-color: var(--brand); font-weight: 650; }
.tab-panel[hidden] { display: none; }

.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); z-index: 1; }
.tl-dot.ok { background: var(--ok-soft); color: var(--ok); }
.tl-dot.brand { background: var(--brand-soft); color: var(--brand-2); }
.tl-dot.err { background: var(--err-soft); color: var(--err); }
.tl-body .t { font-size: 13.5px; font-weight: 600; }
.tl-body .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-body .time { font-size: 11.5px; color: #94a3b8; margin-top: 3px; font-variant-numeric: tabular-nums; }

.copy-field { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 4px 4px 4px 11px; }
.copy-field code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.copy-field .btn { flex: none; }

.kpi-list { display: grid; gap: 0; }
.kpi-list .line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kpi-list .line:last-child { border: 0; }
.kpi-list .line b { font-variant-numeric: tabular-nums; }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 12.8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.note brand, .note.info { background: var(--brand-soft); border-color: #dbe4ff; color: var(--brand-2); }
.note.warn { background: var(--warn-soft); border-color: #f6dfc0; color: #92400e; }
.note.ok { background: var(--ok-soft); border-color: #c5eedd; color: #0a6b4c; }
.note .ico { flex: none; margin-top: 1px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 18, 32, .45); backdrop-filter: blur(2px); z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(600px, 100%); max-height: 90vh; overflow: auto; }
.modal.modal-wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--surface-3); color: var(--ink); }

.toast-wrap { position: fixed; right: 18px; top: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { background: #101827; color: #e9eef8; border-radius: 10px; padding: 11px 14px; font-size: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px; animation: toastIn .18s ease; }
.toast.ok { border-left: 3px solid #34d399; }
.toast.err { border-left: 3px solid #f87171; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }

.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { background: radial-gradient(600px 300px at 20% 20%, rgba(47, 91, 255, .35), transparent 70%), radial-gradient(500px 300px at 90% 80%, rgba(14, 165, 164, .25), transparent 70%), #0b1220; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h2 { font-size: 30px; max-width: 20ch; margin-top: 40px; }
.login-art p { color: #a9bada; margin-top: 12px; max-width: 40ch; font-size: 14px; }
.login-art .quote { border-left: 2px solid #2f5bff; padding-left: 14px; color: #c6d2e6; font-size: 13px; }
.login-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-box { width: min(360px, 100%); }
.login-box h1 { font-size: 23px; }
.login-box > p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.login-box form { display: grid; gap: 14px; margin-top: 22px; }
.login-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 18px; }
.reveal { cursor: pointer; border: 0; background: transparent; color: var(--muted); padding: 4px; }
.reveal:hover { color: var(--ink); }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 180px; padding: 6px; z-index: 50; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; border: 0; background: transparent; font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }

.secret-row { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.secret-row .label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 42px; }
  .flow { grid-template-columns: 1fr 1fr; gap: 14px; }
  .flow-node { margin-right: 0; }
  .flow-node::after { display: none; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; gap: 20px; }
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-nav .grp { display: none; }
  .docs-nav a { border-left: 0; border: 1px solid var(--line); background: var(--surface); }
  .docs-nav a.active { border-color: var(--brand); }
}
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .side-brand { padding: 12px 16px; flex: none; }
  .side-brand span { white-space: nowrap; }
  .side-brand small { display: none; }
  .side-nav { display: flex; padding: 8px; gap: 4px; }
  .side-label, .side-foot, .side-nav a .count, .side-nav .side-extra { display: none; }
  .side-nav a { white-space: nowrap; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 10px 16px; }
  .topbar .search { display: none; }
}
@media (max-width: 760px) {
  h1 { font-size: 34px; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: 34px; }
  .hero .lead { font-size: 15px; }
  .nav-links { display: none; }
  .section { padding: 44px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .card-pad { padding: 18px; }
  .page-head h1 { font-size: 21px; }
  .cta-band { padding: 26px; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .stat .value { font-size: 22px; }
  .tbl th, .tbl td { padding: 11px 12px; }
}
