/* VM GEO web-app — дизайн-слой.
   Токены/фон/атомы перенесены 1:1 с боевого сайта vm-geo.ru (премиум tech-SaaS,
   тёмное стекло, бренд-градиент, Inter, авто светлая/тёмная тема).
   Ниже — оболочка кабинета/админки (сайдбар, топбар, виджеты, таблицы) + мобайл. */

/* ==== токены (акцент, общий для обеих тем) ==== */
:root{
  --blue:#6EA8FF; --violet:#9B84FF; --magenta:#D14BFF;
  --grad:linear-gradient(120deg,#6EA8FF,#9B84FF 48%,#D14BFF);
  --good:#3DDC97; --warn:#F5B851; --bad:#FF6B6B; --btn-ink:#0B0710;
  --maxw:1200px; --font:"Inter","SF Pro Display","Segoe UI",Roboto,system-ui,sans-serif;
  --r-btn:11px; --r-field:12px; --r-row:12px; --r-card:18px; --r-panel:22px;
  --sidebar-w:248px;
}
/* ==== тёмная тема (по умолчанию) ==== */
:root,:root[data-theme="dark"]{
  --bg:#08080C; --panel:#101018; --panel2:#14141E;
  --line:rgba(255,255,255,.08); --line2:rgba(255,255,255,.14);
  --tint:rgba(255,255,255,.02); --tint2:rgba(255,255,255,.04);
  --text:#F4F5FA; --muted:#9BA0B3; --faint:#6A6F82;
  --grid-line:rgba(255,255,255,.028); --nav-bg:rgba(8,8,12,.62);
  --mock-bg:linear-gradient(180deg,rgba(20,20,30,.92),rgba(12,12,18,.92));
  --aur-op:.5; --shadow:0 40px 90px -40px #000;
  --net-dot:rgba(180,190,235,.55); --net-line:rgba(150,140,235,.16);
  color-scheme:dark;
}
/* ==== светлая тема ==== */
:root[data-theme="light"]{
  --bg:#F5F6FB; --panel:#FFFFFF; --panel2:#F2F4FB;
  --line:rgba(18,20,45,.10); --line2:rgba(18,20,45,.17);
  --tint:rgba(18,20,45,.025); --tint2:rgba(18,20,45,.045);
  --text:#0F1226; --muted:#565D72; --faint:#9096AC;
  --grid-line:rgba(18,20,45,.05); --nav-bg:rgba(245,246,251,.72);
  --mock-bg:linear-gradient(180deg,#ffffff,#f6f7fc);
  --aur-op:.32; --shadow:0 30px 70px -40px rgba(60,50,120,.32);
  --net-dot:rgba(90,80,150,.42); --net-line:rgba(120,110,220,.14);
  color-scheme:light;
}
@media(prefers-color-scheme:light){
  :root:not([data-theme]){
    --bg:#F5F6FB; --panel:#FFFFFF; --panel2:#F2F4FB;
    --line:rgba(18,20,45,.10); --line2:rgba(18,20,45,.17);
    --tint:rgba(18,20,45,.025); --tint2:rgba(18,20,45,.045);
    --text:#0F1226; --muted:#565D72; --faint:#9096AC;
    --grid-line:rgba(18,20,45,.05); --nav-bg:rgba(245,246,251,.72);
    --mock-bg:linear-gradient(180deg,#ffffff,#f6f7fc);
    --aur-op:.32; --shadow:0 30px 70px -40px rgba(60,50,120,.32);
    --net-dot:rgba(90,80,150,.42); --net-line:rgba(120,110,220,.14);
    color-scheme:light;
  }
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0; background:var(--bg); color:var(--text); font-family:var(--font);
  font-size:16px; line-height:1.55; -webkit-font-smoothing:antialiased; overflow-x:hidden;
  font-variant-numeric:tabular-nums; transition:background .4s,color .4s}
a{color:inherit; text-decoration:none}
h1,h2,h3,h4{font-weight:700; letter-spacing:-.02em; margin:0}
.gt{background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent}
.muted{color:var(--muted)} .faint{color:var(--faint)}
.small{font-size:13px}

/* ==== фон (живая сеть + сетка + кляксы) — из сайта ==== */
.bgfx{position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden}
#net{position:absolute; inset:0; width:100%; height:100%}
.grid{position:absolute; inset:-2px;
  background-image:linear-gradient(var(--grid-line) 1px,transparent 1px),linear-gradient(90deg,var(--grid-line) 1px,transparent 1px);
  background-size:54px 54px; -webkit-mask:radial-gradient(120% 80% at 50% 0%,#000 30%,transparent 78%); mask:radial-gradient(120% 80% at 50% 0%,#000 30%,transparent 78%)}
.aur{position:absolute; border-radius:50%; filter:blur(72px); opacity:var(--aur-op)}
.aur.a{width:640px;height:640px; left:-140px; top:-200px; background:radial-gradient(circle,rgba(110,168,255,.5),transparent 62%); animation:d1 22s ease-in-out infinite}
.aur.b{width:620px;height:620px; right:-120px; top:-260px; background:radial-gradient(circle,rgba(209,75,255,.44),transparent 62%); animation:d2 26s ease-in-out infinite}
.aur.c{width:520px;height:520px; left:44%; top:120px; background:radial-gradient(circle,rgba(155,132,255,.42),transparent 62%); animation:d3 30s ease-in-out infinite}
@keyframes d1{50%{transform:translate(120px,90px)}}
@keyframes d2{50%{transform:translate(-90px,120px)}}
@keyframes d3{50%{transform:translate(-60px,-70px) scale(1.1)}}

/* ==== контейнеры ==== */
.wrap{max-width:var(--maxw); margin:0 auto; padding:0 24px; position:relative; z-index:2}
.eyebrow{display:inline-flex; align-items:center; gap:8px; font-size:12.5px; letter-spacing:.04em; color:var(--muted); font-weight:500;
  padding:6px 13px; border:1px solid var(--line); border-radius:100px; background:var(--tint2)}
.eyebrow .g{width:6px;height:6px;border-radius:50%;background:var(--grad);box-shadow:0 0 10px 1px rgba(155,132,255,.9)}

/* ==== навбар (лендинг/публичные) ==== */
.nav{position:sticky; top:0; z-index:40; backdrop-filter:blur(16px); background:var(--nav-bg); border-bottom:1px solid var(--line)}
.nav-in{display:flex; align-items:center; gap:20px; height:64px}
.logo{display:flex; align-items:center; gap:10px; font-weight:700; font-size:18px}
.logo .m{width:30px;height:30px; border-radius:8px; object-fit:cover; box-shadow:0 0 26px -7px rgba(155,132,255,.85);
  background:var(--grad); display:grid; place-items:center; color:var(--btn-ink); font-weight:800; font-size:14px}
.sp{flex:1}
.navlinks{display:flex; gap:22px}
.nav a.link{color:var(--muted); font-size:14.5px; font-weight:500}
.nav a.link:hover{color:var(--text)}

/* ==== кнопки ==== */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:600; font-size:14.5px; border-radius:var(--r-btn);
  padding:11px 18px; border:1px solid transparent; cursor:pointer; white-space:nowrap; transition:transform .18s,box-shadow .2s,background .2s,border-color .2s; font-family:inherit}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.55; cursor:not-allowed}
.btn-g{background:var(--grad); color:var(--btn-ink); font-weight:700; box-shadow:0 8px 30px -10px rgba(155,132,255,.75)}
.btn-g:hover:not(:disabled){box-shadow:0 12px 40px -8px rgba(155,132,255,.95); transform:translateY(-2px)}
.btn-o{border-color:var(--line2); color:var(--text); background:var(--tint)}
.btn-o:hover{border-color:var(--muted); background:var(--tint2)}
.btn-sm{padding:8px 13px; font-size:13px; border-radius:9px}
.btn-danger{border-color:rgba(255,107,107,.4); color:var(--bad); background:rgba(255,107,107,.08)}
.btn-danger:hover{background:rgba(255,107,107,.15)}
.btn-block{width:100%}

/* ==== тоггл темы (sun/moon) ==== */
.tgl{width:38px;height:38px;flex:none; border:1px solid var(--line); border-radius:10px; background:var(--tint); color:var(--muted);
  display:grid; place-items:center; cursor:pointer; transition:.2s}
.tgl:hover{color:var(--text); border-color:var(--line2)}
.tgl svg{width:17px;height:17px}
.tgl .sun{display:none} :root[data-theme="light"] .tgl .sun{display:block} :root[data-theme="light"] .tgl .moon{display:none}
@media(prefers-color-scheme:light){:root:not([data-theme]) .tgl .sun{display:block} :root:not([data-theme]) .tgl .moon{display:none}}

/* ==== оболочка приложения (кабинет/админка): сайдбар + основной ==== */
.shell{position:relative; z-index:2; display:grid; grid-template-columns:var(--sidebar-w) 1fr; min-height:100vh}
.sidebar{border-right:1px solid var(--line); background:var(--nav-bg); backdrop-filter:blur(16px);
  padding:18px 14px; position:sticky; top:0; height:100vh; overflow-y:auto; display:flex; flex-direction:column; gap:6px}
.sidebar .brand{display:flex; align-items:center; gap:10px; font-weight:700; font-size:17px; padding:6px 8px 14px}
.sidebar .brand .m{width:30px;height:30px;border-radius:8px;background:var(--grad);display:grid;place-items:center;color:var(--btn-ink);font-weight:800;font-size:14px;box-shadow:0 0 26px -7px rgba(155,132,255,.85)}
.side-sec{font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--faint); font-weight:600; padding:14px 10px 6px}
.side-link{display:flex; align-items:center; gap:11px; padding:10px 11px; border-radius:10px; color:var(--muted); font-size:14.5px; font-weight:500; transition:.15s}
.side-link svg{width:18px;height:18px;flex:none;opacity:.85}
.side-link:hover{background:var(--tint2); color:var(--text)}
.side-link.active{background:var(--tint2); color:var(--text); box-shadow:inset 2px 0 0 var(--violet)}
.side-link .pill{margin-left:auto; font-size:11px; font-weight:700; padding:2px 8px; border-radius:100px; background:rgba(155,132,255,.16); color:var(--violet)}
.side-foot{margin-top:auto; padding-top:12px; border-top:1px solid var(--line); display:flex; align-items:center; gap:10px}
.avatar{width:34px;height:34px;border-radius:9px;background:var(--grad);display:grid;place-items:center;color:var(--btn-ink);font-weight:800;font-size:13px;flex:none}

.main{min-width:0; display:flex; flex-direction:column}
.topbar{position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:14px; height:62px; padding:0 26px;
  border-bottom:1px solid var(--line); background:var(--nav-bg); backdrop-filter:blur(16px)}
.topbar h1{font-size:19px}
.topbar .crumb{color:var(--muted); font-size:13px}
.content{padding:26px; max-width:1180px; width:100%; margin:0 auto}
.page-title{font-size:clamp(22px,3vw,30px); margin-bottom:6px}
.page-sub{color:var(--muted); margin-bottom:22px}

/* бургер для мобилки */
.burger{display:none; flex-direction:column; gap:4px; width:40px;height:40px; align-items:center; justify-content:center;
  background:transparent; border:1px solid var(--line); border-radius:11px; cursor:pointer; flex:none}
.burger span{display:block; width:18px; height:2px; background:var(--text); border-radius:2px; transition:.25s}
.scrim{display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:45}
.scrim.open{display:block}

/* ==== панели/карточки ==== */
.panel{border:1px solid var(--line); border-radius:var(--r-panel); background:var(--panel); padding:24px; position:relative}
.card{border:1px solid var(--line); border-radius:var(--r-card); background:var(--panel); padding:22px; transition:transform .2s,border-color .2s,box-shadow .2s}
.card.hover:hover{transform:translateY(-3px); border-color:var(--line2); box-shadow:var(--shadow)}
.glass{background:var(--mock-bg); backdrop-filter:blur(8px); border:1px solid var(--line2); box-shadow:var(--shadow)}
.card-h{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px}
.card-h h3{font-size:16px}

/* сетки */
.grid-2{display:grid; grid-template-columns:1fr 1fr; gap:18px}
.grid-3{display:grid; grid-template-columns:repeat(3,1fr); gap:18px}
.grid-4{display:grid; grid-template-columns:repeat(4,1fr); gap:16px}
.row{display:flex; gap:12px; align-items:center; flex-wrap:wrap}

/* ==== stat-плитки ==== */
.stat{border:1px solid var(--line); border-radius:var(--r-card); background:var(--panel); padding:20px; position:relative; overflow:hidden}
.stat .k{color:var(--muted); font-size:13px; display:flex; align-items:center; gap:8px}
.stat .n{font-weight:800; font-size:30px; letter-spacing:-.03em; margin-top:8px}
.stat .d{font-size:12.5px; margin-top:5px; color:var(--faint)}
.stat.grad::after{content:"";position:absolute;left:0;right:0;top:0;height:2px;background:var(--grad);opacity:.75}

/* кольцо-прогресс */
.ring{width:74px;height:74px;flex:none;border-radius:50%;display:grid;place-items:center;position:relative}
.ring::after{content:"";position:absolute;inset:6px;border-radius:50%;background:var(--panel)}
.ring b{position:relative;z-index:1;font-size:20px;font-weight:800}
.ring.sm{width:56px;height:56px}.ring.sm b{font-size:15px}

/* строка метрики (m-row) */
.m-row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 14px; border:1px solid var(--line);
  border-radius:var(--r-row); background:var(--tint); margin-bottom:9px}
.m-row .k{font-size:13.5px; color:var(--muted); flex:1; min-width:0}
.m-row .v{font-weight:700; font-size:14.5px; display:flex; align-items:center; gap:8px; flex:none; white-space:nowrap}

/* спарклайн */
.spark{display:flex; align-items:flex-end; gap:4px; height:34px}
.spark span{width:7px; border-radius:3px 3px 0 0; background:var(--grad); opacity:.9}

/* бейджи */
.badge{font-size:11.5px; font-weight:700; padding:3px 9px; border-radius:100px; white-space:nowrap; display:inline-flex; align-items:center; gap:5px}
.badge.up{color:#08120c; background:var(--good)}
.badge.ok{color:var(--good); background:rgba(61,220,151,.14); border:1px solid rgba(61,220,151,.32)}
.badge.warn{color:var(--warn); background:rgba(245,184,81,.14); border:1px solid rgba(245,184,81,.34)}
.badge.bad{color:var(--bad); background:rgba(255,107,107,.14); border:1px solid rgba(255,107,107,.32)}
.badge.info{color:var(--violet); background:rgba(155,132,255,.14); border:1px solid rgba(155,132,255,.32)}
.badge.neutral{color:var(--muted); background:var(--tint2); border:1px solid var(--line)}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.dot.g{background:var(--good)} .dot.w{background:var(--warn)} .dot.b{background:var(--bad)} .dot.m{background:var(--muted)}

/* ==== таблицы (адаптив: скролл в контейнере) ==== */
.tbl-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:var(--r-card); background:var(--panel)}
table.tbl{width:100%; border-collapse:collapse; font-size:14px; min-width:520px}
.tbl th{text-align:left; padding:12px 16px; color:var(--faint); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid var(--line); white-space:nowrap}
.tbl td{padding:13px 16px; border-bottom:1px solid var(--line); vertical-align:middle}
.tbl tr:last-child td{border-bottom:none}
.tbl tr:hover td{background:var(--tint)}
.tbl .u-name{font-weight:600}
.tbl .u-sub{color:var(--muted); font-size:12.5px}

/* ==== формы ==== */
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:14px}
.field label{font-size:13px; color:var(--muted); font-weight:500}
.fld{width:100%; background:rgba(125,135,165,.08); border:1px solid var(--line); border-radius:var(--r-field); padding:12px 14px;
  color:var(--text); font:inherit; font-size:15px; outline:none; transition:border-color .2s}
.fld:focus{border-color:#9B84FF}
select.fld{appearance:none; cursor:pointer}
textarea.fld{resize:vertical; min-height:80px}
.consent{display:flex; gap:9px; align-items:flex-start; font-size:13px; color:var(--muted); line-height:1.45; cursor:pointer}
.consent input{margin-top:3px; flex:none}
.consent a{color:var(--violet)}
.note{font-size:13.5px; min-height:18px}
.note.ok{color:var(--good)} .note.err{color:var(--bad)}
.seg{display:inline-flex; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--tint)}
.seg a,.seg button{padding:8px 14px; font-size:13px; color:var(--muted); cursor:pointer; background:transparent; border:none; font-family:inherit}
.seg a.active,.seg button.active{background:var(--tint2); color:var(--text)}

/* ==== авторизация ==== */
.auth-wrap{position:relative; z-index:2; min-height:100vh; display:grid; place-items:center; padding:40px 20px}
.auth-card{width:100%; max-width:420px; border:1px solid var(--line2); border-radius:var(--r-panel); background:var(--panel); padding:34px; box-shadow:var(--shadow)}
.auth-card h1{font-size:24px; margin-bottom:6px}
.auth-yandex{display:flex; align-items:center; justify-content:center; gap:10px; width:100%; padding:13px; border-radius:var(--r-btn);
  background:#FC3F1D; color:#fff; font-weight:700; font-size:15px}
.auth-yandex:hover{filter:brightness(1.06)}
.divider{display:flex; align-items:center; gap:12px; color:var(--faint); font-size:12.5px; margin:20px 0}
.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line)}

/* ==== live-аудит ==== */
.audit-live{border:1px solid var(--line2); border-radius:var(--r-panel); background:var(--mock-bg); backdrop-filter:blur(8px); padding:26px; box-shadow:var(--shadow)}
.progress{height:8px; border-radius:100px; background:var(--tint2); overflow:hidden; margin:16px 0}
.progress .bar{height:100%; width:0; background:var(--grad); transition:width .5s ease; border-radius:100px}
.step-list{display:flex; flex-direction:column; gap:10px; margin-top:14px}
.step{display:flex; align-items:center; gap:11px; color:var(--muted); font-size:14px; transition:.2s}
.step.active{color:var(--text)} .step.done{color:var(--text)}
.step .ic{width:22px;height:22px;border-radius:7px;border:1px solid var(--line2);display:grid;place-items:center;flex:none;font-size:12px}
.step.done .ic{background:var(--grad);border-color:transparent;color:var(--btn-ink)}
.step.active .ic{border-color:var(--violet)}
.spin{width:16px;height:16px;border:2px solid var(--line2);border-top-color:var(--violet);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* аудит: чек-строки */
.check{display:flex; gap:11px; padding:11px 0; border-bottom:1px solid var(--line); align-items:flex-start}
.check:last-child{border-bottom:none}
.check .ci{flex:none;width:20px;height:20px;border-radius:6px;display:grid;place-items:center;font-size:12px;margin-top:1px}
.check .ci.ok{background:rgba(61,220,151,.16);color:var(--good)}
.check .ci.warn{background:rgba(245,184,81,.16);color:var(--warn)}
.check .ci.info{background:rgba(155,132,255,.14);color:var(--violet)}
.check .ct{flex:1;min-width:0}
.check .cn{font-weight:600;font-size:14px}
.check .cd{color:var(--muted);font-size:13px;margin-top:2px}

/* alert-плашки */
.alert{border-radius:var(--r-card); padding:14px 16px; font-size:14px; border:1px solid var(--line); display:flex; gap:10px}
.alert.info{background:rgba(155,132,255,.09); border-color:rgba(155,132,255,.3)}
.alert.warn{background:rgba(245,184,81,.09); border-color:rgba(245,184,81,.3)}
.alert.bad{background:rgba(255,107,107,.09); border-color:rgba(255,107,107,.3)}

.empty{text-align:center; padding:50px 20px; color:var(--muted)}
.empty .ico{width:56px;height:56px;border-radius:16px;background:var(--tint2);display:grid;place-items:center;margin:0 auto 14px}

hr.sep{border:none;border-top:1px solid var(--line);margin:22px 0}

/* prose (AI-отчёт) */
.prose{white-space:pre-wrap; line-height:1.7; font-size:15px; color:var(--text)}
.prose.muted{color:var(--muted)}

/* ==== мобильная адаптация (критично) ==== */
@media(max-width:1024px){ .grid-4{grid-template-columns:repeat(2,1fr)} .grid-3{grid-template-columns:1fr 1fr} }
@media(max-width:860px){
  .shell{grid-template-columns:1fr}
  .sidebar{position:fixed; left:0; top:0; z-index:50; width:min(84vw,300px); transform:translateX(-100%); transition:transform .25s}
  .sidebar.open{transform:none}
  .burger{display:flex}
  .content{padding:18px}
  .grid-2,.grid-3,.grid-4{grid-template-columns:1fr}
  .topbar{padding:0 16px}
  .navlinks{display:none}
}
@media(max-width:520px){
  .auth-card{padding:24px}
  .panel{padding:18px} .card{padding:16px}
  .content{padding:14px}
  .stat .n{font-size:26px}
}
@media(prefers-reduced-motion:reduce){ .aur{animation:none} .spin{animation:none} }
