/* =========================================================
   Notifications — Bell + Dropdown
   ========================================================= */

/* ---------- Bell button ---------- */
.topbar-bell {
    position: relative;
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    color: var(--c-text-soft);
    background: none; border: none; cursor: pointer;
    transition: all var(--t-fast);
}
.topbar-bell:hover {
    background: var(--c-primary-50);
    color: var(--c-primary-600);
}
.topbar-bell i { font-size: 16px; }

.notif-topbar-badge {
    position: absolute;
    top: 2px; left: 2px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--c-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center; justify-content: center;
    border: 2px solid var(--c-surface);
    animation: notifPulse 2s infinite;
}
@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

/* ---------- Dropdown ---------- */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 380px;
    max-width: calc(100vw - 24px);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    animation: notifDropIn .2s ease;
    overflow: hidden;
}
.notif-dropdown[hidden] { display: none; }
@keyframes notifDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notif-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
}
.notif-head h4 {
    margin: 0; font-size: var(--fs-md); font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px;
}
.notif-head h4 i { color: var(--c-primary-600); font-size: 13px; }
.notif-head button {
    background: none; border: none; cursor: pointer;
    font-size: var(--fs-xs); color: var(--c-primary-600);
    font-family: inherit; padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--t-fast);
}
.notif-head button:hover { background: var(--c-primary-50); }

.notif-list {
    list-style: none; padding: 0; margin: 0;
    max-height: 420px; overflow-y: auto;
}

.notif-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-border-soft);
    cursor: pointer;
    transition: background var(--t-fast);
}
.notif-item:hover { background: var(--c-surface-2); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(61,95,143,.04); }
.notif-item.unread::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 3px;
    background: var(--c-primary-600);
}

.notif-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    background: var(--c-primary-50);
    color: var(--c-primary-600);
    display: grid; place-items: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-body { flex: 1; min-width: 0; }
.notif-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 3px;
    line-height: 1.5;
    word-break: break-word;
}
.notif-message {
    font-size: var(--fs-xs);
    color: var(--c-text-soft);
    line-height: 1.6;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-time {
    font-size: 10px;
    color: var(--c-text-muted);
}

.notif-delete {
    position: absolute;
    top: 8px; left: 8px;
    width: 22px; height: 22px;
    border-radius: var(--radius-sm);
    display: grid; place-items: center;
    background: transparent;
    border: none; cursor: pointer;
    color: var(--c-text-muted);
    font-size: 10px;
    opacity: 0;
    transition: all var(--t-fast);
}
.notif-item:hover .notif-delete { opacity: 1; }
.notif-delete:hover {
    background: rgba(194,90,84,.10);
    color: var(--c-danger);
}

.notif-loading,
.notif-empty,
.notif-error {
    text-align: center;
    padding: 30px 16px;
    font-size: var(--fs-sm);
    color: var(--c-text-muted);
}
.notif-loading i { margin-left: 6px; }
.notif-empty i {
    display: block;
    font-size: 30px;
    color: var(--c-border);
    margin-bottom: 8px;
}

.notif-foot {
    padding: 10px 16px;
    border-top: 1px solid var(--c-border);
    text-align: center;
    background: var(--c-surface-2);
}
.notif-foot a {
    font-size: var(--fs-sm);
    color: var(--c-primary-600);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.notif-foot a:hover { text-decoration: underline; }

/* ---------- Mobile ---------- */
@media (max-width: 500px) {
    .notif-dropdown {
        position: fixed;
        top: 60px;
        left: 8px; right: 8px;
        width: auto;
    }
}