/*======================================================
    GridLabs CRM Pro
    Topbar
======================================================*/

.crm-topbar{

    position:sticky;
    top:0;

    width:100%;
    height:var(--topbar-height);

    display:flex;
    align-items:center;

    padding:0 24px;

    background:var(--topbar-bg);

    border-bottom:1px solid var(--border);

    box-shadow:0 2px 12px rgba(15,23,42,.04);

    z-index:900;

}


/*======================================================
    Left
======================================================*/

.topbar-left{

    display:flex;
    align-items:center;

    gap:14px;

    min-width:220px;

}

.topbar-menu-btn{

    width:42px;
    height:42px;

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

    border:0;
    border-radius:11px;

    background:var(--primary);
    color:#fff;

    cursor:pointer;

    font-size:16px;

    transition:var(--transition);

}

.topbar-menu-btn:hover{

    background:var(--primary-dark);

    transform:translateY(-1px);

}


.topbar-page-info h1{

    margin:0;

    font-size:18px;

    font-weight:600;

    color:var(--text);

}


/*======================================================
    Search
======================================================*/

.topbar-search{

    position:relative;

    flex:1;

    max-width:620px;

    margin:0 auto;

}

.topbar-search > i{

    position:absolute;

    left:17px;

    top:50%;

    transform:translateY(-50%);

    color:#94a3b8;

    font-size:14px;

    pointer-events:none;

}

.topbar-search input{

    width:100%;

    height:44px;

    padding:0 75px 0 44px;

    border:1px solid var(--border);

    border-radius:12px;

    background:#f8fafc;

    color:var(--text);

    font-size:13px;

    transition:var(--transition);

}

.topbar-search input::placeholder{

    color:#94a3b8;

}

.topbar-search input:focus{

    border-color:var(--primary);

    background:#fff;

    box-shadow:0 0 0 3px rgba(179,0,0,.08);

}

.search-shortcut{

    position:absolute;

    right:12px;

    top:50%;

    transform:translateY(-50%);

    padding:3px 7px;

    border:1px solid #e2e8f0;

    border-radius:6px;

    background:#fff;

    color:#94a3b8;

    font-size:10px;

}


/*======================================================
    Right
======================================================*/

.topbar-right{

    display:flex;

    align-items:center;

    gap:14px;

    min-width:220px;

    justify-content:flex-end;

}


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

.topbar-notification{

    position:relative;

}

.notification-btn{

    position:relative;

    width:42px;
    height:42px;

    display:flex;

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

    border:1px solid var(--border);

    border-radius:11px;

    background:#fff;

    color:#475569;

    cursor:pointer;

    transition:var(--transition);

}

.notification-btn:hover{

    color:var(--primary);

    background:#fff7f7;

}

.notification-count{

    position:absolute;

    top:-5px;
    right:-5px;

    min-width:18px;
    height:18px;

    display:flex;

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

    padding:0 4px;

    border-radius:20px;

    background:#dc2626;

    color:#fff;

    border:2px solid #fff;

    font-size:9px;

    font-weight:700;

}


/*======================================================
    Notification Dropdown
======================================================*/

.notification-dropdown{

    position:absolute;

    top:52px;
    right:0;

    width:360px;

    background:#fff;

    border:1px solid var(--border);

    border-radius:14px;

    box-shadow:0 15px 40px rgba(15,23,42,.12);

    overflow:hidden;

    opacity:0;
    visibility:hidden;

    transform:translateY(-8px);

    transition:.2s ease;

}

.notification-dropdown.show{

    opacity:1;

    visibility:visible;

    transform:translateY(0);

}

.notification-header{

    display:flex;

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

    padding:16px;

    border-bottom:1px solid var(--border);

}

.notification-header strong{

    display:block;

    font-size:14px;

    color:var(--text);

}

.notification-header span{

    display:block;

    margin-top:3px;

    color:#94a3b8;

    font-size:10px;

}

.notification-header button{

    border:0;

    background:none;

    color:var(--primary);

    font-size:11px;

    cursor:pointer;

}

.notification-list{

    max-height:330px;

    overflow-y:auto;

}

.notification-empty{

    padding:45px 20px;

    text-align:center;

    color:#94a3b8;

}

.notification-empty i{

    font-size:28px;

    margin-bottom:10px;

}

.notification-empty p{

    margin:0;

    font-size:12px;

}

.notification-footer{

    padding:12px;

    border-top:1px solid var(--border);

    text-align:center;

}

.notification-footer a{

    color:var(--primary);

    font-size:12px;

    font-weight:500;

}


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

.topbar-user{

    position:relative;

}

.topbar-user-btn{

    display:flex;

    align-items:center;

    gap:10px;

    padding:4px 7px;

    border:0;

    border-radius:12px;

    background:transparent;

    cursor:pointer;

}

.topbar-user-btn:hover{

    background:#f8fafc;

}

.topbar-avatar{

    width:38px;
    height:38px;

    display:flex;

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

    flex-shrink:0;

    overflow:hidden;

    border-radius:50%;

    background:#f1f5f9;

    color:#64748b;

    border:1px solid var(--border);

}

.topbar-avatar img{

    width:100%;
    height:100%;

    object-fit:cover;

}

.topbar-user-info{

    display:flex;

    flex-direction:column;

    align-items:flex-start;

    line-height:1.25;

}

.topbar-user-info strong{

    color:var(--text);

    font-size:12px;

    font-weight:600;

}

.topbar-user-info span{

    margin-top:2px;

    color:#94a3b8;

    font-size:10px;

}

.topbar-user-arrow{

    margin-left:3px;

    color:#94a3b8;

    font-size:9px;

    transition:.2s;

}


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

.user-dropdown{

    position:absolute;

    top:54px;
    right:0;

    width:230px;

    padding:8px;

    background:#fff;

    border:1px solid var(--border);

    border-radius:14px;

    box-shadow:0 15px 40px rgba(15,23,42,.12);

    opacity:0;

    visibility:hidden;

    transform:translateY(-8px);

    transition:.2s ease;

}

.user-dropdown.show{

    opacity:1;

    visibility:visible;

    transform:translateY(0);

}

.user-dropdown-header{

    display:flex;

    align-items:center;

    gap:10px;

    padding:8px;

}

.user-dropdown-header strong{

    display:block;

    color:var(--text);

    font-size:12px;

}

.user-dropdown-header span{

    display:block;

    margin-top:3px;

    color:#94a3b8;

    font-size:10px;

}

.user-dropdown-divider{

    height:1px;

    margin:7px 0;

    background:var(--border);

}

.user-dropdown > a{

    display:flex;

    align-items:center;

    gap:10px;

    padding:10px;

    border-radius:8px;

    color:#475569;

    text-decoration:none;

    font-size:12px;

    transition:.2s;

}

.user-dropdown > a:hover{

    background:#f8fafc;

    color:var(--primary);

}

.user-dropdown > a i{

    width:18px;

    text-align:center;

}

.user-dropdown > a.logout-link{

    color:#dc2626;

}

.user-dropdown > a.logout-link:hover{

    background:#fef2f2;

}


/*======================================================
    Responsive
======================================================*/

@media(max-width:991px){

    .crm-topbar{

        padding:0 16px;

    }

    .topbar-left{

        min-width:auto;

    }

    .topbar-page-info{

        display:none;

    }

    .topbar-right{

        min-width:auto;

    }

}

@media(max-width:767px){

    .crm-topbar{

        height:64px;

        padding:0 12px;

        gap:10px;

    }

    .topbar-search{

        max-width:none;

    }

    .search-shortcut{

        display:none;

    }

    .topbar-user-info,
    .topbar-user-arrow{

        display:none;

    }

    .notification-dropdown{

        position:fixed;

        top:70px;

        left:12px;
        right:12px;

        width:auto;

    }

    .user-dropdown{

        right:0;

    }

}

@media(max-width:480px){

    .topbar-search{

        display:none;

    }

    .topbar-right{

        margin-left:auto;

    }

}