/* =============================================
   LeadVector — Компании
   Custom CSS (Bootstrap 5.2.3 override layer)
   ============================================= */

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

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --sidebar-width: 220px;
  --topbar-h: 64px;
  --app-bg: #f6f7fb;
  --card: #fff;
  --text: #171b26;
  --muted: #667085;
  --muted2: #98a2b3;
  --line: #e5e9f1;
  --line2: #eef1f6;
  --blue: #315cf6;
  --blue-soft: #eef3ff;
  --violet: #7357ff;
  --lv-action: #4450B2;
  --lv-action-hover: #3D48A4;
  --lv-action-active: #354093;
  --shadow: 0 2px 8px rgba(17,24,39,.04), 0 20px 48px rgba(17,24,39,.07);
  --shadow-sm: 0 2px 8px rgba(17,24,39,.06);
  --shadow-md: 0 18px 52px rgba(17,24,39,.13), 0 4px 12px rgba(17,24,39,.06);
}

/* ── Reset / Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--app-bg);
  color: var(--text);
  font-family: Onest, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── App layout ────────────────────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns .22s ease;
}
.app.collapsed { --sidebar-width: 72px; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  min-width: 0;
  background: linear-gradient(180deg, #060816 0%, #080B1D 32%, #0B1230 100%);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 30;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 48%, rgba(49,92,246,.16), transparent 34%),
    radial-gradient(circle at 92% 78%, rgba(115,87,255,.12), transparent 38%),
    linear-gradient(180deg, transparent 0%, transparent 30%, rgba(255,255,255,.025) 58%, transparent 100%),
    linear-gradient(90deg, transparent 0%, rgba(49,92,246,.04) 100%);
  opacity: .78;
}
.sidebar > * { position: relative; z-index: 1; }

.sidebar-top {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: relative;
}
.app.collapsed .sidebar-top { justify-content: center; padding: 0; }

/* Brand logo */
.sidebar-brand {
  height: 64px;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-right: 8px;
}
.brand-expanded { width: 142px; height: 40px; display: flex; align-items: center; overflow: visible; }
.sidebar-brand-logo { display: block; width: 142px; height: auto; }
.sidebar-brand-logo .logoVectorRest,
.sidebar-brand-logo .logoArrow path {
  fill: color-mix(in srgb, #335CFF 85%, white);
  transition: fill .2s, transform .24s cubic-bezier(.2,.8,.2,1);
}
.sidebar-brand-logo .logoArrow { transform-box: fill-box; transform-origin: center center; }
.sidebar-brand-logo .logoArrowRight { transform-box: fill-box; transform-origin: 50% 100%; }
.sidebar-brand:hover .sidebar-brand-logo .logoVectorRest,
.sidebar-brand:hover .sidebar-brand-logo .logoArrow path { fill: #335CFF; }
.sidebar-brand-logo .logoArrowMoving {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: fill .2s, transform .28s cubic-bezier(.16,1,.3,1);
}
.sidebar-brand:hover .sidebar-brand-logo .logoArrowMoving { transform: translate(4px,-4px); }

.brand-collapsed { display: none; width: 40px; height: 40px; place-items: center; }
.mini-logo-ring {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 38% 26%, rgba(51,92,255,.28), rgba(138,100,255,.14) 42%, rgba(255,255,255,.035) 72%),
    #060816;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.24);
  overflow: hidden;
}
.mini-logo-svg { width: 36px; height: 36px; display: block; }
.mini-logo-svg .logoArrow path { fill: color-mix(in srgb, #335CFF 85%, white); }
.mini-logo-ring:hover .logoArrowMoving { transform: translate(4px,-4px); }

.app.collapsed .sidebar-brand { flex: 0 0 auto; }
.app.collapsed .brand-expanded { display: none; }
.app.collapsed .brand-collapsed { display: grid; }

/* Sidebar toggle */
.sidebar-toggle {
  margin-left: auto; flex: 0 0 auto;
  width: 28px; height: 28px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  color: #cbd5e1; cursor: pointer;
  display: grid; place-items: center;
  transition: .15s; font-size: 14px; line-height: 1;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }
.app.collapsed .sidebar-toggle {
  position: absolute; right: -14px; top: 18px;
  background: #060816;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
  margin-left: 0;
}

/* Nav */
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  height: 42px;
  display: grid; grid-template-columns: 34px minmax(0,1fr);
  align-items: center; gap: 8px; padding: 0 10px;
  border-radius: 10px; color: #aeb8ca;
  text-decoration: none; font-size: 16px; font-weight: 600;
  letter-spacing: -.016em; transition: .15s; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(49,92,246,.16); color: #fff; }
.nav-icon { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; color: #cbd5e1; }
.nav-icon svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-icon { color: #7ea0ff; }
.nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s ease, width .2s ease; }
.nav-separator { height: 1px; background: rgba(255,255,255,.07); margin: 6px 10px; }

.app.collapsed .nav .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
.app.collapsed .nav .nav-text { opacity: 0; width: 0; position: absolute; pointer-events: none; }
.app.collapsed .nav .nav-item:hover::after {
  content: attr(data-title);
  position: absolute; left: 58px; top: 50%; transform: translateY(-50%);
  background: #111827; color: #fff;
  border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  padding: 7px 9px; font-size: 12px; font-weight: 600;
  white-space: nowrap; box-shadow: 0 10px 28px rgba(0,0,0,.22); z-index: 60;
}
.sidebar-bottom { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }

/* ── Main ──────────────────────────────────────────────────────────────────── */
.main { min-width: 0; display: grid; grid-template-rows: var(--topbar-h) minmax(0,1fr); }

/* ── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fafbfc;
  border-bottom: 1px solid rgba(49,92,246,.08);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; min-width: 0; position: relative; z-index: 20;
}

.top-search { width: min(760px, 56vw); height: 40px; position: relative; }
.top-search::before {
  content: ""; position: absolute; left: 12px; top: 50%;
  width: 15px; height: 15px; transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg width='15' height='15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.8 11.5a4.7 4.7 0 1 0 0-9.4 4.7 4.7 0 0 0 0 9.4ZM10.2 10.2l2.7 2.7' stroke='%2398A2B3' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}
.top-search input {
  width: 100%; height: 40px;
  border: 1px solid #dce3ef; border-radius: 10px;
  background: #fff; outline: none;
  padding: 0 12px 0 36px;
  font: 500 13px Onest, sans-serif; color: #202636;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.top-search input:focus { border-color: #b9c6ff; box-shadow: 0 0 0 3px rgba(49,92,246,.08), 0 8px 22px rgba(17,24,39,.06); }
.top-search:hover input { border-color: #c9d4e6; box-shadow: 0 4px 14px rgba(17,24,39,.045); }

.top-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px);
  z-index: 90; padding: 10px;
  border: 1px solid rgba(226,232,240,.96); border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(15,23,42,.14), 0 5px 14px rgba(15,23,42,.055);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px) scale(.992); transform-origin: 50% 0;
  transition: opacity .18s cubic-bezier(.16,1,.3,1), transform .18s cubic-bezier(.16,1,.3,1), visibility .18s;
  color: #0B1220;
}
.top-search.is-open .top-suggest { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.top-suggest-group { padding: 2px 0; }
.top-suggest-group + .top-suggest-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef2f6; }
.top-suggest-title { padding: 3px 8px 6px; color: #8792A3; font-size: 12px; font-weight: 500; }
.top-suggest-item {
  width: 100%; min-height: 42px; border: 0; border-radius: 11px;
  background: transparent; color: #0B1220;
  display: grid; grid-template-columns: 30px minmax(0,1fr) auto;
  align-items: center; gap: 10px; padding: 6px 8px;
  text-align: left; cursor: pointer; transition: background-color .14s;
}
.top-suggest-item::after { content: "↵"; font-size: 12px; color: #a5adba; opacity: 0; transition: opacity .14s; }
.top-suggest-item:hover, .top-suggest-item.is-active { background: #f7f9fc; }
.top-suggest-item:hover::after, .top-suggest-item.is-active::after { opacity: 1; }
.top-suggest-icon { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: #f3f6fb; color: #5D6878; overflow: hidden; }
.top-suggest-icon svg { width: 17px; height: 17px; stroke-width: 1.8; }
.top-suggest-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-suggest-empty { padding: 14px 10px; color: #98a2b3; font-size: 13px; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.service-btn, .service-pill, .service-profile {
  height: 34px; border: 0; background: transparent; color: #344054;
  padding: 0 6px; font: 600 13px Onest, sans-serif;
  cursor: pointer; display: flex; align-items: center; gap: 7px; transition: color .15s ease;
}
.service-btn svg, .service-pill svg, .service-profile svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: #667085;
}
.service-btn:hover, .service-pill:hover, .service-profile:hover { color: #315CF6; }
.service-btn:hover svg, .service-pill:hover svg, .service-profile:hover svg { color: #315CF6; }
.service-profile { padding-right: 0; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #667085; color: #fff; font-size: 9px; font-weight: 700; }

/* ── Content / Page ────────────────────────────────────────────────────────── */
.content { overflow-y: auto; }

.catalog-page {
  width: calc(100% - 56px);
  margin: 0 auto;
  padding: 28px 0 56px;
}

/* Hero */
.hero { text-align: center; margin: 0 auto 26px; max-width: 940px; }
.hero h1 { margin: 0; font-size: 32px; line-height: 1.12; font-weight: 600; letter-spacing: -.032em; color: #171b26; }
.hero-sub { margin: 12px auto 0; max-width: 860px; color: #475467; font-size: 17px; line-height: 1.55; font-weight: 450; letter-spacing: -.012em; }

.pulse-metrics { margin-top: 20px; display: flex; justify-content: center; align-items: center; gap: 32px; flex-wrap: wrap; }
.pulse-metric { display: inline-flex; align-items: center; gap: 12px; color: #263042; font-size: 15px; font-weight: 650; letter-spacing: -.014em; white-space: nowrap; }
.pulse-dot {
  position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: #0E7A4F; flex: 0 0 auto; box-shadow: 0 0 8px rgba(14,122,79,.18);
  animation: lvPulseMetric 2.05s cubic-bezier(.16,1,.3,1) infinite;
}
.pulse-metric:nth-child(2) .pulse-dot { animation-delay: .34s; }
.pulse-metric:nth-child(3) .pulse-dot { animation-delay: .68s; }
@keyframes lvPulseMetric {
  0%,100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px rgba(14,122,79,.18); }
  45% { transform: scale(1.36); opacity: .72; box-shadow: 0 0 13px rgba(14,122,79,.32); }
  72% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px rgba(14,122,79,.18); }
}

/* Catalog search */
.catalog-search { width: min(900px, 100%); height: 56px; margin: 0 auto 34px; position: relative; }
.catalog-search svg {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; stroke: #8b98ad; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.catalog-search input {
  width: 100%; height: 56px; border-radius: 14px; border: 1px solid #dbe3ef;
  background: #fff; color: #222938; outline: none;
  padding: 0 20px 0 56px; font-size: 16px; font-weight: 560; font-family: Onest, sans-serif;
  box-shadow: 0 8px 22px rgba(16,24,40,.035);
}
.catalog-search input::placeholder { color: #98a2b3; }
.catalog-search input:focus,
.catalog-search.is-open input { border-color: #b9c6ff; box-shadow: 0 0 0 3px rgba(49,92,246,.08), 0 12px 28px rgba(16,24,40,.05); }

/* Company suggest dropdown */
.niche-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  z-index: 30;
  border: 1px solid rgba(226,232,240,.96); border-radius: 16px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 60px rgba(15,23,42,.14), 0 6px 18px rgba(15,23,42,.06);
  overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s cubic-bezier(.16,1,.3,1), transform .16s, visibility .16s;
  backdrop-filter: blur(10px);
}
.catalog-search.is-open .niche-suggest { opacity: 1; visibility: visible; transform: translateY(0); }
.niche-suggest-list { max-height: 380px; overflow: auto; padding: 6px; }
.niche-suggest-item {
  width: 100%; text-decoration: none; min-height: 52px; border: 0;
  background: transparent; border-radius: 10px;
  display: grid; grid-template-columns: 32px minmax(0,1fr) auto;
  align-items: center; gap: 12px; padding: 8px 12px;
  cursor: pointer; color: #202636; transition: background-color .13s;
}
.niche-suggest-item:hover { background: #f6f8fc; }
.company-suggest-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: #f3f6fb; color: #5d6878; flex: 0 0 auto;
}
.company-suggest-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.company-suggest-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.company-suggest-name { font-size: 14px; font-weight: 700; letter-spacing: -.018em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-suggest-name span { color: #315cf6; }
.company-suggest-meta { font-size: 12px; font-weight: 500; color: #667085; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-suggest-meta span { color: #315cf6; }
.niche-suggest-count {
  height: 26px; min-width: 40px; border-radius: 8px;
  background: #edf3ff; color: #244cf2;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 8px; font-size: 13px; font-weight: 800;
}
.niche-suggest-empty { padding: 14px 16px; color: #667085; font-size: 14px; font-weight: 550; }

/* ── Table section ─────────────────────────────────────────────────────────── */
.table-section { margin: 0 auto; width: 100%; max-width: none; }
.section-title { text-align: center; margin-bottom: 22px; }
.section-title h2 { margin: 0; font-size: 28px; line-height: 1.12; font-weight: 600; letter-spacing: -.03em; color: #171b26; }
.section-title p { margin: 10px auto 0; color: #475467; font-size: 16px; line-height: 1.5; font-weight: 450; }

.table-card { border: 1px solid #e1e7f0; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }

/* DataTables wrapper overrides */
.table-card .dataTables_wrapper { padding: 0; }
.table-card .dataTables_wrapper .dataTables_length,
.table-card .dataTables_wrapper .dataTables_filter,
.table-card .dataTables_wrapper .dataTables_info { display: none; }
.table-card .dataTables_wrapper .dataTables_paginate {
  padding: 14px 18px; border-top: 1px solid var(--line2);
  display: flex; justify-content: flex-end; gap: 4px;
}
.table-card .dataTables_wrapper .dataTables_paginate .paginate_button {
  height: 32px; min-width: 32px; border-radius: 8px;
  border: 1px solid transparent; background: transparent;
  color: #667085 !important; font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 8px; transition: background .14s, border-color .14s;
}
.table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: #f4f6f9 !important; border-color: var(--line) !important; color: #202636 !important; }
.table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--lv-action) !important; border-color: var(--lv-action) !important; color: #fff !important; }
.table-card .dataTables_wrapper .dataTables_paginate .paginate_button.disabled { opacity: .4; cursor: default; }

/* Table itself */
#companiesTable { width: 100% !important; border-collapse: collapse; }
#companiesTable thead th {
  height: 44px; background: #f7f9fc;
  border-bottom: 1px solid #e7edf5;
  color: #98a2b3; font-size: 11px; font-weight: 650;
  letter-spacing: .035em; text-transform: uppercase;
  text-align: left; padding: 0 18px; white-space: nowrap;
}
#companiesTable tbody td {
  height: 66px; border-bottom: 1px solid #edf1f7;
  padding: 10px 18px; color: #202636;
  font-size: 14px; font-weight: 550; letter-spacing: -.012em;
  vertical-align: middle;
}
#companiesTable tbody tr:last-child td { border-bottom: 0; }
#companiesTable tbody tr { cursor: pointer; transition: background .13s; }
#companiesTable tbody tr:hover td { background: #fafbff; }

/* Company cell */
.company-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.company-niche-icon {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px; background: #f3f6fb;
  display: grid; place-items: center; color: #5d6878;
}
.company-niche-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.company-main { min-width: 0; }
.company-name { font-size: 15px; font-weight: 700; letter-spacing: -.02em; color: #171b26; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-domain { margin-top: 3px; font-size: 12px; font-weight: 500; color: #667085; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Niche pill */
.niche-pill {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 10px; border-radius: 999px;
  background: #f2f5fa; color: #475467;
  font-size: 12px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; text-decoration: none;
  transition: background .14s, color .14s;
}
.niche-pill-link:hover { background: #eef3ff; color: #315cf6; }

/* Score cell */
.score {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; min-width: 48px; padding: 0 9px;
  border-radius: 9px; background: #edf3ff; color: #244cf2;
  font-size: 15px; font-weight: 800; letter-spacing: -.012em;
}
.score-sparkle { font-size: 11px; }
.score-sparkle.score-high { color: #0E7A4F; }
.score-sparkle.score-mid  { color: #B45309; }
.score-sparkle.score-low  { color: #98a2b3; }

/* PPC badge */
.ppc-active {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 9px; border-radius: 999px;
  background: #ecfdf5; color: #0E7A4F;
  font-size: 12px; font-weight: 700;
}

/* Tech stack */
.tech-stack { display: flex; flex-wrap: wrap; gap: 4px; }
.tech-mini {
  height: 22px; padding: 0 8px; border-radius: 6px;
  background: #f4f6f8; border: 1px solid #e5e9f1;
  color: #475467; font-size: 11px; font-weight: 650;
  display: inline-flex; align-items: center;
  white-space: nowrap;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .catalog-page { width: calc(100% - 28px); padding-top: 22px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 15px; }
  .table-card { overflow: auto; }
  #companiesTable { min-width: 860px; }
}
@media (prefers-reduced-motion: reduce) { .pulse-dot { animation: none; } }
