:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --text: #1c2434;
  --muted: #8b95a8;
  --line: #e6ebf4;
  --blue: #3b6cff;
  --blue-dark: #2d5df0;
  --red: #ff4d57;
  --red-text: #e23b45;
  --red-soft: #fff1f2;
  --yellow: #f5be3d;
  --green: #2fbf71;
  --stage-bg: #f0ecff;
  --stage-text: #6d5ce0;
  --shadow: 0 1px 2px rgba(22, 34, 61, 0.04), 0 10px 28px rgba(22, 34, 61, 0.04);
  --radius: 18px;
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 28px 56px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.sub button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  padding: 0;
}

.sub button:hover { text-decoration: underline; }

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.chips { display: flex; gap: 8px; }

.chip, .pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(22, 34, 61, 0.03);
}

.chip {
  padding: 8px 16px;
  color: #667085;
  font-weight: 700;
  font-size: 14px;
}

.chip[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-width: 58px;
  font-weight: 800;
}

.count-pills { display: flex; gap: 8px; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  display: inline-block;
  flex: none;
}
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }
.dot.blue { background: var(--blue); }

.stats, .board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.stats { margin-bottom: 16px; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.accent { overflow: hidden; }
.card.accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}
.card.red { --accent: var(--red); }
.card.yellow { --accent: var(--yellow); }
.card.green { --accent: var(--green); }
.card.blue { --accent: var(--blue); }

.stat { padding: 16px 18px 16px 20px; min-height: 132px; }
.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}
.stat-num {
  margin-top: 8px;
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.stat-desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.col, .side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.warm { grid-column: 1 / -1; }

.lead { padding: 14px 16px 14px 18px; }
.lead h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stage {
  display: inline-flex;
  align-items: center;
  background: var(--stage-bg);
  color: var(--stage-text);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}
.meta, .quiet {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.activity {
  margin: 6px 0 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
}
.activity.bad { color: var(--red-text); }
.activity.normal { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  width: fit-content;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
}
.btn:hover { background: var(--blue-dark); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #e43741; }
.btn:disabled { opacity: 0.6; cursor: progress; }

.more, .calls-more {
  border: 1px solid var(--line);
  background: #fff;
  color: #667085;
  border-radius: 14px;
  padding: 14px 12px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.more:hover, .calls-more:hover { color: var(--blue); }

.panel { padding: 16px; }
.panel h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.panel .note {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.call {
  background: var(--red-soft);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}
.call-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-weight: 800;
}
.call-top span { color: var(--muted); font-weight: 600; font-size: 13px; }
.call-lead {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
  text-decoration: none;
}
.call-lead:hover { color: var(--blue); }
.call .btn { margin-top: 10px; }

.rules p {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #526074;
}
.rules p:last-child { margin-bottom: 0; }
.rules b { color: var(--text); }
.rule-note { color: var(--muted); }

.warm-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 16px 18px;
  text-align: left;
}
.warm-title { font-weight: 800; font-size: 16px; }
.warm-action { color: var(--blue); font-weight: 700; }
.warm-help {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 13px;
}
.warm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}
.warm .lead { box-shadow: none; }

.empty {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.loading, .banner {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  color: #526074;
}
.banner { color: var(--red-text); }
.banner button {
  margin-top: 10px;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
}

.noscript {
  max-width: 1480px;
  margin: 12px auto;
  padding: 0 28px;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
}
.login-card h1 { font-size: 30px; }
.login-lead { margin: 8px 0 18px; color: var(--muted); }
.lights { display: flex; gap: 8px; margin-bottom: 14px; }
.lights i { width: 12px; height: 12px; border-radius: 99px; display: block; }
.lights i:nth-child(1) { background: var(--red); }
.lights i:nth-child(2) { background: var(--yellow); }
.lights i:nth-child(3) { background: var(--green); }
.login-card label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #526074;
}
.login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
  color: var(--text);
  background: #fbfcfe;
}
.login-card input:focus {
  outline: 2px solid rgba(59, 108, 255, 0.35);
  border-color: var(--blue);
}
.login-submit { width: 100%; margin-top: 4px; padding: 12px; font-size: 15px; }
.form-error { min-height: 1.2em; margin: 0 0 8px; color: var(--red-text); font-size: 13px; font-weight: 700; }
.hint { margin: 14px 0 0; color: var(--muted); font-size: 13px; }

.chip:focus-visible, .btn:focus-visible, .more:focus-visible, .warm-toggle:focus-visible, .sub button:focus-visible {
  outline: 2px solid rgba(59, 108, 255, 0.45);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .stats, .board, .warm-grid { grid-template-columns: 1fr 1fr; }
  .side, .warm { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .wrap { padding: 18px 14px 40px; }
  .top { flex-direction: column; align-items: stretch; }
  .controls { flex-wrap: wrap; }
  h1 { font-size: 24px; }
  .stats, .board, .warm-grid { grid-template-columns: 1fr; }
  .stat-num { font-size: 36px; }
}
