/* Private automation notifications remain available from every authenticated page. */
.global-notifications {
    position: relative;
}

.global-notifications > summary {
    position: relative;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--interface-border);
    border-radius: 8px;
    background: #fff;
    color: var(--navy-800);
    cursor: pointer;
    list-style: none;
}

.global-notifications > summary::-webkit-details-marker {
    display: none;
}

.global-notifications > summary svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.global-notifications > summary i {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #12a594;
}

.global-notification-menu {
    position: absolute;
    z-index: 130;
    top: 45px;
    right: 0;
    width: min(330px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid var(--interface-border);
    border-radius: var(--interface-tile-radius);
    background: #fff;
    box-shadow: 0 14px 36px rgba(7, 23, 39, 0.18);
}

.global-notification-menu header {
    position: relative;
    display: grid;
    gap: 2px;
    padding: 12px 52px 12px 13px;
    border-bottom: 1px solid var(--interface-divider);
    background: var(--interface-view-surface);
}

/* The existing overlay cross closes only this notification menu. */
.global-notification-menu .global-notification-close {
    position: absolute;
    top: 9px;
    right: 9px;
}

.global-notification-menu header strong {
    color: var(--navy-900);
    font-size: var(--interface-tile-heading-size);
    line-height: 1.25;
}

.global-notification-menu header small {
    color: var(--muted);
    font-size: var(--interface-helper-size);
    line-height: 1.5;
}

.global-notification-menu form {
    margin: 0;
    border-bottom: 1px solid #e8eef0;
}

.global-notification-menu form:last-child {
    border: 0;
}

.global-notification-menu .global-notification-item {
    --notification-dot: var(--blue-600);
    --notification-ring: var(--blue-100);
    display: grid;
    grid-template-columns: 7px 1fr;
    justify-content: stretch;
    gap: 2px 8px;
    width: 100%;
    min-height: 0;
    padding: 11px 12px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    color: var(--navy-900);
    font-size: var(--interface-value-size);
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
}

.global-notification-menu .global-notification-item:hover,
.global-notification-menu .global-notification-item:focus {
    background: #f3f8fa;
    box-shadow: none;
    color: var(--navy-900);
    text-decoration: none;
    transform: none;
}

.global-notification-menu .global-notification-item > span {
    grid-row: 1 / 3;
    width: 7px;
    height: 7px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--notification-dot);
}

.global-notification-menu .global-notification-item.priority-10 {
    --notification-dot: #8798a7;
    --notification-ring: #edf1f4;
}

.global-notification-menu .global-notification-item.priority-30 {
    --notification-dot: #d98b08;
    --notification-ring: #fff1d6;
}

.global-notification-menu .global-notification-item.priority-40 {
    --notification-dot: #cf4d46;
    --notification-ring: #fde8e7;
}

.global-notification-menu .global-notification-item.is-unread > span {
    box-shadow: 0 0 0 3px var(--notification-ring);
}

.global-notification-menu .global-notification-item b {
    font-size: 11px;
    text-decoration: none;
}

.global-notification-menu .global-notification-item small {
    color: var(--muted);
    font-size: var(--interface-helper-size);
    font-weight: 500;
    text-decoration: none;
}

.global-notification-menu .global-notification-all {
    display: block;
    width: fit-content;
    margin: 0;
    padding: 8px 12px 9px;
    color: var(--blue-700);
    font-size: var(--interface-helper-size);
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
}

.global-notification-menu .global-notification-all:hover,
.global-notification-menu .global-notification-all:focus {
    background: transparent;
    color: var(--blue-600);
    text-decoration: none;
}

/* The global inbox sits inside Dashboard and opens outside the navigation rail. */
.sidebar-dashboard {
    position: relative;
}

.sidebar-dashboard .sidebar-link {
    padding-right: 50px;
}

.sidebar-dashboard-notifications {
    position: absolute;
    z-index: 3;
    top: 2px;
    right: 4px;
}

.sidebar-dashboard-notifications .global-notifications > summary {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
}

.sidebar-dashboard-notifications .global-notifications > summary:hover,
.sidebar-dashboard-notifications .global-notifications[open] > summary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-dashboard-notifications .global-notification-menu {
    position: fixed;
    top: 144px;
    right: auto;
    left: calc(var(--sidebar-width) + 8px);
}

@media (min-width: 821px) {
    html.sidebar-is-collapsed .sidebar-dashboard-notifications {
        top: -2px;
        right: 0;
    }

    html.sidebar-is-collapsed .sidebar-dashboard-notifications .global-notifications > summary {
        width: 24px;
        height: 24px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: var(--navy-900);
    }

    html.sidebar-is-collapsed .sidebar-dashboard-notifications .global-notifications > summary svg {
        width: 13px;
        height: 13px;
    }

    html.sidebar-is-collapsed .sidebar-dashboard-notifications .global-notifications > summary i {
        top: 3px;
        right: 3px;
        width: 6px;
        height: 6px;
    }

}

@media (max-width: 820px) {
    .sidebar-dashboard-notifications .global-notification-menu {
        top: 190px;
        left: 14px;
        width: 217px;
    }
}
