.notification-wrapper {
    position: relative;
    display: inline-block;
}

.notification-icon {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

.notification-icon:hover .notification-badge {
    background: #fff;
    color: #e11d48;
}

.notification-menu {
    --nm-charcoal: #1e1e1e;
    --nm-ink: #2e2e2e;
    --nm-muted: #6c757d;
    --nm-primary: #1482FA;
    --nm-line: #e6e6e6;
    --nm-ease: cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    width: 420px;
    max-width: calc(100vw - 24px);
    padding: 0 0 12px;
    border-radius: 22px;
    background: #fff;
    box-shadow:
        5px 20px 50px -19px rgba(30, 30, 30, 0.9),
        inset 0 0 0 1px rgba(230, 230, 230, 0.9);
    z-index: 1000;
    transform-origin: top right;
    animation: nm-in 0.22s var(--nm-ease) both;
}

.notification-menu[hidden] {
    display: none;
}

.notification-menu-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px 18px;
}

.notification-menu-title {
    margin: 0;
    line-height: 1.2;
    color: #1482fa;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.notification-mark-all {
    flex: 0 0 auto;
    margin: -4px -6px 0 0;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--nm-primary);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
    text-align: right;
    cursor: pointer;
    transition: background 0.2s var(--nm-ease), color 0.2s var(--nm-ease), transform 0.15s var(--nm-ease);
}

.notification-mark-all:hover {
    background: rgba(20, 130, 250, 0.08);
}

.notification-mark-all:active {
    transform: scale(0.98);
}

.notification-mark-all:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 130, 250, 0.22);
}

.notification-mark-all:disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.notification-mark-all[hidden] {
    display: none !important;
}

.notification-menu-list {
    max-height: min(68vh, 440px);
    overflow-y: auto;
    padding: 0 6px;
}

.notification-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--nm-ink);
    text-align: left;
    cursor: pointer;
    animation: nm-row-in 0.3s var(--nm-ease) both;
    animation-delay: calc(var(--nm-index, 0) * 28ms);
    transition: background 0.2s var(--nm-ease), transform 0.15s var(--nm-ease);
}

.notification-row + .notification-row {
    margin-top: 1px;
}

.notification-row:hover {
    background: #f7f9fc;
}

.notification-row:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 130, 250, 0.22);
}

.notification-row:active {
    transform: scale(0.992);
}

.notification-row.is-unread {
    background: rgba(20, 130, 250, 0.045);
}

.notification-row.is-unread:hover {
    background: rgba(20, 130, 250, 0.08);
}

.notification-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 1px;
    border-radius: 50%;
    background: rgba(20, 130, 250, 0.12);
    color: #1464c7;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(20, 130, 250, 0.08);
}

.notification-row.is-unread .notification-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nm-primary);
    box-shadow: 0 0 0 2px #fff;
}

.notification-row-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.notification-row-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    color: var(--nm-muted);
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
}

.notification-row-person {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 16rem;
    color: var(--nm-charcoal);
    font-weight: 600;
}

.notification-row-sep {
    opacity: 0.55;
}

.notification-object {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    min-height: 22px;
    padding: 0 8px 0 7px;
    border-radius: 999px;
    background: #f4f6fb;
    box-shadow: inset 0 0 0 1px rgba(230, 230, 230, 0.95);
    color: var(--nm-ink);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

.notification-object > i {
    flex: 0 0 auto;
    font-size: 11px;
}

.notification-object-id {
    flex: 0 0 auto;
    color: var(--nm-muted);
}

.notification-object-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--nm-charcoal);
}

.notification-object.is-gone {
    opacity: 0.78;
}

.notification-row-message {
    color: var(--nm-muted);
    font-size: 12px;
    line-height: 1.4;
}

.notification-menu-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 10px 4px;
    padding: 22px 16px;
    border-radius: 16px;
    background: #f7f9fc;
    text-align: center;
}

.notification-menu-empty-title {
    color: var(--nm-charcoal);
    font-size: 14px;
    font-weight: 600;
}

.notification-menu-empty-text {
    color: var(--nm-muted);
    font-size: 12px;
    line-height: 1.4;
}

.notification-menu-footer {
    margin-top: 8px;
    padding: 10px 16px 4px;
    border-top: 1px solid var(--nm-line);
}

.notification-history-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f4f6fb;
    color: var(--nm-ink);
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s var(--nm-ease), color 0.2s var(--nm-ease), transform 0.15s var(--nm-ease);
}

.notification-history-link:hover {
    background: #e8eef8;
    color: var(--nm-charcoal);
}

.notification-history-link:active {
    transform: scale(0.98);
}

.notification-history-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 130, 250, 0.22);
}

@keyframes nm-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes nm-row-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.nh-page {
    --nh-bg: #f4f6fb;
    --nh-surface: #ffffff;
    --nh-line: #e6e6e6;
    --nh-ink: #2e2e2e;
    --nh-charcoal: #1e1e1e;
    --nh-muted: #6c757d;
    --nh-primary: #1482FA;
    --nh-ease: cubic-bezier(0.16, 1, 0.3, 1);
    padding: 8px 0 48px;
}

.nh-page-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 20px;
}

.nh-kicker {
    margin: 0;
    color: var(--nh-primary);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nh-title {
    margin: 0;
    padding: 0;
    color: var(--nh-charcoal);
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.nh-status {
    margin: 0;
    color: var(--nh-muted);
    font-size: 14px;
}

.nh-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    align-items: stretch;
    border-radius: 22px;
    background: var(--nh-surface);
    box-shadow:
        0 28px 64px -28px rgba(30, 30, 30, 0.28),
        inset 0 0 0 1px rgba(230, 230, 230, 0.9);
}

.nh-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px 22px 0;
    border-radius: 22px 0 0 22px;
    background: #fff;
}

.nh-list {
    display: flex;
    flex-direction: column;
    margin: 0 -4px;
    padding: 0 0 8px;
    list-style: none;
}

.nh-item-wrap {
    animation: nh-item-in 0.35s var(--nh-ease) both;
    animation-delay: calc(var(--nh-index, 0) * 30ms);
}

.nh-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.2s var(--nh-ease), transform 0.15s var(--nh-ease);
}

.nh-item + .nh-item,
.nh-item-wrap + .nh-item-wrap {
    margin-top: 2px;
}

.nh-item:hover {
    background: #f7f9fc;
}

.nh-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 130, 250, 0.22);
}

.nh-item:active {
    transform: scale(0.992);
}

.nh-item.is-unread {
    background: rgba(20, 130, 250, 0.045);
}

.nh-item.is-unread:hover {
    background: rgba(20, 130, 250, 0.08);
}

.nh-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: 1px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(55, 48, 163, 0.08);
}

.nh-item.is-unread .nh-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--nh-primary);
    box-shadow: 0 0 0 2px #fff;
}

.nh-item-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.nh-item-head {
    display: flex;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}

.nh-item-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    color: var(--nh-muted);
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
}

.nh-item-actor {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
    color: var(--nh-charcoal);
    font-weight: 600;
}

.nh-item-sep {
    opacity: 0.55;
}

.nh-object-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: min(100%, 28rem);
    min-height: 24px;
    padding: 0 10px 0 8px;
    border-radius: 999px;
    background: #f4f6fb;
    box-shadow: inset 0 0 0 1px rgba(230, 230, 230, 0.95);
    color: var(--nh-ink);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

.nh-object-chip > i {
    flex: 0 0 auto;
    font-size: 11px;
}

.nh-object-chip-id {
    flex: 0 0 auto;
    color: var(--nh-muted);
}

.nh-object-chip-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--nh-charcoal);
}

.nh-object-chip.is-gone {
    opacity: 0.78;
}

.nh-item-message {
    color: var(--nh-muted);
    font-size: 12px;
    line-height: 1.45;
}

.nh-unread-label {
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(20, 130, 250, 0.1);
    color: var(--nh-primary);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.nh-empty {
    margin: 28px 8px;
    padding: 28px 20px;
    border-radius: 16px;
    background: #f7f9fc;
    color: var(--nh-muted);
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
}

.nh-footer {
    flex: 0 0 auto;
    padding: 14px 0 16px;
    border-top: 1px solid var(--nh-line);
}

.nh-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nh-pager-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.nh-pager-nav,
.nh-pager-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: #f4f6fb;
    color: var(--nh-ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s var(--nh-ease), color 0.2s var(--nh-ease), transform 0.15s var(--nh-ease);
}

.nh-pager-nav:hover,
.nh-pager-page:hover {
    background: #e8eef8;
    color: var(--nh-charcoal);
}

.nh-pager-nav:active,
.nh-pager-page:active {
    transform: scale(0.98);
}

.nh-pager-nav:focus-visible,
.nh-pager-page:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 130, 250, 0.22);
}

.nh-pager-nav.is-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.nh-pager-page.is-current {
    background: var(--nh-charcoal);
    color: #fff;
    cursor: default;
}

.nh-pager-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: var(--nh-muted);
    font-size: 13px;
    user-select: none;
}

.nh-filters {
    border-left: 1px solid rgba(230, 230, 230, 0.95);
    border-radius: 0 22px 22px 0;
    background:
        linear-gradient(180deg, rgba(20, 130, 250, 0.04) 0%, transparent 120px),
        #f5f7fb;
}

.nh-filters-sticky {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 32px);
}

.nh-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 16px 12px;
}

.nh-filters-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nh-filters-title {
    margin: 0;
    color: var(--nh-charcoal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nh-filters-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--nh-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.nh-filters-count[hidden] {
    display: none !important;
}

.nh-filters-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(20, 130, 250, 0.1);
    color: var(--nh-primary);
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    min-height: 28px;
    padding: 0 12px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s var(--nh-ease), color 0.2s var(--nh-ease), transform 0.15s var(--nh-ease);
}

.nh-filters-reset:hover {
    background: var(--nh-primary);
    color: #fff;
}

.nh-filters-reset:active {
    transform: scale(0.98);
}

.nh-filters-reset[hidden] {
    display: none !important;
}

.nh-filters-scroll {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 14px 18px;
}

.nh-filters-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nh-filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow:
        inset 0 0 0 1px rgba(230, 230, 230, 0.95),
        0 10px 24px -20px rgba(30, 30, 30, 0.28);
    animation: nh-filter-in 0.35s var(--nh-ease) both;
}

.nh-filter-group:nth-child(1) { animation-delay: 40ms; }
.nh-filter-group:nth-child(2) { animation-delay: 80ms; }
.nh-filter-group:nth-child(3) { animation-delay: 120ms; }
.nh-filter-group:nth-child(4) { animation-delay: 160ms; }
.nh-filter-group:nth-child(5) { animation-delay: 200ms; }

.nh-filter-group-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--nh-charcoal);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.nh-filter-group-title > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: rgba(20, 130, 250, 0.1);
    color: var(--nh-primary);
    font-size: 10px;
}

.nh-filter-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nh-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.nh-field-label {
    color: var(--nh-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.nh-select {
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: #f4f6fb;
    color: var(--nh-ink);
    font-size: 13px;
    box-shadow: inset 0 0 0 1px transparent;
    outline: none;
    transition: background 0.2s var(--nh-ease), box-shadow 0.2s var(--nh-ease);
}

.nh-select:hover {
    background: #eef2f8;
}

.nh-select:focus {
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(20, 130, 250, 0.45), 0 0 0 3px rgba(20, 130, 250, 0.14);
}

.nh-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nh-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: #f4f6fb;
    color: var(--nh-ink);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s var(--nh-ease), color 0.2s var(--nh-ease), transform 0.15s var(--nh-ease);
}

.nh-chip:hover {
    background: #e8eef8;
}

.nh-chip:active {
    transform: scale(0.98);
}

.nh-chip.is-active {
    background: var(--nh-charcoal);
    color: #fff;
}

.nh-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 130, 250, 0.22);
}

.nh-chip[hidden] {
    display: none !important;
}

.nh-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    background: var(--nh-charcoal);
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.nh-page.is-ready .nh-apply {
    display: none;
}

@keyframes nh-item-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes nh-filter-in {
    from {
        opacity: 0;
        transform: translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nh-item,
    .nh-chip,
    .nh-filters-reset,
    .nh-pager-nav,
    .nh-pager-page,
    .nh-select {
        transition: none;
    }

    .nh-item-wrap,
    .nh-filter-group {
        animation: none;
    }

    .nh-item:active,
    .nh-chip:active,
    .nh-filters-reset:active,
    .nh-pager-nav:active,
    .nh-pager-page:active {
        transform: none;
    }
}

@media (max-width: 960px) {
    .nh-shell {
        grid-template-columns: 1fr;
    }

    .nh-main {
        border-radius: 0 0 22px 22px;
    }

    .nh-filters {
        border-left: 0;
        border-bottom: 1px solid var(--nh-line);
        border-radius: 22px 22px 0 0;
        order: -1;
    }

    .nh-filters-sticky {
        position: static;
        max-height: none;
    }

    .nh-filter-fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .nh-item-head {
        flex-wrap: wrap;
        row-gap: 6px;
    }
}

@media (max-width: 560px) {
    .nh-page {
        padding: 4px 0 32px;
    }

    .nh-page-header {
        margin-bottom: 16px;
    }

    .nh-shell {
        border-radius: 18px;
    }

    .nh-main {
        padding: 14px 14px 0;
    }

    .nh-title {
        font-size: 24px;
    }

    .nh-filter-fields {
        grid-template-columns: 1fr;
    }

    .nh-pager {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notification-menu,
    .notification-row {
        animation: none;
    }

    .notification-mark-all,
    .notification-history-link,
    .notification-row {
        transition: none;
    }

    .notification-mark-all:active,
    .notification-history-link:active,
    .notification-row:active {
        transform: none;
    }
}

@media (max-width: 768px) {
    .notification-menu {
        right: -40px;
        width: min(400px, calc(100vw - 24px));
    }

    .notification-menu-head {
        flex-wrap: wrap;
        align-items: center;
    }

    .notification-mark-all {
        margin: 0;
        min-height: 44px;
        padding: 12px 0;
        text-align: left;
    }
}
