/* Notification system (toasts, bell + inbox, banner).
 *
 * Self-contained and namespaced under .ntf-* so it never clashes with the rest
 * of the app. Driven from JS via window.Notify (app/javascript/notify.js):
 *   Notify.toast('success'|'info'|'warning'|'error', 'текст', { action, onAction })
 *   Notify.banner('текст', { actionLabel, onAction })
 *   Notify.inbox.add({ type:'reminder'|…, title, body, time })
 */

:root {
  --ntf-font: "Manrope", system-ui, sans-serif;
  --ntf-ink: #0E1424;
  --ntf-sub: #59617A;
  --ntf-mut: #8890A2;
  --ntf-border: #E6E9F0;
  --ntf-card: #fff;
  --ntf-accent: #3D50E0;
  /* semantic */
  --ntf-success: #22A06B;
  --ntf-success-bg: #E4F5EC;
  --ntf-info: #3D50E0;
  --ntf-info-bg: #EDEFFD;
  --ntf-warning: #C99A2E;
  --ntf-warning-bg: #FBF6E9;
  --ntf-error: #D5443C;
  --ntf-error-bg: #FBEAE9;
}

/* ---------- TOASTS ---------- */
.ntf-toasts {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 360px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.ntf-toast {
  pointer-events: auto;
  font-family: var(--ntf-font);
  background: var(--ntf-card);
  border: 1px solid var(--ntf-border);
  border-radius: 13px;
  padding: 14px 15px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 20px 44px -22px rgba(14, 20, 36, 0.4);
  animation: ntf-toast-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ntf-toast.ntf-leaving {
  animation: ntf-toast-out 0.2s ease forwards;
}
.ntf-toast__icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}
.ntf-toast__body {
  flex: 1;
  padding-top: 2px;
}
.ntf-toast__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ntf-ink);
}
.ntf-toast__action {
  display: inline-block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ntf-accent);
  cursor: pointer;
}
.ntf-toast__action:hover {
  text-decoration: underline;
}
.ntf-toast__close {
  color: #B4BAC7;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: color 0.12s;
}
.ntf-toast__close:hover {
  color: var(--ntf-ink);
}
.ntf-toast--success .ntf-toast__icon { background: var(--ntf-success-bg); color: var(--ntf-success); }
.ntf-toast--info    .ntf-toast__icon { background: var(--ntf-info-bg);    color: var(--ntf-info); }
.ntf-toast--warning .ntf-toast__icon { background: var(--ntf-warning-bg); color: var(--ntf-warning); }
.ntf-toast--error   .ntf-toast__icon { background: var(--ntf-error-bg);   color: var(--ntf-error); }

/* ---------- BELL + INBOX ---------- */
.ntf-bellwrap {
  position: relative;
  display: inline-block;
  font-family: var(--ntf-font);
}
.ntf-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ntf-sub);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: transparent;
}
.ntf-bell:hover {
  background: var(--ntf-info-bg);
  color: var(--ntf-accent);
}
.ntf-badge {
  position: absolute;
  top: 5px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--ntf-error);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.ntf-badge[hidden] { display: none; }
.ntf-inbox {
  position: absolute;
  top: 52px;
  right: 0;
  width: 384px;
  max-width: calc(100vw - 32px);
  background: var(--ntf-card);
  border: 1px solid var(--ntf-border);
  border-radius: 16px;
  box-shadow: 0 30px 70px -34px rgba(14, 20, 36, 0.5);
  overflow: hidden;
  z-index: 8000;
}
.ntf-inbox[hidden] { display: none; }
.ntf-inbox__head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #EDEFF3;
}
.ntf-inbox__title { font-weight: 800; font-size: 16px; color: var(--ntf-ink); }
.ntf-inbox__mark { font-size: 13px; font-weight: 600; color: var(--ntf-accent); cursor: pointer; }
.ntf-inbox__mark:hover { text-decoration: underline; }
.ntf-inbox__list { max-height: 420px; overflow: auto; }
.ntf-inbox__foot {
  padding: 13px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ntf-accent);
  cursor: pointer;
  border-top: 1px solid #EDEFF3;
}
.ntf-inbox__empty { padding: 34px 18px; text-align: center; font-size: 14px; color: var(--ntf-mut); }
.ntf-row {
  padding: 15px 18px;
  display: flex;
  gap: 13px;
  border-bottom: 1px solid #F4F5F8;
  background: #fff;
  cursor: pointer;
  transition: background 0.12s;
}
.ntf-row:hover { background: #F7F8FE; }
.ntf-row.ntf-unread { background: #F7F8FE; }
.ntf-row__icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}
.ntf-row--success  .ntf-row__icon { background: var(--ntf-success-bg); color: var(--ntf-success); }
.ntf-row--info     .ntf-row__icon { background: var(--ntf-info-bg);    color: var(--ntf-info); }
.ntf-row--reminder .ntf-row__icon { background: var(--ntf-warning-bg); color: var(--ntf-warning); }
.ntf-row--error    .ntf-row__icon { background: var(--ntf-error-bg);   color: var(--ntf-error); }
.ntf-row__main { flex: 1; }
.ntf-row__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 3px;
}
.ntf-row__title { font-weight: 700; font-size: 14px; color: var(--ntf-ink); }
.ntf-row__time { font-size: 12px; color: var(--ntf-mut); white-space: nowrap; }
.ntf-row__body { font-size: 13px; line-height: 1.5; color: var(--ntf-sub); }

/* ---------- BANNER ---------- */
.ntf-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9500;
  font-family: var(--ntf-font);
  background: var(--ntf-ink);
  color: #fff;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 12px 34px -14px rgba(14, 20, 36, 0.6);
  animation: ntf-banner-down 0.28s ease;
}
.ntf-banner[hidden] { display: none; }
.ntf-banner__text { font-size: 14px; font-weight: 600; }
.ntf-banner__btn {
  background: var(--ntf-accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.ntf-banner__btn:hover { filter: brightness(1.06); }
.ntf-banner__close {
  position: absolute;
  right: 20px;
  color: #8890A2;
  cursor: pointer;
  font-size: 16px;
}
.ntf-banner__close:hover { color: #fff; }

@keyframes ntf-toast-in {
  from { opacity: 0; transform: translateX(18px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes ntf-toast-out {
  to { opacity: 0; transform: translateX(18px); }
}
@keyframes ntf-banner-down {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: none; }
}
