/* ===== Einstellungen — секция настроек ===== */

.einst-section,
.einst-section * {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.einst-section {
  margin-top: 20px;
  margin-bottom: 32px;
}

.einst-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.einst-card {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  min-height: 170px;
  overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease;
}

.einst-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #22c55e, #0ea5e9);
}

.einst-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
}

.einst-card--hero {
  grid-column: 1 / -1;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.einst-card--hero:hover {
  transform: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.einst-card--hero .einst-hero-inner {
  max-width: 540px;
}

.einst-eyebrow-hero {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 4px;
}

.einst-hero-inner h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #0f172a;
}

.einst-hero-inner p {
  margin: 0;
  font-size: .9rem;
  color: #6b7280;
}

.einst-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.einst-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 20%, #f5f3ff, #dde4ff);
  box-shadow: 0 10px 20px rgba(79, 70, 229, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.einst-icon i {
  font-size: 1.1rem;
  color: #4338ca;
}

.einst-eyebrow {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 2px;
}

.einst-card-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: #0f172a;
}

.einst-text {
  margin: 4px 0 10px;
  font-size: .9rem;
  color: #4b5563;
}

.einst-footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(148, 163, 184, .2);
}

.einst-current {
  font-size: .82rem;
  color: #6b7280;
}

.einst-current strong {
  color: #111827;
  font-weight: 600;
}
[data-theme="dark"] .einst-current {
  color: #94a3b8;
}
[data-theme="dark"] .einst-current strong {
  color: #f0f4ff;
}

.einst-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .24rem .7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
}

.einst-status--on {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .35), 0 0 10px rgba(34, 197, 94, .30);
  animation: sec-aktiv-pulse 4.5s ease-in-out infinite;
}

.einst-status--off {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, .25), 0 0 6px rgba(220, 38, 38, .15);
}

.einst-tg-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 4px;
}

.einst-tg-sum-item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  color: var(--muted-2, var(--muted-3));
}

.einst-tg-sum-item i {
  opacity: .8;
}

.einst-stub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  background: rgba(148, 163, 184, .15);
  color: #9ca3af;
}

@media (max-width: 900px) {
  .einst-grid { grid-template-columns: 1fr; }
  .einst-card--hero { grid-column: 1; }
}

/* Konto-карточка */
.einst-konto-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
  flex: 1;
}

.einst-konto-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .15);
  gap: 12px;
}

.einst-konto-row:last-child {
  border-bottom: none;
}

.einst-konto-label {
  font-size: .82rem;
  color: #9ca3af;
  font-weight: 500;
  flex-shrink: 0;
}

.einst-konto-value {
  font-size: .88rem;
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

[data-theme="dark"] .einst-hero-inner h2 {
  color: #f0f4ff;
}
[data-theme="dark"] .einst-hero-inner p {
  color: #94a3b8;
}

/* ── Тумблер секции поддержки (superadmin): компактная карточка под нумерацией ─ */
.tf-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tf-switch-row .tf-switch-state {
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 600;
}
.tf-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}
.tf-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tf-switch .tf-switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #64748b;
  border-radius: 999px;
  transition: background .18s ease;
}
.tf-switch .tf-switch-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s ease;
}
.tf-switch input:checked + .tf-switch-slider {
  background: #c49020;
}
.tf-switch input:checked + .tf-switch-slider::before {
  transform: translateX(20px);
}

/* ── Универсальная карточка «Керування секціями та функціями»: строки-фичи ──── */
.tf-feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, .15);
}
.tf-feature-row:last-child { border-bottom: none; }
.tf-feature-meta { flex: 1; min-width: 0; }
.tf-feature-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.tf-feature-name i { color: #c49020; }
.tf-feature-desc {
  font-size: .78rem;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.35;
}
.tf-feature-row .tf-switch-row {
  flex-shrink: 0;
  width: auto;
}
.tf-feature-subhead {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 14px 0 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, .15);
}

/* Тумблери — у дві колонки на всю ширину сітки: в одну колонку картка
   тягнулась у висоту, а праворуч лишалось порожньо (03.10.2026). */
.tf-card-wide { grid-column: 1 / -1; }
.tf-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
/* Колонка = група (секції / канали пуш): непарна кількість у групі не лишає дірок. */
.tf-feature-col { min-width: 0; }
.tf-feature-col .tf-feature-subhead { margin-top: 0; padding-top: 0; border-top: none; }
@media (max-width: 900px) {
  .tf-feature-grid { grid-template-columns: 1fr; }
  .tf-feature-col + .tf-feature-col { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(148, 163, 184, .15); }
}

/* ── Нумерація рахунків: inline-форма в картці (замість модалки) ───────────── */
.invnum-inline {
  margin-top: 4px;
}
.invnum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px 14px;
}
.invnum-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.invnum-hint {
  font-size: .72rem;
  color: #9ca3af;
  line-height: 1.3;
}
.invnum-preview {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--surface, rgba(255,255,255,.03));
  border: 1.5px solid var(--border-2, rgba(255,255,255,.08));
  border-radius: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: .9rem;
}
.invnum-preview code {
  font-weight: 600;
  color: var(--text);
}

/* ── Нагадування бухзвітності: компактна окрема картка, сітка 2–3 колонки ── */
.acc-rem-desc { margin: 0 0 10px; font-size: .85rem; }
.acc-rem-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 18px; }
.acc-rem-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--border-2, #334155); border-radius: 8px; cursor: pointer; margin: 0; }
.acc-rem-who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.acc-rem-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-rem-role { font-size: .74rem; color: #94a3b8; white-space: nowrap; }
.tf-switch--sm { width: 34px; height: 20px; }
.tf-switch--sm .tf-switch-slider::before { height: 14px; width: 14px; }
.tf-switch--sm input:checked + .tf-switch-slider::before { transform: translateX(14px); }
@media (max-width: 1099px) { .acc-rem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699px) { .acc-rem-grid { grid-template-columns: 1fr; } }
