.subnav-wrapper {
    width: 100%;
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-areas: "sidebar content";
    gap: var(--spacing-2xl);
    min-height: 400px;
    align-items: start;
}

@media (min-width: 1200px) {
    .subnav-wrapper {
        grid-template-columns: 250px 1fr;
        gap: var(--spacing-3xl);
    }
}

@media (max-width: 1074px) {
    .subnav-wrapper {
        grid-template-columns: 70px 1fr;
        gap: var(--spacing-lg);
    }

    .subnav-sidebar {
        padding: var(--spacing-sm);
    }

    .subnav-link {
        width: 100%;
        padding: var(--spacing-md);
        border-left: none;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .subnav-text {
        display: none;
    }

    .subnav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        line-height: 1;
    }

    .subnav-link:hover {
        background: linear-gradient(135deg,
            rgba(var(--color-primary-rgb), 0.12) 0%,
            rgba(var(--color-primary-rgb), 0.06) 100%);
        border-left-color: transparent;
        transform: scale(1.05);
    }

    .subnav-link.active {
        background: linear-gradient(135deg,
            rgba(var(--color-primary-rgb), 0.2) 0%,
            rgba(var(--color-primary-rgb), 0.1) 100%);
        border-left-color: transparent;
    }

    .subnav-link.active::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        width: 100%;
        background: linear-gradient(to right,
            transparent 0%,
            var(--color-primary) 20%,
            var(--color-primary) 80%,
            transparent 100%);
        border-radius: var(--radius-sm);
    }
}

@media (max-width: 914px) {
    .subnav-wrapper {
        grid-template-columns: 1fr;
        grid-template-areas: "content";
        gap: 0;
    }

    .subnav-sidebar {
        display: none;
    }

    .subnav-content-panel {
        padding: var(--spacing-2xl);
    }

    .subnav-section-indicator {
        display: flex;
    }
}

.subnav-sidebar {
    grid-area: sidebar;
    background: linear-gradient(to bottom,
        var(--color-bg-primary) 0%,
        var(--color-gray-50) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    position: sticky;
    top: var(--spacing-xl);
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

.subnav-sidebar::-webkit-scrollbar {
    width: 6px;
}

.subnav-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.subnav-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border-medium);
    border-radius: var(--radius-full);
}

.subnav-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-dark);
}

.subnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.subnav-item {
    margin: 0;
}

.subnav-link {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-cubic);
    position: relative;
    font-family: inherit;
}

.subnav-link:hover {
    background: linear-gradient(to right,
        rgba(var(--color-primary-rgb), 0.08) 0%,
        transparent 100%);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    transform: translateX(2px);
}

.subnav-link.active {
    background: linear-gradient(to right,
        rgba(var(--color-primary-rgb), 0.12) 0%,
        rgba(var(--color-primary-rgb), 0.04) 100%);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.subnav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom,
        transparent 0%,
        var(--color-primary) 20%,
        var(--color-primary) 80%,
        transparent 100%);
    border-radius: var(--radius-sm);
}

.subnav-link:focus {
    outline: none;
}

.subnav-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.subnav-content-panel {
    grid-area: content;
    background: linear-gradient(to bottom,
        var(--color-bg-primary) 0%,
        var(--color-gray-50) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-3xl);
    min-height: 400px;
    position: relative;
}

.subnav-section-indicator {
    display: none;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.subnav-section-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subnav-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.subnav-content-panel:has(> .subnav-content.no-padding.active) {
    min-height: auto;
}

.subnav-content {
    display: none;
    animation: contentFadeIn var(--transition-cubic) forwards;
}

.subnav-content.active {
    display: block;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subnav-content-title {
    color: var(--color-text-primary);
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 var(--spacing-xl) 0;
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-border-light);
}

.subnav-content-body {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.subnav-content-body > *:first-child {
    margin-top: 0;
}

.subnav-content-body > *:last-child {
    margin-bottom: 0;
}

.subnav-content.no-padding {
    margin-top: calc(var(--spacing-3xl) * -1);
    margin-bottom: calc(var(--spacing-3xl) * -1);
    margin-left: calc(var(--spacing-3xl) * -1);
    margin-right: calc(var(--spacing-3xl) * -1);
}

.subnav-content-body.no-padding {
    padding: 0;
    margin: 0;
}

.subnav-content-body.no-padding > *:first-child {
    margin-top: 0;
}

.subnav-content-body.no-padding > *:last-child {
    margin-bottom: 0;
}

.subnav-content-body.no-padding .table-component {
    margin: 0;
}

.dark-mode .subnav-sidebar {
    background: linear-gradient(to bottom,
        var(--color-bg-primary) 0%,
        var(--color-bg-tertiary) 100%);
    border-color: var(--color-border-light);
    box-shadow: var(--shadow-md);
}

.dark-mode .subnav-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border-medium);
}

.dark-mode .subnav-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-dark);
}

.dark-mode .subnav-link:hover {
    background: linear-gradient(to right,
        rgba(var(--color-primary-rgb), 0.15) 0%,
        transparent 100%);
}

.dark-mode .subnav-link.active {
    background: linear-gradient(to right,
        rgba(var(--color-primary-rgb), 0.2) 0%,
        rgba(var(--color-primary-rgb), 0.08) 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1074px) {
    .dark-mode .subnav-link:hover {
        background: linear-gradient(135deg,
            rgba(var(--color-primary-rgb), 0.18) 0%,
            rgba(var(--color-primary-rgb), 0.09) 100%);
    }

    .dark-mode .subnav-link.active {
        background: linear-gradient(135deg,
            rgba(var(--color-primary-rgb), 0.25) 0%,
            rgba(var(--color-primary-rgb), 0.12) 100%);
    }
}

.dark-mode .subnav-content-panel {
    background: linear-gradient(to bottom,
        var(--color-bg-primary) 0%,
        var(--color-bg-tertiary) 100%);
    border-color: var(--color-border-light);
    box-shadow: var(--shadow-md);
}

.dark-mode .subnav-section-indicator {
    border-bottom-color: var(--color-border-light);
}