/* Shared toast stack + notification pane. Self-contained (no Tailwind classes) so it works on every layout. */
:root {
  --ntf-info-bg:#eff6ff;    --ntf-info-bd:#bfdbfe;    --ntf-info-fg:#1e40af;
  --ntf-success-bg:#f0fdf4; --ntf-success-bd:#bbf7d0; --ntf-success-fg:#166534;
  --ntf-error-bg:#fef2f2;   --ntf-error-bd:#fecaca;   --ntf-error-fg:#991b1b;
  --ntf-warning-bg:#fefce8; --ntf-warning-bd:#fde68a; --ntf-warning-fg:#92400e;
  --ntf-text:#374151; --ntf-muted:#9ca3af;
  --ntf-panel-bg:#fff; --ntf-panel-bd:#e5e7eb; --ntf-panel-fg:#111827; --ntf-hover:#f3f4f6;
}
.dark, [data-theme="dark"] {
  --ntf-info-bg:#1e3a5f;    --ntf-info-bd:#1d4ed8;    --ntf-info-fg:#93c5fd;
  --ntf-success-bg:#14532d; --ntf-success-bd:#16a34a; --ntf-success-fg:#86efac;
  --ntf-error-bg:#450a0a;   --ntf-error-bd:#dc2626;   --ntf-error-fg:#fca5a5;
  --ntf-warning-bg:#422006; --ntf-warning-bd:#d97706; --ntf-warning-fg:#fcd34d;
  --ntf-text:#cbd5e1; --ntf-muted:#6b7280;
  --ntf-panel-bg:#1f2937; --ntf-panel-bd:#374151; --ntf-panel-fg:#f9fafb; --ntf-hover:#374151;
}

/* Toast stack: above the chatbot launcher (z-index 999999) */
#ntfToasts {
  position: fixed; top: 64px; right: 16px; z-index: 1000000;
  display: flex; flex-direction: column; gap: 8px;
  width: 320px; max-width: calc(100vw - 32px); pointer-events: none;
}
.ntf-toast {
  pointer-events: auto; display: flex; flex-direction: column;
  padding: 12px 14px; border-radius: 10px; border: 1px solid;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  opacity: 0; transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease;
}
.ntf-toast.ntf-in { opacity: 1; transform: translateY(0); }
.ntf-info    { background: var(--ntf-info-bg);    border-color: var(--ntf-info-bd);    --ntf-fg: var(--ntf-info-fg); }
.ntf-success { background: var(--ntf-success-bg); border-color: var(--ntf-success-bd); --ntf-fg: var(--ntf-success-fg); }
.ntf-error   { background: var(--ntf-error-bg);   border-color: var(--ntf-error-bd);   --ntf-fg: var(--ntf-error-fg); }
.ntf-warning { background: var(--ntf-warning-bg); border-color: var(--ntf-warning-bd); --ntf-fg: var(--ntf-warning-fg); }
/* Icon sits only beside the title; the message/time below start flush left
   instead of leaving a blank indent under the icon. */
.ntf-row { display: flex; align-items: center; gap: 8px; }
.ntf-icon { flex: none; width: 17px; height: 17px; color: var(--ntf-fg); }
.ntf-title { flex: 1; min-width: 0; font-weight: 700; font-size: .875rem; line-height: 1.3; color: var(--ntf-fg); letter-spacing: -.01em; }
.ntf-msg { font-size: .8125rem; line-height: 1.4; color: var(--ntf-text); margin-top: 4px; word-wrap: break-word; overflow-wrap: anywhere; }
.ntf-time { flex: none; font-size: .6875rem; color: var(--ntf-muted); white-space: nowrap; }
.ntf-x { flex: none; background: none; border: 0; padding: 4px; margin: -4px -4px -4px 0; cursor: pointer; color: var(--ntf-muted); line-height: 0; border-radius: 6px; transition: background-color .15s ease, color .15s ease; }
.ntf-x:hover { color: var(--ntf-fg); background-color: rgba(0,0,0,.06); }
.dark .ntf-x:hover, [data-theme="dark"] .ntf-x:hover { background-color: rgba(255,255,255,.08); }

/* Bell */
#ntfBellBtn { position: relative; }
#ntfBadge {
  position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9999px; background: #ef4444; color: #fff; font-size: .6875rem; font-weight: 700;
  line-height: 16px; text-align: center; box-sizing: border-box;
}
#ntfBadge[hidden] { display: none; }

/* Pane */
#ntfOverlay { position: fixed; inset: 0; z-index: 1000001; background: rgba(0,0,0,.25); opacity: 0; transition: opacity .2s ease; }
#ntfOverlay[hidden], #ntfPanel[hidden] { display: none; }
#ntfOverlay.ntf-in { opacity: 1; }
#ntfPanel {
  position: fixed; top: 0; right: 0; height: 100%; width: 360px; max-width: 100vw; z-index: 1000002;
  display: flex; flex-direction: column; background: var(--ntf-panel-bg); color: var(--ntf-panel-fg);
  border-left: 1px solid var(--ntf-panel-bd); box-shadow: -8px 0 24px rgba(0,0,0,.12);
  transform: translateX(100%); transition: transform .25s ease;
}
#ntfPanel.ntf-in { transform: translateX(0); }
.ntf-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--ntf-panel-bd); flex: none; }
.ntf-head h2 { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.ntf-actions { display: flex; align-items: center; gap: 12px; }
.ntf-link { background: none; border: 0; padding: 0; cursor: pointer; font-size: .75rem; color: #2563eb; }
.dark .ntf-link, [data-theme="dark"] .ntf-link { color: #60a5fa; }
.ntf-link:hover { text-decoration: underline; }
.ntf-link:disabled { opacity: .5; cursor: default; text-decoration: none; }
#ntfList { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ntf-item { cursor: default; }
/* Unread marker: an inline dot right before the timestamp, not an absolutely-positioned one
   overlapping the card's edge. Uses a neutral "unread" blue rather than red — red already
   means "error" on this card (and on a green success card a red dot read like an extra
   alarm), so a type-agnostic color is what actually says "unread" without implying a status. */
.ntf-item.ntf-unread .ntf-time::before {
  content: ""; display: inline-block; vertical-align: middle; margin-right: 5px;
  width: 7px; height: 7px; border-radius: 9999px;
  background: #2563eb;
}
.dark .ntf-item.ntf-unread .ntf-time::before,
[data-theme="dark"] .ntf-item.ntf-unread .ntf-time::before {
  background: #60a5fa;
}
.ntf-empty { text-align: center; color: var(--ntf-muted); font-size: .875rem; margin-top: 48px; }
.ntf-empty svg { width: 32px; height: 32px; margin: 0 auto 8px; display: block; opacity: .6; }
@media (prefers-reduced-motion: reduce) { .ntf-toast, #ntfPanel, #ntfOverlay { transition: none; } }
