/* due grigi intermedi usati dai fogli del 17/10 e mai definiti: a metà
   fra le tonalità vicine, così seguono anche il tema scuro */
:root {
  --n-600: color-mix(in srgb, var(--n-500) 50%, var(--n-700));
  --n-800: color-mix(in srgb, var(--n-700) 50%, var(--n-900));
}
/* ============================================================
   CENTRO NOTIFICHE (js/notifiche.js, 17/10)
   ============================================================ */
.nc-pannello {
  position: fixed; top: 0; bottom: 0; left: 244px; z-index: 950;
  width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--n-0);
  border-right: 1px solid var(--n-200);
  box-shadow: 24px 0 60px -24px rgba(6, 12, 18, .45);
  transform: translateX(-16px); opacity: 0;
  transition: transform .22s var(--ease), opacity .18s ease;
}
.nc-pannello.aperto { transform: none; opacity: 1; }
@media (max-width: 820px) { .nc-pannello { left: 0 !important; width: 100vw; } }

.nc-testa {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 18px 12px;
}
.nc-testa strong { font-family: var(--titoli, inherit); font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--n-900); }
.nc-conta {
  margin-left: 10px; padding: 2px 9px; border-radius: 999px; vertical-align: 3px;
  font-size: 11.5px; font-weight: 800; background: var(--brand-600); color: #fff;
}
.nc-testa-az { display: flex; align-items: center; gap: 6px; }
.nc-x {
  width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font-size: 15px; color: var(--n-500);
}
.nc-x:hover { background: var(--n-100); color: var(--n-900); }

.nc-filtri { display: flex; gap: 6px; padding: 0 18px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--n-100); }
.nc-filtri::-webkit-scrollbar { display: none; }
.nc-filtro {
  flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--n-200); background: var(--n-0);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--n-700); cursor: pointer;
}
.nc-filtro b { margin-left: 4px; font-weight: 800; color: var(--n-400); }
.nc-filtro:hover { border-color: var(--brand-600); color: var(--brand-700); }
.nc-filtro.attivo { background: var(--n-900); border-color: var(--n-900); color: #fff; }
.nc-filtro.attivo b { color: rgba(255, 255, 255, .7); }

.nc-lista { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 16px; }
.nc-giorno {
  position: sticky; top: 0; z-index: 1;
  padding: 12px 8px 6px; background: color-mix(in srgb, var(--n-0) 92%, transparent); backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--n-400);
}
.nc-voce {
  --c: var(--n-500);
  position: relative;
  display: flex; gap: 12px; padding: 12px 34px 12px 10px; margin-bottom: 2px;
  border-radius: 14px; cursor: pointer;
  transition: background var(--t-veloce);
}
.nc-voce:hover { background: var(--n-50); }
.nc-voce.nuova { background: color-mix(in srgb, var(--brand-50) 65%, var(--n-0)); }
.nc-voce.nuova:hover { background: var(--brand-50); }
.nc-ic {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 13%, var(--n-0)); color: color-mix(in srgb, var(--c) 85%, #101828);
}
.nc-ic .ic { width: 18px; height: 18px; }
.nc-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nc-riga1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.nc-riga1 strong { font-size: 14px; font-weight: 700; color: var(--n-900); line-height: 1.35; }
.nc-voce:not(.nuova) .nc-riga1 strong { font-weight: 600; color: var(--n-700); }
.nc-riga1 time { flex-shrink: 0; font-size: 11.5px; color: var(--n-400); white-space: nowrap; }
.nc-testo { margin: 0; font-size: 13px; line-height: 1.5; color: var(--n-700); white-space: pre-line; }
.nc-da { font-size: 12px; color: var(--n-500); }
.nc-stato {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
}
.nc-stato .ic { width: 12px; height: 12px; }
.nc-stato.ok { background: var(--ok-bg); color: var(--ok-ink); }
.nc-stato.no { background: var(--err-bg); color: var(--err-ink); }
.nc-azioni { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.nc-btn {
  height: 30px; padding: 0 12px; border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--brand-600) 30%, var(--n-200)); background: var(--n-0);
  font: inherit; font-size: 12.5px; font-weight: 700; color: var(--brand-700); cursor: pointer;
}
.nc-btn:hover { background: var(--brand-50); border-color: var(--brand-600); }
.nc-btn-tenue { border-color: transparent; background: transparent; color: var(--n-500); font-weight: 600; }
.nc-btn-tenue:hover { background: var(--n-100); border-color: transparent; color: var(--n-900); }
.nc-punto {
  position: absolute; top: 18px; right: 12px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-600) 20%, transparent);
}
.nc-vuoto {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 50px 30px; color: var(--n-500);
}
.nc-vuoto .ic { width: 34px; height: 34px; color: var(--n-300); }
.nc-vuoto strong { font-size: 15px; color: var(--n-900); }
.nc-vuoto span { font-size: 13px; line-height: 1.5; }
.nc-piede {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--n-100); background: var(--n-50);
  font-size: 12.5px; color: var(--n-700);
}

/* riquadri a comparsa per le notifiche nuove */
.nc-pop-zona {
  position: fixed; right: 18px; bottom: 18px; z-index: 1300;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
}
.nc-pop {
  --c: var(--brand-600);
  pointer-events: auto;
  position: relative;
  display: flex; gap: 12px; width: min(380px, calc(100vw - 36px));
  padding: 14px 40px 14px 14px; border-radius: 16px;
  background: var(--n-0); border: 1px solid var(--n-200);
  box-shadow: 0 22px 50px -18px rgba(6, 12, 18, .45), inset 3px 0 0 var(--c);
  transform: translateY(12px) scale(.98); opacity: 0;
  transition: transform .25s var(--ease), opacity .2s ease;
}
.nc-pop.dentro { transform: none; opacity: 1; }
.nc-pop-corpo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nc-pop-corpo strong { font-size: 14px; font-weight: 800; color: var(--n-900); }
.nc-pop-corpo p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--n-700);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc-pop-azioni { display: flex; gap: 6px; margin-top: 4px; }
.nc-pop-x {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--n-400); cursor: pointer;
}
.nc-pop-x:hover { background: var(--n-100); color: var(--n-900); }

/* campanella: pulsa quando arriva qualcosa */
@keyframes nc-pulsa { 0% { transform: scale(1); } 30% { transform: scale(1.18) rotate(-8deg); } 60% { transform: scale(1.1) rotate(8deg); } 100% { transform: scale(1); } }
#btn-notifiche.pulsa svg { animation: nc-pulsa .7s var(--ease) 2; }
@media (prefers-reduced-motion: reduce) {
  #btn-notifiche.pulsa svg { animation: none; }
  .nc-pannello, .nc-pop { transition: none; }
}

[data-theme="dark"] .nc-pannello { border-right-color: var(--n-200); }
[data-theme="dark"] .nc-voce.nuova { background: var(--n-50); }
[data-theme="dark"] .nc-filtro.attivo { background: var(--n-900); border-color: var(--n-900); color: var(--n-0); }

/* pratica senza responsabile (17/10) */
.pr-da-assegnare {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--warn-bg); color: var(--warn-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent);
}
.pr-da-assegnare::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.inc-f-aiuto { margin: -2px 0 6px; }
