/*--------------------------------------------------------------
# The header bell's notifications panel (Views/Shared/_NotificationsPanel.cshtml, drawn by
# notifications.js), in the landing dashboard's frosted-glass look: an AL-MA blue header with an
# unread count, unread rows tinted with a dot to mark them read, and "Mark all as Read" below.
# Text in the dashboard panels' sizes (a card row's title and facts), and an arrow up to the bell.
# The dashboard cogwheel's menu (.dash-menu in dashboard.css, on the welcome line) takes the same look.
# Loaded by every layout that has the bell.
--------------------------------------------------------------*/
#notifPanel.notif-panel {
    --notif-blue: #304f7f;
    --notif-accent: #106eea;
    --notif-line: rgba(48, 79, 127, 0.18);
    position: fixed; /* top: under the bell, set by notifications.js */
    right: 10px;
    z-index: 2000;
    width: 380px;
    max-width: calc(100vw - 20px);
    margin-top: 10px; /* the arrow's room */
    padding: 0;
    border: 1px solid var(--notif-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(12, 7, 74, 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 0.69rem;
    color: #333;
}

    /* The arrow, under the bell's middle (--notif-arrow-x, set by notifications.js). Not clipped by
       the panel, so the corners are rounded on its head and list instead of by overflow. */
    #notifPanel.notif-panel::before {
        content: "";
        position: absolute;
        bottom: 100%;
        left: var(--notif-arrow-x, calc(100% - 20px));
        border: 7px solid transparent;
        border-bottom-color: var(--notif-blue);
        transform: translateX(-50%);
    }

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 9px 9px 0 0;
    background: var(--alma-panel-head);
    box-shadow: var(--alma-panel-head-edge);
    color: #fff;
}

.notif-head-title {
    font-size: 0.77rem;
    font-weight: 600;
}

.notif-count {
    border-radius: 999px;
    padding: 0 7px;
    background: #fff;
    color: var(--notif-blue);
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.notif-list {
    max-height: min(60vh, 520px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.notif-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 7px 12px;
    border-bottom: 1px solid rgba(48, 79, 127, 0.10);
}

    .notif-row:last-child {
        border-bottom: 0;
    }

    .notif-row.is-unread {
        background: rgba(16, 110, 234, 0.07);
    }

    .notif-row.is-link {
        cursor: pointer;
    }

        .notif-row.is-link:hover {
            background: rgba(48, 79, 127, 0.09);
        }

.notif-icon {
    flex: none;
    margin-top: 1px;
    font-size: 0.85rem;
    color: var(--notif-blue);
}

.notif-body {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.notif-title {
    font-weight: 600;
    color: #222;
}

.notif-row.is-unread .notif-title {
    font-weight: 700;
}

.notif-msg {
    margin-top: 1px;
    font-size: 0.62rem;
    color: #555;
}

    .notif-msg a {
        color: var(--notif-accent);
        text-decoration: none;
    }

        .notif-msg a:hover {
            text-decoration: underline;
        }

    .notif-msg b {
        font-weight: 600;
    }

.notif-time {
    margin-top: 1px;
    font-size: 0.58rem;
    color: #6c757d;
}

.notif-read {
    flex: none;
    padding: 4px;
    border: 0;
    border-radius: 50%;
    background: none;
    line-height: 0;
    cursor: pointer;
}

    .notif-read:focus-visible {
        outline: 2px solid var(--notif-accent);
    }

.notif-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--notif-accent);
}

.notif-read:hover .notif-dot {
    box-shadow: 0 0 0 3px rgba(16, 110, 234, 0.25);
}

.notif-empty {
    padding: 18px 12px;
    text-align: center;
    color: #6c757d;
}

/* "All notifications" (the inbox) on the left, always; "Mark all as Read" on the right while something is unread. */
.notif-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 12px;
    border-top: 1px solid var(--notif-line);
}

.notif-all,
.notif-markall {
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--notif-blue);
    font-size: 0.67rem;
    font-weight: 600;
    text-decoration: none;
}

    .notif-all:hover,
    .notif-markall:hover {
        color: var(--notif-accent);
        text-decoration: underline;
    }

    .notif-markall[hidden] {
        display: none;
    }

/* Opened from the footer bell (notifications.js adds .is-above): the panel rests on the bell instead of hanging
   under it, with its arrow pointing down. */
#notifPanel.notif-panel.is-above {
    margin-top: 0;
    margin-bottom: 10px;
}

    #notifPanel.notif-panel.is-above::before {
        top: 100%;
        bottom: auto;
        border-bottom-color: transparent;
        border-top-color: rgba(255, 255, 255, 0.92);
    }

/*--------------------------------------------------------------
# The in-app toast (notifications.js, showInAppNotification): one at a time in the header's slot (header-toast.css
# places it and slides it down and back up), a newer one in its place, up for 5 seconds. An icon, the title (an order's In Stock / Pending beside it) and one short
# line naming the record; the full details are in the panel above. The panel's frosted glass in the light;
# the night scene's dark version is in v3-night.css. Orders take their status colour (.is-ok / .is-pending).
--------------------------------------------------------------*/
.notif-toast {
    --toast-accent: #304f7f;
    --toast-accent-bg: rgba(48, 79, 127, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px 8px 10px;
    border: 1px solid rgba(48, 79, 127, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(12, 7, 74, 0.16);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    width: 320px; /* within the slot's max-width */
    color: #333;
    line-height: 1.3;
}

    .notif-toast.is-ok {
        --toast-accent: #1e7a46;
        --toast-accent-bg: rgba(30, 122, 70, 0.12);
    }

    .notif-toast.is-pending {
        --toast-accent: #a86a00;
        --toast-accent-bg: rgba(247, 184, 1, 0.18);
    }

    .notif-toast.is-link {
        cursor: pointer;
    }

        .notif-toast.is-link:hover {
            border-color: rgba(48, 79, 127, 0.3);
        }

.notif-toast-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--toast-accent-bg);
    color: var(--toast-accent);
    font-size: 15px;
}

.notif-toast-text {
    flex: 1 1 auto;
    min-width: 0;
}

.notif-toast-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2b40;
}

    .notif-toast-title > span:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.notif-toast-status {
    flex: none;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--toast-accent-bg);
    color: var(--toast-accent);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.6;
}

.notif-toast-sub {
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #5a6678;
}

.notif-toast-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #8090a6;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

    .notif-toast-close:hover,
    .notif-toast-close:focus-visible {
        background: rgba(48, 79, 127, 0.1);
        color: #304f7f;
    }
