.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--background-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-collapsed {
    width: 48px;
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: var(--space-md) 0;
}

/* Thinner scrollbar for sidebar */
.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 6px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
    border: 2px solid var(--background-secondary);
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.sidebar-section {
    margin-bottom: var(--space-lg);
    padding-top: var(--space-md);
}

.sidebar-section:first-child {
    padding-top: 0;
}

.sidebar-collapsed .sidebar-section:not(:first-child) {
    margin-left: 0;
    margin-right: 0;
}

.sidebar-section-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 var(--space-md) var(--space-xs);
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.sidebar-section .sidebar-list {
    padding: 0;
    margin: 0;
}

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

.sidebar-item {
    display: flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    color: var(--text-primary);
    border-radius: 0;
    cursor: pointer;
    position: relative;
    transition: background-color var(--transition-fast);
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-item * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.sidebar-item::selection,
.sidebar-item *::selection {
    background: transparent;
}

.sidebar-item:hover {
    background-color: var(--surface-hover);
}

.sidebar-item.active {
    background-color: var(--accent-surface);
    color: var(--accent);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--accent);
}

.sidebar-item-icon {
    width: 20px;
    height: 20px;
    margin-right: var(--space-md);
    flex-shrink: 0;
    color: var(--text-secondary);
}

.sidebar-item.active .sidebar-item-icon {
    color: var(--accent);
}

.sidebar-collapsed .sidebar-item-icon {
    margin-right: 0;
}

.sidebar-item-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-collapsed .sidebar-item-content {
    opacity: 0;
    pointer-events: none;
}

.sidebar-item-name {
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item-info {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
    margin-left: var(--space-sm);
}

.sidebar-item:hover .sidebar-item-actions {
    opacity: 1;
}

.sidebar-item-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-item-action:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.sidebar-item-action .icon {
    width: 14px;
    height: 14px;
}

.sidebar-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    gap: 0;
}

.empty-state-icon {
    margin-bottom: 0;
    opacity: 0.5;
}

.empty-state-icon .icon {
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
}

.empty-state-text {
    margin-top: -32px;
}

.empty-state-text p {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 var(--space-xs) 0;
    padding: 0;
    line-height: 1;
}

.empty-state-text span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}

.empty-state-title {
    font-size: 0.8rem !important;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.7;
    text-align: left;
    line-height: 1.3;
    margin-bottom: var(--space-xs);
}

.empty-state-subtitle {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0.6;
    text-align: left;
    line-height: 1.3;
    margin-bottom: var(--space-sm);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border);
}

.sidebar-collapsed .sidebar-footer {
    padding: var(--space-xs);
    align-items: center;
}

.sidebar-action-button {
    display: flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-action-button * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.sidebar-action-button::selection,
.sidebar-action-button *::selection {
    background: transparent;
}

.sidebar-action-button:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.sidebar-action-button.active {
    background-color: var(--accent-surface);
    color: var(--accent);
}

.sidebar-action-button .icon {
    margin-right: var(--space-sm);
    width: 18px;
    height: 18px;
}

.sidebar-collapsed .sidebar-action-button {
    justify-content: center;
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: var(--space-xs);
}

.sidebar-collapsed .sidebar-action-button .icon {
    margin-right: 0;
}

.sidebar-collapsed .sidebar-action-button span:not(.icon) {
    display: none;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.sidebar-section-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.sidebar-section-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.section-add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-circle);
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.section-add-button * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.section-add-button::selection,
.section-add-button *::selection {
    background: transparent;
}

.section-add-button:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.section-add-button .icon {
    width: 12px;
    height: 12px;
}

.section-collapse-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.section-collapse-button * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.section-collapse-button::selection,
.section-collapse-button *::selection {
    background: transparent;
}

.section-collapse-button:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.section-collapse-button .icon {
    width: 12px;
    height: 12px;
}

/* Additional icons */
.icon-plus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

.icon-plus-small {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

.icon-star {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'%3E%3C/polygon%3E%3C/svg%3E");
}

/* Icon definitions */
.icon-user {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.icon-network {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2c2.21 2.94 4 7.06 4 10s-1.79 7.06-4 10c-2.21-2.94-4-7.06-4-10s1.79-7.06 4-10z'/%3E%3C/svg%3E");
}

.icon-computer {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='3' width='20' height='14' rx='2' ry='2'/%3E%3Cline x1='8' y1='21' x2='16' y2='21'/%3E%3Cline x1='12' y1='17' x2='12' y2='21'/%3E%3C/svg%3E");
}

.icon-terminal {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 17 10 11 4 5'/%3E%3Cline x1='12' y1='19' x2='20' y2='19'/%3E%3C/svg%3E");
}

.icon-template {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='9' y1='21' x2='9' y2='9'/%3E%3C/svg%3E");
}

.icon-eject {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12V7a5 5 0 0 1 10 0v5'/%3E%3Cpath d='M4 15h16l-2 6H6l-2-6Z'/%3E%3C/svg%3E");
}

.icon-chevron-down {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.icon-chevron-right {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
}

.icon-chevron-left {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E");
}

.icon-chevron-up {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar:not(.sidebar-collapsed) {
        position: fixed;
        top: 0;
        left: 0;
        z-index: var(--z-index-fixed);
        box-shadow: var(--shadow-lg);
    }
}