/* ── Docs Theme ── */
:root {
    --bg-body: #0a0a0f;
    --bg-card: #12121a;
    --bg-sidebar: #0e0e16;
    --bg-code: #161622;
    --border: #1e1e2e;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --text-primary: #e2e2ea;
    --text-secondary: #a0a0b8;
    --text-muted: #6c6c80;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-width: 260px;
    --header-height: 56px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 15px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Header ── */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.docs-header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.docs-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}
.logo-mark {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 6px;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
}
.docs-header-nav {
    display: flex;
    gap: 24px;
}
.docs-header-nav a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}
.docs-header-nav a:hover { color: var(--text-primary); }
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ── Layout ── */
.docs-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* ── Sidebar ── */
.docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 50;
}
.sidebar-section {
    padding: 0 20px;
    margin-bottom: 24px;
}
.sidebar-section h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}
.sidebar-link {
    display: block;
    padding: 5px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: 6px;
    margin-bottom: 1px;
    transition: all 0.15s;
}
.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.06);
}
.sidebar-link.active {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 500;
}

/* ── Main Content ── */
.docs-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    max-width: 860px;
    padding: 40px 48px 80px;
}

section {
    margin-bottom: 56px;
    padding-top: 8px;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.01em;
}
h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 28px 0 10px;
    color: var(--text-primary);
}
h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 8px;
}
p { margin-bottom: 14px; color: var(--text-secondary); }
p.lead { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.7; }
ul, ol { margin: 0 0 16px 24px; color: var(--text-secondary); }
li { margin-bottom: 4px; }
strong { color: var(--text-primary); font-weight: 600; }

/* ── Code ── */
code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    color: #c4b5fd;
}
pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 20px;
    line-height: 1.5;
}
pre code {
    background: none;
    padding: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg-code);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
tr:hover td { background: rgba(99, 102, 241, 0.03); }

/* ── Callouts ── */
.callout {
    border-left: 3px solid;
    padding: 14px 18px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
    background: var(--bg-card);
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.callout strong { display: block; margin-bottom: 4px; }
.callout-info { border-color: var(--info); }
.callout-info strong { color: var(--info); }
.callout-warning { border-color: var(--warning); }
.callout-warning strong { color: var(--warning); }

/* ── Cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}
.doc-card h3, .doc-card h4 {
    margin: 0 0 8px;
    color: var(--text-primary);
}
.doc-card p { margin-bottom: 10px; font-size: 0.9rem; }
.doc-card a { font-size: 0.85rem; font-weight: 500; }

/* ── Steps ── */
.steps { margin: 20px 0; }
.step {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}
.step h4 { margin: 0 0 6px; }
.step p { margin-bottom: 8px; }
.step pre { margin-top: 8px; }

/* ── Footer ── */
.docs-footer {
    margin-left: var(--sidebar-width);
    border-top: 1px solid var(--border);
    padding: 24px 48px;
}
.docs-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.docs-footer p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.docs-footer nav { display: flex; gap: 20px; }
.docs-footer nav a { font-size: 0.8rem; color: var(--text-muted); }

/* ── Mobile ── */
@media (max-width: 768px) {
    .docs-header-nav { display: none; }
    .mobile-toggle { display: block; }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s;
        z-index: 90;
    }
    .docs-sidebar.open { transform: translateX(0); }

    .docs-main {
        margin-left: 0;
        padding: 24px 20px 60px;
    }

    .docs-footer {
        margin-left: 0;
        padding: 20px;
    }
    .docs-footer .container { flex-direction: column; gap: 8px; }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .card-grid { grid-template-columns: 1fr; }

    table { font-size: 0.8rem; }
    th, td { padding: 8px 10px; }
}
