@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Unbounded:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: rgba(17, 21, 28, .78);
  --panel-solid: #11151c;
  --panel-hover: #151b24;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .15);
  --text: #f5f7fb;
  --muted: #8993a4;
  --soft: #b9c1ce;
  --red: #ef233c;
  --red-soft: rgba(239, 35, 60, .14);
  --cyan: #34d3ff;
  --cyan-soft: rgba(52, 211, 255, .12);
  --lime: #b7f34b;
  --amber: #ffb84d;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(7, 9, 13, .55) 0%, rgba(7, 9, 13, .82) 46%, rgba(7, 9, 13, .96) 100%),
    url("/static/assets/radar-bg-v1.png") center top / cover fixed no-repeat,
    var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
::selection { background: var(--red); color: white; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.shell { width: min(1600px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 60px; position: relative; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 10px 0 28px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo {
  width: 52px; height: 52px; border-radius: 16px; object-fit: cover;
  box-shadow: 0 12px 32px rgba(239, 35, 60, .2);
}
.brand-copy { min-width: 0; }
.eyebrow {
  color: var(--muted); text-transform: uppercase; letter-spacing: .16em;
  font-size: 10px; font-weight: 700;
}
.brand-name { margin-top: 2px; font-family: var(--display); font-size: 15px; letter-spacing: -.03em; }
.system-state { display: flex; align-items: center; gap: 8px; color: var(--soft); font-size: 12px; font-weight: 600; }
.state-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--lime);
  box-shadow: 0 0 0 5px rgba(183,243,75,.08), 0 0 18px rgba(183,243,75,.55);
}

.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: 40px; align-items: end;
  min-height: 320px; padding: 48px;
  border: 1px solid var(--line); border-radius: 32px;
  background: linear-gradient(135deg, rgba(22,27,36,.95), rgba(12,15,21,.90));
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  right: -90px; top: -180px; border: 68px solid rgba(239,35,60,.07);
  box-shadow: 0 0 0 68px rgba(52,211,255,.025);
}
.hero-copy, .hero-side { position: relative; z-index: 1; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--cyan);
  background: var(--cyan-soft); text-transform: uppercase; letter-spacing: .13em;
  font-size: 10px; font-weight: 800;
}
.hero-kicker::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
h1 {
  max-width: 980px; margin: 24px 0 20px; font-family: var(--display);
  font-size: clamp(38px, 5vw, 78px); line-height: .98; letter-spacing: -.065em; font-weight: 600;
}
.gradient-text {
  color: transparent;
  background: linear-gradient(90deg, #fff 0%, #aab5c7 55%, #5d697a 100%);
  background-clip: text; -webkit-background-clip: text;
}
.hero-sub { max-width: 690px; margin: 0; color: var(--muted); font-size: 15px; }
.hero-side { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.scan-meta { padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.scan-meta-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.scan-meta-value { margin-top: 5px; font-weight: 700; color: var(--soft); }
.tech-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tech {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px;
  background: rgba(255,255,255,.045); color: var(--muted); font-size: 10px; font-weight: 700;
}
.tech::before { content:""; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); }
.tech.off::before { background: var(--amber); }

.btn {
  border: 0; cursor: pointer; min-height: 52px; padding: 0 20px; border-radius: 15px;
  display: inline-flex; justify-content: center; align-items: center; gap: 10px;
  color: white; font-weight: 800; transition: transform .2s ease, filter .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary { background: var(--red); box-shadow: 0 14px 34px rgba(239,35,60,.22); }
.btn-secondary { background: rgba(255,255,255,.07); border: 1px solid var(--line-strong); }
.btn-stop { color:#ff8a98; background:rgba(239,35,60,.08); border:1px solid rgba(239,35,60,.24); }
.stop-square { width:10px; height:10px; border-radius:2px; background:currentColor; }
.btn-icon { width: 18px; height: 18px; border: 2px solid currentColor; border-radius: 50%; position: relative; }
.btn-icon::after { content:""; position:absolute; width:5px; height:2px; background:currentColor; right:-4px; top:2px; transform:rotate(-35deg); }
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stats {
  display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px;
  margin: 18px 0 28px;
}
.stat {
  position: relative; overflow: hidden; min-height: 172px; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); backdrop-filter: blur(18px);
}
.stat::after {
  content:""; position:absolute; right:-22px; bottom:-38px; width:110px; height:110px;
  border-radius:50%; background: radial-gradient(circle, rgba(52,211,255,.12), transparent 68%);
}
.stat.hot::after { background: radial-gradient(circle, rgba(239,35,60,.18), transparent 68%); }
.stat-top { display:flex; justify-content:space-between; gap:12px; color:var(--muted); }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.stat-index { font-family: var(--display); font-size: 10px; color: rgba(255,255,255,.22); }
.stat-value { margin-top: 20px; font-family: var(--display); font-size: 44px; line-height: 1; letter-spacing: -.06em; }
.stat-sub { margin-top: 12px; color: var(--muted); font-size: 12px; }
.stat.hot .stat-value { color: var(--red); }

.section-head { display:flex; align-items:end; justify-content:space-between; gap:20px; margin: 4px 0 14px; }
.section-title { margin:0; font-family:var(--display); font-size:22px; letter-spacing:-.04em; }
.section-count { color:var(--muted); font-size:12px; }
.toolbar {
  display: grid; grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(150px, .6fr)) auto auto;
  gap: 10px; align-items:center; margin-bottom:18px; padding:12px;
  border:1px solid var(--line); border-radius:20px; background:var(--panel);
}
.control {
  width:100%; height:46px; border:1px solid var(--line); border-radius:13px; padding:0 14px;
  background:#0c1016; color:var(--soft); transition:border-color .2s, background .2s;
}
.control:hover, .control:focus { border-color:var(--line-strong); background:#0f141c; }
.control::placeholder { color:#5e6877; }
select.control { cursor:pointer; }
.filter-btn { min-height:46px; padding-inline:18px; background:var(--text); color:var(--bg); }
.reset { text-decoration:none; color:var(--muted); font-weight:700; font-size:12px; padding:10px; text-align:center; }
.reset:hover { color:var(--text); }
.quick-link {
  display:inline-flex; margin:-6px 0 18px; color:var(--muted); text-decoration:none;
  font-size:11px; font-weight:700; letter-spacing:.03em;
}
.quick-link:hover { color:var(--red); }

.leads { display:grid; grid-template-columns:repeat(auto-fill, minmax(350px,1fr)); gap:14px; }
.lead {
  position:relative; overflow:hidden; cursor:pointer; min-height:350px;
  padding:24px; border:1px solid var(--line); border-radius:var(--radius);
  background:linear-gradient(150deg, rgba(20,25,34,.96), rgba(13,16,22,.96));
  transition:transform .25s ease, border-color .25s ease, background .25s ease;
}
.lead:hover { transform:translateY(-5px); border-color:rgba(52,211,255,.28); background:var(--panel-hover); }
.lead::before {
  content:""; position:absolute; left:0; right:0; top:0; height:2px;
  background:linear-gradient(90deg, transparent, var(--cyan), transparent); opacity:0;
  transition:opacity .25s;
}
.lead:hover::before { opacity:1; }
.lead-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.lead-company { margin:0; font-family:var(--display); font-size:17px; line-height:1.3; letter-spacing:-.035em; }
.score {
  flex:0 0 auto; width:55px; height:55px; border-radius:17px; display:grid; place-items:center;
  font-family:var(--display); font-size:20px; color:var(--cyan);
  border:1px solid rgba(52,211,255,.24); background:var(--cyan-soft);
}
.score.hot { color:#ff5c70; border-color:rgba(239,35,60,.3); background:var(--red-soft); }
.lead-tags { display:flex; flex-wrap:wrap; gap:6px; margin:17px 0 12px; }
.tag { padding:5px 8px; border-radius:999px; background:rgba(255,255,255,.05); color:var(--muted); font-size:10px; font-weight:700; }
.tag.category { color:var(--cyan); background:var(--cyan-soft); }
.tag.priority { color:#ff6d7e; background:var(--red-soft); }
.lead-date { color:#667181; font-size:11px; margin-bottom:18px; }
.event { display:inline-flex; margin:-4px 0 16px; padding:7px 10px; border-radius:10px; color:var(--amber); background:rgba(255,184,77,.09); font-size:11px; font-weight:800; }
.lead-details { display:flex; flex-direction:column; gap:10px; }
.lead-row { color:var(--muted); font-size:12px; line-height:1.55; }
.lead-row b { color:var(--soft); font-weight:700; }
.requisites {
  display:flex; flex-direction:column; gap:7px; margin-top:18px; padding:14px;
  border:1px solid rgba(52,211,255,.13); border-radius:14px; background:rgba(52,211,255,.035);
}
.requisites-title {
  margin-bottom:3px; color:var(--cyan); font-size:9px; font-weight:800;
  letter-spacing:.14em; text-transform:uppercase;
}
.requisite-row { display:grid; grid-template-columns:90px 1fr; gap:10px; font-size:11px; line-height:1.45; }
.requisite-row span { color:#657080; }
.requisite-row b { color:var(--soft); font-weight:600; word-break:break-word; }
.requisites-empty { border-style:dashed; background:rgba(255,255,255,.018); }
.requisites-empty .requisites-title { color:#667181; }
.requisites-missing { color:#596373; font-size:11px; }
.lead-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:22px; padding-top:15px; border-top:1px solid var(--line); }
.src { color:var(--cyan); text-decoration:none; font-size:11px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
.open-hint { color:#556070; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.empty { grid-column:1/-1; padding:60px 24px; text-align:center; border:1px dashed var(--line-strong); border-radius:var(--radius); color:var(--muted); }
.warning { margin:18px 0; padding:16px 18px; border:1px solid rgba(255,184,77,.2); border-radius:16px; background:rgba(255,184,77,.08); color:#ffd08a; }

.overlay {
  position:fixed; inset:0; z-index:100; display:none; place-items:center; padding:24px;
  background:rgba(2,4,8,.78); backdrop-filter:blur(14px);
}
.overlay.open { display:grid; animation:fade .18s ease; }
@keyframes fade { from { opacity:0; } }
.modal {
  position:relative; width:min(760px,100%); max-height:88vh; overflow:auto; padding:34px;
  border:1px solid var(--line-strong); border-radius:28px;
  background:#10141b; box-shadow:0 40px 120px rgba(0,0,0,.65);
}
.modal h2 { max-width:90%; margin:10px 0 6px; font-family:var(--display); font-size:27px; letter-spacing:-.045em; }
.modal .field { padding:14px 0; border-bottom:1px solid var(--line); }
.modal .field:last-child { border-bottom:0; }
.modal .k { color:#657080; font-size:9px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; }
.modal .v { margin-top:5px; color:var(--soft); font-size:14px; line-height:1.55; word-break:break-word; }
.modal .v a { color:var(--cyan); }
.modal .close {
  position:absolute; top:20px; right:20px; width:38px; height:38px; border:1px solid var(--line);
  border-radius:12px; cursor:pointer; background:rgba(255,255,255,.04); color:var(--muted); font-size:22px;
}
.muted { color:var(--muted); font-size:12px; }

@media (max-width: 1180px) {
  .hero { grid-template-columns:1fr; }
  .hero-side { display:grid; grid-template-columns:1fr 1fr; }
  .stats { grid-template-columns:repeat(3,1fr); }
  .toolbar { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 720px) {
  .shell { width:min(100% - 24px, 1600px); padding-top:12px; }
  .topbar { padding-bottom:16px; }
  .system-state { display:none; }
  .hero { padding:26px; min-height:0; border-radius:24px; }
  h1 { font-size:38px; }
  .hero-side { grid-template-columns:1fr; }
  .stats { grid-template-columns:repeat(2,1fr); }
  .stat { min-height:145px; padding:18px; }
  .stat-value { font-size:36px; }
  .stats .stat:last-child { grid-column:1/-1; }
  .toolbar { grid-template-columns:1fr; }
  .leads { grid-template-columns:1fr; }
  .lead { min-height:0; }
  .modal { padding:25px; border-radius:22px; }
}
