/* Notify — toasts & dialogs (public/js/notify.js). Loaded by every page. */
.nt-region {
  position: fixed; z-index: 2147483000; top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 10px;
  width: min(420px, calc(100vw - 32px)); pointer-events: none;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.nt-toast {
  --nt-a: #1d4ed8; --nt-b: #4f46e5; --nt-glow: rgba(79, 70, 229, .35);
  position: relative; pointer-events: auto; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 14px 14px 16px 14px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, var(--nt-a), var(--nt-b));
  box-shadow: 0 14px 34px -10px var(--nt-glow), 0 4px 10px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .18);
  transform: translateX(24px) scale(.98); opacity: 0;
  transition: transform .26s cubic-bezier(.2, .9, .3, 1.2), opacity .2s ease;
  touch-action: pan-y; user-select: none;
}
.nt-toast::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .22), transparent 55%);
}
.nt-toast.nt-in { transform: none; opacity: 1; }
.nt-toast.nt-out { transform: translateX(40px) scale(.96); opacity: 0; }
.nt-toast.nt-dragging { transition: none; cursor: grabbing; }

.nt-success { --nt-a: #047857; --nt-b: #0d9488; --nt-glow: rgba(13, 148, 136, .45); }
.nt-error   { --nt-a: #9f1239; --nt-b: #e11d48; --nt-glow: rgba(225, 29, 72, .45); }
.nt-warning { --nt-a: #b45309; --nt-b: #c2410c; --nt-glow: rgba(234, 88, 12, .45); }
.nt-info    { --nt-a: #1d4ed8; --nt-b: #4f46e5; --nt-glow: rgba(79, 70, 229, .45); }
.nt-loading { --nt-a: #6d28d9; --nt-b: #a21caf; --nt-glow: rgba(162, 28, 175, .45); }

.nt-icon {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.nt-icon svg, .nt-close svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nt-spin { animation: nt-spin .8s linear infinite; }
@keyframes nt-spin { to { transform: rotate(360deg); } }

.nt-body { min-width: 0; position: relative; }
.nt-head { display: flex; align-items: center; gap: 6px; }
.nt-label { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.nt-count { font-size: 10.5px; font-weight: 800; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, .25); }
.nt-title { font-size: 14px; font-weight: 700; line-height: 1.35; margin-top: 1px; overflow-wrap: anywhere; }
.nt-desc { font-size: 12.5px; line-height: 1.45; margin-top: 3px; opacity: .95; overflow-wrap: anywhere; white-space: pre-line; }
.nt-details { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 12px; background: rgba(0, 0, 0, .14); border-radius: 10px; padding: 8px 10px; }
.nt-details dt { opacity: .85; }
.nt-details dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nt-detail-line { grid-column: 1 / -1; }
.nt-actions { margin-top: 10px; }
.nt-action {
  border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--nt-a);
  background: #fff; padding: 6px 12px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.nt-action:hover { filter: brightness(.95); }
.nt-close {
  position: relative; border: 0; background: rgba(255, 255, 255, .14); width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; cursor: pointer;
}
.nt-close svg { width: 14px; height: 14px; }
.nt-close:hover { background: rgba(255, 255, 255, .28); }
.nt-close:focus-visible, .nt-action:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.nt-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: rgba(255, 255, 255, .75); transform-origin: left;
  animation-name: nt-shrink; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes nt-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* dialogs */
.nt-overlay {
  position: fixed; inset: 0; z-index: 2147483001; display: grid; place-items: center; padding: 16px;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .16s ease;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.nt-overlay.nt-in { opacity: 1; }
.nt-dialog {
  --nt-a: #2563eb; --nt-b: #7c3aed;
  width: min(460px, 100%); background: #fff; color: #0f172a; border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .06);
  transform: translateY(10px) scale(.97); transition: transform .2s cubic-bezier(.2, .9, .3, 1.2);
}
.nt-overlay.nt-in .nt-dialog { transform: none; }
.nt-tone-danger { --nt-a: #be123c; --nt-b: #ea580c; }
.nt-tone-info { --nt-a: #0284c7; --nt-b: #4f46e5; }
.nt-tone-primary { --nt-a: #2563eb; --nt-b: #7c3aed; }
.nt-dialog-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 22px; color: #fff;
  background: linear-gradient(135deg, var(--nt-a), var(--nt-b));
}
.nt-dialog-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .2); flex: none; }
.nt-dialog-icon svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nt-dialog-title { margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.3; }
.nt-dialog-body { padding: 16px 22px 4px; font-size: 13.5px; line-height: 1.55; color: #334155; }
.nt-dialog-msg { margin: 0 0 8px; white-space: pre-line; overflow-wrap: anywhere; }
.nt-dialog-details { margin: 0 0 8px 18px; padding: 0; color: #475569; }
.nt-field { display: flex; flex-direction: column; gap: 6px; padding: 4px 22px 0; }
.nt-field-label { font-size: 12px; font-weight: 700; color: #475569; }
.nt-input {
  font: inherit; font-size: 14px; padding: 10px 12px; border: 1.5px solid #cbd5e1; border-radius: 10px; outline: none; color: #0f172a;
}
.nt-input:focus { border-color: var(--nt-a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--nt-a) 18%, transparent); }
.nt-input[aria-invalid='true'] { border-color: #e11d48; }
.nt-field-error { min-height: 16px; font-size: 12px; font-weight: 600; color: #be123c; }
.nt-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }
.nt-btn { font: inherit; font-size: 13.5px; font-weight: 700; border-radius: 11px; padding: 9px 18px; cursor: pointer; border: 0; }
.nt-btn-ghost { background: #f1f5f9; color: #334155; }
.nt-btn-ghost:hover { background: #e2e8f0; }
.nt-btn-primary, .nt-btn-info, .nt-btn-danger { color: #fff; background: linear-gradient(135deg, var(--nt-a), var(--nt-b)); box-shadow: 0 8px 18px -8px var(--nt-a); }
.nt-btn-primary:hover, .nt-btn-info:hover, .nt-btn-danger:hover { filter: brightness(1.07); }
.nt-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--nt-a) 45%, transparent); outline-offset: 2px; }

@media (max-width: 640px) {
  .nt-region { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; }
  .nt-toast { transform: translateY(20px); }
  .nt-toast.nt-out { transform: translateY(20px); }
}
@media (prefers-reduced-motion: reduce) {
  .nt-toast, .nt-overlay, .nt-dialog { transition: none; }
  .nt-spin { animation: none; }
  .nt-progress { animation: none; display: none; }
}
@media (forced-colors: active) {
  .nt-toast, .nt-dialog-head { border: 2px solid CanvasText; }
}
