/* =========================================
   TOP BAR
========================================= */

.relay-topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 66px;
    padding: 0 24px;
    background: #faf9ff;
    border-bottom: 1px solid #e2e8f0;
	padding-top: 12px;
    flex-shrink: 0;
}

.relay-topbar-title-block {
    flex-shrink: 0;
    line-height: 1.35;
}

.relay-topbar-crumb {
    font-size: 11px;
    color: #94a3b8;
}

.relay-topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.relay-topbar-search {
    position: relative;
    flex: 1;
    max-width: 420px;
    min-width: 0;
    align-self: center;   /* prevents the wrapper from stretching to fill the topbar's full height */
}

.relay-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #94a3b8;
    pointer-events: none;
    line-height: 1;
}

.relay-topbar-search input {
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 12px 0 34px;
    font-size: 13px;
    background: #f8fafc;
    display: block;
}

.relay-topbar-action-btn {
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 18px;
    height: 38px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
}

.relay-topbar-action-btn:hover {
    background: #4f46e5;
}

.relay-topbar-bell {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.relay-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.relay-notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    width: 320px;
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
    cursor: default;
    text-align: left;
}

.relay-notif-header {
    padding: 14px 16px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #f1f5f9;
}

.relay-notif-list { padding: 6px; }

.relay-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s ease;
}
.relay-notif-item:hover { background: #f8fafc; }
.relay-notif-item-disabled { cursor: not-allowed; opacity: .55; }
.relay-notif-item-disabled:hover { background: transparent; }

/* Unread = highlighted (tinted background, bold title, dot marker).
   Read = plain, no highlight — the whole point being that the two
   are visually easy to tell apart at a glance. */
.relay-notif-item-unread { background: #eef2ff; }
.relay-notif-item-unread:hover { background: #e0e7ff; }
.relay-notif-item-read { background: transparent; }

.relay-notif-dot {
    width: 7px;
    height: 7px;
    margin-top: 5px;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
}

.relay-notif-item-body { flex: 1; min-width: 0; }

.relay-notif-item-title { font-size: 13px; color: #0f172a; }
.relay-notif-item-unread .relay-notif-item-title { font-weight: 700; }
.relay-notif-item-read .relay-notif-item-title { font-weight: 500; color: #64748b; }

.relay-notif-item-sub { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }

.relay-notif-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 12.5px;
    color: #94a3b8;
}

.relay-topbar-divider {
    width: 1px;
    height: 28px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.relay-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

.relay-user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.relay-user-avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #6366f1;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.relay-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.relay-user-role {
    font-size: 11px;
    color: #94a3b8;
}

.relay-user-chevron {
    color: #94a3b8;
    font-size: 11px;
}

/* =========================================
   USER DROPDOWN MENU
========================================= */

.relay-user-menu {
    position: relative;
    flex-shrink: 0;
}

.relay-user-chip.open .relay-user-chevron {
    transform: rotate(180deg);
}

.relay-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    padding: 6px;
    z-index: 1000;
}

.relay-user-dropdown-header {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 4px;
}

.relay-user-dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.relay-user-dropdown-email {
    font-size: 11px;
    color: #94a3b8;
    word-break: break-all;
}

.relay-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s;
}

.relay-user-dropdown-item:hover {
    background: #f1f5f9;
}

.relay-user-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.relay-user-dropdown-logout {
    color: #dc2626;
}

.relay-user-dropdown-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* =========================================
   RESPONSIVE
   Everything except .relay-topbar-search has
   flex-shrink:0, so a narrow viewport (once
   the search box has already shrunk to its
   min-width:0 floor) starts pushing the row
   into horizontal overflow — trim it back
   piece by piece instead.
========================================= */

@media (max-width: 750px) {

    .relay-topbar {
        gap: 12px;
        padding: 0 16px;
    }

    .relay-topbar-search {
        max-width: 220px;
    }

    .relay-user-role {
        display: none;
    }

}

@media (max-width: 560px) {

    .relay-topbar-search {
        display: none;
    }

    .relay-topbar-action-btn {
        padding: 0 12px;
        font-size: 12px;
    }

}

@media (max-width: 420px) {

    .relay-topbar-crumb {
        display: none;
    }

    .relay-user-name {
        display: none;
    }

    .relay-topbar-divider {
        display: none;
    }

}
