:root {
    --sidebar-width: 280px;
    --header-height: 60px;
    --primary-color: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */
    --text-color: #334155;
    /* Slate 700 */
    --heading-color: #1e293b;
    /* Slate 800 */
    --bg-color: #f8fafc;
    /* Slate 50 */
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --table-header-bg: #f1f5f9;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #60a5fa;
        /* Blue 400 */
        --primary-hover: #3b82f6;
        /* Blue 500 */
        --text-color: #e2e8f0;
        /* Slate 200 */
        --heading-color: #f1f5f9;
        /* Slate 100 */
        --bg-color: #0a0a0a;
        /* Very Dark Gray */
        --sidebar-bg: #171717;
        /* Neutral 900 */
        --card-bg: #171717;
        /* Neutral 900 */
        --border-color: #262626;
        /* Neutral 800 */
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
        --table-header-bg: #171717;
    }
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 85%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 32px 20px;
    overflow-y: auto;
    display: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

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

.sidebar nav ul ul {
    padding-left: 12px;
    margin-top: 4px;
    border-left: 1px solid #e2e8f0;
    /* Subtle guide line */
    margin-left: 12px;
}

.sidebar nav li {
    margin-bottom: 4px;
    /* Restored some spacing */
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.sidebar nav a {
    text-decoration: none;
    color: #64748b;
    /* Slate 500 - Softer default text */
    display: inline-block;
    padding: 6px 10px;
    /* Balanced padding */
    border-radius: 6px;
    flex: 1;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.sidebar nav a:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    /* Darker on hover */
}

.sidebar nav a.home-link {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: var(--heading-color);
    padding-left: 0;
}

.sidebar .active>a {
    color: var(--primary-color);
    background-color: #eff6ff;
    /* Blue 50 */
    font-weight: 600;
    /* Removed border-left for a cleaner pill look */
}

/* ... (nav styles remain same) ... */

/* Sidebar Toggles */
.caret {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 4px;
    color: #94a3b8;
    /* Slate 400 */
    transition: transform 0.2s ease;
    border-radius: 4px;
}

.caret:hover {
    background-color: #f1f5f9;
    color: var(--text-color);
}

.caret::before {
    content: "▶";
    font-size: 0.7em;
    display: inline-block;
}

.caret-down::before {
    transform: rotate(90deg);
}

.nested {
    display: none;
    width: 100%;
}

.active {
    display: block;
}

/* Main Content */
.content {
    flex: 1;
    padding: 0;
    min-width: 0;
    max-width: 100%;
}

article {
    background-color: transparent;
    padding: 8px;
    border-radius: 12px;
    box-shadow: none;
    border: none;
    max-width: 100%;
    margin: 0;
}

header {
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

header h1 {
    display: none;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--heading-color);
    line-height: 1.2;
}

.breadcrumbs {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.2;
    white-space: nowrap;
    overflow-x: auto;
    max-width: 100%;
}

/* ... (breadcrumbs links remain same) ... */

/* Mobile Menu Button */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    width: auto;
    position: static;
    box-shadow: none;
    transition: background-color 0.2s;
}

.menu-toggle:hover {
    background-color: #f1f5f9;
}



.close-sidebar {
    display: block;
}

/* List Styling */
.content ul,
.content ol {
    padding-left: 1.5em;
    margin-bottom: 1.25em;
}

.content li {
    margin-bottom: 0.25em;
}

/* Content Links */
.content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
}

.content a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    overflow-x: auto;
    display: block;
}

th,
td {
    border: 1px solid var(--border-color);
    padding: 0.75em;
    text-align: left;
}

th {
    background-color: var(--table-header-bg);
    font-weight: 600;
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin: 1.5em 0;
    display: block;
    /* Removes bottom space */
}

/* Responsive */


@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}