/* ============================================================================
   NOTIFICATION BADGES & PANEL
   ============================================================================ */

/* ── Badge circle — positioned at top-right of user menu toggle ── */
.spa-user-menu-toggle {
    position: relative !important;
    overflow: visible !important;
}
.spa-user-menu {
    overflow: visible !important;
}
.notif-badge {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 16px;
    text-align: center;
    z-index: 10;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    border: 1px solid #fff;
    box-sizing: content-box;
}
.notif-badge--red {
    background: var(--danger, #EF4444);
}
.notif-badge--green {
    background: var(--success, #22c55e);
}

/* Pulse animation */
@keyframes notifPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.notif-pulse {
    animation: notifPulse 0.4s ease;
}

/* ── Dropdown panel ── */
.notif-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-height: 420px;
    background: rgba(20, 22, 28, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 2px solid rgba(120, 120, 120, 0.30);
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-hover, 0 8px 20px rgba(0,0,0,0.50));
    z-index: 10001;
    overflow: hidden;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-family: var(--font, 'Inter', sans-serif);
}
.notif-panel--open {
    display: block;
    transform: translateY(4px);
    opacity: 1;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, rgba(160,160,160,0.25));
    background: rgba(60, 60, 60, 0.20);
}
.notif-panel-header span {
    font-weight: 600;
    font-size: var(--text-sm, 13px);
    color: var(--text-primary, #e6e6e6);
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--accent, #00d97e);
    font-size: var(--text-xs, 12px);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm, 8px);
    transition: background 0.2s;
    font-family: inherit;
}
.notif-mark-all:hover {
    background: var(--accent-glow, rgba(0,217,126,0.15));
}

.notif-panel-list {
    overflow-y: auto;
    max-height: 360px;
}

/* ── Notification item ── */
.notif-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted, #808080);
    border-bottom: 1px solid rgba(120, 120, 120, 0.12);
    transition: background 0.15s;
    cursor: pointer;
    position: relative;
}
.notif-item:hover {
    background: rgba(255,255,255,0.04);
}
.notif-item--unread {
    background: rgba(0,217,126,0.03);
    color: var(--text-primary, #e6e6e6);
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: var(--text-sm, 13px);
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 2px;
    color: inherit;
}

.notif-item-time {
    font-size: var(--text-xs, 12px);
    color: var(--text-muted, #808080);
}

/* Severity dot (right side) */
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.notif-dot--error   { background: var(--danger, #EF4444); }
.notif-dot--warning { background: var(--warning, #F59E0B); }
.notif-dot--success { background: var(--success, #22c55e); }
.notif-dot--info    { background: var(--blue, #3B82F6); }

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted, #808080);
    font-size: var(--text-sm, 13px);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .notif-badge {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
        padding: 0 4px;
        top: -4px;
        right: -6px;
    }
    .notif-panel {
        width: 100vw;
        right: -16px;
        border-radius: 0 0 var(--radius-md, 12px) var(--radius-md, 12px);
    }
}
