:root {
  --bg: #0a0d14;
  --panel: #121722;
  --panel-2: #182031;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --cyan: #22d3ee;
  --magenta: #f472b6;
  --lime: #a3e635;
  --amber: #fbbf24;
  --violet: #a78bfa;
  --text: #e5edf7;
  --muted: #8b9bb0;
  --dim: #61728a;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Мягкое неоновое свечение по краям фона */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(820px 460px at 8% -12%, rgba(34, 211, 238, 0.13), transparent 62%),
    radial-gradient(760px 480px at 96% 0%, rgba(167, 139, 250, 0.11), transparent 60%);
}

.ic {
  width: 16px;
  height: 16px;
  flex: none;
  display: block;
}

/* ── Шапка ─────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 28px;
  background: rgba(10, 13, 20, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 26px -10px var(--cyan);
}

.brand .mark .logo {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 7px rgba(34, 211, 238, 0.35));
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f3f8ff;
}

.brand .tagline {
  font-size: 12px;
  color: var(--dim);
}

/* ── Кнопки ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, box-shadow 0.16s, background 0.16s;
}

.btn:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 24px -12px var(--cyan);
}

.btn.accent {
  color: #06232b;
  background: var(--cyan);
  border-color: transparent;
  font-weight: 600;
}

.btn.accent:hover { color: #06232b; box-shadow: 0 0 26px -8px var(--cyan); }

/* Переключатель режима */
.mode {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}

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

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.25);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px -2px var(--cyan);
  transition: transform 0.2s, background 0.2s;
}

.switch[data-on="false"] { background: rgba(251, 191, 36, 0.22); }
.switch[data-on="false"]::after {
  transform: translateX(18px);
  background: var(--amber);
  box-shadow: 0 0 12px -2px var(--amber);
}

/* ── Основная сетка ────────────────────────────────────── */

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 28px 40px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  padding: 17px 19px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stat .k {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 9px;
}

.stat .k .ic { width: 15px; height: 15px; color: var(--accent, var(--cyan)); }

.stat .v {
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #f5faff;
}

.stat .sub {
  margin-top: 7px;
  font-size: 12px;
  color: var(--dim);
}

/* ── Фильтры ───────────────────────────────────────────── */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.toolbar .sep { flex: 1; }

.chip-filter {
  padding: 8px 15px;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s;
}

.chip-filter:hover { color: var(--text); border-color: var(--line-strong); }

.chip-filter[data-active="true"] {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.1);
}

select.chip-filter {
  appearance: none;
  border-radius: 9px;
  color: var(--text);
  background: var(--panel-2);
  padding-right: 28px;
}

select.chip-filter option { background: #141a26; color: var(--text); }

/* ── Карточки лидов ────────────────────────────────────── */

.leads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  align-items: stretch;
  gap: 14px;
}

.lead {
  display: flex;
  flex-direction: column;
  padding: 18px 19px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.lead:hover {
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 14px 44px -30px var(--cyan);
}

.lead .head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 11px;
}

.lead h3 {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.lead h3 a { color: #f0f6ff; text-decoration: none; }
.lead h3 a:hover { color: var(--cyan); }

.badge {
  flex: none;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent, var(--cyan));
  background: color-mix(in srgb, var(--accent, var(--cyan)) 13%, transparent);
  border-radius: 999px;
}

.badge.upwork { --accent: var(--lime); }
.badge.freelancer { --accent: var(--cyan); }
.badge.freelancehunt { --accent: var(--amber); }
.badge.codeur { --accent: var(--violet); }
.badge.reddit { --accent: #fb7c46; }
.badge.hnfreelance, .badge.hn { --accent: #ffa657; }
.badge.tg { --accent: #4fc3f7; }
.badge.remoteok, .badge.remotive, .badge.weworkremotely, .badge.arbeitnow, .badge.adzuna { --accent: var(--magenta); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 11px;
  font-size: 12.5px;
  color: var(--muted);
}

.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta .ic { width: 14px; height: 14px; color: var(--dim); }
.meta .money { color: var(--lime); font-family: var(--mono); font-size: 12px; }
.meta .money .ic { color: var(--lime); }

.desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #a8b8cc;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.chip {
  padding: 3px 10px;
  font-size: 11.5px;
  color: #8fd9e8;
  background: rgba(34, 211, 238, 0.09);
  border-radius: 999px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  font-family: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.act .ic { width: 14px; height: 14px; }
.act:hover { color: var(--text); border-color: var(--line-strong); }
.act.ok:hover { color: var(--lime); border-color: rgba(163, 230, 53, 0.4); }
.act.hide:hover { color: var(--magenta); border-color: rgba(244, 114, 182, 0.4); }
.act.open { margin-left: auto; color: var(--cyan); border-color: rgba(34, 211, 238, 0.3); }
.act.open:hover { background: rgba(34, 211, 238, 0.1); }
.act.done { color: var(--lime); border-color: rgba(163, 230, 53, 0.4); }

.workflow-note {
  margin: -4px 2px 14px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

/* ── Пустое состояние ──────────────────────────────────── */

.empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 72px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.empty .ic { width: 40px; height: 40px; color: var(--dim); }
.empty b { font-size: 15px; font-weight: 600; color: var(--text); }
.empty p { margin: 0; font-size: 13px; max-width: 400px; }
.empty code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  padding: 1px 6px;
  border-radius: 5px;
}

.empty.error .ic { color: var(--magenta); }

/* ── Выбор направлений ─────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 8, 13, 0.82);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.overlay[hidden] { display: none; }

.sheet {
  width: 100%;
  max-width: 780px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 40px 90px -50px rgba(34, 211, 238, 0.5);
  overflow: hidden;
}

.sheet-head { padding: 26px 28px 20px; }

.sheet-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f5faff;
}

.sheet-head p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 560px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 10px;
  padding: 0 28px 22px;
}

.spec {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.spec:hover { border-color: var(--line-strong); }

.spec[data-on="true"] {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.08);
}

.spec .box {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9px;
  transition: all 0.15s;
}

.spec[data-on="true"] .box {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.15);
  box-shadow: 0 0 18px -8px var(--cyan);
}

.spec .box .ic { width: 17px; height: 17px; }
.spec .t { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.spec .h { display: block; margin-top: 3px; font-size: 12px; color: var(--dim); line-height: 1.35; }

.sheet-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 28px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.sheet-foot .hint { flex: 1; font-size: 12.5px; color: var(--dim); }

/* Направления на карточке лида */
.spec-chip {
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.12);
  border-radius: 999px;
}

/* Индикатор связи */
.pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.pulse .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: blip 2.6s ease-in-out infinite;
}

.pulse[data-state="off"] .dot { background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }

@keyframes blip {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(140, 160, 190, 0.2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.35); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding: 18px 2px 0;
  color: var(--dim);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover { color: var(--cyan); }

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  main { padding: 16px; }
  .leads { grid-template-columns: 1fr; }
  .brand .tagline { display: none; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

