/* Purple variant */
.metric-purple .metric-icon-wrap {
  background: rgba(var(--purple-rgb), .15);
  color: rgba(var(--purple-rgb), 1);
}

.metric-purple .metric-value {
  color: rgba(var(--purple-rgb), 1);
}

.metric-purple .metric-accent {
  background: linear-gradient(90deg, rgba(var(--purple-rgb), .8), rgba(var(--purple-rgb), .2));
}

/* Mint variant */
.metric-mint .metric-icon-wrap {
  background: rgba(var(--mint-rgb), .15);
  color: rgba(var(--mint-rgb), 1);
}

.metric-mint .metric-value {
  color: rgba(var(--mint-rgb), 1);
}

.metric-mint .metric-accent {
  background: linear-gradient(90deg, rgba(var(--mint-rgb), .8), rgba(var(--mint-rgb), .2));
}

/* ============================
   BALAGAN — панель управления ботом
   Палитра и шрифты сняты с balaganmafia.ru
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600&family=Tektur:wght@400;500;600&display=swap');

/* ============================
   Design Tokens
   ============================ */

:root {
  /* Фон: основной тон сайта и глубокий тёмный для перепадов */
  --bg-0: #141414;
  --bg-1: #0f0d16;
  --bg-2: #090713;

  /* Surfaces */
  --panel:   rgba(255, 255, 255, .10);
  --panel-2: rgba(255, 255, 255, .06);
  --stroke:  rgba(255, 255, 255, .14);

  /* Текст */
  --text:  rgba(255, 255, 255, .92);
  --muted: #a8a7b6;

  /* Фирменные цвета */
  --brand-1: #a449f5;   /* основной акцент, кнопки */
  --brand-2: #f2b626;   /* второй акцент */
  --brand-3: #dbb3ff;   /* светлый фиолетовый для текста на тёмном */

  /* Те же цвета в RGB — для полупрозрачных вариантов.
     Имена переменных исторические, менять их пришлось бы по всему файлу. */
  --blue-rgb:   164, 73, 245;
  --pink-rgb:   242, 182, 38;
  --teal-rgb:   219, 179, 255;
  --purple-rgb: 120, 24, 223;
  /* Приток людей и поздравления — «живые» показатели, а не тревожные. */
  --mint-rgb:   106, 214, 158;

  /* Shadows */
  --shadow:      0 18px 60px rgba(0, 0, 0, .45);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .30);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, .35);

  /* Radii */
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm:  8px;

  /* Blur */
  --blur: blur(18px);

  /* Spacing scale */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Sidebar */
  --sidebar-w: 240px;

  /* Parallax input from JS */
  --scrollY: 0px;

  /* Шрифты: заголовки — Oswald, текст и интерфейс — Tektur */
  --font-ui: "Tektur", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Oswald", "Tektur", system-ui, Arial, sans-serif;
}

/* ============================
   Reset & Base
   ============================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.1px;
  color: var(--text);
  /* Ровный тон под всей страницей: градиент рисуется отдельным слоем,
     иначе на длинной странице он растягивается и даёт резкий перепад
     яркости — выглядит как склейка из двух половин. */
  background-color: var(--bg-0);
  overflow-x: hidden;
}

/* Подсветка фона: закреплена за экраном, поэтому одинакова
   и на короткой странице, и на длинной. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(164, 73, 245, .20) 0%, rgba(20, 20, 20, 0) 60%),
    radial-gradient(900px 500px at 70% 20%, rgba(242, 182, 38, .12) 0%, rgba(20, 20, 20, 0) 55%),
    radial-gradient(1200px 800px at 60% 90%, rgba(120, 24, 223, .14) 0%, rgba(20, 20, 20, 0) 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
}

/* Utility */
.hidden { display: none !important; }

/* Custom scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .22);
}

/* Selection */
::selection {
  background: rgba(var(--blue-rgb), .35);
  color: #fff;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 14px 0;
  letter-spacing: -0.2px;
}
h1 { font-size: 1.7rem;  font-weight: 600; }
h2 { font-size: 1.3rem;  font-weight: 500; color: rgba(255, 255, 255, .92); }
h3 { font-size: 1.05rem; font-weight: 500; color: rgba(255, 255, 255, .88); }

p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 12px 0;
}

a {
  color: rgba(170, 190, 255, .95);
  text-decoration: none;
}
a:hover {
  color: rgba(255, 119, 198, .95);
}

hr {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, .10);
  margin: 18px 0;
}

/* ============================
   Background: galaxy + fog
   ============================ */

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

/* Star dust */
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 10%  20%, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 35%  15%, rgba(255, 255, 255, .35) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 65%  30%, rgba(255, 255, 255, .45) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 85%  22%, rgba(255, 255, 255, .30) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 15%  70%, rgba(255, 255, 255, .35) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 55%  78%, rgba(255, 255, 255, .40) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 88%  74%, rgba(255, 255, 255, .32) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 42%  55%, rgba(255, 255, 255, .28) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 72%  62%, rgba(255, 255, 255, .22) 0, rgba(255, 255, 255, 0) 2px),
    radial-gradient(1px 1px at 28%  38%, rgba(255, 255, 255, .30) 0, rgba(255, 255, 255, 0) 2px);
  opacity: .65;
  filter: blur(.2px);
}

.fog {
  position: absolute;
  inset: -25%;
  opacity: .85;
  filter: blur(28px) saturate(1.1);
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  animation: fog-drift-1 26s ease-in-out infinite;
  translate: 0 calc(var(--scrollY) * -0.04);
  background:
    radial-gradient(60% 40% at 20% 30%, rgba(170, 190, 255, .18) 0%, rgba(170, 190, 255, 0) 60%),
    radial-gradient(55% 45% at 70% 25%, rgba(255, 170, 220, .14) 0%, rgba(255, 170, 220, 0) 62%),
    radial-gradient(70% 55% at 55% 75%, rgba(120, 255, 235, .10) 0%, rgba(120, 255, 235, 0) 65%),
    radial-gradient(60% 60% at 30% 85%, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, 0) 70%);
}

.fog.fog2 {
  opacity: .55;
  filter: blur(34px) saturate(1.05);
  animation: fog-drift-2 32s ease-in-out infinite;
  translate: 0 calc(var(--scrollY) * -0.065);
  background:
    radial-gradient(60% 55% at 25% 20%, rgba(120, 255, 235, .10) 0%, rgba(120, 255, 235, 0) 65%),
    radial-gradient(55% 45% at 75% 35%, rgba(255, 170, 220, .10) 0%, rgba(255, 170, 220, 0) 62%),
    radial-gradient(70% 60% at 55% 80%, rgba(170, 190, 255, .12) 0%, rgba(170, 190, 255, 0) 70%);
}

@keyframes fog-drift-1 {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.02); opacity: .82; }
  25%  { transform: translate3d( 2%, -2%, 0) scale(1.05); opacity: .90; }
  50%  { transform: translate3d( 3%,  2%, 0) scale(1.03); opacity: .86; }
  75%  { transform: translate3d(-1%,  3%, 0) scale(1.06); opacity: .92; }
  100% { transform: translate3d(-2%, -1%, 0) scale(1.02); opacity: .82; }
}

@keyframes fog-drift-2 {
  0%   { transform: translate3d( 2%,  1%, 0) scale(1.03); opacity: .52; }
  25%  { transform: translate3d(-1%,  3%, 0) scale(1.06); opacity: .60; }
  50%  { transform: translate3d(-3%, -1%, 0) scale(1.04); opacity: .55; }
  75%  { transform: translate3d( 1%, -3%, 0) scale(1.07); opacity: .62; }
  100% { transform: translate3d( 2%,  1%, 0) scale(1.03); opacity: .52; }
}

@media (prefers-reduced-motion: reduce) {
  .fog, .fog.fog2 { animation: none; }
}

/* ============================
   Layout
   ============================ */

.layout {
  display: flex;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  /* min-width: 0 обязателен: без него контейнер внутри flex не сжимается
     ниже ширины содержимого и распирает страницу вбок на телефоне. */
  min-width: 0;
  width: 100%;
  margin: 0 auto;
  padding: 0 22px;
}

/* ============================
   Sidebar
   ============================ */

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(10, 12, 30, .88), rgba(106, 124, 255, .06));
  border-right: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 2px 0 32px rgba(0, 0, 0, .22);
  position: sticky;
  top: 0;
  /* dvh учитывает панель браузера на телефоне: с vh снизу оставалась
     полоса другого тона. */
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  z-index: 21;
  isolation: isolate;
  flex-shrink: 0;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 28px 16px 20px;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 0 4px;
}

.sidebar-logo-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .96);
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.15;
}

/* Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  font-weight: 500;
  font-size: .92rem;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  isolation: isolate;
}

.nav-link:hover {
  color: rgba(255, 255, 255, .96);
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .08);
  transform: translateX(2px);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--blue-rgb), .22), rgba(var(--pink-rgb), .14));
  border-color: rgba(var(--blue-rgb), .28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .20);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: currentColor;
  opacity: .75;
  transition: opacity .15s ease;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  opacity: 1;
}

/* Legacy sidebar-nav a support (other templates may use plain <a>) */
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  font-weight: 500;
  font-size: .92rem;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.sidebar-nav a:hover {
  color: rgba(255, 255, 255, .96);
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .08);
  transform: translateX(2px);
}

.sidebar-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--blue-rgb), .22), rgba(var(--pink-rgb), .14));
  border-color: rgba(var(--blue-rgb), .28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .20);
  font-weight: 600;
}

/* Spacer pushes profile to bottom */
.sidebar-spacer {
  flex: 1;
  min-height: 16px;
}

/* Density toggle */
.density-toggle {
  margin-bottom: 14px;
}

.density-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  color: rgba(255, 255, 255, .55);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  font-family: var(--font-ui);
}

.density-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: currentColor;
}

.density-btn:hover {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .75);
}

/* Sidebar profile */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  isolation: isolate;
}

.profile-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.profile-name {
  font-size: .9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.profile-role {
  font-size: .75rem;
  color: rgba(255, 255, 255, .50);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Avatar */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(var(--blue-rgb), .8), rgba(var(--pink-rgb), .6));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .30);
  isolation: isolate;
}

/* Logout button */
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: rgba(255, 255, 255, .45);
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
}

.logout-btn svg {
  width: 16px;
  height: 16px;
}

.logout-btn:hover {
  background: rgba(255, 90, 120, .18);
  color: rgba(255, 140, 160, .90);
}

/* ============================
   Main content area
   ============================ */

.main-content {
  flex: 1;
  width: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Top bar with breadcrumb */
.main-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 28px;
  background: rgba(7, 8, 20, .55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  isolation: isolate;
}

.main-content > .container {
  padding: 28px;
  flex: 1;
}

/* ============================
   Breadcrumb
   ============================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb-item {
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .50);
  text-decoration: none;
  transition: color .15s ease;
}

.breadcrumb-item:not(.breadcrumb-current):hover {
  color: rgba(255, 255, 255, .80);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  margin-right: 6px;
  color: rgba(255, 255, 255, .25);
}

.breadcrumb-current {
  color: rgba(255, 255, 255, .75);
  cursor: default;
}

/* ============================
   Page header
   ============================ */

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .96);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: .9rem;
  color: rgba(255, 255, 255, .50);
  margin: 0;
}

/* ============================
   Cards
   ============================ */

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur);
  padding: 20px;
  isolation: isolate;
  transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

/* Nested card */
.card .card {
  background: rgba(10, 12, 20, .28);
  border-color: rgba(255, 255, 255, .10);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

.card .card:hover {
  transform: none;
}

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .88);
  margin: 0;
}

.card-link {
  font-size: .82rem;
  font-weight: 500;
  color: rgba(var(--blue-rgb), .85);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--blue-rgb), .25);
  transition: background .15s ease, color .15s ease;
}

.card-link:hover {
  background: rgba(var(--blue-rgb), .12);
  color: rgba(var(--blue-rgb), 1);
}

/* Reveal animation */
.card.reveal {
  opacity: 0;
  transform: translateY(12px) scale(.99);
  transition: opacity .55s ease, transform .55s ease;
}

.card.reveal.in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================
   Metrics grid
   ============================ */

.metrics-grid {
  display: grid;
  /* auto-fit, а не фиксированные колонки: плиток стало пять, и жёсткая
     сетка оставляла последнюю в одиночестве на своей строке. */
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
}

.metric-card .metric-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.metric-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.metric-body {
  flex: 1;
  min-width: 0;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -1px;
}

.metric-label {
  font-size: .82rem;
  color: rgba(255, 255, 255, .60);
  font-weight: 500;
}

/* Blue variant */
.metric-blue .metric-icon-wrap {
  background: rgba(var(--blue-rgb), .15);
  color: rgba(var(--blue-rgb), 1);
}

.metric-blue .metric-value {
  color: rgba(var(--blue-rgb), 1);
}

.metric-blue .metric-accent {
  background: linear-gradient(90deg, rgba(var(--blue-rgb), .8), rgba(var(--blue-rgb), .2));
}

/* Pink variant */
.metric-pink .metric-icon-wrap {
  background: rgba(var(--pink-rgb), .15);
  color: rgba(var(--pink-rgb), 1);
}

.metric-pink .metric-value {
  color: rgba(var(--pink-rgb), 1);
}

.metric-pink .metric-accent {
  background: linear-gradient(90deg, rgba(var(--pink-rgb), .8), rgba(var(--pink-rgb), .2));
}

/* Teal variant */
.metric-teal .metric-icon-wrap {
  background: rgba(var(--teal-rgb), .15);
  color: rgba(var(--teal-rgb), 1);
}

.metric-teal .metric-value {
  color: rgba(var(--teal-rgb), 1);
}

.metric-teal .metric-accent {
  background: linear-gradient(90deg, rgba(var(--teal-rgb), .8), rgba(var(--teal-rgb), .2));
}

/* ============================
   Dashboard layout grid
   ============================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* ============================
   Incidents table card
   ============================ */

.incidents-card {
  padding: 20px;
}

/* ============================
   Incident badges
   ============================ */

.incident-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: lowercase;
  white-space: nowrap;
}

.badge-warn {
  background: rgba(255, 195, 60, .16);
  border: 1px solid rgba(255, 195, 60, .35);
  color: rgba(255, 210, 90, .95);
}

.badge-ban {
  background: rgba(255, 70, 90, .16);
  border: 1px solid rgba(255, 70, 90, .35);
  color: rgba(255, 110, 120, .95);
}

.badge-mute {
  background: rgba(255, 150, 50, .16);
  border: 1px solid rgba(255, 150, 50, .35);
  color: rgba(255, 175, 80, .95);
}

.badge-kick {
  background: rgba(255, 70, 90, .14);
  border: 1px solid rgba(255, 70, 90, .30);
  color: rgba(255, 100, 115, .95);
}

.badge-unmute {
  background: rgba(var(--teal-rgb), .14);
  border: 1px solid rgba(var(--teal-rgb), .28);
  color: rgba(var(--teal-rgb), .95);
}

.badge-unban {
  background: rgba(var(--teal-rgb), .12);
  border: 1px solid rgba(var(--teal-rgb), .25);
  color: rgba(var(--teal-rgb), .90);
}

.badge-default {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .70);
}

/* ============================
   Quick actions
   ============================ */

.quick-actions-card {
  padding: 20px;
}

.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.quick-action-item:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .12);
  transform: translateX(3px);
  color: inherit;
}

.qa-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qa-icon svg {
  width: 18px;
  height: 18px;
}

.qa-icon-blue   { background: rgba(var(--blue-rgb), .16);   color: rgba(var(--blue-rgb), 1); }
.qa-icon-pink   { background: rgba(var(--pink-rgb), .16);   color: rgba(var(--pink-rgb), 1); }
.qa-icon-teal   { background: rgba(var(--teal-rgb), .16);   color: rgba(var(--teal-rgb), 1); }
.qa-icon-purple { background: rgba(var(--purple-rgb), .16); color: rgba(var(--purple-rgb), 1); }

.qa-body {
  flex: 1;
  min-width: 0;
}

.qa-title {
  font-size: .9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .88);
  line-height: 1.2;
}

.qa-desc {
  font-size: .78rem;
  color: rgba(255, 255, 255, .48);
  margin-top: 2px;
}

.qa-arrow {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, .28);
  flex-shrink: 0;
  transition: color .15s ease;
}

.quick-action-item:hover .qa-arrow {
  color: rgba(255, 255, 255, .55);
}

/* ============================
   Tables
   ============================ */

.table-wrapper {
  border-radius: var(--radius-md);
  /* Широкая таблица прокручивается внутри своей рамки, а не толкает
     всю страницу: hidden просто обрезал бы колонки без доступа к ним. */
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(255, 255, 255, .10);
}

table,
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(0, 0, 0, .14);
}

thead th {
  text-align: left;
  font-size: .78rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  padding: 11px 14px;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  font-weight: 600;
  white-space: nowrap;
}

.data-table thead th {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(20, 25, 60, .80);
  font-size: .78rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .82);
  font-size: .88rem;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, .04);
}

tbody tr:last-child td {
  border-bottom: none;
}

.td-time {
  color: rgba(255, 255, 255, .50);
  font-size: .8rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.td-reason {
  color: rgba(255, 255, 255, .60);
  font-size: .85rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-cell {
  text-align: center;
  color: rgba(255, 255, 255, .40);
  padding: 32px 14px;
  font-size: .9rem;
}

/* ============================
   Buttons
   ============================ */

/* Иконка в кнопке всегда фиксированного размера: без этого svg
   без явных размеров растягивается флексом на всю высоту кнопки. */
.btn svg,
button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .92);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-decoration: none;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(var(--blue-rgb), .50), rgba(var(--pink-rgb), .32));
  border-color: rgba(255, 255, 255, .16);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(var(--blue-rgb), .65), rgba(var(--pink-rgb), .42));
}

.btn-danger {
  background: linear-gradient(135deg, rgba(255, 70, 90, .30), rgba(255, 140, 160, .16));
  border-color: rgba(255, 255, 255, .14);
}

.btn-danger:hover {
  background: linear-gradient(135deg, rgba(255, 70, 90, .42), rgba(255, 140, 160, .24));
}

.btn-xs {
  padding: 5px 10px;
  font-size: .78rem;
  border-radius: 9px;
}

/* ============================
   Badges
   ============================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .2px;
}

.badge-admin {
  background: rgba(var(--blue-rgb), .18);
  border: 1px solid rgba(var(--blue-rgb), .35);
}

.badge-super {
  background: rgba(var(--pink-rgb), .18);
  border: 1px solid rgba(var(--pink-rgb), .35);
}

.badge-user {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
}

/* ============================
   Forms
   ============================ */

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .72);
  letter-spacing: .2px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, .35);
  pointer-events: none;
  flex-shrink: 0;
}

.password-toggle {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .35);
  cursor: pointer;
  padding: 0;
  transition: color .15s ease, background .15s ease;
}

.password-toggle:hover {
  color: rgba(255, 255, 255, .70);
  background: rgba(255, 255, 255, .07);
  transform: none;
  box-shadow: none;
}

.eye-icon {
  width: 16px;
  height: 16px;
}

.form-actions {
  padding-top: 4px;
}

input,
select,
textarea,
.input {
  width: 100%;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, .92);
  padding: 11px 14px;
  font-size: .92rem;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder,
textarea::placeholder {
  /* .28 на тёмном фоне почти не читалось */
  color: rgba(255, 255, 255, .45);
}

input.input-with-icon {
  padding-left: 38px;
}

input.input-with-toggle {
  padding-right: 42px;
}

input:focus,
select:focus,
textarea:focus,
.input:focus {
  border-color: rgba(var(--blue-rgb), .45);
  box-shadow: 0 0 0 4px rgba(var(--blue-rgb), .12);
}

select,
select option {
  color: #23243a;
  background: #fff;
}

/* Compact number input */
.input-compact {
  width: 140px;
  height: 34px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
}

/* ============================
   Alert
   ============================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: .88rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(255, 70, 90, .13);
  border: 1px solid rgba(255, 70, 90, .30);
  color: rgba(255, 130, 140, .95);
}

.alert-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ============================
   Login page
   ============================ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 24px 0;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: rgba(var(--blue-rgb), .10);
  border: 1px solid rgba(var(--blue-rgb), .22);
  border-radius: 18px;
}

.login-logo-svg {
  width: 40px;
  height: 40px;
}

.login-title {
  font-family: var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 1.35rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .95);
  margin-bottom: 6px;
}

.login-subtitle {
  color: rgba(255, 255, 255, .62);
  font-size: .88rem;
  color: rgba(255, 255, 255, .48);
  margin: 0;
}

.btn-login {
  background: var(--brand-1);
  color: #fff;
  /* Свечение вместо тени — так оформлены кнопки на сайте сети */
  box-shadow: 0 0 28px 10px rgba(var(--blue-rgb), .32),
              0 0 20px rgba(var(--blue-rgb), .52);
  width: 100%;
  /* Одной высоты с полями ввода */
  height: 43px;
  padding: 0 20px;
  font-size: .95rem;
}

/* When login page is shown, hide the breadcrumb topbar */
.login-page ~ * .main-topbar {
  display: none;
}

/* ============================
   Toggle Switch
   ============================ */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.toggle-ui {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
  position: relative;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  flex: 0 0 auto;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .90);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
  transition: transform .18s ease, background .18s ease;
}

.toggle-input:checked + .toggle-ui {
  background: rgba(var(--purple-rgb), .40);
  border-color: rgba(var(--purple-rgb), .60);
  box-shadow: 0 0 0 4px rgba(var(--purple-rgb), .14);
}

.toggle-input:checked + .toggle-ui::after {
  transform: translateY(-50%) translateX(18px);
}

.toggle-input:focus-visible + .toggle-ui {
  outline: none;
  box-shadow: 0 0 0 4px rgba(var(--purple-rgb), .20);
}

.toggle-input:disabled + .toggle-ui {
  opacity: .55;
  cursor: not-allowed;
}

/* ============================
   Toggle list + rows
   ============================ */

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 18px;
  max-width: 560px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.toggle-row:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .14);
}

.toggle-label {
  font-weight: 600;
  color: rgba(255, 255, 255, .90);
}

/* ============================
   Settings layout
   ============================ */

.settings {
  max-width: 720px;
}

.settings-group {
  margin: 16px 0 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .10);
}

.settings-group-title {
  font-size: .80rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .50);
  margin: 4px 4px 12px;
  font-weight: 600;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: background .18s ease, border-color .18s ease;
}

.setting-row + .setting-row {
  margin-top: 10px;
}

.setting-row:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .14);
}

.setting-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Подпись занимает свободное место, но не ужимается в ноль:
     без min-width текст схлопывался и наезжал на элемент управления. */
  flex: 1 1 auto;
  min-width: 160px;
}

.setting-title {
  font-weight: 650;
  color: rgba(255, 255, 255, .92);
  line-height: 1.15;
}

.setting-hint {
  font-size: .82rem;
  color: rgba(255, 255, 255, .52);
  line-height: 1.15;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.setting-row.toggle {
  cursor: pointer;
}

.setting-row.toggle .toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.setting-row.toggle .toggle-ui {
  width: 46px;
  height: 26px;
}

.setting-row.toggle .toggle-ui::after {
  width: 20px;
  height: 20px;
}

.setting-row.toggle .toggle-input:checked + .toggle-ui {
  background: rgba(var(--purple-rgb), .45);
  border-color: rgba(var(--purple-rgb), .70);
}

.setting-row.toggle .toggle-input:checked + .toggle-ui::after {
  transform: translateY(-50%) translateX(20px);
}

.settings-actions {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Value badge */
.value-badge {
  min-width: 44px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .85);
  font-weight: 650;
}

/* ============================
   Toolbar (filter bars)
   ============================ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .10);
  backdrop-filter: blur(14px);
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1;
}

.toolbar-field label {
  font-size: .78rem;
  color: rgba(255, 255, 255, .55);
  letter-spacing: .3px;
  font-weight: 500;
}

.toolbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.toolbar:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, .30);
  transition: box-shadow .2s ease;
}

/* ============================
   Empty state
   ============================ */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  opacity: .70;
}

.empty-state h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.empty-state p {
  color: rgba(255, 255, 255, .52);
  font-size: .88rem;
}

/* ============================
   Topbar (legacy, unused but kept for other templates)
   ============================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 12, 30, .55);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  isolation: isolate;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0;
  color: rgba(255, 255, 255, .95);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: rgba(255, 255, 255, .86);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  padding: 10px 12px;
  border-radius: 999px;
  transition: transform .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .06);
}

.nav a:hover {
  color: rgba(255, 255, 255, .96);
  background: rgba(255, 255, 255, .10);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  transform: translateY(-1px);
}

.nav a.active {
  background: linear-gradient(135deg, rgba(var(--blue-rgb), .22), rgba(var(--pink-rgb), .16));
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .20);
}

/* ============================
   Compact density mode
   ============================ */

body.compact .main-content > .container {
  padding: 18px 20px;
}

body.compact .card {
  padding: 14px;
}

body.compact .metrics-grid {
  gap: 10px;
  margin-bottom: 16px;
}

body.compact .metric-card {
  padding: 14px 16px;
}

body.compact .metric-value {
  font-size: 1.6rem;
}

body.compact .metric-icon-wrap {
  width: 38px;
  height: 38px;
}

body.compact .metric-icon-wrap svg {
  width: 18px;
  height: 18px;
}

body.compact .dashboard-grid {
  gap: 10px;
}

body.compact .quick-action-item {
  padding: 8px 12px;
}

body.compact .qa-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

body.compact .qa-icon svg {
  width: 14px;
  height: 14px;
}

body.compact .qa-desc {
  display: none;
}

body.compact thead th,
body.compact tbody td {
  padding: 8px 12px;
}

body.compact .setting-row {
  padding: 9px 12px;
}

body.compact .sidebar-inner {
  padding: 20px 12px 14px;
}

body.compact .sidebar-nav {
  gap: 2px;
}

body.compact .nav-link,
body.compact .sidebar-nav a {
  padding: 7px 10px;
  font-size: .88rem;
}

body.compact .main-topbar {
  padding: 10px 20px;
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions-card {
    order: -1;
  }

  .quick-actions-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }

  .sidebar-logo-text { display: none; }
  .sidebar-logo { justify-content: center; padding: 0; }

  .nav-link span,
  .sidebar-nav a span { display: none; }

  .nav-link,
  .sidebar-nav a {
    justify-content: center;
    padding: 10px;
    gap: 0;
  }

  .nav-icon { width: 20px; height: 20px; opacity: .80; }

  .density-btn span { display: none; }
  .density-btn { justify-content: center; padding: 8px; }

  .sidebar-profile {
    flex-direction: column;
    padding: 8px 6px;
    gap: 6px;
  }

  .profile-info { display: none; }

  .logout-btn {
    width: 100%;
    justify-content: center;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .container { padding: 0 14px; }
  .main-content > .container { padding: 16px; }
  .main-topbar { padding: 10px 16px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .quick-actions-list { grid-template-columns: 1fr; }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .login-card { padding: 24px 18px; }
}

/* ============================
   Spacing utilities
   ============================ */

.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-2 { margin-left: 8px; }

/* ============================
   Inline form (кнопки удаления в строке)
   ============================ */

.form-inline { display: inline; }

/* ============================
   Action row (кнопки действий в ряд)
   ============================ */

.action-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================
   Alert variants
   ============================ */

.alert-success {
  color: rgba(89, 255, 209, .9);
  margin-top: 8px;
}

.alert-muted {
  color: rgba(255, 255, 255, .55);
}

/* ============================
   Toolbar spaced
   ============================ */

.toolbar--spaced { margin-bottom: 24px; }

/* ============================
   Button row
   ============================ */

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================
   Инструкция по подключению чата
   ============================ */

.connect-guide {
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  /* Текст читается слева: по центру нумерованный список разъезжается */
  text-align: left;
}

.connect-guide h3 {
  margin-bottom: var(--sp-4);
}

.connect-lead {
  color: var(--muted);
  margin-bottom: var(--sp-5);
}

.connect-steps {
  margin: 0 0 var(--sp-5) 0;
  padding-left: var(--sp-6);
  display: grid;
  gap: var(--sp-5);
}

.connect-steps li {
  color: var(--text);
  line-height: 1.55;
}

.connect-hint {
  color: var(--muted);
  font-size: .9rem;
  margin-top: var(--sp-2);
  line-height: 1.5;
}

.connect-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.connect-actions .connect-hint {
  margin-top: 0;
}

@media (max-width: 900px) {
  .connect-guide { padding: var(--sp-4); }
  .connect-actions { flex-direction: column; align-items: flex-start; }
}

.connect-rights {
  margin: var(--sp-2) 0 var(--sp-2) 0;
  padding-left: var(--sp-5);
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}

.connect-rights b {
  color: var(--text);
}

/* ============================
   Страница настроек чата
   ============================ */

.chat-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  background: var(--panel-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
}

.chat-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-summary-label {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.chat-summary-value {
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Вкладки: без стилей они выглядели строкой обычных ссылок */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--stroke);
}

.tabs .tab {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .92rem;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}

.tabs .tab:hover {
  background: var(--panel-2);
  color: var(--text);
}

.tabs .tab.active {
  background: rgba(var(--blue-rgb), .22);
  color: var(--text);
  font-weight: 500;
}

@media (max-width: 900px) {
  .chat-summary { gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); }
  .tabs .tab { padding: var(--sp-2) var(--sp-3); font-size: .88rem; }
}

/* Ни один блок не должен распирать страницу по горизонтали */
.layout,
.main,
.card {
  min-width: 0;
}

/* ============================
   Настройки на узких экранах
   ============================ */

@media (max-width: 600px) {
  /* Подпись сверху, элемент управления под ней: в строку они
     не помещаются, и текст наезжал на поля ввода. */
  .setting-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
  }

  .setting-left {
    min-width: 0;
  }

  .setting-control {
    width: 100%;
    justify-content: flex-start;
  }

  .setting-control select,
  .setting-control input[type="text"],
  .setting-control input[type="number"] {
    width: 100%;
  }

  /* Переключатель остаётся справа от подписи — он узкий и помещается */
  .setting-row.toggle {
    flex-direction: row;
    align-items: center;
  }

  .setting-row.toggle .setting-control {
    width: auto;
    flex: 0 0 auto;
  }

  /* Вкладки прокручиваются в одну строку вместо трёх рядов.
     Затемнение справа подсказывает, что список продолжается. */
  .tabs {
    position: relative;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
    mask-image: linear-gradient(to right, #000 85%, transparent 100%);
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .chat-summary {
    flex-direction: column;
    gap: var(--sp-3);
  }
}

.nowrap { white-space: nowrap; }

.holiday-text {
  font-size: .88rem;
  margin-top: 3px;
  line-height: 1.45;
}

/* Фильтры праздников: одна строка вместо трёх, чтобы таблица
   попадала в первый экран. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-3);
}

.filter-bar .form-field {
  flex: 1 1 160px;
  min-width: 140px;
  margin: 0;
}

.filter-bar .form-field:last-child {
  flex: 0 0 auto;
  display: flex;
  gap: var(--sp-2);
}

.holiday-next {
  color: var(--text);
  margin: 0;
}

.holiday-help summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .9rem;
  padding: var(--sp-2) 0 0 0;
}

.holiday-help summary:hover {
  color: var(--text);
}

.holiday-help[open] summary {
  margin-bottom: var(--sp-2);
}

@media (max-width: 600px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  /* flex сбрасывается обязательно: в колонке базис 160px становится
     высотой, и поля раздуваются вдвое против содержимого. */
  .filter-bar .form-field {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }
}
