/* =====================================================================
   Notifications panel (PostHog-style)
   Ships with the CH.BowlingCRM.UI.Framework library; consumers link it
   via _content/CH.BowlingCRM.UI.Framework/css/notifications.css and
   supply the `--bo-*` theme tokens.

   Flat surface, hairline borders, compact typography — matches the
   BackOffice sidebar / workspace-switcher popovers.
   ===================================================================== */

/* MudMenu wraps ChildContent in a MudList inside the popover; zero its
   padding so the panel controls its own spacing. */
.bo-notif-popover .mud-list {
    padding: 0;
}

/* --- Unread-count badge ---------------------------------------------- */
/* MudBadge defaults to a 20px pill (pointer-events:auto) that swamps the
   Size.Small bell and steals its clicks. Shrink it and let clicks pass
   through to the button underneath. */
.bo-notif .mud-badge {
    height: 15px;
    min-width: 15px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 15px;
    pointer-events: none;
}

/* Nudge the overlapped badge out toward the corner so it stops covering
   the icon's centre (default overlap offset is tuned for the 20px pill). */
.bo-notif .mud-badge-top.right.mud-badge-overlap {
    inset: auto auto calc(100% - 8px) calc(100% - 8px);
}

.bo-notif-popover {
    border: 1px solid var(--bo-border-strong);
    border-radius: var(--bo-radius-lg);
    background-color: var(--bo-surface-solid);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    overflow: hidden;
}

.bo-notif-panel {
    width: 340px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
}

/* --- Header ---------------------------------------------------------- */
.bo-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bo-border);
    background-color: var(--bo-surface-muted);
}

.bo-notif-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bo-text-muted);
}

.bo-notif-markall {
    border: none;
    background: transparent;
    padding: 2px 6px;
    border-radius: var(--bo-radius);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bo-primary);
    cursor: pointer;
    transition: background-color 0.12s ease;
}

    .bo-notif-markall:hover {
        background-color: var(--bo-primary-soft);
    }

/* --- Empty state ------------------------------------------------------ */
.bo-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 16px;
    color: var(--bo-text-muted);
    font-size: 0.85rem;
}

    .bo-notif-empty .bo-notif-empty-icon {
        font-size: 2rem;
        opacity: 0.5;
    }

/* --- List ------------------------------------------------------------- */
.bo-notif-list {
    max-height: 420px;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bo-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--bo-radius);
    transition: background-color 0.12s ease;
}

    .bo-notif-item:hover {
        background-color: var(--bo-surface-muted);
    }

    .bo-notif-item.unread {
        background-color: var(--bo-primary-soft);
    }

.bo-notif-item-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bo-notif-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.bo-notif-item-title {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bo-text);
}

.bo-notif-item-time {
    flex: 0 0 auto;
    font-size: 0.7rem;
    color: var(--bo-text-muted);
}

.bo-notif-item-desc {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--bo-text-muted);
    overflow-wrap: anywhere;
}

/* Unread marker — a small clickable dot that marks the item read. */
.bo-notif-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--bo-primary);
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

    .bo-notif-dot:hover {
        transform: scale(1.4);
        background-color: var(--bo-primary-hover);
    }
