/*======================================================
    GridLabs CRM Pro
    Sidebar - Light Theme
======================================================*/

.crm-sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: var(--sidebar-width);
    height: 100vh;

    background: #ffffff;
    color: #1f2937;

    display: flex;
    flex-direction: column;

    z-index: 1000;

    transition: var(--transition);

    border-right: 1px solid #e5e7eb;

    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.05);
}


/*======================================================
    Header
======================================================*/

.sidebar-header {
    height: var(--topbar-height);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 20px;

    background: #ffffff;

    border-bottom: 1px solid #e5e7eb;
}


/*======================================================
    Logo
======================================================*/

.sidebar-logo {
    display: flex;
    align-items: center;

    gap: 11px;

    color: #1f2937;

    text-decoration: none;
}


.sidebar-logo:hover {
    color: #1f2937;
}


.sidebar-logo-icon {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: var(--primary);

    color: #ffffff;

    font-size: 18px;

    flex-shrink: 0;
}


.sidebar-logo-text {
    display: flex;
    flex-direction: column;

    line-height: 1.2;
}


.sidebar-logo-text strong {
    font-size: 17px;

    font-weight: 700;

    color: #1f2937;
}


.sidebar-logo-text span {
    font-size: 10px;

    color: #94a3b8;

    letter-spacing: 1px;

    text-transform: uppercase;
}


/*======================================================
    Close Button
======================================================*/

.sidebar-close {
    display: none;

    width: 34px;
    height: 34px;

    align-items: center;
    justify-content: center;

    border: 0;

    background: transparent;

    color: #475569;

    cursor: pointer;

    font-size: 18px;

    border-radius: 8px;

    transition: var(--transition);
}


.sidebar-close:hover {
    background: #f1f5f9;

    color: var(--primary);
}


/*======================================================
    Navigation
======================================================*/

.sidebar-nav {
    flex: 1;

    overflow-y: auto;

    padding: 18px 12px;
}


.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}


.sidebar-nav::-webkit-scrollbar-track {
    background: #f8fafc;
}


.sidebar-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 20px;
}


.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* Firefox */

.sidebar-nav {
    scrollbar-width: thin;

    scrollbar-color: #cbd5e1 #f8fafc;
}


/*======================================================
    Section
======================================================*/

.sidebar-section {
    margin-bottom: 24px;
}


.sidebar-section-title {
    padding: 0 13px 9px;

    font-size: 10px;

    font-weight: 600;

    color: #94a3b8;

    letter-spacing: 1.2px;

    text-transform: uppercase;
}


/*======================================================
    Sidebar Link
======================================================*/

.sidebar-link {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 46px;

    margin-bottom: 4px;

    padding: 0 13px;

    gap: 12px;

    border-radius: 11px;

    color: #475569;

    text-decoration: none;

    font-size: 13px;

    font-weight: 500;

    transition: var(--transition);
}


.sidebar-link:hover {
    color: #1f2937;

    background: #f8fafc;
}


.sidebar-link.active {
    color: #ffffff;

    background: var(--primary);

    box-shadow: 0 5px 15px rgba(196, 0, 0, 0.20);
}


/*======================================================
    Icon
======================================================*/

.sidebar-link-icon {
    width: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    font-size: 15px;

    color: inherit;
}


.sidebar-link-text {
    flex: 1;
}


/*======================================================
    Notification Badge
======================================================*/

.sidebar-notification-badge {
    min-width: 20px;
    height: 20px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0 5px;

    border-radius: 20px;

    background: #ef4444;

    color: #ffffff;

    font-size: 10px;

    font-weight: 600;
}


/*======================================================
    Sidebar Footer
======================================================*/

.sidebar-footer {
    padding: 14px;

    background: #ffffff;

    border-top: 1px solid #e5e7eb;
}


/*======================================================
    User
======================================================*/

.sidebar-user {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 12px;
}


.sidebar-user-avatar {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: #f1f5f9;

    color: #64748b;

    border: 1px solid #e2e8f0;
}


.sidebar-user-info {
    min-width: 0;

    display: flex;

    flex-direction: column;
}


.sidebar-user-info strong {
    color: #1f2937;

    font-size: 12px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.sidebar-user-info span {
    color: #94a3b8;

    font-size: 10px;

    margin-top: 2px;
}


/*======================================================
    Logout
======================================================*/

.sidebar-logout {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    width: 100%;

    padding: 10px;

    border: 1px solid #e5e7eb;

    border-radius: 9px;

    background: #ffffff;

    color: #64748b;

    text-decoration: none;

    font-size: 12px;

    transition: var(--transition);
}


.sidebar-logout:hover {
    color: #dc2626;

    background: #fff5f5;

    border-color: #fecaca;
}


/*======================================================
    Overlay
======================================================*/

.sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

    background: rgba(15, 23, 42, 0.45);

    z-index: 999;
}


/*======================================================
    Tablet
======================================================*/

@media (max-width: 991px) {

    .crm-sidebar {
        transform: translateX(-100%);

        box-shadow: 8px 0 30px rgba(15, 23, 42, 0.12);
    }


    .crm-sidebar.active {
        transform: translateX(0);
    }


    .sidebar-close {
        display: flex;
    }


    .sidebar-overlay.active {
        display: block;
    }

}


/*======================================================
    Mobile
======================================================*/

@media (max-width: 575px) {

    .crm-sidebar {
        width: 280px;
    }


    .sidebar-header {
        padding: 0 16px;
    }


    .sidebar-nav {
        padding: 16px 10px;
    }


    .sidebar-footer {
        padding: 12px;
    }

}