/* /opt/skynet-portal/app/static/css/notifications.css */
/* v0.3.0 — футер ленты в 2 колонки (+«Очистить»), иконка строки по центру */
/* 17.07.2026: v0.1.0 колокольчик/бейдж/лента/страница/тумблеры */

/* =====================================================================
   Колокольчик и бейдж (топбар)
   ===================================================================== */
.ntf-bell { position: relative; }
.ntf-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
  border: 2px solid var(--bg-base);
  animation: ntfPulse 2s ease-in-out infinite;
}
@keyframes ntfPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

/* =====================================================================
   Дропдаун-лента (топбар)
   ===================================================================== */
.ntf-menu {
  width: 380px;
  max-width: calc(100vw - 24px);
  padding: 0;
  overflow: hidden;
}
.ntf-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-primary);
}
.ntf-readall {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: var(--fs-xs);
  cursor: pointer;
}
.ntf-readall:hover { text-decoration: underline; }
.ntf-feed-list {
  max-height: 420px;
  overflow-y: auto;
}
.ntf-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  border-bottom: 1px solid var(--border-primary);
  transition: background var(--transition-fast);
}
.ntf-item:last-child { border-bottom: none; }
.ntf-item:hover { background: var(--bg-elevated); }
.ntf-item.is-unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ntf-item.is-unread:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ntf-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
.ntf-item.sev-success::before { background: #22c55e; }
.ntf-item.sev-warning::before { background: #f59e0b; }
.ntf-item.sev-danger::before { background: #ef4444; }
.ntf-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.ntf-ico svg { width: 16px; height: 16px; }
.ntf-item.sev-danger .ntf-ico { color: #f87171; background: rgba(239, 68, 68, 0.10); }
.ntf-item.sev-success .ntf-ico { color: #4ade80; background: rgba(34, 197, 94, 0.10); }
.ntf-item.sev-warning .ntf-ico { color: #fbbf24; background: rgba(245, 158, 11, 0.10); }
.ntf-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ntf-title {
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.ntf-sub {
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ntf-time { color: var(--text-muted); font-size: 0.66rem; }
.ntf-dot {
  align-self: center;
  margin-left: auto;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}
.ntf-empty {
  padding: var(--sp-6);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.ntf-feed-foot-row {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border-primary);
}
.ntf-feed-foot {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: background var(--transition-fast);
}
.ntf-feed-foot:hover { background: var(--bg-elevated); }
.ntf-feed-clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--sp-3) var(--sp-4);
  border: none;
  border-left: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.ntf-feed-clear svg { width: 13px; height: 13px; }
.ntf-feed-clear:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}

/* =====================================================================
   Страница центра (/notifications/) — на всю ширину
   ===================================================================== */
.ntfp-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Hero-плитки KPI (геометрия как в /damofon) */
.ntfp-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-3);
}
.ntfp-stat {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ntfp-stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 60px at 12% 0%, var(--st-glow, transparent), transparent 70%);
  pointer-events: none;
}
.ntfp-stat-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--st-c, var(--accent)) 14%, transparent);
  color: var(--st-c, var(--accent));
}
.ntfp-stat-ico svg { width: 20px; height: 20px; }
.ntfp-stat-num {
  display: block;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ntfp-stat-lbl {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Панель управления: сегменты + действия */
.ntfp-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.ntfp-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ntfp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.ntfp-tab svg { width: 14px; height: 14px; }
.ntfp-tab:hover { color: var(--text-primary); background: var(--bg-elevated); }
.ntfp-tab.is-active {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.ntfp-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
}
.ntfp-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Заголовок дня */
.ntfp-day {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ntfp-day::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-primary);
}

/* Список-карточки */
.ntfp-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.ntfp-card {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.ntfp-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-primary));
  box-shadow: var(--shadow-md);
}
.ntfp-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
}
.ntfp-card.sev-success::before { background: #22c55e; }
.ntfp-card.sev-warning::before { background: #f59e0b; }
.ntfp-card.sev-danger::before { background: #ef4444; }
.ntfp-card.is-unread { background: color-mix(in srgb, var(--accent) 6%, var(--bg-surface)); }
.ntfp-card .ntf-ico { width: 40px; height: 40px; }
.ntfp-card .ntf-ico svg { width: 18px; height: 18px; }
.ntfp-card .ntf-body { flex: 1 1 auto; gap: 3px; }
.ntfp-card .ntf-title { font-size: var(--fs-md); }
.ntfp-card .ntf-sub { white-space: normal; }
.ntfp-card .ntf-time { font-size: var(--fs-xs); }
.ntfp-card .ntf-dot { align-self: flex-start; margin-top: 6px; }
.ntf-silent-mark {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  margin-left: 8px;
  font-size: 0.62rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  vertical-align: middle;
}

/* Пагинация */
.ntfp-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
}
.ntfp-pager .num {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Настройки (тумблеры категорий) — страница prefs
   ===================================================================== */
.ntfs-list {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.ntfs-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}
.ntfs-row .ntf-ico { width: 38px; height: 38px; }
.ntfs-info { flex: 1 1 auto; min-width: 0; }
.ntfs-name { color: var(--text-primary); font-weight: var(--fw-semibold); }
.ntfs-hint { color: var(--text-muted); font-size: var(--fs-xs); }
.ntfs-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.ntfs-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.ntfs-switch.is-on { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.ntfs-switch.is-on::after {
  transform: translateX(18px);
  background: var(--accent);
}
.ntfs-switch.is-busy { opacity: 0.55; pointer-events: none; }

@media (max-width: 720px) {
  .ntfp-panel { flex-direction: column; align-items: stretch; }
  .ntfp-actions { margin-left: 0; }
}