:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface-2: #0d0d14;
  --border: #2a2a3a;
  --text: #e2e8f0;
  --muted: #64748b;
  --subtle: #94a3b8;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: #a78bfa;
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
  --info: #60a5fa;
  --sidebar-w: 260px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-header {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.logo-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-label {
  font-size: 11px;
  color: var(--muted);
  padding-left: 38px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--subtle);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: #1a1a24;
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(124, 58, 237, 0.14);
  color: var(--accent-light);
  border-color: rgba(124, 58, 237, 0.22);
}

.nav-icon { font-size: 14px; width: 18px; text-align: center; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-cta {
  display: block;
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: background 0.12s;
}

.sidebar-cta:hover { background: var(--accent-hover); text-decoration: none; }

/* ── Main layout ──────────────────────────────────── */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }

.content {
  max-width: 780px;
  margin: 0 auto;
  padding: 52px 56px 80px;
}

/* ── Typography ───────────────────────────────────── */
h1 {
  font-size: 30px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  color: #f1f5f9;
  margin-top: 52px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 15.5px;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 28px;
  margin-bottom: 8px;
}

h4 {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 4px;
}

p { color: var(--subtle); margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { color: var(--subtle); padding-left: 22px; margin-bottom: 14px; }
li { margin-bottom: 5px; }
li p { margin-bottom: 4px; }

strong { color: var(--text); font-weight: 600; }

.page-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 40px;
  line-height: 1.6;
}

/* ── Quick links grid ─────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 24px 0 36px;
}

.card-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}

.card-link:hover {
  border-color: var(--accent);
  background: #13131e;
  text-decoration: none;
}

.card-link .card-icon { font-size: 22px; margin-bottom: 10px; }
.card-link h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.card-link p { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ── Code blocks ──────────────────────────────────── */
pre {
  margin: 10px 0 18px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.65;
}

pre code.hljs { border-radius: 8px; padding: 18px 20px; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: #1a1a28;
  border: 1px solid #2e2e44;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #c4b5fd;
}

/* ── Tables ───────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead tr { border-bottom: 1px solid var(--border); }

th {
  padding: 9px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}

td {
  padding: 10px 16px;
  border-bottom: 1px solid #1a1a24;
  color: #cbd5e1;
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
td code { font-size: 12.5px; }

/* ── Badges ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.05em;
}

.badge-get    { background: #1e3a5f; color: #60a5fa; }
.badge-post   { background: #1a3a2a; color: #4ade80; }
.badge-delete { background: #3a1a1a; color: #f87171; }
.badge-patch  { background: #2a2a1a; color: #fbbf24; }

/* ── Endpoint blocks ──────────────────────────────── */
.endpoint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.endpoint-path {
  font-family: var(--mono);
  font-size: 14px;
  color: #e2e8f0;
}

.endpoint-desc {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 10px;
}

.auth-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: #c4b5fd;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.field-req  { color: #f87171; font-size: 11px; font-weight: 500; }
.field-opt  { color: var(--muted); font-size: 11px; }
.field-type { font-family: var(--mono); color: #67e8f9; font-size: 12px; }

/* ── Callouts ─────────────────────────────────────── */
.callout {
  padding: 13px 16px;
  border-radius: 8px;
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.callout-tip {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: #c4b5fd;
}

.callout-warning {
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.22);
  color: #fcd34d;
}

.callout-info {
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.callout strong { color: inherit; }

/* ── Tabs ─────────────────────────────────────────── */
.tabs { margin: 12px 0 4px; }

.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn.active { color: var(--accent-light); border-bottom-color: var(--accent); }
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Steps ────────────────────────────────────────── */
.steps { margin: 18px 0 24px; }

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.step-num {
  width: 26px; height: 26px;
  min-width: 26px;
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-light);
  margin-top: 3px;
}

.step-body { flex: 1; }
.step-body h4 { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.step-body p  { font-size: 13.5px; }

/* ── SMTP creds card ──────────────────────────────── */
.creds-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 14px 0 24px;
}

.creds-card table { margin: 0; }
.creds-card th { background: var(--surface-2); padding: 9px 20px; }
.creds-card td { padding: 10px 20px; }

/* ── Webhook event table ──────────────────────────── */
.event-name {
  font-family: var(--mono);
  font-size: 12.5px;
  color: #c4b5fd;
}

/* ── Section separator ────────────────────────────── */
.sep { height: 1px; background: var(--border); margin: 44px 0; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 820px) {
  .main { margin-left: 0; }
  #sidebar { display: none; }
  .content { padding: 28px 20px 60px; }
  .cards-grid { grid-template-columns: 1fr; }
}
