/* =========================================================
   Раздел «Администратор → Оповещения» — дополнительные стили
   Версия 2026-08-12 — к существующим style.css
   ========================================================= */

/* ----- Расширенная строка оповещения в списке ----- */
.notif-row {
  cursor: pointer;
  transition: background .12s ease;
  position: relative;
}
.notif-row:active { background: rgba(255,255,255,.04); }

/* Сетка внутри карточки: иконка + основное + правая колонка */
.notif-row .notif-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}
.notif-row .notif-info {
  flex: 1;
  min-width: 0;
}
.notif-row .notif-info b {
  font-size: 13.5px;
  font-weight: 700;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.notif-row .notif-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-row .notif-meta span {
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-row .notif-meta .nm-highlight {
  color: var(--gold);
}
.notif-row .notif-meta .nm-error {
  color: var(--red);
}

/* Правая панель: статус-пилюля + тоггл */
.notif-row .notif-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* Счётчики отправок под тоглом */
.notif-stats-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.notif-stat-cell {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  border-radius: var(--radius-s);
  background: var(--card-soft);
  border: 1px solid var(--border);
}
.notif-stat-cell b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 3px;
}
.notif-stat-cell span {
  font-size: 9.5px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.notif-stat-cell.ok b { color: var(--green); }
.notif-stat-cell.err b { color: var(--red); }
.notif-stat-cell.sent b { color: var(--gold); }

/* ----- Сортировка ----- */
.notif-sort-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.notif-sort-row::-webkit-scrollbar { display: none; }
.notif-sort-btn {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 700;
  background: var(--card-soft);
  color: var(--ink-dim);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .12s ease, color .12s ease;
}
.notif-sort-btn.active {
  background: var(--gold-tint);
  border-color: var(--gold);
  color: var(--gold);
}
.notif-sort-btn .sort-arrow {
  display: inline-block;
  margin-left: 3px;
  font-size: 9px;
  vertical-align: middle;
  opacity: .7;
}

/* ----- Категориальный заголовок группы ----- */
.notif-group-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: .8px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.notif-group-header:first-child {
  border-top: none;
  margin-top: 0;
}
.notif-group-header svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
  flex-shrink: 0;
}

/* ----- Модальная форма редактирования ----- */
/* Секции внутри модалки: вкладки уже есть (.chip), добавляем мелкие доп. */

.notif-schedule-info {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.7;
  margin-bottom: 12px;
}
.notif-schedule-info b { color: var(--ink); }

.notif-var-chip {
  display: inline-block;
  background: var(--gold-tint);
  border: 1px solid rgba(201,162,92,.3);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--gold);
  cursor: pointer;
  user-select: none;
  margin: 3px 3px 3px 0;
  transition: background .12s ease;
}
.notif-var-chip:active { background: rgba(201,162,92,.3); }

.notif-vars-section {
  margin-top: 10px;
  margin-bottom: 4px;
}
.notif-vars-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.notif-var-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-dim);
  padding: 3px 0;
}
.notif-var-row code {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 11px;
  background: var(--gold-tint);
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.notif-var-row .nv-desc {
  color: var(--ink-dim);
  font-size: 11px;
}

/* ----- Критичное оповещение — особая подсветка в списке ----- */
.notif-row.is-critical {
  border-left: 2px solid var(--red);
}
.notif-row.is-disabled {
  opacity: .55;
}

/* ----- «Следующая отправка» метка ----- */
.notif-next-label {
  font-size: 10px;
  color: var(--ink-dim);
  white-space: nowrap;
}
.notif-next-label.event-based {
  color: var(--green);
}

/* ----- «Последний запуск» в строке ----- */
.notif-last-run {
  font-size: 10px;
  color: var(--ink-dim);
}

/* ----- Предпросмотр Telegram — мокап окна чата ----- */
.tg-preview-wrap {
  background: #17212b;
  border-radius: var(--radius-m);
  padding: 14px 12px;
  margin-bottom: 14px;
  position: relative;
}
.tg-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.tg-preview-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4A76A8 0%, #2C5282 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.tg-preview-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.tg-preview-name small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,.4);
  margin-top: 1px;
}
.tg-preview-bubble {
  background: #2b5278;
  border-radius: 14px 14px 14px 2px;
  padding: 9px 12px;
  max-width: calc(100% - 10px);
  font-size: 13.5px;
  line-height: 1.55;
  color: #fff;
  word-break: break-word;
  white-space: pre-wrap;
}
.tg-preview-time {
  text-align: right;
  font-size: 10px;
  color: rgba(255,255,255,.4);
  margin-top: 4px;
}

/* ----- Сводка: «Отправлено всего» в шапке раздела ----- */
.notif-header-stats {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}
.notif-header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 9.5px;
  color: var(--ink-dim);
  gap: 1px;
}
.notif-header-stat b {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ----- Адаптив: на очень узких экранах убираем мета-подписи ----- */
@media (max-width: 360px) {
  .notif-stat-cell span { font-size: 8px; }
  .notif-var-row .nv-desc { display: none; }
}
