.notif-bell-wrap {
    position: relative;
    z-index: 201;
}

.notif-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    color: var(--text-2);
    transition: color var(--duration, 0.15s) ease, border-color var(--duration, 0.15s) ease, background var(--duration, 0.15s) ease;
}

.notif-bell-btn:hover,
.notif-bell-btn[aria-expanded="true"] {
    color: var(--text-0);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.04);
}

.notif-bell-btn svg {
    width: 18px;
    height: 18px;
}

.notif-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 2px solid var(--bg-0);
    box-sizing: border-box;
}

.notif-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(5, 5, 6, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: notifFade 0.2s ease;
}

@keyframes notifFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(300px, calc(100vw - 32px));
    max-height: min(360px, 70dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(165deg, rgba(28, 30, 36, 0.98) 0%, rgba(18, 19, 24, 0.99) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 20px 48px rgba(0, 0, 0, 0.5);
    z-index: 200;
    animation: notifPop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notifPop {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.notif-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 10px;
    flex-shrink: 0;
}

.notif-panel-title {
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text-0);
}

.notif-mark-all {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    font-family: var(--font);
    transition: color var(--duration, 0.15s) ease;
}

.notif-mark-all:hover {
    color: var(--accent);
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
    -webkit-overflow-scrolling: touch;
}

.notif-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
    margin: 0;
}

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--duration, 0.15s) ease, border-color var(--duration, 0.15s) ease;
}

.notif-item-main {
    flex: 1;
    min-width: 0;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.notif-item.unread {
    background: rgba(62, 255, 160, 0.05);
    border-color: rgba(62, 255, 160, 0.12);
}

.notif-item-icon {
    grid-row: 1 / span 2;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-item-icon--security {
    background: rgba(255, 180, 60, 0.12);
    color: #f5b84a;
    box-shadow: inset 0 0 0 1px rgba(255, 180, 60, 0.18);
}

.notif-item-icon--default {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
}

.notif-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-0);
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-4);
    font-variant-numeric: tabular-nums;
}

.notif-item-summary {
    font-size: 12px;
    color: var(--text-3);
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-item-meta {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin: 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-action {
    flex-shrink: 0;
    align-self: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    opacity: 0;
    transition: opacity var(--duration, 0.15s) ease;
}

.notif-item:hover .notif-item-action,
.notif-item.unread .notif-item-action {
    opacity: 1;
}

[data-theme="light"] .notif-panel {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.99) 100%);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .notif-item.unread {
    background: rgba(22, 163, 74, 0.06);
    border-color: rgba(22, 163, 74, 0.15);
}
