/* Danmalama API Docs — same brand as admin.danmalama.com.ng and the
   customer app: teal, solid colors, minimal gradients. Docs-specific
   layout (sidebar + long-form content column) rather than the admin
   panel's dashboard-card layout. */

:root {
  --background: #f2faf9;
  --surface: #ffffff;
  --surface-alt: #e3f2f0;
  --border: #cfe8e4;
  --ink: #0a3d39;
  --ink-soft: #135049;
  --text-primary: #0a3d39;
  --text-secondary: rgba(10, 61, 57, 0.65);
  --text-muted: rgba(10, 61, 57, 0.45);
  --accent: #2dd4bf;
  --accent-ink: #05201d;
  --danger: #f04438;
  --danger-muted: rgba(240, 68, 56, 0.1);
  --warning: #f79009;
  --warning-muted: rgba(247, 144, 9, 0.1);
  --success: #12b76a;
  --success-muted: rgba(18, 183, 106, 0.1);
  --info: #2e6fdb;
  --info-muted: rgba(46, 111, 219, 0.1);
  --code-bg: #062723;
  --code-text: #d6f5ef;
  --sidebar-width: 280px;
  --content-max: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

a { color: inherit; }

code, pre, .mono { font-family: 'SFMono-Regular', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(242, 250, 249, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; text-decoration: none; color: var(--text-primary); }
.topbar__brand img { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.topbar__spacer { flex: 1; }
.topbar__link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  padding: 9px 16px; border-radius: 8px;
  background: var(--ink); color: #fff;
}
.topbar__link:hover { background: var(--ink-soft); }
.topbar__menu-btn {
  display: none;
  border: none; background: var(--surface-alt); color: var(--text-primary);
  width: 36px; height: 36px; border-radius: 8px; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ---------- Layout ---------- */
.layout { display: flex; padding-top: 64px; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 64px; bottom: 0; left: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  padding: 24px 16px 60px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.sidebar__group { margin-bottom: 22px; }
.sidebar__group-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); padding: 0 12px 8px;
}
.sidebar__link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
  text-decoration: none;
}
.sidebar__link:hover { background: var(--surface-alt); color: var(--text-primary); }
.sidebar__link.is-active { background: var(--accent); color: var(--accent-ink); }
.sidebar__method {
  font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 4px;
  min-width: 34px; text-align: center; letter-spacing: 0.02em;
}
.sidebar__method--get { background: var(--success-muted); color: var(--success); }
.sidebar__method--post { background: var(--info-muted); color: var(--info); }

.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 48px 32px 120px;
  max-width: calc(var(--content-max) + 64px);
}

/* ---------- Typography ---------- */
h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 10px; }
h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 6px; scroll-margin-top: 84px; }
h3 { font-size: 17px; font-weight: 800; margin: 0 0 4px; }
p { color: var(--text-secondary); margin: 0 0 16px; }
.lede { font-size: 16.5px; color: var(--text-secondary); max-width: var(--content-max); margin-bottom: 24px; }
.section { margin-bottom: 56px; padding-top: 12px; }
.section-intro { margin-bottom: 28px; }
.section-intro h2 { border: none; padding: 0; margin-bottom: 6px; }
.note { font-size: 13px; color: var(--text-muted); }
.note--tight { margin-top: 8px; }
.list-plain { color: var(--text-secondary); font-size: 14px; padding-left: 20px; }
.eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px; }

/* ---------- Endpoint card ---------- */
.endpoint { margin-bottom: 48px; border-top: 1px solid var(--border); padding-top: 32px; }
.endpoint:first-of-type { border-top: none; padding-top: 0; }
.endpoint__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.method {
  font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 6px; letter-spacing: 0.03em;
}
.method--get { background: var(--success-muted); color: var(--success); }
.method--post { background: var(--info-muted); color: var(--info); }
.method--patch { background: var(--warning-muted); color: var(--warning); }
.method--delete { background: var(--danger-muted); color: var(--danger); }
.endpoint__path { font-family: 'SFMono-Regular', ui-monospace, monospace; font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.badge {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-alt); color: var(--text-secondary);
}
.badge--auth { background: var(--ink); color: #fff; }

/* ---------- Tables ---------- */
.param-table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 13.5px; }
.param-table th {
  text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.param-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.param-table code { background: var(--surface-alt); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; color: var(--text-primary); }
.param-table .req { color: var(--danger); font-weight: 800; font-size: 11px; }
.param-table .opt { color: var(--text-muted); font-weight: 700; font-size: 11px; }

/* ---------- Code blocks ---------- */
.code-tabs { border-radius: 12px; overflow: hidden; margin: 16px 0 24px; background: var(--code-bg); }
.code-tabs__bar { display: flex; align-items: center; gap: 2px; padding: 8px 10px; background: rgba(255,255,255,0.04); }
.code-tabs__tab {
  border: none; background: transparent; color: rgba(214,245,239,0.55);
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 7px; cursor: pointer;
  font-family: inherit;
}
.code-tabs__tab.is-active { background: rgba(255,255,255,0.1); color: var(--code-text); }
.code-tabs__copy {
  margin-left: auto; border: none; background: transparent; color: rgba(214,245,239,0.55);
  font-size: 11.5px; font-weight: 700; padding: 6px 10px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
.code-tabs__copy:hover { color: var(--code-text); }
.code-tabs__panel { display: none; }
.code-tabs__panel.is-active { display: block; }
.code-tabs__panel pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  color: var(--code-text); font-size: 12.8px; line-height: 1.65;
}

/* Minimal manual syntax coloring (no JS highlighter dependency) */
.tok-key { color: #7fd8c8; }
.tok-str { color: #ffd08a; }
.tok-num { color: #a3d9ff; }
.tok-bool { color: #f7a2c1; }
.tok-comment { color: rgba(214,245,239,0.4); font-style: italic; }
.tok-method { color: #ffb4a8; font-weight: 700; }

/* ---------- Callouts ---------- */
.callout { border-radius: 12px; padding: 16px 18px; margin: 16px 0 24px; font-size: 13.5px; }
.callout p:last-child { margin-bottom: 0; }
.callout__title { font-weight: 800; font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.callout--info { background: var(--info-muted); }
.callout--info .callout__title { color: var(--info); }
.callout--warn { background: var(--warning-muted); }
.callout--warn .callout__title { color: var(--warning); }
.callout--danger { background: var(--danger-muted); }
.callout--danger .callout__title { color: var(--danger); }
.callout p { color: var(--text-primary); opacity: 0.85; }

/* ---------- Misc ---------- */
.hr { height: 1px; background: var(--border); border: none; margin: 40px 0; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.pill { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--surface-alt); color: var(--text-secondary); }
.err-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 16px 0; }
.err-table th { text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.err-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.status { font-family: monospace; font-weight: 800; font-size: 13px; }
.status--4 { color: var(--warning); }
.status--5 { color: var(--danger); }
.status--2 { color: var(--success); }
.cta-card {
  background: var(--ink); color: #fff; border-radius: 16px; padding: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 8px;
}
.cta-card h3 { color: #fff; margin: 0 0 4px; }
.cta-card p { color: rgba(255,255,255,0.65); margin: 0; }
.cta-card a {
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 13.5px;
  padding: 12px 20px; border-radius: 10px; text-decoration: none; white-space: nowrap;
}
footer { margin-left: var(--sidebar-width); padding: 28px 32px 60px; color: var(--text-muted); font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; z-index: 60; box-shadow: 20px 0 40px rgba(0,0,0,0.08); }
  .sidebar.is-open { transform: translateX(0); }
  .content, footer { margin-left: 0; padding-left: 20px; padding-right: 20px; }
  .topbar__menu-btn { display: flex; }
  .topbar__link span { display: none; }
  h1 { font-size: 26px; }
  .backdrop { display: none; position: fixed; inset: 0; top: 64px; background: rgba(10,61,57,0.35); z-index: 55; }
  .backdrop.is-open { display: block; }
}
