/* ============================================================
   Le notifiche per persona sul computer (D533.35): la campanella nella
   colonna delle azioni, il riquadro con le ultime e la scheda di una
   notifica. Adattato da Wainow Platform/Wainow.Blazor.Server/
   wwwroot/css/wainow/wainow-shell.css il 26/11/2026 (.nx-topbtn__badge,
   .nx-notifmenu*, .nx-notif*: la campanella che la copia del Lab aveva
   tolto). Adottato: classi del Lab (nl-notif), tre gravita' con il loro
   colore (informazione teal, «tocca a te» ambra, errore rosso: il colore
   nel punto e nel filo, mai un fondo pieno), il conteggio nel titolo,
   «Mostra le precedenti», la scheda con il pulsante dell'oggetto.
   Solo variabili del tema: chiaro e scuro si ribaltano da soli. Il telefono
   ha le sue regole in lab-mobile.css (/m/notifiche).
   ============================================================ */

/* la campanella: il bottone tondo della colonna delle azioni (.nx-topbtn) con il numero in alto a destra */
.nl-notif {
    position: relative;
}

.nl-notif__badge {
    position: absolute;
    top: -3px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--nx-pill);
    background: var(--nx-bracket-color, var(--nx-corallo));
    color: var(--nx-prugna-deep);
    font-family: var(--wainow-font-family);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

/* un clic fuori chiude, senza ascoltatori globali (come il menu dell'account) */
.nl-notif__scrim {
    position: fixed;
    inset: 0;
    z-index: 48;
    background: transparent;
}

/* il riquadro si apre di fianco alla campanella, verso sinistra, sopra il foglio e il pannello dell'assistente */
.nl-notif__pop {
    position: absolute;
    right: calc(100% + var(--wainow-space-2));
    top: 0;
    z-index: 50;
    width: min(420px, calc(100vw - 96px));
    max-height: min(600px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    border-radius: var(--nx-radius-card);
    background: var(--nx-surface);
    color: var(--nx-text);
    box-shadow: var(--nx-shadow-float);
    overflow: hidden;
    font-family: var(--wainow-font-family);
}

.nl-notif__pop:focus {
    outline: none;
}

/* gli avvisi a schermo stanno nello stesso angolo (lab-alerts.css, z-index 31000 di XAF) e coprivano la testata del riquadro
   (prova a browser del 26/11): a riquadro aperto si nascondono, senza fermarne le animazioni (main.js aspetta animationend) */
body:has(.nl-notif__pop) .xaf-alerts-stack {
    visibility: hidden;
}

.nl-notif__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--wainow-space-2);
    padding: var(--wainow-space-2) var(--wainow-space-3);
    border-bottom: 1px solid var(--nx-line-soft);
}

.nl-notif__head--detail {
    justify-content: flex-start;
}

.nl-notif__title {
    display: inline-flex;
    align-items: baseline;
    gap: var(--wainow-space-2);
    font-size: var(--wainow-fs-body-sm);
    font-weight: var(--wainow-fw-semibold);
}

.nl-notif__count {
    font-size: var(--wainow-fs-caption);
    font-weight: normal;
    color: var(--nx-text-muted);
}

.nl-notif__markall,
.nl-notif__more,
.nl-notif__back {
    border: 0;
    background: none;
    padding: 4px 6px;
    border-radius: var(--nx-radius-sm);
    font-family: inherit;
    font-size: var(--wainow-fs-caption);
    color: var(--nx-corallo-ink);
    cursor: pointer;
}

.nl-notif__markall:hover,
.nl-notif__more:hover,
.nl-notif__back:hover {
    background: var(--nx-field-hover);
}

.nl-notif__markall:focus-visible,
.nl-notif__more:focus-visible,
.nl-notif__back:focus-visible,
.nl-notif__open:focus-visible {
    outline: none;
    box-shadow: var(--wainow-focus-ring);
}

.nl-notif__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: var(--wainow-space-2) var(--wainow-space-2) var(--wainow-space-3);
}

.nl-notif__empty {
    margin: var(--wainow-space-2);
    font-size: var(--wainow-fs-body-sm);
    line-height: 1.5;
    color: var(--nx-text-muted);
}

.nl-notif__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nl-notif__item {
    list-style: none;
    /* il colore della gravita': punto e filo della non letta */
    --nl-notif-tone: var(--nx-corallo);
}

.nl-notif__item--action,
.nl-notif__detail--action {
    --nl-notif-tone: var(--nx-warning-ink);
}

.nl-notif__item--error,
.nl-notif__detail--error {
    --nl-notif-tone: var(--nx-danger-ink);
}

.nl-notif__detail--info {
    --nl-notif-tone: var(--nx-corallo-ink);
}

.nl-notif__open {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: var(--wainow-space-2);
    padding: var(--wainow-space-2);
    border: 0;
    border-radius: var(--nx-radius-sm);
    background: none;
    font-family: inherit;
    text-align: left;
    color: var(--nx-text);
    cursor: pointer;
}

.nl-notif__open:hover {
    background: var(--nx-field-hover);
}

.nl-notif__item--unread .nl-notif__open {
    box-shadow: inset 3px 0 0 var(--nl-notif-tone);
}

.nl-notif__dot {
    flex: none;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--nl-notif-tone);
}

/* una notifica letta resta, tenue */
.nl-notif__item:not(.nl-notif__item--unread) .nl-notif__dot {
    background: var(--nx-line);
}

.nl-notif__main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.nl-notif__item-title {
    font-size: var(--wainow-fs-body-sm);
    line-height: 1.35;
}

.nl-notif__item--unread .nl-notif__item-title {
    font-weight: var(--wainow-fw-semibold);
}

.nl-notif__item:not(.nl-notif__item--unread) .nl-notif__item-title {
    color: var(--nx-text-muted);
}

.nl-notif__item-text {
    font-size: var(--wainow-fs-caption);
    line-height: 1.45;
    color: var(--nx-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.nl-notif__item-meta {
    margin-top: 2px;
    font-size: var(--wainow-fs-caption);
    color: var(--nx-text-muted);
}

/* le parole per i lettori di schermo */
.nl-notif__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.nl-notif__more {
    display: block;
    margin: var(--wainow-space-2) auto 0;
}

/* la scheda di una notifica (D436 della Suite): testo intero e il pulsante dell'oggetto */
.nl-notif__detail {
    display: flex;
    flex-direction: column;
    gap: var(--wainow-space-2);
    padding: var(--wainow-space-3);
}

.nl-notif__severity {
    align-self: flex-start;
    padding: 1px 8px;
    border-radius: var(--nx-pill);
    box-shadow: inset 0 0 0 1px var(--nl-notif-tone);
    color: var(--nl-notif-tone);
    font-size: var(--wainow-fs-caption);
    font-weight: var(--wainow-fw-semibold);
}

.nl-notif__detail-title {
    margin: 0;
    font-size: var(--wainow-fs-body-sm);
    font-weight: var(--wainow-fw-semibold);
    line-height: 1.35;
    color: var(--nx-text);
}

.nl-notif__detail-when {
    margin: 0;
    font-size: var(--wainow-fs-caption);
    color: var(--nx-text-muted);
}

.nl-notif__detail-text {
    margin: 0;
    font-size: var(--wainow-fs-body-sm);
    line-height: 1.5;
    color: var(--nx-text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.nl-notif__cta {
    align-self: flex-start;
}

.nl-notif__note {
    margin: 0;
    font-size: var(--wainow-fs-caption);
    color: var(--nx-text-muted);
}

/* a finestra stretta il riquadro resta dentro lo schermo */
@media (max-width: 576px) {
    .nl-notif__pop {
        position: fixed;
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* ============================================================
   Il push del browser (D533.35 tappa 2): l'ingranaggio in testata, la riga
   in cima all'elenco (Components/LabPushPanel, Banner) e le notifiche su
   questo dispositivo (Panel) dentro il riquadro. Le stesse classi servono
   /m/notifiche: gli adattamenti del telefono stanno in lab-mobile.css.
   Solo variabili del tema.
   ============================================================ */

.nl-notif__tools {
    display: inline-flex;
    align-items: center;
    gap: var(--wainow-space-1);
}

.nl-notif__settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: var(--nx-radius-sm);
    background: none;
    color: var(--nx-text-muted);
    cursor: pointer;
}

.nl-notif__settings:hover {
    background: var(--nx-field-hover);
    color: var(--nx-text);
}

.nl-notif__settings:focus-visible {
    outline: none;
    box-shadow: var(--wainow-focus-ring);
}

.nl-notif__body--push {
    padding: var(--wainow-space-3);
}

/* la riga in cima all'elenco: un invito discreto, o l'avviso ambra se il dispositivo non riceve piu' */
.nl-push-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px var(--wainow-space-2);
    margin: 0 0 var(--wainow-space-2);
    padding: var(--wainow-space-2) var(--wainow-space-3);
    border-radius: var(--nx-radius-sm);
    background: var(--nx-field);
    color: var(--nx-text-muted);
    font-size: var(--wainow-fs-caption);
    line-height: 1.45;
}

.nl-push-banner--warning {
    background: var(--nx-warning-bg);
    color: var(--nx-text);
    box-shadow: inset 3px 0 0 var(--nx-warning-ink);
}

.nl-push-banner__text {
    flex: 1 1 14em;
}

.nl-push-banner__actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--wainow-space-1) var(--wainow-space-2);
}

.nl-push-banner__note {
    flex: 1 1 100%;
}

.nl-push-link {
    border: 0;
    background: none;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: var(--nx-radius-sm);
    font-family: inherit;
    font-size: inherit;
    color: var(--nx-corallo-ink);
    cursor: pointer;
    text-align: left;
}

.nl-push-link--strong {
    font-weight: var(--wainow-fw-semibold);
}

.nl-push-link:hover {
    background: var(--nx-field-hover);
}

.nl-push-link:disabled {
    opacity: 0.6;
    cursor: default;
}

.nl-push-link:focus-visible {
    outline: none;
    box-shadow: var(--wainow-focus-ring);
}

/* le notifiche su questo dispositivo */
.nl-push {
    display: flex;
    flex-direction: column;
    gap: var(--wainow-space-4);
    color: var(--nx-text);
    font-size: var(--wainow-fs-body-sm);
}

.nl-push__section {
    display: flex;
    flex-direction: column;
    gap: var(--wainow-space-2);
}

.nl-push__section + .nl-push__section {
    padding-top: var(--wainow-space-3);
    border-top: 1px solid var(--nx-line-soft);
}

.nl-push__heading {
    margin: 0;
    font-size: var(--wainow-fs-caption);
    font-weight: var(--wainow-fw-semibold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--nx-text-muted);
}

.nl-push__state {
    margin: 0;
    line-height: 1.5;
}

.nl-push__state--ok {
    color: var(--nx-success-ink);
}

.nl-push__state--warning {
    color: var(--nx-warning-ink);
}

.nl-push__cta {
    align-self: flex-start;
}

.nl-push__message,
.nl-push__devices,
.nl-push__hint,
.nl-push__saved {
    margin: 0;
    font-size: var(--wainow-fs-caption);
    line-height: 1.45;
    color: var(--nx-text-muted);
}

.nl-push__devices {
    color: var(--nx-text);
}

/* un interruttore: la casella vera resta (tastiera e lettori di schermo), sopra la pista disegnata */
.nl-push__switch {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--wainow-space-3);
    cursor: pointer;
}

.nl-push__switch input {
    position: absolute;
    opacity: 0;
    width: 36px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.nl-push__switch-track {
    flex: none;
    position: relative;
    width: 36px;
    height: 20px;
    margin-top: 1px;
    border-radius: var(--nx-pill);
    background: var(--nx-line);
    transition: background-color 0.15s ease;
}

.nl-push__switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--nx-surface);
    box-shadow: 0 0 0 1px var(--nx-line-soft);
    transition: transform 0.15s ease;
}

.nl-push__switch input:checked + .nl-push__switch-track {
    background: var(--nx-corallo);
}

.nl-push__switch input:checked + .nl-push__switch-track::after {
    transform: translateX(16px);
}

.nl-push__switch input:focus-visible + .nl-push__switch-track {
    box-shadow: var(--wainow-focus-ring);
}

.nl-push__switch input:disabled + .nl-push__switch-track {
    opacity: 0.5;
}

.nl-push__switch-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.nl-push__switch-title {
    font-weight: var(--wainow-fw-semibold);
}

.nl-push__switch-hint {
    font-size: var(--wainow-fs-caption);
    line-height: 1.4;
    color: var(--nx-text-muted);
}

.nl-push__hours {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wainow-space-3);
    padding-left: calc(36px + var(--wainow-space-3));
}

.nl-push__hour {
    display: inline-flex;
    align-items: center;
    gap: var(--wainow-space-2);
    color: var(--nx-text-muted);
}

.nl-push__hour select {
    padding: 4px 8px;
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius-sm);
    background: var(--nx-surface);
    color: var(--nx-text);
    font-family: inherit;
    font-size: var(--wainow-fs-body-sm);
}

.nl-push__hour select:focus-visible {
    outline: none;
    box-shadow: var(--wainow-focus-ring);
}
