/* ===== Sidebar Premium ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width, 260px);
    height: 100vh;
    background: var(--bg-secondary, #111820);
    border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-base, 250ms ease);
}

/* ===== Brand ===== */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.12) 0%, rgba(0, 212, 170, 0.04) 100%);
    border: 1px solid rgba(0, 212, 170, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0, 212, 170, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

.sidebar-brand-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #a1b0c0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
}

.sidebar-pro-badge {
    font-size: 10px;
    font-weight: 800;
    color: var(--color-primary, #00d4aa);
    background: linear-gradient(135deg, rgba(0, 240, 192, 0.12) 0%, rgba(0, 168, 136, 0.08) 100%);
    border: 1px solid rgba(0, 212, 170, 0.25);
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(0, 212, 170, 0.1);
    flex-shrink: 0;
}

/* ===== Navigation ===== */
.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary, #8899aa);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 150ms ease;
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    color: var(--text-primary, #e8edf4);
}

.sidebar-item.active {
    background: var(--bg-active, rgba(0, 212, 170, 0.08));
    color: var(--color-primary, #00d4aa);
    border-left-color: var(--color-primary, #00d4aa);
}

.sidebar-item.active .sidebar-icon {
    color: var(--color-primary, #00d4aa);
}

.sidebar-icon {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.sidebar-item:hover .sidebar-icon,
.sidebar-item.active .sidebar-icon {
    opacity: 1;
}

.sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Separator ===== */
.sidebar-separator {
    height: 1px;
    background: var(--border-color, rgba(255, 255, 255, 0.08));
    margin: 8px 12px;
}

/* ===== Alert Badge ===== */
.sidebar-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-secondary, #111820), 0 2px 4px rgba(239, 68, 68, 0.4);
    display: none;
    pointer-events: none;
}

.sidebar-badge.visible {
    display: block;
    animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badge-pop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* ===== Footer ===== */
.sidebar-footer {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-primary, #00d4aa) 15%, transparent);
    border: 1px solid var(--color-primary, #00d4aa);
    color: var(--color-primary, #00d4aa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #e8edf4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-plan {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-primary, #00d4aa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-logout {
    background: none;
    border: none;
    color: var(--text-muted, #5a6b7c);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger, #ef4444);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }
}

/* ===== Sidebar Logo Image ===== */
.sidebar-brand-logo {
    height: 28px;
    width: auto;
    filter: drop-shadow(0 1px 6px rgba(0, 212, 170, 0.15));
}