.kb-sidebar {
    position: sticky;
    top: 72px;
    left: 0;
    width: 20%;
    min-width: 220px;
    height: 100%;
    min-height: 50vh;
    padding: 0.75rem 1.5rem;
    box-sizing: border-box;
}

.kb-sidebar-inner {
    display: flex;
    flex-direction: column;
}

.kb-sidebar-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Mobile trigger - hidden on desktop */
.kb-sidebar-mobile-trigger {
    display: none;
}

.kb-sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sidebar Group */
.kb-sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.kb-sidebar-group-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.kb-sidebar-group-items {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* Sidebar Items */
.kb-sidebar-group-item {
    display: block;
    padding: 0.5rem 0.625rem;
    color: var(--text-secondary);
    background-color: transparent;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
}

.kb-sidebar-group-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.kb-sidebar-group-item:active {
    background-color: var(--active-bg);
}

.kb-sidebar-group-item.active,
.kb-sidebar-group-item[aria-current="page"] {
    background-color: var(--bg-accent);
    color: var(--brand-primary);
    font-weight: 500;
}

/* Responsive Adjustments */
@media screen and (max-width: 1024px) {
    .kb-sidebar {
        width: 220px;
        min-width: 220px;
        padding: 0.75rem 1.25rem;
    }
}

@media screen and (max-width: 768px) {
    .kb-sidebar {
        position: static;
        width: 100%;
        min-width: unset;
        min-height: unset;
        padding: 0;
        margin-bottom: 1.5rem;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-secondary);
    }

    .kb-sidebar-header {
        display: none;
    }

    /* Mobile trigger - visible on mobile */
    .kb-sidebar-mobile-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.75rem 1rem;
        background: transparent;
        border: none;
        border-radius: var(--radius-lg);
        cursor: pointer;
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--text-primary);
        text-align: left;
    }

    .kb-sidebar-mobile-trigger:hover {
        background-color: var(--hover-bg);
    }

    .kb-sidebar-mobile-trigger-icon {
        transition: transform 0.2s ease;
        color: var(--text-secondary);
    }

    .kb-sidebar.expanded .kb-sidebar-mobile-trigger-icon {
        transform: rotate(180deg);
    }

    /* Content hidden by default on mobile */
    .kb-sidebar-content {
        display: none;
        padding: 0 1rem 1rem 1rem;
        gap: 1.25rem;
    }

    .kb-sidebar.expanded .kb-sidebar-content {
        display: flex;
    }

    /* Hide the group title on mobile since trigger shows it */
    .kb-sidebar-group-title {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .kb-sidebar-mobile-trigger {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .kb-sidebar-content {
        padding: 0 0.75rem 0.75rem 0.75rem;
    }

    .kb-sidebar-group-item {
        font-size: 0.8125rem;
        padding: 0.4375rem 0.5rem;
    }
}

