/* 🔔 NotificationBell — reuse RADIM tokens */

#notification-slot {
    position: relative;
    display: inline-flex;
    margin-right: 8px;
}

.nb-bell {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 8px 10px;
    border-radius: 12px;
    position: relative;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
}
.nb-bell:hover { background: rgba(255, 255, 255, 0.1); }
.nb-bell:focus { outline: 2px solid var(--radim-primary, var(--radim-primary)); outline-offset: 2px; }

.nb-icon { line-height: 1; }

.nb-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(229, 62, 62, 0.4);
}

@keyframes nb-flash-anim {
    0%, 100% { transform: rotate(0); }
    10%, 30%, 50%, 70% { transform: rotate(-14deg); }
    20%, 40%, 60%, 80% { transform: rotate(14deg); }
}
.nb-bell.nb-flash { animation: nb-flash-anim 1.2s ease-in-out; }

/* v10.58: escape the topbar's overflow:hidden by pinning to viewport.
   Position is calibrated to land just below the topbar (~72-76px tall). */
.nb-panel {
    position: fixed;
    top: 72px;
    right: 16px;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 100px);
    background: var(--radim-surface, #fff);
    border-radius: var(--radim-radius-xl, 16px);
    border: 1px solid var(--radim-border, #e2e8f0);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9500;                 /* above sidebar (lower) + below modals */
    color: var(--radim-text, #2d3748);
    transform-origin: top right;
}

.nb-panel.nb-open {
    display: flex;
    animation: nb-panel-in 180ms var(--radim-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

@keyframes nb-panel-in {
    from { opacity: 0; transform: scale(0.96) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Backdrop — dim page slightly on open, catches outside-click */
.nb-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9400;
    display: none;
}
.nb-backdrop.nb-open { display: block; }

.nb-header {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fafc;
}

.nb-header strong {
    font-size: 1rem;
    color: #2d3748;
}

.nb-link {
    background: transparent;
    border: none;
    color: var(--radim-primary, var(--radim-primary));
    cursor: pointer;
    font-size: 0.88rem;
    padding: 4px 8px;
    border-radius: 8px;
}
.nb-link:hover { background: color-mix(in srgb, var(--radim-primary) 10%, transparent); }

.nb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.nb-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #edf2f7;
    cursor: pointer;
    transition: background 0.14s;
}
.nb-item:last-child { border-bottom: 0; }
.nb-item:hover { background: #f7fafc; }

.nb-item.nb-unread {
    background: color-mix(in srgb, var(--radim-primary) 6%, transparent);
    border-left: 3px solid var(--radim-primary, var(--radim-primary));
}
.nb-item.nb-read { opacity: 0.85; }

.nb-item.nb-sev-crisis {
    background: rgba(229, 62, 62, 0.08);
    border-left-color: #e53e3e;
}
.nb-item.nb-sev-alert {
    background: rgba(236, 201, 75, 0.1);
    border-left-color: #ecc94b;
}
.nb-item.nb-sev-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: #f59e0b;
}

.nb-ico { font-size: 1.6rem; flex-shrink: 0; line-height: 1.2; }

.nb-body { flex: 1; min-width: 0; }
.nb-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
    line-height: 1.35;
}
.nb-sub {
    color: #4a5568;
    font-size: 0.88rem;
    margin-top: 2px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.nb-meta {
    color: #a0aec0;
    font-size: 0.78rem;
    margin-top: 4px;
}

/* v10.40: SOS Ack actions */
.nb-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.nb-action-ack,
.nb-action-resolve {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: #2d3748;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.nb-action-ack {
    background: #48bb78;
    color: #fff;
    border-color: #48bb78;
}
.nb-action-ack:hover {
    background: #38a169;
    border-color: #38a169;
}
.nb-action-resolve:hover {
    border-color: #718096;
    background: #f7fafc;
}

.nb-empty {
    padding: 28px 16px;
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.55;
}
.nb-empty small {
    display: block;
    margin-top: 8px;
    color: #a0aec0;
    font-size: 0.82rem;
}

.nb-footer {
    padding: 8px 12px;
    border-top: 1px solid #edf2f7;
    text-align: right;
    background: #f7fafc;
}

@media (max-width: 640px) {
    .nb-panel {
        position: fixed;
        top: 64px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
    }
}

/* ═════════════════════════════════════════════════════════════════
   Sprint B — DND + filters + per-type settings
   ═════════════════════════════════════════════════════════════════ */

.nb-dnd-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ED8936;
    border: 2px solid #fff;
    box-shadow: 0 0 0 0 rgba(237, 137, 54, 0.6);
    animation: nbDndPulse 2s ease-in-out infinite;
}

@keyframes nbDndPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(237, 137, 54, 0.6); }
    50%      { box-shadow: 0 0 0 5px rgba(237, 137, 54, 0); }
}

.nb-bell-dnd { filter: grayscale(0.15); }

.nb-dnd-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(90deg, #ED8936, #f6ad55);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
}

.nb-dnd-banner .nb-link {
    color: #fff;
    text-decoration: underline;
    margin-left: auto;
    font-weight: 600;
}

.nb-dnd-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid #edf2f7;
    flex-wrap: wrap;
    background: #fafbfc;
}

.nb-dnd-label {
    font-size: 0.82rem;
    color: #4a5568;
    font-weight: 600;
    margin-right: 4px;
}

.nb-dnd-btn {
    padding: 6px 12px;
    background: #fff;
    color: #4a5568;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    min-height: 32px;
}

.nb-dnd-btn:hover {
    border-color: #ED8936;
    background: color-mix(in srgb, #ED8936 8%, #fff);
}

.nb-dnd-active {
    background: #ED8936;
    color: #fff;
    border-color: #c2410c;
}

.nb-settings-btn {
    margin-left: auto;
    font-size: 1rem;
}

.nb-filters {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-bottom: 1px solid #edf2f7;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #fafbfc;
}

.nb-filters::-webkit-scrollbar { display: none; }

.nb-filter-tab {
    flex: 0 0 auto;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    white-space: nowrap;
    min-height: 32px;
    transition: background 0.15s, color 0.15s;
}

.nb-filter-tab:hover { color: #2d3748; background: color-mix(in srgb, var(--radim-primary) 10%, transparent); }

.nb-filter-active {
    background: #fff;
    color: var(--radim-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.nb-filter-tab:focus-visible,
.nb-dnd-btn:focus-visible {
    outline: 2px solid var(--radim-primary);
    outline-offset: 2px;
}

.nb-settings-panel {
    padding: 12px;
    border-bottom: 1px solid #edf2f7;
    background: #f8fafa;
}

.nb-settings-panel h4 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #2d3748;
}

.nb-type-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.9rem;
    color: #2d3748;
    cursor: pointer;
}

.nb-type-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--radim-primary);
    cursor: pointer;
}

.nb-type-row small {
    margin-left: auto;
    font-size: 0.72rem;
    color: #a0aec0;
}

.nb-type-locked { opacity: 0.75; cursor: not-allowed; }
.nb-type-locked input { cursor: not-allowed; }

.nb-settings-panel .nb-link {
    margin-top: 10px;
    display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
    .nb-dnd-dot { animation: none; }
}
