/* база */
:root {
  --bg: #05070d;
  --bg-2: #060a10;
  --text: #e7f3ec;
  --muted: #7f9a8b;
  --accent: #34d399;
  --accent-2: #10b981;
  --teal: #2dd4bf;
  --forest: #065f46;
  --grad: linear-gradient(135deg, #10b981 0%, #34d399 52%, #2dd4bf 100%);

  --glass: rgba(16, 28, 23, 0.44);
  --glass-2: rgba(20, 34, 28, 0.34);
  --glass-border: rgba(120, 240, 190, 0.13);
  --glass-hi: rgba(180, 255, 220, 0.05);

  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --radius: 16px;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  user-select: none;
  cursor: default;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

input, .logs {
  user-select: text;
}

::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(52, 211, 153, 0.16);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(52, 211, 153, 0.32);
}

.grad-text {
  background: linear-gradient(90deg, #10b981, #34d399, #2dd4bf, #34d399, #10b981);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-move 6s ease-in-out infinite alternate;
}

@keyframes grad-move {
  from { background-position: 0% center; }
  to { background-position: 100% center; }
}

/* дрейфующие блобы фона */
#bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.blob-wrap {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}

.blob.b1 {
  width: 520px;
  height: 520px;
  left: -140px;
  top: -160px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.55), transparent 68%);
  animation: drift1 22s ease-in-out infinite;
}

.blob.b2 {
  width: 460px;
  height: 460px;
  right: -120px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.4), transparent 68%);
  animation: drift2 27s ease-in-out infinite;
}

.blob.b3 {
  width: 360px;
  height: 360px;
  left: 45%;
  top: 40%;
  background: radial-gradient(circle, rgba(6, 95, 70, 0.55), transparent 70%);
  animation: drift3 32s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.12); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, -50px) scale(1.15); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-42%, -60%) scale(1.2); }
}

/* мерцающая цветовая сетка поверх блобов */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 600px at 12% 0%, rgba(52, 211, 153, 0.07), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(45, 212, 191, 0.05), transparent 60%);
  pointer-events: none;
}

/* свечение за курсором (--gi = мощность, задаётся из Визуала) */
#cursor-glow {
  --gi: 1;
  position: fixed;
  width: 460px;
  height: 460px;
  left: -230px;
  top: -230px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(52, 211, 153, calc(0.13 * var(--gi))), rgba(45, 212, 191, calc(0.05 * var(--gi))) 55%, transparent 72%);
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  will-change: transform, opacity;
}

@media (pointer: coarse) {
  #cursor-glow { display: none; }
}

/* заголовок окна */
.titlebar {
  display: flex;
  height: 44px;
  align-items: stretch;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(10, 18, 14, 0.4);
  backdrop-filter: blur(20px);
}

.tb-drag {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 15px;
}

.tb-logo {
  width: 21px;
  height: 21px;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.5));
}

.tb-logo-dot {
  animation: logo-pulse 2.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes logo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.78); }
}

.tb-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.tb-btns {
  display: flex;
}

.tb-btn {
  width: 46px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.tb-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.tb-btn:hover {
  background: rgba(52, 211, 153, 0.1);
  color: var(--text);
}

.tb-close:hover {
  background: #e11d48;
  color: #fff;
}

/* layout */
.layout {
  display: flex;
  height: calc(100% - 44px);
}

/* сайдбар */
.sidebar {
  width: 204px;
  display: flex;
  flex-direction: column;
  padding: 15px 11px;
  border-right: 1px solid var(--glass-border);
  background: rgba(8, 14, 11, 0.42);
  backdrop-filter: blur(22px);
}

#nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s ease;
}

.nav-item:hover {
  background: rgba(52, 211, 153, 0.07);
  color: var(--text);
  transform: translateX(3px);
}

.nav-item:hover svg {
  transform: scale(1.12);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(45, 212, 191, 0.09));
  color: #eafff5;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.28), 0 6px 22px rgba(16, 185, 129, 0.16);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 2px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.9);
}

/* появление вкладки при включении продвинутого функционала */
.nav-item.nav-appear {
  animation: nav-appear 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes nav-appear {
  0% { opacity: 0; transform: translateX(-14px) scale(0.9); max-height: 0; }
  100% { opacity: 1; transform: translateX(0) scale(1); max-height: 60px; }
}

.sb-footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(127, 154, 139, 0.5);
  padding: 8px 0 2px;
}

/* контент */
.content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  perspective: 1300px;
}

.page {
  display: none;
}

.page.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

#page-settings.active, #page-sessions.active {
  height: auto;
  min-height: 100%;
}

/* карточки - стекло */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--glass-hi);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* hover карточек ставит js (класс hovered с гистерезисом) - css :hover мигает, потому что наклон двигает край под курсором */
.card.hovered {
  border-color: rgba(52, 211, 153, 0.3);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.42), 0 0 26px rgba(16, 185, 129, 0.1), inset 0 1px 0 var(--glass-hi);
}

/* анимация появления страницы (staggered) */
.page.active > .card,
.page.active > .save-row {
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.page.active > *:nth-child(1) { animation-delay: 0.02s; }
.page.active > *:nth-child(2) { animation-delay: 0.09s; }
.page.active > *:nth-child(3) { animation-delay: 0.16s; }
.page.active > *:nth-child(4) { animation-delay: 0.23s; }
.page.active > *:nth-child(5) { animation-delay: 0.30s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* spotlight под мышкой (--si = мощность, задаётся из Визуала; 0 = выключено) */
:root {
  --si: 1;
}

.spot {
  position: relative;
}

.spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), rgba(52, 211, 153, calc(0.1 * var(--si))), transparent 68%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.spot:not(.card):hover::after,
.spot.hovered::after {
  opacity: 1;
}

/* выключенное свечение краёв секций - возвращаем .hovered к обычному виду (spotlight остаётся) */
:root.no-section-glow .card.hovered {
  border-color: var(--glass-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--glass-hi);
}

.card-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--accent);
  margin-bottom: 15px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-head .card-title {
  margin-bottom: 0;
}

/* статус */
.status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 17px;
}

.status-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.status-dot.disconnected {
  background: #4a5a52;
}

.status-dot.connecting {
  background: var(--amber);
  animation: pulse-amber 1.2s ease-in-out infinite;
}

.status-dot.connected {
  background: var(--green);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
}

@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
}

.status-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.status-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.status-actions {
  display: flex;
  gap: 11px;
}

/* кнопки */
.btn {
  position: relative;
  padding: 11px 28px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  will-change: transform;
  transition: box-shadow 0.18s ease, opacity 0.18s ease, filter 0.18s ease, background 0.18s ease, transform 0.16s ease-out;
}

/* градиент переобъявляется на hover */
.btn-primary {
  background: var(--grad);
  color: #04120c;
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: var(--grad);
  box-shadow: 0 10px 34px rgba(52, 211, 153, 0.55), 0 0 20px rgba(45, 212, 191, 0.35);
}

.btn-ghost {
  background: rgba(120, 240, 190, 0.05);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--glass-border);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(251, 113, 133, 0.1);
  box-shadow: inset 0 0 0 1px rgba(251, 113, 133, 0.45), 0 8px 26px rgba(251, 113, 133, 0.16);
}

.btn:active:not(:disabled) {
  transform: scale(0.96) !important;
}

.btn:disabled {
  opacity: 0.38;
  filter: grayscale(0.6);
  cursor: default;
}

.btn-mini {
  padding: 6px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-mini:hover {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(52, 211, 153, 0.08);
}

/* логи */
.logs-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.logs {
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #b6cabf;
  cursor: text;
}

.log-entry {
  padding: 5px 11px;
  margin-bottom: 3px;
  border-left: 2px solid transparent;
  border-radius: 5px;
  white-space: pre-wrap;
  word-break: break-word;
  animation: log-in 0.25s ease;
}

.log-entry:hover {
  background: rgba(120, 240, 190, 0.03);
}

.log-entry.mention {
  border-left-color: var(--accent);
  background: rgba(52, 211, 153, 0.06);
}

.log-entry .log-time {
  color: rgba(127, 154, 139, 0.6);
  margin-right: 9px;
}

@keyframes log-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* поля */
.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.3px;
  color: var(--muted);
  margin: 13px 2px 6px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.field-row input[type="text"],
.field-row input[type="password"],
.field-row textarea {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 11px;
  background: rgba(120, 240, 190, 0.035);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field-row input[type="text"]:hover,
.field-row input[type="password"]:hover,
.field-row textarea:hover {
  border-color: rgba(120, 240, 190, 0.24);
}

.field-row input[type="text"]:focus,
.field-row input[type="password"]:focus,
.field-row textarea:focus {
  border-color: var(--accent);
  background: rgba(52, 211, 153, 0.06);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

/* авто-растущее поле: JS выставляет height по scrollHeight, здесь только база */
.field-row textarea {
  resize: none;
  overflow: hidden;
  min-height: 42px;
  line-height: 1.4;
  font-family: var(--font-body);
}

/* скрываемое поле (discord webhook): фикс. высота 2 строки + маскировка точками */
.field-row textarea.masked-field {
  overflow-y: auto;
  min-height: 0;
  height: 58px;
  -webkit-text-security: disc;
  word-break: break-all;
}

.field-row textarea.masked-field.revealed {
  -webkit-text-security: none;
}

/* нативная иконка показа пароля (WebView2/Edge) - прячем, у нас свой глазок */
.field-row input[type="password"]::-ms-reveal {
  display: none;
}

/* кнопка-глазок показать/спрятать пароль */
.reveal-btn {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border: none;
  border-radius: 50%;
  background: rgba(120, 240, 190, 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reveal-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reveal-btn .ic-eye-off {
  display: none;
}

.reveal-btn.revealed .ic-eye {
  display: none;
}

.reveal-btn.revealed .ic-eye-off {
  display: block;
}

.reveal-btn:hover {
  color: var(--text);
  background: rgba(52, 211, 153, 0.14);
}

.reveal-btn.revealed {
  color: #04120c;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.45);
}

/* слайдер (input range) */
.range-input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--val, 40%), rgba(120, 240, 190, 0.1) var(--val, 40%), rgba(120, 240, 190, 0.1) 100%);
  outline: none;
  cursor: pointer;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
  cursor: pointer;
}

.range-input::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: none;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
  cursor: pointer;
}

.range-input::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(120, 240, 190, 0.1);
}

/* кнопка помощи и тултип */
.help-btn {
  position: relative;
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  border: none;
  border-radius: 50%;
  background: rgba(120, 240, 190, 0.08);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.help-btn:hover {
  background: var(--grad);
  color: #04120c;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.55);
}

.tip {
  position: absolute;
  right: 31px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  width: max-content;
  max-width: 340px;
  padding: 11px 14px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 11px;
  background: rgba(10, 22, 17, 0.86);
  backdrop-filter: blur(18px);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  white-space: pre-line;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  z-index: 50;
}

.help-btn:hover .tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* переключатели */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 0;
}

.toggle-label {
  flex: 1;
  font-size: 13.5px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: rgba(120, 240, 190, 0.08);
  box-shadow: inset 0 0 0 1px var(--glass-border);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #9db4a8;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease;
}

.switch input:checked + .slider {
  background: var(--grad);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.5);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: #04120c;
}

.switch:hover .slider {
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.45);
}

.switch:hover input:checked + .slider {
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.7);
}

/* сворачиваемые блоки */
.collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s ease, opacity 0.32s ease;
  opacity: 0;
}

.collapse.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.collapse > div {
  overflow: hidden;
}

.save-row {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 4px;
}

/* статистика */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 26px 24px;
  overflow: hidden;
}

.stat-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(45, 212, 191, 0.1));
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.24);
  margin-bottom: 10px;
}

.stat-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #34d399, #2dd4bf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-top: 4px;
}

.stat-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

/* появление статистики (как у остальных страниц) */
#page-statistics.active .stat-card,
#page-statistics.active .stat-foot {
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
#page-statistics.active .stat-card:nth-child(1) { animation-delay: 0.04s; }
#page-statistics.active .stat-card:nth-child(2) { animation-delay: 0.12s; }
#page-statistics.active .stat-foot { animation-delay: 0.2s; }

/* сессии */
.btn-sm {
  padding: 8px 18px;
  font-size: 12.5px;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(120, 240, 190, 0.035);
  box-shadow: inset 0 0 0 1px var(--glass-border);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.session-row:hover {
  background: rgba(52, 211, 153, 0.06);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.24);
}

.session-ava {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad);
  color: #04120c;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}

.session-ava.has-img {
  background: none;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.35);
}

.session-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.session-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-del {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.session-del svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.session-del:hover {
  background: rgba(251, 113, 133, 0.12);
  color: var(--red);
}

.sessions-empty {
  padding: 26px 0 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* qr авторизация */
.qr-flex {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.qr-img-wrap {
  width: 210px;
  height: 210px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 26px rgba(52, 211, 153, 0.22);
}

.qr-img-wrap img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.qr-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.qr-steps {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.qr-steps b {
  color: var(--text);
  font-weight: 600;
}

.qr-status {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  min-height: 18px;
}

.qr-cancel-row {
  display: flex;
  justify-content: flex-end;
}

/* розыгрыши */
.gw-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 4px;
}

.gw-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* выбор каналов из поста */
.gw-select-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  margin-bottom: 7px;
  border-radius: 11px;
  background: rgba(120, 240, 190, 0.035);
  box-shadow: inset 0 0 0 1px var(--glass-border);
  cursor: pointer;
  transition: background 0.18s ease;
}

.gw-select-row:hover {
  background: rgba(52, 211, 153, 0.06);
}

.gw-select-row input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.gw-select-row span {
  font-size: 13.5px;
  word-break: break-all;
}

#gw-progress {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#gw-progress:empty {
  display: none;
}

.gw-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(120, 240, 190, 0.035);
  box-shadow: inset 0 0 0 1px var(--glass-border);
  animation: log-in 0.25s ease;
}

.gw-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #4a5a52;
}

.gw-row[data-status="start"] .gw-dot,
.gw-row[data-status="joined"] .gw-dot {
  background: var(--amber);
  animation: pulse-amber 1.2s ease-in-out infinite;
}

.gw-row[data-status="entered"] .gw-dot,
.gw-row[data-status="webapp"] .gw-dot {
  background: var(--green);
}

.gw-row[data-status="error"] .gw-dot {
  background: var(--red);
}

.gw-acc {
  font-size: 13.5px;
  font-weight: 500;
  flex-shrink: 0;
}

.gw-state {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.gw-row[data-status="webapp"] .gw-state,
.gw-row[data-status="entered"] .gw-state {
  color: var(--accent);
}

.gw-row[data-status="error"] .gw-state {
  color: var(--red);
}

/* список ботов */
.bot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(120, 240, 190, 0.035);
  box-shadow: inset 0 0 0 1px var(--glass-border);
}

.bot-name {
  font-size: 13.5px;
  font-weight: 500;
}

.bot-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  flex-shrink: 0;
}

.bot-badge.works {
  color: var(--green);
  background: rgba(52, 211, 153, 0.12);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.3);
}

.bot-badge.testing {
  color: var(--amber);
  background: rgba(251, 191, 36, 0.1);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.28);
}

/* заглушка сессий */
.placeholder-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 340px;
  border-style: dashed;
  text-align: center;
}

.placeholder-card svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
  filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.4));
}

.ph-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.ph-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* тосты */
#toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  padding: 13px 18px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-left: 3px solid var(--accent);
  background: rgba(10, 22, 17, 0.82);
  backdrop-filter: blur(20px);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.5), 0 0 18px rgba(16, 185, 129, 0.12);
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 340px;
}

.toast.warn {
  border-color: rgba(251, 191, 36, 0.4);
  border-left-color: var(--amber);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.5), 0 0 18px rgba(251, 191, 36, 0.12);
}

.toast.out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(44px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(44px); }
}

/* модалка предупреждения (liquid glass) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 5, 0.55);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 32px 30px 26px;
  border-radius: 22px;
  text-align: center;
  overflow: hidden;
  background: rgba(14, 26, 20, 0.72);
  backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid rgba(120, 240, 190, 0.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 50px rgba(16, 185, 129, 0.14), inset 0 1px 0 rgba(180, 255, 220, 0.1);
  transform: translateY(24px) scale(0.94);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.modal-overlay.show .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-glow {
  position: absolute;
  top: -60%;
  left: 50%;
  width: 340px;
  height: 340px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.22), transparent 68%);
  pointer-events: none;
}

.modal-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 113, 133, 0.12));
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.32), 0 0 26px rgba(251, 191, 36, 0.18);
  animation: modal-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

.modal-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes modal-pop {
  from { transform: scale(0) rotate(-12deg); }
  to { transform: scale(1) rotate(0); }
}

.modal-title {
  position: relative;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal-text {
  position: relative;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 26px;
}

.modal-actions {
  position: relative;
  display: flex;
  gap: 11px;
  justify-content: center;
}

.modal-actions .btn {
  flex: 1;
  max-width: 170px;
}
