/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1020;
    transition: var(--transition);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Glass effect on sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.5rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.sidebar-brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, var(--teal) 0%, var(--teal-d) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.3), 0 2px 4px rgba(13, 148, 136, 0.2);
    position: relative;
    overflow: hidden;
}

.sidebar-brand-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.sidebar-brand-name {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text) 0%, var(--text2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-company {
    font-size: 0.7rem;
    color: var(--text3);
    font-weight: 600;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 165px;
    letter-spacing: 0.01em;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.85rem;
    overflow-y: auto;
}

.nav-group-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text3);
    padding: 1rem 0.85rem 0.4rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text2);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 3px;
    transition: var(--transition);
    position: relative;
    border: 1px solid transparent;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    border-radius: 50%;
}

.nav-link:hover::before {
    width: 200%;
    height: 200%;
}

.nav-link-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: transparent;
    transition: var(--transition);
    flex-shrink: 0;
    color: var(--text3);
    position: relative;
    z-index: 1;
}

.nav-link-text {
    flex: 1;
    position: relative;
    z-index: 1;
}

.nav-badge {
    font-size: 0.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-l) 100%);
    color: #fff;
    padding: 0.2em 0.6em;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3);
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface3);
    border-color: var(--border);
}

.nav-link:hover .nav-link-icon {
    background: var(--bg);
    color: var(--text2);
}

.nav-link.active {
    color: var(--teal-d);
    background: linear-gradient(135deg, var(--teal-pale) 0%, rgba(240, 253, 250, 0.5) 100%);
    border-color: rgba(13, 148, 136, 0.2);
    font-weight: 700;
}

.nav-link.active .nav-link-icon {
    background: linear-gradient(145deg, var(--teal) 0%, var(--teal-d) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.85rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
}

.nav-logout {
    color: var(--text3);
}

.nav-logout:hover {
    color: var(--red) !important;
    background: var(--red-pale) !important;
    border-color: rgba(220, 38, 38, 0.15) !important;
}

.nav-logout:hover .nav-link-icon {
    background: rgba(220, 38, 38, 0.1) !important;
    color: var(--red) !important;
}

/* Sidebar overlay and toggle */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
    z-index: 999;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1010;
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

