/* =============================================================================
   DUPPLA — NOTIFICAÇÕES
   Sino no cabeçalho (ao lado do Speaker), painel com mensagens e avisos do sistema,
   preferências (som e navegador) e os avisos clicáveis no canto da tela.
   ============================================================================= */
.appbar-bell { position: relative; }
.notify-badge {
  position: absolute; top: .2rem; right: .15rem; min-width: 1.1rem; height: 1.1rem; padding: 0 .3rem; border-radius: var(--r-pill);
  display: inline-grid; place-items: center; background: var(--c-danger); color: #fff;
  font-size: .64rem; font-weight: var(--fw-bold); line-height: 1; box-shadow: 0 0 0 2px var(--c-surface); font-variant-numeric: tabular-nums;
}
.notify-badge[hidden] { display: none; }
.appbar-bell.has-new svg { animation: notify-ring .9s var(--ease) 1; transform-origin: 50% 10%; }
@keyframes notify-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }

.notify-panel {
  position: fixed; z-index: 80; top: calc(var(--appbar-h) + 2px); right: var(--sp-4);
  width: min(400px, calc(100vw - 1.5rem)); max-height: min(640px, calc(100dvh - var(--appbar-h) - var(--sp-5)));
  display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; outline: none; animation: notify-in .16s var(--ease);
}
.notify-panel[hidden] { display: none; }
@keyframes notify-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--c-border); }
.notify-head h2 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.notify-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-1) var(--sp-2) var(--sp-2); overscroll-behavior: contain; }
.notify-section { padding: var(--sp-3) var(--sp-2) var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-ink-3); text-transform: uppercase; letter-spacing: .04em; }
.notify-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.notify-item {
  position: relative; width: 100%; display: flex; align-items: flex-start; gap: .7rem; padding: .6rem .55rem; border: 0; border-radius: var(--r-md);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.notify-item:hover { background: var(--c-surface-sunken); }
.notify-item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.notify-item.is-unread { background: color-mix(in srgb, var(--c-brand-soft) 55%, transparent); }
.notify-item.is-unread:hover { background: var(--c-brand-soft); }
.notify-item-media { flex: none; display: inline-flex; }
.notify-item-icon { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--c-surface-sunken); color: var(--c-brand); }
.notify-item-icon svg { width: 1.05rem; height: 1.05rem; }
.notify-item-text { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.notify-item-title { display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; font-size: var(--fs-sm); }
.notify-item-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notify-item-count { flex: none; font-size: .7rem; font-weight: var(--fw-bold); color: var(--c-chat-accent); }
.notify-item-body { font-size: var(--fs-xs); color: var(--c-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notify-item-time { font-size: .7rem; color: var(--c-ink-3); }
.notify-dot { position: absolute; top: .9rem; right: .6rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--c-brand); }
.notify-empty { display: grid; justify-items: center; gap: var(--sp-1); padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--c-ink-3); }
.notify-empty svg { width: 1.8rem; height: 1.8rem; margin-bottom: var(--sp-1); }
.notify-empty p { color: var(--c-ink-2); font-weight: var(--fw-semibold); }
.notify-empty small { max-width: 30ch; font-size: var(--fs-xs); }

.notify-foot { display: grid; gap: .1rem; padding: var(--sp-2) var(--sp-3) var(--sp-3); border-top: 1px solid var(--c-border); background: var(--c-surface-2); }
.notify-pref { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: .4rem .25rem; cursor: pointer; font-size: var(--fs-sm); }
.notify-pref.is-disabled { cursor: default; opacity: .75; }
.notify-pref-text { display: grid; }
.notify-pref-text small { font-size: .72rem; color: var(--c-ink-3); }
.notify-switch {
  appearance: none; flex: none; width: 2.3rem; height: 1.3rem; border-radius: var(--r-pill); background: var(--c-border-strong);
  position: relative; cursor: pointer; transition: background-color var(--t-fast);
}
.notify-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.3rem - 4px); height: calc(1.3rem - 4px); border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t-fast) var(--ease); }
.notify-switch:checked { background: var(--c-brand); }
.notify-switch:checked::after { transform: translateX(1rem); }
.notify-switch:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.notify-switch:disabled { cursor: default; }
.notify-clear { justify-self: start; margin-top: var(--sp-1); padding: .2rem .25rem; border: 0; background: none; color: var(--c-ink-3); font: inherit; font-size: var(--fs-xs); text-decoration: underline; cursor: pointer; }

/* Aviso clicável no canto da tela (mensagem nova, tarefa, reunião) */
.toast.toast-notify { padding: 0; pointer-events: auto; align-items: stretch; }
.toast-notify-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: .7rem; padding: .7rem .4rem .7rem .8rem; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.toast-notify-media { flex: none; display: inline-flex; }
.toast-notify-media .avatar { --size: 2.2rem; }
.toast-notify-icon { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.toast-notify-icon svg { margin: 0; color: var(--c-toast-info); }
.toast-notify-text { min-width: 0; display: grid; gap: .1rem; font-size: var(--fs-sm); }
.toast-notify-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-notify-text span { opacity: .82; font-size: var(--fs-xs); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast-notify-close { flex: none; width: 2rem; border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; display: grid; place-items: center; }
.toast-notify-close:hover { opacity: 1; }
.toast-notify-close svg { width: .9rem; height: .9rem; margin: 0; }

@media (max-width: 960px) {
  .notify-panel { right: .75rem; left: .75rem; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .appbar-bell.has-new svg, .notify-panel { animation: none; }
}

/* v0.32 — Conversas no cabeçalho, ao lado do sino */
.appbar-chat { position: relative; display: inline-grid; place-items: center; text-decoration: none; color: inherit; }
.appbar-chat .notify-badge { background: #25A768; }
