@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   FEARSUPPORT — тёмная панель (glassmorphism, акцент #5865F2)
   ============================================================ */

:root {
  /* палитра */
  --bg-0: #0a0a0f;
  --bg-1: #0d0c14;
  --bg-2: #12101d;
  --bg-3: #181527;
  --bg-4: #1f1b31;
  --panel2: rgba(255, 255, 255, 0.03);

  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.04);

  --violet: #5865F2;
  --violet-bright: #7c8cf8;
  --violet-dim: #4a56d6;
  --violet-faint: rgba(88, 101, 242, 0.14);

  --text: #f2f1f8;
  --text-dim: #a9a6bf;
  --text-faint: #7d7a96;

  --ok: #57F287;
  --warn: #fbbf24;
  --bad: #ED4245;

  --ok-soft: rgba(87, 242, 135, 0.12);
  --warn-soft: rgba(251, 191, 36, 0.12);
  --bad-soft: rgba(237, 66, 69, 0.12);
  --violet-soft: rgba(88, 101, 242, 0.14);

  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'Inter', system-ui, sans-serif;

  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ---- фон: #0a0a0f + мягкие фиолетово-синие свечения по краям ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 700px at 0% 50%, rgba(88, 101, 242, 0.15), transparent 62%),
    radial-gradient(900px 700px at 100% 50%, rgba(124, 58, 237, 0.13), transparent 62%),
    radial-gradient(1200px 700px at 50% -12%, rgba(88, 101, 242, 0.08), transparent 60%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 40% at 50% 110%, rgba(88, 101, 242, 0.06), transparent 70%);
}

.scanlines { display: none; }

.container { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }

/* ============================================================
   УТИЛИТЫ
   ============================================================ */
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-faint); }
.hlg { color: var(--text-dim); }
.violet { color: var(--violet-bright); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* ============================================================
   СКРОЛЛБАР
   ============================================================ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 5px; border: 2px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: var(--violet-dim); }

::selection { background: rgba(139, 92, 246, 0.35); color: #fff; }

/* ============================================================
   LED / ИНДИКАТОРЫ
   ============================================================ */
.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
  flex-shrink: 0;
  position: relative;
}
.led-on { background: var(--ok); box-shadow: 0 0 10px rgba(52, 211, 153, 0.8); }
.led-on::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(52, 211, 153, 0.45);
  animation: led-pulse 2s ease-out infinite;
}
.led-off { background: var(--text-faint); }
.led-warn { background: var(--warn); box-shadow: 0 0 10px rgba(251, 191, 36, 0.7); }
.led-bad { background: var(--bad); box-shadow: 0 0 10px rgba(248, 113, 113, 0.7); }
.led-violet { background: var(--violet-bright); box-shadow: 0 0 10px rgba(167, 139, 250, 0.8); }

@keyframes led-pulse {
  0% { transform: scale(0.8); opacity: 1; }
  70% { transform: scale(1.8); opacity: 0; }
  100% { opacity: 0; }
}

/* ============================================================
   GLASS-БЛОК (полупрозрачная карточка с блюром)
   ============================================================ */
.hud {
  position: relative;
  background: rgba(21, 19, 33, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.hud:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hud-label .idx { color: var(--violet-bright); }

/* ============================================================
   КНОПКИ (пилюли, без острых углов)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
  user-select: none;
}
.btn:hover {
  border-color: var(--violet-bright);
  color: var(--violet-bright);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: linear-gradient(90deg, #5865F2, #7c3aed);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 28px rgba(88, 101, 242, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(90deg, #6570f5, #8b4cf5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 36px rgba(88, 101, 242, 0.5);
}

.btn-danger {
  border-color: rgba(237, 66, 69, 0.4);
  color: var(--bad);
}
.btn-danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }

.btn-success { border-color: rgba(87, 242, 135, 0.4); color: var(--ok); }
.btn-success:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }

.btn-ghost { border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--line-strong); color: var(--text); background: var(--bg-3); }
.btn-warn { border-color: rgba(254, 231, 92, 0.35); color: #fee75c; }
.btn-warn:hover { background: rgba(254, 231, 92, 0.1); border-color: rgba(254, 231, 92, 0.6); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 11px; }

.btn-icon { padding: 0.5rem 0.7rem; }
.btn-icon svg { width: 15px; height: 15px; }

.kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 5px;
  background: var(--bg-2);
}

/* ============================================================
   НАВБАР
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.5rem;
  background: rgba(10, 10, 15, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(160deg, #5865F2, #7c3aed);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.35);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.nav-right { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { font-family: var(--font-ui); font-size: 13px; font-weight: 600; color: var(--text-dim); padding: 8px 14px; border-radius: 999px; text-decoration: none; transition: color .15s, background .15s; }
.nav-link:hover { color: var(--text); background: rgba(124, 140, 248, 0.1); }
.nav-link-active { color: #fff; background: linear-gradient(90deg, rgba(88, 101, 242, 0.35), rgba(124, 58, 237, 0.35)); }

.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}
.nav-user-name { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }

/* ============================================================
   ПРОФИЛЬ СВЕРХУ
   ============================================================ */
.user-chip { display: inline-flex; align-items: center; gap: 10px; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); }

/* ============================================================
   ЗАГОЛОВКИ СТРАНИЦ
   ============================================================ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.page-title .dot { color: var(--violet-bright); }

/* ============================================================
   СТАТИСТИКА (модули приборов)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 16px;
  margin-bottom: 2.5rem;
}
.stat {
  padding: 1.1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--violet-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.violet { color: var(--violet-bright); }
.stat-icon.ok { color: var(--ok); }
.stat-icon.bad { color: var(--bad); }
.stat-icon.warn { color: var(--warn); }
.stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label { font-size: 12.5px; color: var(--text-dim); }
.stat-foot { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--text-faint); text-transform: uppercase; }

/* ============================================================
   БЕЙДЖИ
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-open { color: var(--ok); background: var(--ok-soft); border-color: rgba(87, 242, 135, 0.25); }
.badge-closed { color: var(--bad); background: var(--bad-soft); border-color: rgba(237, 66, 69, 0.25); }
.badge-accepted { color: var(--violet-bright); background: var(--violet-soft); border-color: rgba(124, 140, 248, 0.3); }

/* ============================================================
   ТИКЕТЫ — СПИСОК/СТРОКИ ТЕРМИНАЛА
   ============================================================ */
.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-item {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.95rem 1.25rem;
  background: rgba(21, 19, 33, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.ticket-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #7c8cf8, #5865F2);
  opacity: 0;
  transition: opacity 0.2s;
}
.ticket-row:hover {
  border-color: rgba(124, 140, 248, 0.4);
  background: rgba(30, 27, 48, 0.6);
}
.ticket-row:hover::before { opacity: 1; }

.ticket-id {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--violet-bright);
  letter-spacing: 0.04em;
}
.ticket-info { min-width: 0; }
.ticket-subject {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-preview {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ticket-user img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.ticket-user span {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
  white-space: nowrap;
}

/* пустое состояние */
.empty-state {
  padding: 3.5rem 1.5rem;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
}
.empty-state .line { color: var(--violet); }
.empty-state .e-icon { font-size: 13px; margin-bottom: 14px; color: var(--text-faint); }

/* ============================================================
   СТРАНИЦА ТИКЕТА
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--violet-bright); }
.back-link svg { width: 14px; height: 14px; }

.closed-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid rgba(237, 66, 69, 0.3);
  border-radius: 14px;
  background: var(--bad-soft);
  color: var(--bad);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.ticket-head h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.02em; }
.ticket-meta {
  margin-top: 10px;
  display: flex;
  gap: 12px 22px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.ticket-meta b { color: var(--text); font-weight: 600; }
.ticket-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----- окно сообщений (современный чат) ----- */
.msgs {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.msg {
  display: flex;
  gap: 12px;
  max-width: 82%;
}
.msg .msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  margin-top: 20px;
}
.msg-body {
  min-width: 0;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--ok);
  border-radius: 18px;
  border-top-left-radius: 6px;
}
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.msg-name { font-family: var(--font-mono); font-weight: 600; font-size: 12px; color: var(--text-dim); letter-spacing: 0.03em; }
.msg-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.msg-text { font-size: 14px; color: var(--text); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.msg-attach { display: block; max-width: min(420px, 100%); max-height: 320px; object-fit: cover; border-radius: 14px; margin-top: 8px; border: 1px solid rgba(124, 140, 248, 0.25); background: var(--panel2); }
.msg-file { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--violet-bright); text-decoration: underline; word-break: break-all; }

/* ============================================================
   ПУЗЫРИ ПЕРСОНАЛА (фиолетовый) / ПОЛЬЗОВАТЕЛЕЙ (зелёный)
   ============================================================ */
.msg-staff .msg-body {
  background: linear-gradient(180deg, rgba(88, 101, 242, 0.18), rgba(30, 27, 48, 0.75));
  border-color: rgba(124, 140, 248, 0.35);
  border-left-color: var(--violet);
  border-top-left-radius: 18px;
  border-bottom-right-radius: 6px;
}
.msg-staff .msg-name { color: var(--violet-bright); }
.staff-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--violet-soft);
  border: 1px solid rgba(124, 140, 248, 0.3);
  color: var(--violet-bright);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* системные сообщения — центрированная пилюля с мягким градиентом */
.sys-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  align-self: center;
  width: auto;
  max-width: 92%;
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(124, 140, 248, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(88, 101, 242, 0.22), rgba(124, 58, 237, 0.12));
}
.sys-msg .sys-led { flex-shrink: 0; }
.sys-title { font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet-bright); }
.sys-text { font-size: 13px; color: var(--text-dim); margin-top: 2px; text-align: left; }
.sys-text b { color: var(--text); }

/* ----- поле ответа ----- */
.reply-box { padding: 1.25rem; }
.reply-box-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.reply-box-head .prompt { color: var(--violet-bright); }
.reply-row { display: flex; gap: 12px; align-items: flex-start; }
.reply-row .msg-avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); flex-shrink: 0; }

textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0.9rem 1rem;
  border-radius: 14px;
  resize: vertical;
  min-height: 96px;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea::placeholder { color: var(--text-faint); }
textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}

.reply-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.reply-hint { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--text-faint); text-transform: uppercase; }

/* ============================================================
   ЛОГИН — центрированная glass-карточка
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.auth-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.2rem 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(16, 15, 26, 0.62);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  padding: 2.4rem 2.1rem 1.8rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: afade 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.auth-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.1rem;
  border-radius: 15px;
  background: linear-gradient(160deg, #5865F2, #7c3aed);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 10px 30px rgba(88, 101, 242, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.auth-logo svg { width: 30px; height: 30px; }
.auth-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.15;
}
.auth-by {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-faint);
}
.auth-by b { color: var(--violet-bright); font-weight: 600; }
.auth-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 1.5rem 0;
}
.auth-welcome {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.01em;
}
.auth-desc {
  margin: 8px 0 1.6rem;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.6;
}
.auth-btn {
  width: 100%;
  height: 52px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  gap: 12px;
}
.auth-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.auth-agree {
  margin-top: 1.15rem;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
}
.auth-agree a {
  color: var(--violet-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-agree a:hover { color: #9db0ff; }
.auth-limit {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-faint);
  opacity: 0.75;
}
.auth-foot {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.2rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* служебные (используются в error.ejs и пустых состояниях) */
.access-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.boot-cursor {
  display: inline-block;
  width: 9px;
  height: 16px;
  background: var(--violet-bright);
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }

/* ============================================================
   ТИКЕТ: 3-КОЛОНОЧНАЯ ПАНЕЛЬ (чат + сайдбары)
   ============================================================ */
body.ticket-page {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
.panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 300px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* --- левый сайдбар: список тикетов --- */
.ticket-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(14, 13, 22, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.sidebar-head { padding: 1rem 1.1rem 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.sidebar-title { font-weight: 700; font-size: 15px; display: block; margin-bottom: 10px; }
.filter-pills { display: flex; gap: 6px; }
.pill {
  flex: 1;
  padding: 6px 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pill:hover { color: var(--text); border-color: rgba(124, 140, 248, 0.4); }
.pill.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.5), rgba(124, 58, 237, 0.5));
  border-color: transparent;
}
.ticket-chat-list { flex: 1; overflow-y: auto; padding: 0.6rem; display: flex; flex-direction: column; gap: 4px; }
.tchat-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.tchat-row:hover { background: rgba(255, 255, 255, 0.04); }
.tchat-row.active {
  background: rgba(88, 101, 242, 0.12);
  border-color: rgba(124, 140, 248, 0.35);
}
.tchat-row.active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 12%;
  bottom: 12%;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #7c8cf8, #5865F2);
}
.tchat-row img { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.12); flex-shrink: 0; }
.tchat-info { min-width: 0; flex: 1; }
.tchat-top { display: flex; align-items: baseline; gap: 6px; }
.tchat-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tchat-id { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.tchat-time { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.tchat-preview { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tchat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-open { background: var(--ok); box-shadow: 0 0 8px rgba(87, 242, 135, 0.7); }
.dot-closed { background: var(--bad); box-shadow: 0 0 8px rgba(237, 66, 69, 0.7); }
.dot-mine { background: var(--violet-bright); box-shadow: 0 0 8px rgba(124, 140, 248, 0.8); }

/* --- центр: чат --- */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(14, 13, 22, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.chat-head-avatar { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14); flex-shrink: 0; }
.chat-user-info { min-width: 0; flex: 1; }
.chat-name { font-weight: 700; font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.chat-head-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: rgba(124, 140, 248, 0.45); background: rgba(88, 101, 242, 0.12); }
.icon-btn svg { width: 18px; height: 18px; }

.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 10px; }

.lock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 1.2rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
  color: var(--warn);
  font-size: 13px;
}
.lock-banner b { color: var(--text); }

.chat-input {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.8rem 1.2rem 1rem;
  background: rgba(14, 13, 22, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.templates-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.templates-row::-webkit-scrollbar { display: none; }
.tpl {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 12px;
  transition: all 0.15s;
}
.tpl:hover { color: #fff; border-color: rgba(124, 140, 248, 0.5); background: rgba(88, 101, 242, 0.15); }

/* ── Шаблоны: dropdown + кнопка ── */
.tpl-dropdown-wrap { position: relative; flex-shrink: 0; }
.tpl-plus-btn {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim); font-size: 18px; font-weight: 700; font-family: var(--font-ui);
  display: grid; place-items: center; transition: all 0.15s; flex-shrink: 0;
}
.tpl-plus-btn:hover { color: var(--violet-bright); border-color: rgba(124,140,248,0.4); background: rgba(88,101,242,0.1); }
.tpl-plus-btn:disabled { opacity: 0.3; pointer-events: none; }
.tpl-dropdown {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 260px; max-width: 360px; max-height: 280px; overflow-y: auto;
  background: var(--bg-2); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.tpl-dropdown::-webkit-scrollbar { width: 5px; }
.tpl-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; }
.tpl-dropdown-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 8px 12px; border-radius: 8px; border: none; background: none;
  color: var(--text-dim); font-family: var(--font-ui); font-size: 12.5px;
  transition: all 0.12s; line-height: 1.4;
}
.tpl-dropdown-item:hover { background: rgba(124,140,248,0.12); color: var(--text); }
.tpl-add textarea,
.tpl-row textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-ui);
  font-size: 13.5px;
  resize: vertical;
}
.tpl-list { display: flex; flex-direction: column; gap: 12px; }
.tpl-row { border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 0.8rem; background: rgba(255, 255, 255, 0.02); }
.tpl-row-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tpl-pos { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.1em; }
.tpl-row-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.staff-row {
  display: flex; gap: 12px; align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.02);
}
.staff-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.staff-info { flex: 0 0 200px; text-align: left; min-width: 0; }
.staff-name { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-row input[type="text"] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  font-family: var(--font-ui);
  font-size: 13px;
}
.staff-label-add input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  font-family: var(--font-ui);
  font-size: 13px;
}

/* --- прикрепление файлов в запросе доказательств --- */
.attach-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.attach-btn:hover { color: var(--text); border-color: rgba(124, 140, 248, 0.45); background: rgba(124, 140, 248, 0.1); }
.attach-btn svg { width: 17px; height: 17px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(124, 140, 248, 0.35);
  background: rgba(124, 140, 248, 0.08);
  color: var(--text);
  font-size: 12px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip-x {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.attach-chip-x:hover { color: var(--bad); }

/* --- блок модератора в правой панели запроса --- */
.up-mod {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0.3rem 0.4rem;
}
.up-mod-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(124, 140, 248, 0.35);
}
.input-row { display: flex; align-items: flex-end; gap: 10px; }
.input-row textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-radius: 14px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-row textarea::placeholder { color: var(--text-faint); }
.input-row textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18); }
.input-row textarea:disabled { opacity: 0.5; }
.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #5865F2, #7c3aed);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
  transition: transform 0.1s, box-shadow 0.2s;
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(88, 101, 242, 0.55); }
.send-btn:disabled { opacity: 0.5; pointer-events: none; }
.send-btn svg { width: 20px; height: 20px; }

/* --- правый сайдбар: профиль пользователя --- */
/* ═══════════════════════════════════════════
   ПРАВОЕ МЕНЮ (user-panel) — тикет
   ═══════════════════════════════════════════ */
.user-panel {
  border-left: 1px solid var(--line);
  background: var(--bg-1);
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.user-panel::-webkit-scrollbar { width: 6px; }
.user-panel::-webkit-scrollbar-thumb { background: rgba(124, 140, 248, 0.2); border-radius: 6px; }
.user-panel::-webkit-scrollbar-track { background: transparent; }

/* ── Профиль ── */
.up-profile {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.9rem; border-radius: 14px;
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.18);
}
.up-avatar-wrap { position: relative; flex-shrink: 0; }
.up-avatar {
  width: 56px; height: 56px; border-radius: 16px; object-fit: cover;
  border: 2px solid rgba(88, 101, 242, 0.4);
}
.up-presence {
  position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px;
  border-radius: 50%; border: 2.5px solid var(--bg-1);
}
.up-presence.online { background: var(--ok); animation: fpPulse 2s infinite; }
.up-presence.off { background: #555; }
@keyframes fpPulse {
  0% { box-shadow: 0 0 0 0 rgba(87, 242, 135, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(87, 242, 135, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 242, 135, 0); }
}
.up-meta { min-width: 0; flex: 1; }
.up-name {
  font-weight: 700; font-size: 15px; line-height: 1.2; word-break: break-word;
  color: var(--text);
}
.up-id {
  font-size: 11px; color: var(--text-faint); display: inline-flex;
  align-items: center; gap: 5px; margin-top: 4px; font-family: var(--font-mono);
}
.copy-btn {
  display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 6px; cursor: pointer; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); color: var(--text-faint);
  transition: all 0.15s; vertical-align: middle;
}
.copy-btn:hover { color: var(--violet-bright); border-color: rgba(124,140,248,0.4); }
.copy-btn svg { width: 11px; height: 11px; }
.up-status {
  margin-top: 6px; display: inline-flex; align-items: center;
  gap: 6px; font-size: 11.5px; color: var(--text-dim);
}

/* ── Статистика ── */
.up-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.up-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255,255,255,0.05);
}
.up-stat-val { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--text); line-height: 1; }
.up-stat-val.warn-val { color: var(--warn); }
.up-stat-val.ban-val { color: var(--bad); }
.up-stat-val.kick-val { color: var(--ok); }
.up-stat-val.mute-val { color: var(--violet-bright); }
.up-stat-lbl { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }

/* ── FearProject профиль в тикете ── */
.up-fear-card .fear-profile { display: flex; flex-direction: column; gap: 6px; }
.up-fear-card .fear-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.fear-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.fear-lbl { color: var(--text-dim); }
.fear-val { color: var(--text); font-family: var(--font-mono); font-size: 12px; }

/* ── Карточки секций ── */
.up-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 0.75rem;
}
.up-card-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.65rem;
}
.up-ico {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(88, 101, 242, 0.15); color: var(--violet-bright); flex-shrink: 0;
}
.up-ico svg { width: 13px; height: 13px; }
.up-card-title { color: var(--text-dim); }

/* ── Быстрые действия ── */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.qa {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 9px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255,255,255,0.06);
  color: var(--text); font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  transition: all 0.15s;
}
.qa:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); }
.qa:disabled { opacity: 0.35; pointer-events: none; }
.qa-ico {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.05); flex-shrink: 0; transition: all 0.15s;
}
.qa-ico svg { width: 14px; height: 14px; }
.qa-mute:hover { border-color: rgba(251, 191, 36, 0.4); } .qa-mute:hover .qa-ico { background: rgba(251,191,36,0.12); color: var(--warn); }
.qa-kick:hover { border-color: rgba(87, 242, 135, 0.4); } .qa-kick:hover .qa-ico { background: rgba(87,242,135,0.12); color: var(--ok); }
.qa-ban:hover { border-color: rgba(237, 66, 69, 0.4); } .qa-ban:hover .qa-ico { background: rgba(237,66,69,0.12); color: var(--bad); }
.qa-warn:hover { border-color: rgba(124, 140, 248, 0.4); } .qa-warn:hover .qa-ico { background: rgba(124,140,248,0.12); color: var(--violet-bright); }
.qa-unmute:hover { border-color: rgba(87, 242, 135, 0.4); } .qa-unmute:hover .qa-ico { background: rgba(87,242,135,0.12); color: var(--ok); }
.qa-unwarn:hover { border-color: rgba(87, 242, 135, 0.4); } .qa-unwarn:hover .qa-ico { background: rgba(87,242,135,0.12); color: var(--ok); }

/* ── Инфо тикета ── */
.up-row {
  font-size: 12px; color: var(--text-dim); display: flex;
  justify-content: space-between; gap: 8px; margin-bottom: 7px;
}
.up-row:last-child { margin-bottom: 0; }
.up-row b { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer { display: flex; flex-direction: column; gap: 7px; margin-top: 0.15rem; }
.transfer select {
  width: 100%; padding: 0.55rem 0.75rem; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text); font-family: var(--font-ui); font-size: 12.5px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
.transfer select:focus { outline: none; border-color: var(--violet); }
.transfer select:disabled { opacity: 0.35; }
.transfer .btn-primary { width: 100%; justify-content: center; padding: 0.55rem; border-radius: 10px; font-weight: 700; font-size: 12px; }

/* ── Наказания / FearProject внутри карточек ── */
.up-card .punish-block { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); border-radius: 10px; padding: 7px 9px; margin-top: 5px; }
.punish-search { display: flex; gap: 6px; margin: 8px 0 0; }
.punish-input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); color: var(--text);
  border-radius: 8px; padding: 0.45rem 0.6rem; font-family: var(--font-mono); font-size: 12px;
}
.punish-input:focus { outline: none; border-color: var(--violet); }

/* ── Модераторские формы ── */
.mod-field { display: block; margin-bottom: 10px; text-align: left; }
.mod-field span { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 5px; }
.mod-field textarea,
.mod-field select,
.mod-field input {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text); border-radius: 10px; padding: 0.55rem 0.75rem;
  font-family: var(--font-ui); font-size: 12.5px; resize: vertical;
}
.mod-field select { padding: 0.5rem 0.7rem; cursor: pointer; }
select option { background: var(--bg-2); color: var(--text); }

/* ── Evidence ── */
.evid-form { display: flex; flex-direction: column; gap: 2px; }
.evid-form .mod-field { margin-bottom: 8px; }
.evid-form .btn { align-self: flex-end; }
.evid-list { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 6px; }
.evid-empty { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: 0.08em; }
.evid-row { border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 0.5rem 0.6rem; background: rgba(255,255,255,0.03); text-align: left; }
.evid-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 3px; }
.evid-reason { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; word-break: break-word; }
.evid-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-top: 4px; }
.evid-status { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.evid-status.evid-ok { color: var(--ok); }
.evid-status.evid-pending { color: var(--warn); }
.evid-status.evid-bad { color: var(--bad); }
.evid-row.evid-ok { border-color: rgba(87,242,135,0.2); }
.evid-row.evid-pending { border-color: rgba(251,191,36,0.25); }
.evid-row.evid-bad { border-color: rgba(237,66,69,0.25); }

/* ── Punish list ── */
.punish-list { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; max-height: 160px; overflow-y: auto; }
.punish-list::-webkit-scrollbar { width: 5px; }
.punish-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; }
.punish-item { font-size: 11px; color: var(--text-dim); padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); line-height: 1.35; }
.punish-item b { color: var(--text); font-weight: 600; }

/* --- адаптив: планшет/мобайл --- */
@media (max-width: 1100px) {
  .panel { grid-template-columns: 280px minmax(0, 1fr); }
  .user-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    z-index: 80;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
  }
  body.userpanel-open .user-panel { display: block; }
}
@media (max-width: 768px) {
  .panel { grid-template-columns: 1fr; }
  .ticket-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    z-index: 80;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
  }
  body.sidebar-open .ticket-sidebar { transform: translateX(0); }
  .msgs { padding: 0.9rem; }
  .chat-input { padding: 0.7rem 0.9rem 0.9rem; }
  .msg { max-width: 94%; }
}

/* --- тогглы панелей кнопками (работают на любом экране) --- */
@media (min-width: 769px) and (max-width: 1100px) {
  body.sidebar-open .panel { grid-template-columns: minmax(0, 1fr); }
  body.sidebar-open .ticket-sidebar { display: none; }
}
@media (min-width: 1101px) {
  body.sidebar-open .panel { grid-template-columns: minmax(0, 1fr) 300px; }
  body.sidebar-open .ticket-sidebar { display: none; }
  body.userpanel-open .panel { grid-template-columns: 320px minmax(0, 1fr); }
  body.userpanel-open .user-panel { display: none; }
}

/* ============================================================
   ОШИБКА
   ============================================================ */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.error-card {
  position: relative;
  text-align: center;
  padding: 3rem 2.5rem;
  max-width: 460px;
  width: 100%;
}
.error-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--bad);
  margin-bottom: 1.2rem;
}
.error-title { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; margin-bottom: 0.9rem; }
.error-text { color: var(--text-dim); margin-bottom: 2rem; font-size: 14px; }
.error-text .mono { color: var(--violet-bright); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  background: rgba(21, 19, 33, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease-out;
}
.toast::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.toast.success::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.toast.error::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   АНИМАЦИИ ПОЯВЛЕНИЯ
   ============================================================ */
.afade { animation: afade 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
@keyframes afade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.1s; }
.d3 { animation-delay: 0.15s; }
.d4 { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .led-on::after { display: none; }
}

/* ============================================================
   КЛИКАБЕЛЬНЫЙ НИК
   ============================================================ */
.nick {
  color: var(--text);
  border-bottom: 1px dashed rgba(167, 139, 250, 0.45);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.nick:hover { color: var(--violet-bright); border-bottom-style: solid; border-color: var(--violet-bright); }
.nav-user-name.nick { color: var(--text-dim); border-bottom-color: rgba(139, 92, 246, 0.35); }
.nav-user-name.nick:hover { color: var(--violet-bright); }

/* ============================================================
   МОДАЛ ПРОФИЛЯ
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(8, 7, 13, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1.2rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 460px;
  max-height: min(82vh, 640px);
  overflow-y: auto;
  padding: 1.4rem 1.4rem 1.6rem;
  background: rgba(21, 19, 33, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.modal-close {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close:hover { border-color: var(--bad); color: var(--bad); }

.modal-user { display: flex; align-items: center; gap: 14px; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.modal-user img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex-shrink: 0;
}
.modal-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.modal-user-info .mono { font-size: 11px; margin-top: 3px; }

.modal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 1.1rem;
}
.ms-stat {
  text-align: center;
  padding: 0.65rem 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}
.ms-stat span {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  line-height: 1.1;
}
.ms-stat label {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.warn-list { display: flex; flex-direction: column; gap: 6px; }
.warn-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}
.warn-reason { word-break: break-word; }
.warn-reason:hover { color: var(--text); }
.pm-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.8rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ok);
  letter-spacing: 0.04em;
}
.pm-loading { padding: 0.8rem 0.5rem; }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 820px) {
  .navbar { flex-wrap: wrap; }
  .nav-status { display: none; }
  .ticket-row { grid-template-columns: auto 1fr auto; }
  .ticket-user { grid-column: 2 / 3; grid-row: 2; }
  .ticket-date { grid-column: 3 / 4; grid-row: 2; }
  .msg { max-width: 94%; }
  .sys-msg { max-width: 100%; }
}
@media (max-width: 560px) {
  .container { padding: 2rem 1rem 4rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .ticket-row { grid-template-columns: 1fr; gap: 8px; }
  .ticket-date { grid-column: auto; grid-row: auto; text-align: left; }
  .auth-card { padding: 1.9rem 1.35rem 1.5rem; border-radius: 24px; }
  .auth-title { font-size: 1.5rem; }
  .msg { max-width: 100%; }
}

/* ============================================================
   ХАБ: карточки модулей после авторизации
   ============================================================ */
.hub-wrap {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 1.2rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hub-head { text-align: center; margin-bottom: 2.2rem; }
.hub-sub { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 6px; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  width: 100%;
}
.hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 1.5rem 1.4rem 1.35rem;
  border-radius: 22px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.25s, border-color 0.25s;
}
.hub-card:hover { transform: translateY(-6px); border-color: rgba(124, 140, 248, 0.45); box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--violet-bright);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(124, 58, 237, 0.12));
  border: 1px solid rgba(124, 140, 248, 0.3);
}
.card-icon svg { width: 26px; height: 26px; }
.card-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-soon {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  animation: pulseBadge 1.8s ease-in-out infinite;
}
.badge-ready {
  color: var(--ok);
  background: rgba(87, 242, 135, 0.08);
  border: 1px solid rgba(87, 242, 135, 0.3);
}
@keyframes pulseBadge { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.card-title { font-size: 16.5px; font-weight: 700; }
.card-sub { font-size: 12.5px; color: var(--text-faint); }
.card-open { margin-top: 14px; font-family: var(--font-mono); font-size: 11.5px; color: var(--violet-bright); display: flex; align-items: center; gap: 8px; transition: gap 0.2s; }
.hub-card:hover .card-open { gap: 14px; }
.card-arrow { transition: transform 0.2s; }
.hub-card:hover .card-arrow { transform: translateX(3px); }

/* Soon-карточки: пунктир + приглушение */
.card-soon { border-style: dashed; background: rgba(255, 255, 255, 0.015); }
.card-soon .card-icon { opacity: 0.55; filter: grayscale(0.4); }
.card-soon .card-title { color: var(--text-dim); }
.card-soon .card-sub { color: var(--text-faint); }
.card-soon:hover { transform: none; border-color: rgba(255, 255, 255, 0.16); box-shadow: none; cursor: default; }

/* Дискорд-карточка: вращающаяся градиентная рамка + свечение + парящая иконка */
@property --hub-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
.card-discord { background: rgba(88, 101, 242, 0.06); }
.card-discord::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--hub-angle), #5865F2, #7c8cf8, #a78bfa, #ed4245, #5865F2);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spinAngle 5s linear infinite;
  pointer-events: none;
}
@keyframes spinAngle { to { --hub-angle: 360deg; } }
.card-discord { animation: discordGlow 3s ease-in-out infinite; }
@keyframes discordGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(88, 101, 242, 0.0), 0 12px 34px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 34px rgba(88, 101, 242, 0.35), 0 12px 34px rgba(0, 0, 0, 0.35); }
}
.card-discord .card-icon {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.3), rgba(124, 58, 237, 0.22));
  border-color: rgba(124, 140, 248, 0.55);
}
.card-discord .card-icon svg { animation: iconFloat 3.4s ease-in-out infinite; }
@keyframes iconFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
.card-discord .card-title { background: linear-gradient(90deg, #8ea0ff, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card-discord::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -30%;
  width: 70%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: rotate(25deg) translateX(-160%);
  transition: transform 0.9s ease;
  pointer-events: none;
}
.card-discord:hover::after { transform: rotate(25deg) translateX(320%); }

/* ============================================================
   МОДЕРАЦИЯ ДИСКОРД
   ============================================================ */
.mod-wrap { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; padding: 2.4rem 1.2rem 4rem; }
.mod-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 1.4rem; flex-wrap: wrap; }
.mod-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0.7rem 1.2rem;
  border-radius: 16px;
}
.mod-count-num { font-size: 1.9rem; font-weight: 800; background: linear-gradient(90deg, #8ea0ff, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mod-count-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }

.mod-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 1rem;
  border-radius: 14px;
  margin-bottom: 1.4rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mod-search:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18); }
.mod-search svg { width: 17px; height: 17px; color: var(--text-faint); flex-shrink: 0; }
.mod-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
}
.mod-search input::placeholder { color: var(--text-faint); }

.mod-list { display: flex; flex-direction: column; gap: 8px; }
.mod-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.mod-row:hover { border-color: rgba(124, 140, 248, 0.4); background: rgba(255, 255, 255, 0.05); transform: translateX(3px); }
.mod-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(124, 140, 248, 0.35);
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mod-row:hover .mod-avatar { transform: scale(1.08); box-shadow: 0 0 18px rgba(88, 101, 242, 0.4); }
.mod-info { flex: 1; min-width: 0; }
.mod-name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.mod-nick { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.mod-id { font-size: 11px; margin-top: 2px; }
.mod-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-kick {
  background: rgba(87, 242, 135, 0.1);
  border: 1px solid rgba(87, 242, 135, 0.35);
  color: var(--ok);
}
.btn-kick:hover { background: rgba(87, 242, 135, 0.2); border-color: var(--ok); }
.mod-row.mod-muted { opacity: 0.65; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.05); }
.mod-muted .mod-actions [data-act="mute"] { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }

.mod-target {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 600;
}
.mod-target img { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(124, 140, 248, 0.4); }
.mod-target span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-pop { animation: modPop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes modPop {
  from { transform: scale(0.85) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

@media (max-width: 640px) {
  .mod-actions { width: 100%; justify-content: flex-end; }
  .mod-row { flex-wrap: wrap; }
}
/* ---- Telegram module ---- */
.tg-wrap { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 2.4rem 1.2rem 4rem; }
.tg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 1.4rem; flex-wrap: wrap; }
.tg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
@media (max-width: 980px) { .tg-grid { grid-template-columns: 1fr; } }
.tg-chat { display: flex; flex-direction: column; min-height: 420px; height: calc(100vh - 250px); border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 12, 22, 0.72); overflow: hidden; }
.tg-chat-head { display: flex; align-items: center; gap: 10px; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.tg-chat-avatar { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.14); object-fit: cover; background: var(--bg-3); }
.tg-chat-title { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-chat-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.tg-bot-led { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tg-bot-led.led-on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.tg-bot-led.led-off { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.tg-msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tg-msg { display: flex; gap: 9px; max-width: 88%; align-items: flex-end; }
.tg-msg.self { align-self: flex-end; flex-direction: row-reverse; }
.tg-av { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.12); flex-shrink: 0; object-fit: cover; background: var(--bg-3); }
.tg-av.sm { width: 28px; height: 28px; font-size: 12px; }
.tg-av-ph { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--violet-bright); background: linear-gradient(135deg, rgba(88, 101, 242, 0.35), rgba(10, 12, 22, 0.9)); border-color: rgba(88, 101, 242, 0.5); }
.tg-bubble { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 0.55rem 0.8rem; }
.tg-msg.self .tg-bubble { background: rgba(88, 101, 242, 0.16); border-color: rgba(88, 101, 242, 0.4); border-radius: 12px 12px 4px 12px; }
.tg-bubble-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.tg-msg-name { font-size: 11.5px; font-weight: 700; color: var(--violet-bright); }
.tg-msg-time { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint); }
.tg-msg-text { font-size: 13px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.tg-input { display: flex; gap: 8px; padding: 0.7rem 1rem; border-top: 1px solid var(--line); background: var(--bg-2); }
.tg-input input { flex: 1; }
.tg-side { border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 12, 22, 0.72); overflow: hidden; display: flex; flex-direction: column; }
.tg-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.tg-search { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); }
.tg-search input { width: 100%; }
.tg-members { overflow-y: auto; max-height: calc(100vh - 380px); min-height: 120px; padding: 0.6rem; display: flex; flex-direction: column; gap: 4px; }
.tg-members .mod-row { padding: 0.5rem 0.6rem; }
.tg-badge { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; border: 1px solid; flex-shrink: 0; }
.tg-badge-admin { color: var(--violet-bright); border-color: rgba(124, 140, 248, 0.5); background: rgba(88, 101, 242, 0.12); }
.tg-badge-ban { color: var(--bad); border-color: rgba(237, 66, 69, 0.5); background: rgba(237, 66, 69, 0.1); }
.tg-badge-mute { color: var(--warn); border-color: rgba(250, 166, 26, 0.5); background: rgba(250, 166, 26, 0.08); }
.tg-badge-warn { color: #38bdf8; border-color: rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.08); }
.tg-punish-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(10, 12, 22, 0.72); overflow: hidden; }
.tg-punish-list { padding: 0.6rem; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.tg-punish-row { display: flex; align-items: center; gap: 10px; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.tg-punish-row:hover { border-color: rgba(124, 140, 248, 0.4); }
.tg-act { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.tg-act-on { color: var(--ok); }
.mod-target { display: flex; align-items: center; gap: 12px; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.mod-target .tg-av { width: 34px; height: 34px; }

/* ================= Twitch ================= */
.tw-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.2rem; margin-top: 1.2rem; }
.tw-col { min-width: 0; }
.tw-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3b4048; margin: 0 .5rem; vertical-align: middle; }
.tw-dot-on { background: #57a866; box-shadow: 0 0 6px #57a866; }
.tw-chat { height: 460px; overflow-y: auto; padding: .8rem 1rem; background: rgba(10, 12, 18, .55); border: 1px solid rgba(255, 255, 255, .07); border-radius: 6px; display: flex; flex-direction: column; gap: .35rem; }
.tw-msg { display: flex; align-items: baseline; gap: .45rem; font-size: 13.5px; line-height: 1.35; }
.tw-msg-time { flex-shrink: 0; font-size: 11px; }
.tw-msg-name { font-weight: 600; flex-shrink: 0; }
.tw-msg-text { word-break: break-word; min-width: 0; }
.tw-msg-actions { margin-left: auto; flex-shrink: 0; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.tw-msg:hover .tw-msg-actions { opacity: 1; }
.btn-xs { padding: 1px 6px; font-size: 11px; line-height: 1.5; }
.tw-sys { font-size: 12px; color: #9aa0ab; padding: .15rem 0; border-left: 2px solid #3b4048; padding-left: .5rem; }
.tw-card { background: rgba(10, 12, 18, .45); border: 1px solid rgba(255, 255, 255, .07); border-radius: 6px; padding: .9rem 1rem; margin-top: .6rem; }
.tw-stream-line { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.tw-pill { font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 2px 8px; border-radius: 4px; flex-shrink: 0; }
.tw-live { background: rgba(224, 108, 117, .18); color: #e06c75; }
.tw-offline { background: rgba(154, 160, 171, .15); color: #9aa0ab; }
.tw-stream-title { font-weight: 600; word-break: break-word; }
.tw-stream-meta { font-size: 12px; margin-top: .2rem; }
.tw-search-row { display: flex; gap: .5rem; }
.tw-search-row input { flex: 1; }
.tw-ban-row { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.tw-ban-row:last-child { border-bottom: none; }
.tw-ban-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.tw-ban-name { font-weight: 600; font-size: 13.5px; }
.tw-ban-reason, .tw-ban-exp { font-size: 11.5px; word-break: break-word; }
.tw-mod-chip { display: inline-block; font-size: 12px; background: rgba(88, 101, 242, .14); color: #aab4ff; padding: 2px 9px; border-radius: 12px; margin: 2px; }
.tw-account { display: flex; align-items: center; justify-content: space-between; }
.tw-log-row { display: flex; align-items: baseline; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: 13px; }
.tw-log-row:last-child { border-bottom: none; }
.tw-log-act { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.tw-act-ban { background: rgba(224, 108, 117, .18); color: #e06c75; }
.tw-act-timeout { background: rgba(229, 192, 123, .16); color: #e5c07b; }
.tw-act-unban { background: rgba(87, 168, 102, .16); color: #57a866; }
.tw-log-user { font-weight: 600; flex-shrink: 0; }
.tw-log-reason, .tw-log-who { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-log-who { margin-left: auto; flex-shrink: 0; }
@media (max-width: 900px) {
  .tw-grid { grid-template-columns: 1fr; }
  .tw-chat { height: 340px; }
}

/* --- Панель наказаний (Discord + Telegram) в тикете --- */
.punish-block { margin-top: 8px; }
.punish-search { display: flex; gap: 8px; margin: 10px 0; }
.punish-input {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.punish-input:focus { outline: none; border-color: var(--accent, #5865f2); }
.punish-src { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin: 10px 0 4px; }
.punish-row { font-size: 12.5px; padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); word-break: break-word; }
.punish-row:last-child { border-bottom: none; }
.punish-cat { font-weight: 700; margin-right: 6px; color: var(--text); }
.punish-ul { margin: 2px 0 2px 18px; padding: 0; }
.punish-ul li { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim, #b9c0d4); }

/* --- Карточка FearProject-игрока в тикете --- */
.fear-card { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.fear-avatar { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: rgba(255,255,255,.05); flex-shrink: 0; }
.fear-meta { font-size: 12.5px; line-height: 1.5; min-width: 0; }
.fear-meta b { font-size: 13.5px; }
.fear-btn { display: inline-block; margin-top: 8px; }

/* --- Прогресс-бар синка FearProject (главная) --- */
.fear-sync {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
}
.fear-sync-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.fear-sync-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.fear-sync-pct { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--violet-bright, #8b9bff); }
.progress {
  width: 100%; height: 10px; border-radius: 999px;
  background: rgba(255,255,255,.07); overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #5865f2, #8b9bff);
  transition: width .6s ease;
}
.fear-sync-foot { margin-top: 8px; font-size: 12px; color: var(--text-dim, #b9c0d4); display: flex; align-items: center; gap: 8px; }

/* ================= Документы (dokum) ================= */
.dokum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.dokum-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.02);
}
.dokum-card:hover { border-color: rgba(88,101,242,.3); }
.dokum-card-head { display: flex; align-items: center; gap: 12px; }
.dokum-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,.05); flex-shrink: 0; }
.dokum-info { min-width: 0; }
.dokum-name { font-weight: 700; font-size: 15px; }
.dokum-role { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-top: 2px; }
.dokum-id { font-size: 10px; color: var(--text-faint); margin-top: 1px; }
.dokum-stats { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.dokum-target { font-weight: 600; font-size: 14px; }

/* ── Активные запросы внутри карточки модератора ── */
.dokum-requests { display: flex; flex-direction: column; gap: 8px; }
.dokum-req {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,191,36,0.06); border: 1px solid rgba(255,191,36,0.18);
}
.dokum-req-info { min-width: 0; flex: 1; }
.dokum-req-user { font-size: 13px; font-weight: 600; color: var(--text); }
.dokum-req-reason { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dokum-req-meta { font-size: 10px; color: var(--text-faint); margin-top: 3px; }
.dokum-req-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dokum-req-actions .btn { padding: 5px 12px; font-size: 11px; }

/* ── Контекстное меню (ПКМ) ── */
.ctx-menu {
  position: fixed; z-index: 999; display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 4px; min-width: 160px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5); font-family: var(--font-ui);
}
.ctx-menu[hidden] { display: none; }
.ctx-item {
  padding: 8px 14px; border-radius: 8px; border: none; background: none;
  color: var(--text-dim); font-size: 13px; cursor: pointer; text-align: left;
  transition: all 0.12s; font-family: var(--font-ui);
}
.ctx-item:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.ctx-del { color: var(--bad); }
.ctx-del:hover { background: rgba(237,66,69,0.12); color: var(--bad); }