:root {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-2: #171f2f;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22d3ee;
  --accent-dim: #0e7490;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--mono); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
section { padding: 56px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: 0; }

/* Header */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 15, 23, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
header.site .container { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; }
nav.main { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
nav.main a { color: var(--muted); font-size: 0.95rem; }
nav.main a:hover, nav.main a.active { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 80px 0 56px; }
.hero h1 { max-width: 720px; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 680px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: #1e2838; text-decoration: none; }
.btn.primary { background: var(--accent); color: #04121a; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #67e8f9; }
.btn.danger { color: var(--danger); border-color: #4b1f1f; }
.btn.danger:hover { background: #2a1515; }
.btn.sm { padding: 6px 10px; font-size: 0.85rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* Inputs */
label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; outline: none;
}
input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12); }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 200px; }
.row > .btn { flex: 0 0 auto; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.stat .label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-size: 1.5rem; font-weight: 600; margin-top: 4px; }

.pack { text-align: center; }
.pack .usd { font-size: 2rem; font-weight: 700; }
.pack .inr { color: var(--muted); margin-bottom: 12px; }
.pack .btn { width: 100%; margin-top: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.badge.soon { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.badge.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.badge.accent { color: var(--accent); border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }

/* Banners */
.banner {
  padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); margin-bottom: 16px; font-size: 0.95rem;
}
.banner.warn { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); color: #fde68a; }
.banner.ok { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); color: #a7f3d0; }
.banner.danger { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); color: #fecaca; }
.banner:empty { display: none; }

/* Code */
pre {
  background: #0a0e15; border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 0.85rem; line-height: 1.5;
  margin: 0 0 16px;
}
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
pre code { background: none; padding: 0; }
.code-tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.code-tabs button { background: none; border: 1px solid var(--border); color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.code-tabs button.active { color: var(--text); border-color: var(--accent-dim); }
.key-box {
  font-family: var(--mono); word-break: break-all; padding: 14px; border-radius: 8px;
  border: 1px solid var(--accent-dim); background: rgba(34, 211, 238, 0.06); margin: 12px 0;
}

/* FAQ */
details { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; background: var(--surface); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--muted); }

/* Tabs (login) */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px; font: inherit; cursor: pointer; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

.auth-wrap { max-width: 420px; margin: 60px auto; }

/* Footer */
footer.site { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: 0.9rem; }
footer.site .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Prose */
.prose { max-width: 760px; }
.prose h2 { margin-top: 32px; font-size: 1.3rem; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }

/* ───────────── Dashboard layout ───────────── */
.dash-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: 0 0 230px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { font-size: 0.95rem; padding: 4px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { color: var(--muted); padding: 9px 12px; border-radius: 8px; font-size: 0.95rem; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-nav a.active { background: rgba(34, 211, 238, 0.1); color: var(--accent); }
.side-foot { margin-top: auto; padding: 8px 12px; border-top: 1px solid var(--border); word-break: break-all; }
.side-foot a { display: inline-block; margin-top: 6px; }
.dash-main { flex: 1 1 auto; min-width: 0; }
.dash-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--border); background: rgba(11, 15, 23, 0.9); position: sticky; top: 0; z-index: 5;
}
.dash-top h1 { font-size: 1.35rem; margin: 0; }
.dash-content { padding: 24px; max-width: 1180px; }
#menu-toggle { display: none; }
.loading { color: var(--muted); font-size: 0.9rem; padding: 12px 0; }
.stat .sub { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.cards-4 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 20px; }

/* Progress */
.progress { height: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }
.progress-fill.warn { background: var(--warn); }
.progress-fill.danger { background: var(--danger); }

/* Toggle */
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.toggle .t-text { font-size: 0.95rem; }
.toggle .t-text .muted { display: block; font-size: 0.85rem; }

/* Radios / checkbox lists */
.radio-group { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.radio-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: var(--bg); }
.radio-card input { margin-top: 4px; accent-color: var(--accent); }
.radio-card.selected { border-color: var(--accent-dim); }
.radio-card.disabled { opacity: 0.5; cursor: not-allowed; }
.check-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check-list label { display: flex; gap: 8px; align-items: center; color: var(--text); margin: 0; font-size: 0.9rem; }
.check-list input { accent-color: var(--accent); }
input[type="date"], input[type="number"], select {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit; outline: none;
}
select { cursor: pointer; }

/* Charts */
.chart { width: 100%; height: 220px; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { opacity: 0.85; }
.chart .bar:hover { opacity: 1; }
.chart .line { fill: none; stroke-width: 2; }
.chart .area { opacity: 0.12; }
.chart .dot { opacity: 0.9; }
.barlist-row { display: grid; grid-template-columns: 170px 1fr 150px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 0.9rem; }
.barlist-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 0.85rem; }
.barlist-track { height: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.barlist-fill { height: 100%; background: var(--accent); opacity: 0.8; }
.barlist-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--muted); padding: 7px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.seg button.active { background: var(--surface-2); color: var(--text); }

/* Plans */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.plan { display: flex; flex-direction: column; }
.plan.current { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1); }
.plan .price { font-size: 1.9rem; font-weight: 700; }
.plan .price small { font-size: 0.9rem; color: var(--muted); font-weight: 400; }
.plan ul { padding-left: 18px; margin: 10px 0 14px; color: var(--muted); font-size: 0.9rem; }
.plan li { margin-bottom: 4px; }
.plan .btn { margin-top: auto; }

.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 0.95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Docs */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.docs-toc { position: sticky; top: 76px; align-self: start; font-size: 0.9rem; }
.docs-toc a { display: block; color: var(--muted); padding: 4px 0; }
.docs-toc a:hover { color: var(--text); text-decoration: none; }
.docs h2 { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); }
.docs h3 { margin-top: 24px; }
.docs table { margin-bottom: 16px; }

@media (max-width: 900px) {
  .dash-layout { flex-direction: column; }
  .sidebar { position: fixed; left: -260px; top: 0; z-index: 20; transition: left 0.2s; }
  .sidebar.open { left: 0; }
  #menu-toggle { display: inline-flex; }
  .dash-content { padding: 16px; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; }
  .barlist-row { grid-template-columns: 110px 1fr 110px; }
  .kv { grid-template-columns: 120px 1fr; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.8rem; }
  .hero { padding: 48px 0 32px; }
  header.site .container { height: auto; padding: 10px 20px; flex-direction: column; align-items: flex-start; }
  nav.main { gap: 12px; }
  section { padding: 40px 0; }
}
