:root {
    --sidebar-w: 280px;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --primary: #7d68ca;
    --primary-hover: #6854b4;
    --primary-light: #f3f1fb;
    --accent: #06b6d4;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --code-bg: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar-brand {
    padding: 0 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.sidebar-brand a {
    text-decoration: none;
    color: inherit;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.sidebar-brand h1 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.sidebar-brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.sidebar-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    margin-top: 0.75rem;
    transition: color 0.2s;
}
.sidebar-back-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.sidebar nav {
    flex: 1;
    padding: 0 0.75rem;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    margin-bottom: 2px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.sidebar nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar nav a.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

/* Main Content Area */
.content {
    flex: 1;
    max-width: 960px;
    padding: 3rem 3.5rem 5rem;
    background: var(--surface);
    margin: 1.5rem auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
}

/* Typography */
h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

h2 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
}

h3 {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 1.75rem;
    margin-bottom: 0.6rem;
}

h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1.15rem;
    color: #334155;
}

ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: #334155;
}

li {
    margin-bottom: 0.4rem;
}

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

hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2.5rem 0;
}

a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:hover {
    color: var(--primary-hover);
}

/* Code & Pre */
code {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.87em;
    background: var(--code-bg);
    color: #6f5db6;
    padding: 0.2em 0.45em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

pre {
    background: #0f172a;
    color: #f8fafc;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 1em;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2rem;
    font-size: 0.92rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

thead {
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
}

th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #f8fafc;
}

/* Callout / Badges */
.badge-role {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
}

.footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    gap: 1rem;
}

.footer-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: all 0.15s;
}

.footer-nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.footer-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 2rem;
}
