:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-blue: #1f6feb;
    --accent-green: #2ea043;
    --accent-red: #f85149;
    --accent-yellow: #d29922;
    --border-color: #30363d;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    color: var(--accent-blue);
    font-size: 1.3rem;
}

.sidebar-header p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 5px;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(31, 111, 235, 0.1);
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

.nav-item svg {
    width: 18px;
    height: 18px;
}

/* Content */
.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px 40px;
    max-width: calc(100% - var(--sidebar-width));
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
}

h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    margin: 20px 0 15px;
    color: var(--text-primary);
}

h4 {
    margin: 15px 0 10px;
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-blue);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Cards */
.info-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.info-card h2 {
    border-bottom: none;
    margin-bottom: 15px;
    padding-bottom: 0;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.filter-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-btn.active {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Diagrams */
.diagram-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.mermaid {
    text-align: center;
}

/* API Blocks */
.api-block {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.api-block pre {
    background-color: #0d1117;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.api-block code {
    background-color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Subsection */
.subsection {
    margin-bottom: 30px;
}

.subsection ul,
.subsection ol {
    margin-left: 20px;
    color: var(--text-secondary);
}

.subsection li {
    margin-bottom: 5px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green {
    background-color: rgba(46, 160, 67, 0.2);
    color: var(--accent-green);
}

.badge-yellow {
    background-color: rgba(210, 153, 34, 0.2);
    color: var(--accent-yellow);
}

.badge-red {
    background-color: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.badge-blue {
    background-color: rgba(31, 111, 235, 0.2);
    color: var(--accent-blue);
}

/* Checkmark in traceability */
.traceability-check {
    color: var(--accent-green);
    font-weight: bold;
    text-align: center;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar span,
    .sidebar-header p {
        display: none;
    }

    .sidebar-header h2 {
        font-size: 1rem;
        text-align: center;
    }

    .nav-item {
        justify-content: center;
        padding: 15px;
    }

    .content {
        margin-left: 60px;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}