/* Notifiche (notifications_center.js): campana con il numero di avvisi non letti nell'intestazione e pannello con gli
   ultimi avvisi e gli interruttori. html:root davanti: lo stile generico dei pulsanti del tema (nrc_aurora.css,
   html:root button) non deve vincere. Sul PC la campana sta in alto a destra nella barra laterale, sul telefono nella
   riga in alto accanto all'account. */
.sidebar .nrc-notify{position:absolute; top:20px; right:16px; z-index:3}
html:root .nrc-notify-btn{
  position:relative; display:grid; place-items:center; width:40px; height:40px; padding:0; border-radius:12px; cursor:pointer;
  color:var(--t-text, #E6EAF2); background:transparent; border:1px solid var(--t-border-hi, rgba(255,255,255,.14));
}
html:root .nrc-notify-btn:hover{background:color-mix(in srgb, var(--t-text, #E6EAF2) 6%, transparent)}
html:root .nrc-notify-btn[aria-expanded="true"]{background:var(--t-active-bg, rgba(157,178,255,.12)); border-color:var(--t-accent, #9DB2FF)}
html:root .nrc-notify-btn:focus-visible{outline:2px solid var(--t-accent, #9DB2FF); outline-offset:2px}
.nrc-notify-badge{
  position:absolute; top:-6px; right:-6px; min-width:18px; height:18px; padding:0 5px; box-sizing:border-box; border-radius:999px;
  display:grid; place-items:center; font:700 11px/1 var(--t-sans, system-ui); font-variant-numeric:tabular-nums;
  background:var(--t-accent, #9DB2FF); color:var(--t-on-accent, #0E1220); box-shadow:0 0 0 2px #13161C;
}
.nrc-notify-badge[hidden]{display:none}

.nrc-notify-panel{
  position:fixed; z-index:240; box-sizing:border-box; max-height:min(76vh, 620px); overflow:auto; overscroll-behavior:contain;
  padding:12px 14px 14px; border-radius:16px; background:#15171D; color:var(--t-text, #E6EAF2);
  border:1px solid var(--t-border-hi, rgba(255,255,255,.14)); box-shadow:0 30px 70px -20px rgba(0,0,0,.85);
  font-family:var(--t-sans, system-ui); font-size:14px; line-height:1.45;
}
.nrc-notify-panel[hidden]{display:none!important}
.nrc-notify-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px}
.nrc-notify-head h2{margin:0; font-size:16px; font-weight:700}
html:root .nrc-notify-close{display:grid; place-items:center; width:40px; height:40px; padding:0; border-radius:10px; cursor:pointer}
.nrc-notify-list{list-style:none; margin:0 0 10px; padding:0; display:grid; gap:6px}
.nrc-notify-item{padding:9px 10px; border-radius:10px; border:1px solid var(--t-border, rgba(255,255,255,.07)); background:var(--t-surface, rgba(255,255,255,.03))}
.nrc-notify-item.is-new{border-color:color-mix(in srgb, var(--t-accent, #9DB2FF) 45%, transparent)}
.nrc-notify-item[data-severity="error"], .nrc-notify-item[data-severity="critical"]{box-shadow:inset 3px 0 0 var(--t-down, #FF5C7A)}
.nrc-notify-item[data-severity="warning"]{box-shadow:inset 3px 0 0 var(--t-warn, #FFB547)}
.nrc-notify-row{display:flex; align-items:baseline; justify-content:space-between; gap:10px}
.nrc-notify-row b{font-size:13.5px; min-width:0; overflow-wrap:anywhere}
.nrc-notify-row time{flex:none; font-size:12px; color:var(--t-muted, #8A94A8)}
.nrc-notify-item p{margin:3px 0 0; font-size:13px; color:var(--t-muted, #8A94A8); overflow-wrap:anywhere}
.nrc-notify-empty{padding:10px 2px; color:var(--t-muted, #8A94A8)}
.nrc-notify-prefs{border-top:1px solid var(--t-border, rgba(255,255,255,.07)); padding-top:10px}
.nrc-notify-cats{border:0; margin:8px 0 0; padding:0}
.nrc-notify-cats legend{padding:0; margin-bottom:4px; font-size:12px; font-weight:650; letter-spacing:.06em; text-transform:uppercase; color:var(--t-muted, #8A94A8)}
.nrc-switch-row{display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px}
.nrc-switch-row > span{min-width:0}
.nrc-notify-note{margin:0 0 4px; font-size:12.5px; color:var(--t-muted, #8A94A8)}
/* interruttore (role="switch"): binario e pallino, glicine quando acceso */
html:root .nrc-switch{
  position:relative; flex:none; width:46px; height:28px; padding:0; border-radius:999px; cursor:pointer;
  background:color-mix(in srgb, var(--t-muted, #8A94A8) 28%, transparent); border:1px solid var(--t-border-hi, rgba(255,255,255,.14));
  transition:background .18s ease;
}
html:root .nrc-switch i{position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:var(--t-text, #E6EAF2); transition:transform .18s ease}
html:root .nrc-switch[aria-checked="true"]{background:var(--t-accent, #9DB2FF); border-color:transparent}
html:root .nrc-switch[aria-checked="true"] i{transform:translateX(18px); background:var(--t-on-accent, #0E1220)}
html:root .nrc-switch:disabled{opacity:.45; cursor:not-allowed}
html:root .nrc-switch:focus-visible{outline:2px solid var(--t-accent, #9DB2FF); outline-offset:2px}

@media (max-width:767px){
  /* riga in alto: logo, account, campana */
  .sidebar .nrc-notify{position:static; order:3; flex:none}
  html:root .nrc-notify-btn{width:44px; height:44px}
  /* menu utente: parte chiuso e, aperto, sta SOPRA il contenuto (non spinge giù la pagina) */
  /* l'account si restringe (control_room.css gli dà flex:0 0 auto!important) così logo, account e campana stanno
     su una riga anche a 360px; il nome si accorcia con i puntini */
  html:root .sidebar #nrcAccountWidget.nrc-account-widget{position:relative; flex:1 1 0!important; min-width:0!important; width:auto!important}
  html:root #nrcAccountWidget #nrcAccountMenu.nrc-account-menu{position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:230; margin:0!important}
}
@media (prefers-reduced-motion: reduce){ html:root .nrc-switch, html:root .nrc-switch i{transition:none} }
