/* ---- дизайн-токены ---- */
:root {
  --ink: #10131a;
  --panel: #171b24;
  --panel-2: #1d2230;
  --paper: #edeae1;
  --muted: #8b92a4;
  --teal: #3ed9c4;
  --amber: #f2a65a;
  --coral: #e8604c;
  --line: #262b38;

  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 620;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.mono { font-family: var(--font-mono); }

/* ---- лендинг / вход ---- */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(62, 217, 196, 0.08), transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(242, 166, 90, 0.06), transparent 40%),
    var(--ink);
}

.landing .badge {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}

.landing h1 { font-size: 44px; max-width: 520px; }
.landing p { color: #aab1c4; max-width: 440px; margin: 0; }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }

.btn-primary { background: #9146ff; color: #fff; }
.btn-ghost { background: var(--panel); color: var(--paper); border: 1px solid var(--line); }

.landing-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---- каркас панели ---- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar .brand {
  font-family: var(--font-display);
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar .brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(62, 217, 196, 0.15);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(62, 217, 196, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(62, 217, 196, 0.05); }
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
}
.nav a.active { color: var(--paper); background: var(--panel-2); }
.nav a:hover:not(.active) { color: var(--paper); }

.sidebar-foot {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.main { flex: 1; padding: 28px 36px 60px; max-width: 1040px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.topbar .who { color: var(--muted); font-size: 13px; }
.status-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

.demo-banner {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
  background: rgba(242, 166, 90, 0.08);
  border: 1px solid rgba(242, 166, 90, 0.25);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 24px;
}

/* ---- сетка карточек ---- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.stat-card .num { font-family: var(--font-mono); font-size: 26px; }
.stat-card .label { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-card.teal .num { color: var(--teal); }
.stat-card.amber .num { color: var(--amber); }
.stat-card.coral .num { color: var(--coral); }

.section { margin-bottom: 32px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 18px; }
.section-head .hint { color: var(--muted); font-size: 13px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

/* ---- список команд ---- */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal);
  background: rgba(62, 217, 196, 0.08);
  border-radius: 6px;
  padding: 3px 8px;
  flex-shrink: 0;
}
.row .text { color: var(--muted); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .action { color: var(--coral); font-size: 12px; cursor: pointer; }

/* ---- стоп-слова ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 18px; }
.chip {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(232, 96, 76, 0.08);
  color: var(--coral);
  border: 1px solid rgba(232, 96, 76, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chip.global { background: rgba(242, 166, 90, 0.08); color: var(--amber); border-color: rgba(242, 166, 90, 0.25); }
.chip .x { opacity: 0.6; cursor: pointer; }

.add-row { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.add-row input {
  flex: 1;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13px;
}
.add-row input::placeholder { color: var(--muted); }

/* ---- переключатели фильтров ---- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .name { font-weight: 500; font-size: 14px; }
.toggle-row .desc { color: var(--muted); font-size: 12px; margin-top: 2px; }

.switch { width: 40px; height: 22px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); position: relative; flex-shrink: 0; }
.switch.on { background: rgba(62, 217, 196, 0.18); border-color: var(--teal); }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: all .15s ease; }
.switch.on .knob { left: 20px; background: var(--teal); }

/* ---- лента активности (терминал) ---- */
.feed { font-family: var(--font-mono); font-size: 13px; }
.feed .entry {
  display: flex;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.feed .entry:last-child { border-bottom: none; }
.feed .entry.warning { border-left-color: var(--amber); }
.feed .entry.timeout { border-left-color: var(--coral); }
.feed .entry.welcome { border-left-color: var(--teal); }
.feed .entry.timer { border-left-color: #7c9cff; }
.feed .entry.command { border-left-color: var(--muted); }
.feed .time { color: var(--muted); flex-shrink: 0; }
.feed .kind { flex-shrink: 0; width: 78px; text-transform: uppercase; font-size: 11px; letter-spacing: 0.04em; }
.feed .entry.warning .kind { color: var(--amber); }
.feed .entry.timeout .kind { color: var(--coral); }
.feed .entry.welcome .kind { color: var(--teal); }
.feed .entry.timer .kind { color: #7c9cff; }
.feed .entry.command .kind { color: var(--muted); }
.feed .text { color: var(--paper); }
.feed .chan { color: var(--muted); }

/* ---- таблица каналов (админ) ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; min-width: 560px; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .chan-name { font-weight: 600; }
.table .chan-login { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }

.dot-status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; }
.dot-status .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-status.online .dot { background: var(--teal); }
.dot-status.offline .dot { background: var(--muted); }

.kill-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--coral);
  background: rgba(232, 96, 76, 0.08);
  border: 1px solid rgba(232, 96, 76, 0.25);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; gap: 18px; }
  .nav { flex-direction: row; }
  .main { padding: 20px; }
}

@media (max-width: 560px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 14px; }
  .stat-card .num { font-size: 20px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .add-row { flex-wrap: wrap; }
  .add-row input { min-width: 100%; }
  .landing h1 { font-size: 30px; }
  .row { flex-wrap: wrap; }
  .row .text { min-width: 100%; order: 3; white-space: normal; }
}
