/* ───── Notifications page ───── */
.np-page { display: flex; flex-direction: column; gap: 14px; }

/* Firebase status card */
.np-fb-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  position: relative;
}
.np-fb-card.np-fb-ok { border-left: 4px solid #16a34a; }
.np-fb-card.np-fb-err { border-left: 4px solid #ef4444; background: #fff8f8; }
.np-fb-card.np-fb-error { background: #fef2f2; color: #b91c1c; }
.np-fb-card.np-fb-loading { opacity: 0.6; pointer-events: none; }

.np-fb-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.np-fb-icon { font-size: 30px; flex-shrink: 0; }
.np-fb-body { flex: 1; min-width: 0; }
.np-fb-title { font-size: 16px; font-weight: 700; color: #111827; }
.np-fb-badge {
  display: inline-block; margin-left: 8px;
  background: rgba(255,193,7,0.15); color: #B8860B;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: 5px; letter-spacing: 0.3px;
}
.np-fb-sub { font-size: 13px; color: #6b7280; margin-top: 3px; }
.np-fb-actions { display: flex; gap: 8px; }
.np-fb-upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: #FFC107; color: #000;
  border-radius: 8px; border: 0;
  font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.np-fb-upload-btn:hover { background: #B8860B; color: #fff; }
.np-fb-upload-btn i { font-size: 18px !important; }

/* Grid */
.np-grid {
  display: grid; gap: 14px;
  grid-template-columns: 1fr 1fr;
}
.np-panel {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 18px;
  display: flex; flex-direction: column;
  min-width: 0;
}
.np-h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: #111827; }
.np-hint { color: #6b7280; font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.np-tip { color: #9ca3af; font-size: 11px; margin: 4px 0 0; }

/* Tabs */
.np-tabs {
  display: flex; gap: 4px;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}
.np-tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}
.np-tab:hover { color: #111827; background: rgba(255,255,255,0.5); }
.np-tab.active {
  background: #FFC107; color: #000;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255,193,7,0.3);
}
.np-tab i { font-size: 17px !important; }

/* Inputs */
.np-label {
  display: block;
  font-size: 11px; color: #6b7280;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  margin: 12px 0 5px;
}
.np-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  transition: border 0.15s, box-shadow 0.15s;
}
.np-input:focus {
  outline: none;
  border-color: #FFC107;
  box-shadow: 0 0 0 3px rgba(255,193,7,0.15);
}
.np-textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

/* Recipient picker */
.np-search { position: relative; }
.np-search-results {
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.np-search-results:empty { display: none; }
.np-search-loading {
  padding: 14px; text-align: center;
  color: #9ca3af; font-style: italic; font-size: 13px;
}
.np-search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
}
.np-search-item:hover { background: #fffbeb; }
.np-search-item:last-child { border-bottom: 0; }
.np-search-icon { font-size: 22px; }
.np-search-body { flex: 1; min-width: 0; }
.np-search-name {
  font-weight: 600; color: #111827; font-size: 14px;
  display: flex; align-items: center; gap: 6px;
}
.np-search-meta {
  font-size: 12px; color: #6b7280;
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.np-dot-on { background: #22c55e; }
.np-no-fcm { color: #f59e0b; font-size: 12px; }

/* Selected recipient */
.np-recipient {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(255,193,7,0.12), rgba(255,193,7,0.04));
  border: 1.5px solid rgba(255,193,7,0.4);
  border-radius: 10px;
}
.np-recipient-info { flex: 1; min-width: 0; }
.np-recipient-name { font-weight: 700; color: #111827; font-size: 15px; }
.np-recipient-meta { font-size: 12px; color: #6b7280; margin-top: 3px; }
.np-recipient-clear {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.06);
  cursor: pointer;
  font-size: 18px;
  color: #6b7280;
  transition: all 0.15s;
}
.np-recipient-clear:hover { background: #ef4444; color: #fff; }

/* Buttons */
.np-btn-row { display: flex; gap: 8px; margin-top: 14px; }
.np-btn-yellow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 22px;
  background: #FFC107; color: #000;
  border: 0; border-radius: 8px;
  font-family: inherit; font-weight: 700; font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 14px;
}
.np-btn-yellow:hover:not(:disabled) {
  background: #B8860B; color: #fff;
  box-shadow: 0 4px 12px rgba(255,193,7,0.4);
}
.np-btn-yellow:disabled { opacity: 0.5; cursor: not-allowed; }
.np-btn-row > .np-btn-yellow { margin-top: 0; }
.np-btn-ghost {
  padding: 11px 18px;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer;
  color: #6b7280;
}
.np-btn-ghost:hover:not(:disabled) { background: #f9fafb; color: #111827; }
.np-btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.np-btn-sm {
  background: transparent; border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 13px;
}
.np-btn-sm:hover { background: #f3f4f6; }

.np-result { margin-top: 10px; }

/* ───── Phone preview ───── */
.np-preview {
  display: flex; justify-content: center;
  padding: 14px 0;
}
.np-phone {
  width: 280px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  border-radius: 28px;
  padding: 20px 14px 14px;
  box-shadow:
    0 20px 50px rgba(0,0,0,0.3),
    0 0 0 2px #333,
    inset 0 0 0 1px rgba(255,255,255,0.05);
}
.np-phone-top {
  display: flex; justify-content: space-between;
  color: #fff; font-size: 11px; opacity: 0.7;
  padding: 0 4px 12px;
}
.np-notif {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 12px 14px;
  color: #111;
  /* #9: длинный текст/длинные слова без пробелов не должны вылезать за рамку телефона */
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.np-notif-app {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: #6b7280;
  margin-bottom: 6px;
}
.np-notif-app-icon { font-size: 14px; }
.np-notif-app-name { font-weight: 700; letter-spacing: 0.3px; }
.np-notif-app-time { margin-left: auto; }
.np-notif-title {
  font-size: 14px; font-weight: 700; color: #111827;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}
/* #9: тело уведомления переносится и ограничивается ~8 строками в preview,
   чтобы очень длинный текст не растягивал макет до бесконечности. */
.np-notif-body {
  font-size: 13px; color: #374151; line-height: 1.4;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* History */
.np-history { margin-top: 22px; }
.np-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.np-history-list {
  max-height: 280px; overflow-y: auto;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
}
.np-history-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.np-history-item:last-child { border-bottom: 0; }
.np-history-item .np-history-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.np-history-body { color: #6b7280; font-size: 12.5px; }
.np-history-meta { color: #9ca3af; font-size: 11px; margin-top: 4px; }
.np-status { padding: 1px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 700; margin-left: auto; }

.np-spinner-sm {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,193,7,0.2);
  border-top-color: #FFC107;
  border-radius: 50%;
  animation: npSpin 0.8s linear infinite;
}
@keyframes npSpin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .np-grid { grid-template-columns: 1fr; }
}

/* ───── Templates panel ───── */
.np-tpl-panel { margin-top: 4px; }
.np-tpl-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.np-tpl-actions { display: flex; gap: 8px; align-items: center; }
.np-tpl-actions .np-input { padding: 7px 10px; font-size: 13px; }

.np-tpl-list { display: flex; flex-direction: column; gap: 16px; }

.np-tpl-group {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fafbfc;
}
.np-tpl-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-weight: 700; font-size: 13px;
  color: #374151;
  background: linear-gradient(90deg, rgba(255,193,7,0.10), transparent);
  border-bottom: 1px solid #e5e7eb;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.np-tpl-count {
  background: #fff; border: 1px solid #d1d5db;
  border-radius: 10px; padding: 1px 8px;
  font-size: 11px; font-weight: 700; color: #6b7280;
}

.np-tpl-card {
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
}
.np-tpl-card[open] { background: #fffbeb; }
.np-tpl-card:last-child { border-bottom: 0; }

.np-tpl-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}
.np-tpl-summary::-webkit-details-marker { display: none; }
.np-tpl-summary:hover { background: rgba(255,193,7,0.06); }

.np-tpl-sum-main { flex: 1; min-width: 0; }
.np-tpl-key {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px; font-weight: 700;
  color: #111827;
}
.np-tpl-desc {
  font-size: 12.5px; color: #6b7280;
  margin-top: 2px;
}
.np-tpl-sum-side {
  display: flex; gap: 10px; align-items: center;
}
.np-tpl-who {
  font-size: 11.5px; color: #6b7280;
  background: #f3f4f6;
  padding: 3px 9px; border-radius: 12px;
  white-space: nowrap;
}
.np-tpl-off {
  font-size: 10.5px; color: #b91c1c;
  background: #fee2e2; padding: 2px 7px;
  border-radius: 4px; font-weight: 700;
  text-transform: uppercase;
}
.np-tpl-chev {
  font-size: 14px; color: #9ca3af;
  transition: transform 0.15s;
}
.np-tpl-card[open] .np-tpl-chev { transform: rotate(180deg); }

.np-tpl-body {
  padding: 4px 16px 16px;
  border-top: 1px dashed #e5e7eb;
}
.np-tpl-vars {
  font-size: 12px; color: #6b7280;
  margin-bottom: 10px; padding: 8px 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #FFC107;
}
.np-tpl-vars code {
  background: #fff; border: 1px solid #e5e7eb;
  padding: 1px 6px; border-radius: 4px;
  font-size: 11.5px; color: #b45309;
  margin: 0 2px;
}
.np-tpl-lang-tabs {
  display: flex; gap: 4px;
  background: #f3f4f6; padding: 3px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.np-tpl-lang {
  flex: 1; padding: 7px 10px;
  background: transparent; border: 0;
  border-radius: 6px;
  font-size: 12.5px; font-weight: 600;
  color: #6b7280; cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.np-tpl-lang:hover { background: rgba(255,255,255,0.5); color: #111827; }
.np-tpl-lang.active {
  background: #FFC107; color: #000; font-weight: 700;
  box-shadow: 0 1px 4px rgba(255,193,7,0.3);
}
.np-tpl-pane .np-label { margin-top: 8px; }
.np-tpl-pane .np-input { font-size: 13px; padding: 8px 10px; }
.np-tpl-pane .np-textarea { min-height: 56px; }

.np-tpl-actions-row {
  display: flex; gap: 8px; align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.np-tpl-actions-row .np-btn-yellow { margin-top: 0; padding: 8px 16px; font-size: 12.5px; }
.np-tpl-msg {
  margin-top: 8px;
  font-size: 12.5px;
  min-height: 18px;
}
