:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: #eff6ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 15% -10%, #dbeafe 0%, transparent 60%),
    radial-gradient(700px 380px at 90% 0%, #ede9fe 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ── Верхняя панель ─────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px clamp(18px, 4vw, 40px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo { width: 34px; height: 34px; object-fit: contain; }
.brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.16em;
  color: var(--text);
}

.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }

.user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.user-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

/* ── Контент ────────────────────────────────────────────────── */
main { max-width: 1120px; margin: 0 auto; padding: 30px clamp(18px, 4vw, 40px) 96px; }

.hero { text-align: center; padding: clamp(36px, 7vw, 78px) 0 34px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #dbeafe;
  padding: 7px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--accent);
}
.hero h1 {
  font-size: clamp(40px, 6.2vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  font-weight: 800;
}
.grad {
  background: linear-gradient(90deg, #2563eb, #7c3aed 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { font-size: clamp(15px, 1.8vw, 19px); color: var(--muted); margin: 0 auto 28px; max-width: 620px; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0 0 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 11px;
}

button, .secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
button:hover, .secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }
button:active, .secondary:active { transform: translateY(1px); }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}
button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.big, .secondary.big { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: var(--surface-2); color: var(--text); }
button.linklike { background: none; border: none; color: var(--accent); padding: 0 6px; }

/* ── Модули ─────────────────────────────────────────────────── */
.modules { margin-top: 18px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.section-head p { margin: 0; font-size: 13px; }
.section-count {
  font-size: 12px; font-weight: 700; color: var(--ok);
  background: var(--ok-soft); border: 1px solid #d1fae5;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
}
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.module-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-height: 190px;
}
.module-card.active:hover { border-color: #bfdbfe; box-shadow: var(--shadow); transform: translateY(-2px); }
.module-card.soon { opacity: 0.72; }
.module-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.module-icon {
  width: 42px; height: 42px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.module-icon.blue { background: #eff6ff; color: #2563eb; }
.module-icon.violet { background: #f5f3ff; color: #7c3aed; }
.module-icon.amber { background: #fffbeb; color: #d97706; }
.module-card h3 { margin: 2px 0 0; font-size: 17px; }
.module-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.module-link { color: var(--accent); font-size: 13px; font-weight: 700; }
.badge {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 8px; border-radius: 999px; white-space: nowrap;
}
.badge-green { color: var(--ok); background: var(--ok-soft); border-color: #d1fae5; }

/* ── Кабинет ────────────────────────────────────────────────── */
.app-head { margin: 10px 0 22px; }
.app-head h2 { margin: 5px 0 4px; font-size: 28px; letter-spacing: -0.02em; }
.grid.two { display: grid; grid-template-columns: 1fr 1.35fr; gap: 18px; align-items: start; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel h3 { margin: 0 0 14px; font-size: 18px; }
.panel-head h3 { margin: 0; }
.panel h4 {
  margin: 22px 0 10px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.item {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px 14px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.item:hover { border-color: #bfdbfe; background: #fff; }
.item.active { border-color: #93c5fd; background: #eff6ff; }
.item .t { font-weight: 700; margin-bottom: 4px; }
.item .m { color: var(--muted); font-size: 13px; line-height: 1.45; }
.item .status {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
  background: var(--surface);
  margin-top: 6px;
}

.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }

input, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #1e293b;
  padding: 12px 16px;
  border-radius: 13px;
  max-width: 360px;
  font-size: 14px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.24);
  z-index: 50;
}
.toast.error { background: #7f1d1d; border-color: #991b1b; }

@media (max-width: 860px) {
  .module-grid { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .hero h1 { letter-spacing: -0.03em; }
  .topbar { gap: 14px; padding: 12px 16px; }
  .nav a { padding: 8px; font-size: 13px; }
  .brand-name { font-size: 17px; }
  .section-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .nav a[href="/catapult/"] { display: none; }
  .hero { padding-top: 30px; }
  .user #user-name { display: none; }
  .actions .secondary, .actions button { width: 100%; }
}
