/* ============================================================
   NOTIFICATIONS.CSS  —  v2
   Copre TUTTE le sezioni relative alle notifiche:
     1. Campanella (dropdown nel TopNav)
     2. Pagina Inbox  (/tables/notification-inbox)
     3. Pagina Permessi  (/tables/notification-permissions)
     4. Pagina Tracking  (/tables/notification-tracking)

   Tema: tablemanagerv2.css
     Primary     #153d77
     Radius      12px card / 8px btn
     Shadow      0 2px 8px rgba(0,0,0,.08)
     Hover       0 4px 14px rgba(21,61,119,.14)
     Transition  all 0.3s ease
   ============================================================ */

/* ── CSS custom properties ───────────────────────────────────── */
:root {
    --nm-primary:      #153d77;
    --nm-primary-lt:   #e8f0fe;
    --nm-success:      #22c55e;
    --nm-warning:      #f59e0b;
    --nm-danger:       #dc3545;
    --nm-muted:        #6c757d;
    --nm-bg:           #f8f9fa;
    --nm-card:         #ffffff;
    --nm-border:       #e2e8f2;
    --nm-radius:       12px;
    --nm-radius-sm:    8px;
    --nm-shadow:       0 2px 8px rgba(0,0,0,.08);
    --nm-shadow-h:     0 4px 14px rgba(21,61,119,.14);
    --nm-transition:   all 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════
   1.  CAMPANELLA — notification dropdown nel top-nav
   ══════════════════════════════════════════════════════════════ */

/* Badge rosso sul click della campanella */
.indicator {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--nm-danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

/* Backdrop click-outside */
.notification-center-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1039;
    background: transparent;
    border: none;
    cursor: default;
}

/* Pannello dropdown */
.notification-center-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 360px;
    max-width: calc(100vw - 20px);
    background: var(--nm-card);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: 0 8px 32px rgba(21,61,119,.18);
    z-index: 1040;
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: nmSlideDown .18s ease forwards;
}
.notification-center-dropdown.show { display: flex; }

@keyframes nmSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header del pannello */
.notification-center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.1rem;
    background: var(--nm-primary);
    color: #fff;
    flex-shrink: 0;
}

.notification-center-title {
    font-size: .9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .45rem;
    letter-spacing: .01em;
}

.notification-center-badge {
    background: rgba(255,255,255,.2);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 1px 9px;
    min-width: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,.35);
}

/* Lista notifiche */
.notification-center-body {
    flex: 1;
    overflow-y: auto;
    max-height: 340px;
    scrollbar-width: thin;
    scrollbar-color: var(--nm-border) transparent;
}
.notification-center-body::-webkit-scrollbar { width: 4px; }
.notification-center-body::-webkit-scrollbar-track { background: transparent; }
.notification-center-body::-webkit-scrollbar-thumb { background: var(--nm-border); border-radius: 4px; }

/* Empty state nella campanella */
.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    gap: .6rem;
    color: #adb5bd;
}
.notification-empty i    { font-size: 2rem; opacity: .5; }
.notification-empty span { font-size: .82rem; font-weight: 500; }

/* Singolo item notifica */
.notification-center-item {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .8rem 1.1rem;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f4fa;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease;
}
.notification-center-item:last-child { border-bottom: none; }
.notification-center-item:hover { background: #f5f8fd; }

.notification-center-item.is-unread { background: #f7faff; border-left: 3px solid var(--nm-primary); }
.notification-center-item.is-unread:hover { background: #edf3ff; }
.notification-center-item.is-read   { opacity: .8; }

/* Icona sinistra */
.notification-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .88rem;
    flex-shrink: 0;
    background: var(--nm-primary-lt);
    color: var(--nm-primary);
}
.notification-icon.icon-success  { background: #d4edda; color: #155724; }
.notification-icon.icon-warning  { background: #fff3cd; color: #856404; }
.notification-icon.icon-danger   { background: #f8d7da; color: #721c24; }
.notification-icon.icon-info     { background: #cce5ff; color: #004085; }
.notification-icon.icon-primary  { background: var(--nm-primary-lt); color: var(--nm-primary); }

/* Contenuto testo */
.notification-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.notification-title {
    font-size: .82rem;
    font-weight: 600;
    color: #212529;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notification-center-item.is-unread .notification-title { color: var(--nm-primary); }

.notification-message {
    font-size: .77rem;
    color: var(--nm-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notification-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    margin-top: .1rem;
}
.notification-meta > span:first-child { font-size: .7rem; color: #adb5bd; }
.notification-action {
    font-size: .7rem;
    font-weight: 600;
    color: var(--nm-primary);
}

/* Footer campanella */
.notification-center-footer {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border-top: 1px solid var(--nm-border);
    background: #f8f9fa;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.notification-center-footer .btn {
    border-radius: var(--nm-radius-sm);
    font-size: .78rem;
    font-weight: 500;
    transition: var(--nm-transition);
}
.notification-center-footer .btn-primary {
    background: var(--nm-primary);
    border-color: var(--nm-primary);
}
.notification-center-footer .btn-primary:hover {
    background: #0f2d5e;
    box-shadow: 0 2px 8px rgba(21,61,119,.35);
}
.notification-center-footer .btn-outline-primary {
    color: var(--nm-primary);
    border-color: var(--nm-primary);
}
.notification-center-footer .btn-outline-primary:hover {
    background: var(--nm-primary-lt);
}

/* ══════════════════════════════════════════════════════════════
   2.  COMPONENTI CONDIVISI TRA LE TRE PAGINE
   ══════════════════════════════════════════════════════════════ */

/* Card filtri in cima alle pagine admin */
.notification-filters-card {
    border: none;
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
    background: var(--nm-card);
}

/* Label sopra i controlli */
.notification-label,
.tracking-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--nm-muted);
    display: block;
    margin-bottom: .3rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Delivery status pill */
.delivery-pill {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    font-size: .72rem;
    padding: 2px 9px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}
.delivery-pill.status-read      { background: #d4edda; color: #155724; }
.delivery-pill.status-delivered { background: #cce5ff; color: #004085; }
.delivery-pill.status-muted     { background: #e2e3e5; color: #383d41; }
.delivery-pill.status-pending   { background: #fff3cd; color: #856404; }

/* Channel chip */
.channel-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: .68rem;
    flex-shrink: 0;
}
.channel-chip.active   { background: var(--nm-primary); color: #fff; }
.channel-chip.inactive { background: #eef0f4; color: #c0c8d4; }

/* Role level chip */
.role-level-chip {
    display: inline-block;
    font-size: .68rem;
    background: var(--nm-primary-lt);
    color: var(--nm-primary);
    border-radius: 4px;
    padding: 1px 7px;
    font-weight: 700;
    letter-spacing: .05em;
    font-family: monospace;
}

/* Toggle switch */
.tm-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    margin: 0;
    vertical-align: middle;
}
.tm-switch input { opacity: 0; width: 0; height: 0; }
.tm-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e0;
    border-radius: 34px;
    transition: background .25s ease;
}
.tm-switch-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.tm-switch input:checked  + .tm-switch-slider         { background: var(--nm-primary); }
.tm-switch input:checked  + .tm-switch-slider::before { transform: translateX(18px); }
.tm-switch input:disabled + .tm-switch-slider         { opacity: .4; cursor: default; }

/* Save-count badge (inside buttons) */
.save-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.9);
    color: var(--nm-primary);
    border-radius: 20px;
    padding: 0 7px;
    font-size: .68rem;
    font-weight: 700;
    min-width: 1.2rem;
    line-height: 1.5;
    margin-left: .3rem;
}
.save-count-badge.bg-success { background: var(--nm-success); color: #fff; }

/* btn-xs helper */
.btn-xs {
    font-size: .75rem;
    padding: .22rem .7rem;
    border-radius: 6px;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════
   3.  PAGINA PERMESSI  /tables/notification-permissions
   ══════════════════════════════════════════════════════════════ */

/* State filter pill group */
.state-filter-group {
    display: flex;
    gap: .2rem;
    background: #f0f4fa;
    border-radius: var(--nm-radius-sm);
    padding: .25rem;
}
.state-btn {
    flex: 1;
    background: none;
    border: none;
    padding: .28rem .5rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--nm-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--nm-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    white-space: nowrap;
}
.state-btn:hover { background: rgba(255,255,255,.65); color: var(--nm-primary); }
.state-btn.active {
    background: #fff;
    color: var(--nm-primary);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(21,61,119,.12);
}
.state-btn.active.enabled  { color: #155724; }
.state-btn.active.disabled { color: #6c757d; }
.state-btn-count {
    background: #dde4ef;
    color: #4a6080;
    border-radius: 20px;
    padding: 0 6px;
    font-size: .68rem;
    font-weight: 700;
    min-width: 1.2rem;
    text-align: center;
}
.state-btn.active .state-btn-count { background: var(--nm-primary); color: #fff; }

/* KPI bar */
.np-kpi-bar {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid var(--nm-border);
}
.np-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    font-size: .78rem;
    background: var(--nm-primary-lt);
    color: var(--nm-primary);
    border-radius: 20px;
    padding: .22rem .85rem;
    font-weight: 500;
}
.np-kpi-chip strong  { font-weight: 700; }
.np-kpi-chip.success { background: #d4edda; color: #155724; }
.np-kpi-chip.info    { background: #cce5ff; color: #004085; }
.np-kpi-chip.email   { background: #e2d9f3; color: #4a1d8a; }

.np-bulk-actions {
    display: flex;
    gap: .4rem;
    align-items: center;
    margin-left: auto;
}
.np-last-save {
    font-size: .74rem;
    color: var(--nm-muted);
    white-space: nowrap;
}

/* Tabella permessi */
.notification-table-card {
    border: none;
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
    overflow: hidden;
}

.notification-role-table thead th {
    background: #f5f8fd;
    color: var(--nm-primary);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--nm-border);
    padding: .65rem 1rem;
    white-space: nowrap;
}
.notification-role-table .col-enabled,
.notification-role-table .col-channel { width: 90px; }
.notification-role-table .col-priority { width: 185px; }

.notification-role-table tbody tr {
    border-bottom: 1px solid #f0f4fa;
    transition: background .15s ease;
}
.notification-role-table tbody tr:last-child { border-bottom: none; }
.notification-role-table tbody tr:hover      { background: #f7faff; }
.notification-role-table tbody tr.row-dirty  { background: #fffbe6; border-left: 3px solid var(--nm-warning); }
.notification-role-table tbody tr.row-off    { opacity: .6; background: #fafafa; }
.notification-role-table td { padding: .6rem 1rem; }

.role-main-text { font-size: .88rem; font-weight: 600; color: #212529; }
.role-off-badge {
    display: inline-block;
    font-size: .64rem;
    background: #e2e3e5;
    color: #383d41;
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 600;
    margin-left: .3rem;
    vertical-align: middle;
}
.role-channels-summary {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .75rem;
    color: var(--nm-muted);
    margin-left: .3rem;
}

/* Priority segmented button */
.priority-btn-group {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--nm-border);
}
.priority-btn-group.disabled { opacity: .38; pointer-events: none; }

.priority-btn {
    background: #fff;
    border: none;
    border-right: 1px solid var(--nm-border);
    padding: .24rem .65rem;
    font-size: .72rem;
    font-weight: 500;
    color: var(--nm-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.priority-btn:last-child { border-right: none; }
.priority-btn:hover { background: var(--nm-primary-lt); color: var(--nm-primary); }

.priority-btn.low.active    { background: #d4edda; color: #155724; font-weight: 700; border-color: #c3e6cb; }
.priority-btn.medium.active { background: #fff3cd; color: #856404; font-weight: 700; border-color: #ffeeba; }
.priority-btn.high.active   { background: #f8d7da; color: #721c24; font-weight: 700; border-color: #f5c6cb; }

/* ══════════════════════════════════════════════════════════════
   4.  PAGINA TRACKING  /tables/notification-tracking
   ══════════════════════════════════════════════════════════════ */

/* KPI counters nella filter bar */
.tracking-kpi {
    background: var(--nm-card);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    padding: .55rem .9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--nm-shadow);
    transition: var(--nm-transition);
}
.tracking-kpi:hover { box-shadow: var(--nm-shadow-h); transform: translateY(-1px); }
.tracking-kpi span   { font-size: .68rem; color: var(--nm-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.tracking-kpi strong { font-size: 1.4rem; font-weight: 800; color: var(--nm-primary); line-height: 1; }
.tracking-kpi.success strong { color: #155724; }
.tracking-kpi.info    strong { color: #004085; }

/* Batch event card */
.batch-group-card {
    border: none;
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
    animation: nmFadeIn .25s ease forwards;
}
.batch-group-card:hover { box-shadow: var(--nm-shadow-h); transform: translateY(-1px); }

.batch-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1.1rem;
    background: #f5f8fd;
    border-bottom: 1px solid var(--nm-border);
    flex-wrap: wrap;
}
.batch-header-left  { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.batch-header-kpis  { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.batch-datetime {
    font-size: .82rem;
    font-weight: 600;
    color: var(--nm-primary);
    display: flex;
    align-items: center;
    gap: .3rem;
}
.batch-id-chip {
    font-size: .68rem;
    background: var(--nm-primary-lt);
    color: var(--nm-primary);
    border-radius: 4px;
    padding: 2px 7px;
    font-family: monospace;
    font-weight: 600;
}
.batch-title-chip { font-size: .8rem; color: #495057; font-style: italic; }

.batch-kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    font-size: .72rem;
    padding: 2px 9px;
    border-radius: 20px;
    font-weight: 600;
    background: var(--nm-primary-lt);
    color: var(--nm-primary);
}
.batch-kpi-chip.delivered { background: #cce5ff; color: #004085; }
.batch-kpi-chip.read      { background: #d4edda; color: #155724; }
.batch-kpi-chip.pending   { background: #fff3cd; color: #856404; }

/* Tabella destinatari dentro ogni batch */
.tracking-user-table thead th {
    background: #fff;
    color: var(--nm-primary);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--nm-border);
    padding: .5rem .9rem;
    white-space: nowrap;
}
.tracking-user-table tbody tr {
    border-bottom: 1px solid #f0f4fa;
    transition: background .12s ease;
}
.tracking-user-table tbody tr:last-child { border-bottom: none; }
.tracking-user-table tbody tr:hover { background: #f7faff; }
.tracking-user-table td { padding: .5rem .9rem; font-size: .83rem; }

.recipient-main-text { font-weight: 600; font-size: .85rem; color: #212529; }

.role-chip {
    display: inline-block;
    font-size: .67rem;
    background: var(--nm-primary-lt);
    color: var(--nm-primary);
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 700;
    letter-spacing: .04em;
}

/* ══════════════════════════════════════════════════════════════
   5.  PAGINA INBOX  /tables/notification-inbox  (ni-* prefix)
   ══════════════════════════════════════════════════════════════ */

/* Stat cards */
.ni-stat-card {
    background: var(--nm-card);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    box-shadow: var(--nm-shadow);
    transition: var(--nm-transition);
}
.ni-stat-card:hover { box-shadow: var(--nm-shadow-h); transform: translateY(-2px); }
.ni-stat-card.ni-stat-unread { border-color: #ffd9b3; background: #fffaf6; }

.ni-stat-icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.ni-icon-total     { background: var(--nm-primary-lt); color: var(--nm-primary); }
.ni-icon-unread    { background: #fff0e4; color: #c95000; }
.ni-icon-read      { background: #e4f7ec; color: #155724; }
.ni-icon-pending   { background: #fffbe4; color: #856404; }
.ni-icon-delivered { background: #cce5ff; color: #004085; }
.ni-icon-muted     { background: #f0f0f2; color: #888; }

.ni-stat-body  { display: flex; flex-direction: column; gap: .07rem; }
.ni-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--nm-primary); line-height: 1; }
.ni-stat-label { font-size: .67rem; font-weight: 600; color: #9aabbc; text-transform: uppercase; letter-spacing: .06em; }

/* Tab filter */
.ni-tab-bar {
    display: flex;
    gap: .3rem;
    background: #f0f4fa;
    border-radius: var(--nm-radius-sm);
    padding: .28rem;
    width: fit-content;
}
.ni-tab {
    background: none;
    border: none;
    padding: .36rem 1.1rem;
    font-size: .81rem;
    font-weight: 500;
    color: var(--nm-muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: var(--nm-transition);
    white-space: nowrap;
}
.ni-tab:hover { background: rgba(255,255,255,.6); color: var(--nm-primary); }
.ni-tab.ni-tab-active {
    background: #fff;
    color: var(--nm-primary);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(21,61,119,.12);
}
.ni-tab-badge {
    background: #dde4ef;
    color: #4a6080;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: .68rem;
    font-weight: 700;
}
.ni-tab.ni-tab-active .ni-tab-badge { background: var(--nm-primary); color: #fff; }
.ni-tab-badge-alert { background: var(--nm-danger) !important; color: #fff !important; }

/* Empty */
.ni-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: .9rem;
    color: #b0bec5;
    background: var(--nm-card);
    border: 2px dashed #dee2e6;
    border-radius: var(--nm-radius);
    margin-top: .5rem;
}
.ni-empty i       { font-size: 2.8rem; opacity: .4; }
.ni-empty-title   { font-size: .95rem; font-weight: 500; }

/* List */
.ni-list { display: flex; flex-direction: column; gap: .45rem; }

/* Item */
.ni-item {
    background: var(--nm-card);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
    animation: nmFadeIn .25s ease forwards;
}
.ni-item:hover { box-shadow: var(--nm-shadow-h); transform: translateY(-1px); }
.ni-item.ni-item-unread { border-left: 4px solid var(--nm-primary); background: #f7faff; }
.ni-item.ni-item-open   { border-color: var(--nm-primary); box-shadow: var(--nm-shadow-h); transform: none; }

/* Row */
.ni-item-row {
    display: flex;
    align-items: center;
    padding: .9rem 1rem;
    gap: .9rem;
    cursor: pointer;
    user-select: none;
}

/* Left icon */
.ni-notif-icon {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
    position: relative;
}
.ni-notif-icon.ni-icon-read      { background: #e4f7ec; color: #155724; }
.ni-notif-icon.ni-icon-delivered { background: #cce5ff; color: #004085; }
.ni-notif-icon.ni-icon-pending   { background: #fff8e0; color: #856404; }
.ni-notif-icon.ni-icon-muted     { background: #f0f0f2; color: #888; }

.ni-unread-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: var(--nm-danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Content */
.ni-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.ni-item-top   { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ni-item-title { font-size: .88rem; color: #212529; line-height: 1.3; }
.ni-bold       { font-weight: 700; font-size: .9rem; }
.ni-code-chip  {
    font-size: .65rem;
    background: var(--nm-primary-lt);
    color: #4a6080;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
    white-space: nowrap;
    flex-shrink: 0;
}
.ni-preview {
    font-size: .79rem;
    color: var(--nm-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.ni-item-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .05rem; }

/* Right aside */
.ni-item-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    flex-shrink: 0;
}
.ni-date { font-size: .71rem; color: #9aabbc; white-space: nowrap; }

.ni-item-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.ni-eye-btn {
    background: none;
    border: 1px solid #d5dce8;
    border-radius: var(--nm-radius-sm);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nm-muted);
    cursor: pointer;
    font-size: .8rem;
    transition: var(--nm-transition);
}
.ni-eye-btn:hover       { background: var(--nm-primary-lt); color: var(--nm-primary); border-color: var(--nm-primary); }
.ni-eye-btn.ni-eye-open { background: var(--nm-primary); border-color: var(--nm-primary); color: #fff; }

.ni-delete-btn {
    background: none;
    border: 1px solid #d5dce8;
    border-radius: var(--nm-radius-sm);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nm-muted);
    cursor: pointer;
    font-size: .8rem;
    transition: var(--nm-transition);
}
.ni-delete-btn:hover { background: #fff1f2; color: var(--nm-danger); border-color: var(--nm-danger); }

/* Detail */
.ni-detail {
    border-top: 1px solid var(--nm-border);
    background: #f5f8fd;
    padding: 1.1rem 1.2rem;
}
.ni-msg-box {
    background: var(--nm-card);
    border: 1px solid var(--nm-border);
    border-left: 4px solid var(--nm-primary);
    border-radius: var(--nm-radius-sm);
    padding: .85rem 1rem;
    margin-bottom: .9rem;
}
.ni-msg-label {
    font-size: .67rem;
    font-weight: 700;
    color: #8a9ab5;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: .4rem;
}
.ni-msg-text { font-size: .88rem; color: #212529; line-height: 1.65; white-space: pre-line; }

.ni-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .65rem 1.4rem;
}
.ni-meta-cell  { display: flex; flex-direction: column; gap: .1rem; }
.ni-meta-label { font-size: .65rem; font-weight: 700; color: #9aabbc; text-transform: uppercase; letter-spacing: .06em; }
.ni-meta-val   { font-size: .82rem; color: var(--nm-primary); font-weight: 500; }
.ni-meta-val code { background: var(--nm-primary-lt); border-radius: 4px; padding: 1px 5px; font-size: .76rem; color: #4a6080; }

/* Inbox status pills */
.ni-pill {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    font-size: .7rem;
    padding: 2px 9px;
    border-radius: 20px;
    font-weight: 600;
}
.ni-pill-read      { background: #d4edda; color: #155724; }
.ni-pill-delivered { background: #cce5ff; color: #004085; }
.ni-pill-muted     { background: #e2e3e5; color: #383d41; }
.ni-pill-pending   { background: #fff3cd; color: #856404; }

/* Inbox channel chips */
.ni-channel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: .65rem;
}
.ni-ch-on  { background: var(--nm-primary); color: #fff; }
.ni-ch-off { background: #eef0f4; color: #c0c8d4; }

/* ══════════════════════════════════════════════════════════════
   6.  RECEIPT PANEL  (WhatsApp-style read receipts in inbox)
   ══════════════════════════════════════════════════════════════ */

/* Loading state */
.ni-receipt-loading {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .9rem;
    padding-top: .75rem;
    border-top: 1px solid var(--nm-border);
    font-size: .8rem;
    color: var(--nm-muted);
}

/* Outer wrapper */
.ni-receipt {
    margin-top: .9rem;
    padding-top: .75rem;
    border-top: 1px solid var(--nm-border);
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

/* One group (Read / Delivered / Pending) */
.ni-receipt-section {
    background: var(--nm-card);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    overflow: hidden;
}

/* Group header row */
.ni-receipt-hdr {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .85rem;
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--nm-border);
}
.ni-rh-read      { background: #eaf7ef; color: #1a6b3c; }
.ni-rh-delivered { background: #e8f2ff; color: #1a4a8a; }
.ni-rh-pending   { background: #fffbe6; color: #856404; }

/* Badge count inside header */
.ni-rh-count {
    margin-left: auto;
    font-size: .68rem;
    background: rgba(0,0,0,.08);
    border-radius: 20px;
    padding: 1px 8px;
    font-weight: 700;
}

/* Individual user row */
.ni-receipt-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .85rem;
    border-bottom: 1px solid #f0f4fa;
    transition: background .12s ease;
}
.ni-receipt-row:last-child { border-bottom: none; }
.ni-receipt-row:hover      { background: #f7faff; }

/* Avatar circle with initials */
.ni-receipt-av {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.ni-av-read      { background: #d4edda; color: #155724; }
.ni-av-delivered { background: #cce5ff; color: #004085; }
.ni-av-pending   { background: #fff3cd; color: #856404; }

/* Name */
.ni-receipt-name {
    flex: 1;
    font-size: .83rem;
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Date */
.ni-receipt-date {
    font-size: .71rem;
    color: #9aabbc;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Trailing status icon */
.ni-rh-icon          { font-size: .8rem; flex-shrink: 0; }
.ni-rh-read-icon     { color: #1a73e8; }
.ni-rh-delivered-icon{ color: #6c757d; }
.ni-rh-pending-icon  { color: #f59e0b; }

/* ══════════════════════════════════════════════════════════════
   7.  ANIMAZIONE CONDIVISA
   ══════════════════════════════════════════════════════════════ */
@keyframes nmFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   8.  RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .notification-center-dropdown { width: 320px; }
}

@media (max-width: 576px) {
    .notification-center-dropdown { width: calc(100vw - 16px); right: -8px; }
    .ni-stat-value    { font-size: 1.3rem; }
    .ni-item-row      { padding: .75rem .85rem; gap: .65rem; }
    .ni-meta-grid     { grid-template-columns: 1fr 1fr; }
    .ni-detail        { padding: .85rem; }
    .batch-group-header { flex-direction: column; align-items: flex-start; }
    .np-bulk-actions  { margin-left: 0; }
    .tracking-kpi     { min-width: 70px; }
}
