:root {
  --bg: #f4fbff;
  --bg-2: #e7f6ff;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: #ffffff;
  --line: rgba(24, 116, 175, 0.15);
  --text: #0d2433;
  --muted: #5f7a8d;
  --blue: #1f9fff;
  --blue-2: #74d2ff;
  --cyan: #49d9e7;
  --ok: #17b87e;
  --warn: #ef9f1a;
  --bad: #ef476f;
  --shadow: 0 24px 80px rgba(37, 125, 181, 0.15);
  --soft-shadow: 0 12px 36px rgba(37, 125, 181, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(31, 159, 255, 0.22), transparent 36%),
    radial-gradient(circle at 88% 2%, rgba(73, 217, 231, 0.2), transparent 34%),
    linear-gradient(145deg, var(--bg), #ffffff 54%, var(--bg-2));
  font-family: "Manrope", "SF Pro Display", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 159, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 159, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 78%);
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(12px);
  opacity: .5;
  pointer-events: none;
}

.ambient.one {
  width: 240px;
  height: 240px;
  right: -80px;
  top: 130px;
  background: rgba(116, 210, 255, .35);
}

.ambient.two {
  width: 180px;
  height: 180px;
  left: -70px;
  bottom: 130px;
  background: rgba(73, 217, 231, .28);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.hero,
.command-strip,
.tabs,
.card,
.panel,
.bot-card,
.fact,
.stat {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  min-height: 184px;
  padding: 26px;
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(224, 246, 255, 0.82)),
    radial-gradient(circle at 84% 18%, rgba(31, 159, 255, 0.24), transparent 34%);
}

.hero-copy {
  display: grid;
  align-content: center;
}

.hero-side {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-direction: column;
  gap: 14px;
}

.eyebrow,
.mini-label,
.label {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(48px, 10vw, 96px);
  line-height: .88;
  letter-spacing: -0.078em;
}

h2 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: -0.045em;
}

h3 {
  margin: 6px 0 0;
  font-size: 21px;
  letter-spacing: -0.04em;
}

button,
select {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 12px 15px;
  font: inherit;
}

button {
  cursor: pointer;
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, opacity .16s ease;
}

button:hover {
  border-color: rgba(31, 159, 255, .42);
  box-shadow: 0 12px 30px rgba(31, 159, 255, .14);
}

button:active {
  transform: scale(.98);
}

button:disabled {
  cursor: wait;
  opacity: .55;
}

.primary,
.ghost {
  color: white;
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.ghost.small {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  font-weight: 850;
}

.live-badge i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(239, 159, 26, .13);
}

.live-badge.online i {
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(23, 184, 126, .13);
}

.live-badge.offline i {
  background: var(--bad);
  box-shadow: 0 0 0 6px rgba(239, 71, 111, .13);
}

.command-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 24px;
}

.command-strip div {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .66);
}

.command-strip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  position: sticky;
  top: 8px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0;
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .78);
}

.tab {
  color: var(--muted);
  padding: 12px 8px;
  border-radius: 16px;
  box-shadow: none;
}

.tab.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), #67c7ff);
}

.view {
  display: none;
  animation: rise .24s ease both;
}

.view.active {
  display: block;
}

.grid {
  display: grid;
  gap: 14px;
}

.hero-grid {
  grid-template-columns: repeat(4, 1fr);
}

.two {
  grid-template-columns: 1.15fr .85fr;
  margin-top: 14px;
}

.card,
.panel {
  border-radius: 28px;
}

.card {
  min-height: 164px;
  padding: 19px;
}

.metric strong {
  display: block;
  margin: 12px 0;
  font-size: clamp(34px, 7vw, 58px);
  letter-spacing: -0.075em;
}

.muted,
small,
.hint {
  color: var(--muted);
}

.accent {
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(211, 242, 255, .86));
}

.heat {
  background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(255, 243, 217, .9));
}

.meter {
  overflow: hidden;
  height: 11px;
  margin: 12px 0;
  border-radius: 100px;
  background: #e2f3fc;
}

.meter i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width .4s ease;
}

.panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.status-list,
.facts,
.stats-grid,
.bot-grid {
  display: grid;
  gap: 12px;
}

.facts {
  grid-template-columns: repeat(2, 1fr);
}

.bot-grid {
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

.bot-card,
.fact,
.stat {
  padding: 15px;
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}

.fact.wide {
  grid-column: 1 / -1;
}

.bot-title,
.bot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bot-title {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.bot-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: #eef9ff;
  font-size: 22px;
}

.bot-card.online {
  border-color: rgba(23, 184, 126, .24);
}

.bot-card.paused {
  border-color: rgba(239, 159, 26, .26);
}

.bot-card.offline {
  border-color: rgba(239, 71, 111, .26);
}

.stat strong {
  display: block;
  margin: 8px 0;
  font-size: 34px;
  letter-spacing: -0.055em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 3px 4px 3px 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef8ff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.pill.ok {
  color: var(--ok);
  background: rgba(23, 184, 126, .11);
}

.pill.bad {
  color: var(--bad);
  background: rgba(239, 71, 111, .11);
}

.pill.warn {
  color: #a66b00;
  background: rgba(239, 159, 26, .14);
}

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

.between {
  justify-content: space-between;
}

.wrap {
  flex-wrap: wrap;
}

.compact {
  gap: 8px;
}

.select-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.log-box {
  min-height: 460px;
  max-height: 68vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  color: #103043;
  background: #f8fcff;
  font-family: "JetBrains Mono", "Cascadia Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.control-grid button,
.bot-actions button {
  background: linear-gradient(135deg, #f7fcff, #e6f6ff);
}

button.warn {
  color: #8a5b00;
  background: #fff6de;
}

button.danger {
  color: #9e1234;
  border-color: rgba(239, 71, 111, .32);
  background: #fff0f4;
}

.bot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.action-result {
  margin-top: 16px;
  color: var(--muted);
  white-space: pre-wrap;
}

.alert-panel {
  margin-top: 14px;
  border-color: rgba(239, 71, 111, .18);
  background: rgba(255, 248, 250, .86);
}

.alert-lines {
  display: grid;
  gap: 8px;
}

.alert-lines div {
  padding: 10px 12px;
  border-radius: 16px;
  color: #7a1230;
  background: rgba(255, 255, 255, .7);
  font-family: "JetBrains Mono", "Cascadia Mono", monospace;
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  font-weight: 850;
}

.toast.ok {
  color: var(--ok);
}

.toast.warn {
  color: #996300;
}

.toast.bad {
  color: var(--bad);
}

.hidden {
  display: none !important;
}

.skeleton-list:empty::before {
  content: "Загружаю данные...";
  display: block;
  padding: 18px;
  border-radius: 20px;
  color: var(--muted);
  background: linear-gradient(90deg, rgba(255,255,255,.6), rgba(231,246,255,.8), rgba(255,255,255,.6));
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .shell {
    padding: 12px;
  }

  .hero {
    flex-direction: column;
    min-height: 0;
  }

  .hero-side {
    align-items: stretch;
    flex-direction: row;
  }

  .command-strip,
  .tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-grid,
  .two,
  .bot-grid,
  .stats-grid,
  .control-grid,
  .facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 10px;
  }

  .hero,
  .panel,
  .card {
    border-radius: 24px;
  }

  h1 {
    font-size: 54px;
  }

  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .command-strip {
    grid-template-columns: 1fr;
  }

  .hero-side {
    flex-direction: column;
  }

  .bot-card-head,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }
}
