:root{
  --bg: #070a14;
  --panel: rgba(255,255,255,.08);
  --panel2: rgba(255,255,255,.10);
  --stroke: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --muted2: rgba(255,255,255,.52);
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --shadow2: 0 10px 30px rgba(0,0,0,.28);
  --radius: 18px;
  --radius-sm: 14px;
  --accent: #7c5cff;
  --accent2: #17e6b2;
  --danger: #ff4d6d;
  --warn: #ffcc00;
  --ok: #37d67a;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 10% 0%, rgba(124,92,255,.35), transparent 55%),
              radial-gradient(900px 700px at 90% 10%, rgba(23,230,178,.22), transparent 60%),
              radial-gradient(1000px 800px at 50% 120%, rgba(255,77,109,.16), transparent 60%),
              var(--bg);
  color: var(--text);
  overflow-x:hidden;
}

a{color:inherit;text-decoration:none}
a:hover{opacity:.9}
.container{width:min(1100px, calc(100% - 40px)); margin:0 auto}
.main{padding:34px 0 80px}

/* Decorative blobs */
.bg-blobs{position:fixed; inset:0; pointer-events:none; z-index:-1; filter: blur(35px); opacity:.9}
.blob{position:absolute; border-radius:999px; transform: translateZ(0)}
.blob.b1{width:420px; height:420px; left:-120px; top:-120px; background: rgba(124,92,255,.35)}
.blob.b2{width:520px; height:520px; right:-200px; top:30px; background: rgba(23,230,178,.22)}
.blob.b3{width:520px; height:520px; left:25%; bottom:-220px; background: rgba(255,77,109,.16)}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:40;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(8,10,20,.72), rgba(8,10,20,.30));
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.topbar-inner{display:flex; align-items:center; justify-content:space-between; padding:14px 0; gap:14px}
.brand{display:flex; align-items:center; gap:10px; font-weight:700}
.brand-logo{width:30px; height:30px}
.brand-name{letter-spacing:.2px}
.badge{font-size:12px; padding:5px 10px; border-radius:999px; border:1px solid var(--stroke); color:var(--muted); font-weight:600}
.badge-soft{background: rgba(255,255,255,.06)}
.nav{display:flex; gap:18px; align-items:center}
.nav a{color:var(--muted); font-weight:600}
.nav .nav-cta{color:var(--text); padding:10px 14px; border-radius:999px; border:1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06)}
.icon-btn{
  width:44px; height:44px; border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--text);
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.icon-btn span{display:block; width:18px; height:2px; background: rgba(255,255,255,.85); margin:2px 0; border-radius:99px}
.mobile-menu{display:none}
.mobile-drawer{display:none; border-top:1px solid rgba(255,255,255,.10)}
.mobile-drawer .container{display:flex; flex-direction:column; gap:12px; padding:12px 0}
.mobile-drawer a{color:var(--muted); font-weight:650}
.mobile-drawer .nav-cta{margin-top:6px}

/* Alerts */
.alert{margin:14px auto 0; padding:12px; border-radius:14px; border:1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); box-shadow: var(--shadow2)}
.alert .alert-inner{display:flex; align-items:center; justify-content:space-between; gap:12px}
.alert-close{background:transparent; border:0; color:var(--muted); cursor:pointer; font-size:16px}
.alert-warn{border-color: rgba(255,204,0,.35); background: rgba(255,204,0,.08)}
.alert-ok{border-color: rgba(55,214,122,.35); background: rgba(55,214,122,.08)}
.alert-danger{border-color: rgba(255,77,109,.35); background: rgba(255,77,109,.08)}

/* Hero */
.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
  align-items:stretch;
  padding:32px 0 6px;
}
.hero-card{
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:26px;
  backdrop-filter: blur(18px);
}
.hero h1{font-size:44px; line-height:1.04; margin:0 0 12px}
.hero p{margin:0 0 16px; color:var(--muted); font-size:16px; line-height:1.6}
.hero-actions{display:flex; gap:12px; flex-wrap:wrap}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px;
  padding:12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight:700;
  cursor:pointer;
}
.btn:hover{transform: translateY(-1px)}
.btn-primary{
  border-color: rgba(124,92,255,.45);
  background: linear-gradient(135deg, rgba(124,92,255,.25), rgba(23,230,178,.12));
}
.btn-ghost{
  background: transparent;
}
.btn-danger{
  border-color: rgba(255,77,109,.45);
  background: rgba(255,77,109,.10);
}
.btn-sm{padding:9px 12px; border-radius:12px; font-weight:650; font-size:13px}
.muted{color:var(--muted)}
.small{font-size:12px}
.kpis{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
.kpi{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding:14px;
}
.kpi .num{font-size:22px; font-weight:800}
.kpi .lbl{color:var(--muted); font-weight:600; margin-top:2px}

.section{padding:28px 0 8px}
.section-title{font-size:22px; margin:0 0 10px}
.grid3{display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:12px}
.card{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding:16px;
  backdrop-filter: blur(14px);
}
.card h3{margin:2px 0 8px; font-size:16px}
.card p{margin:0; color:var(--muted); line-height:1.55; font-size:14px}
.card .icon{
  width:38px; height:38px; border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  margin-bottom:10px;
}

.pricing-head{display:flex; align-items:end; justify-content:space-between; gap:12px; flex-wrap:wrap}
.pill-tabs{
  display:flex; gap:6px; padding:6px; border-radius: 999px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
}
.pill-tabs button{
  border:0; background:transparent; color:var(--muted);
  padding:8px 10px; border-radius: 999px; cursor:pointer; font-weight:700; font-size:13px
}
.pill-tabs button.active{
  color: var(--text);
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}
.pricing-grid{display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:12px; margin-top:12px}
.price-card{position:relative}
.price-card.popular:before{
  content:"Рекомендуем";
  position:absolute; top:12px; right:12px;
  font-size:12px; font-weight:800; color:rgba(255,255,255,.92);
  padding:6px 10px; border-radius:999px;
  background: rgba(124,92,255,.25);
  border:1px solid rgba(124,92,255,.45);
}
.price{font-size:34px; font-weight:900; letter-spacing:-.5px}
.price small{font-size:14px; font-weight:700; color:var(--muted)}
.ul{margin:10px 0 0; padding:0; list-style:none; display:flex; flex-direction:column; gap:8px}
.ul li{display:flex; gap:8px; align-items:flex-start; color:var(--muted); font-weight:600; font-size:13px}
.check{width:18px; height:18px; border-radius:6px; background: rgba(55,214,122,.14); border:1px solid rgba(55,214,122,.32); display:flex; align-items:center; justify-content:center; flex:0 0 auto}
.check:before{content:"✓"; font-size:12px; color:rgba(255,255,255,.88); font-weight:900}

.faq{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
details{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding:14px;
}
summary{cursor:pointer; font-weight:800}
details p{margin:10px 0 0; color:var(--muted); line-height:1.55}

/* Forms */
.form{
  max-width: 520px;
  margin: 0 auto;
}
.field{display:flex; flex-direction:column; gap:6px; margin:12px 0}
label{font-weight:700; font-size:13px; color:var(--muted)}
input, select, textarea{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding:12px 12px;
  color: var(--text);
  outline:none;
}
textarea{min-height:120px; resize:vertical}
input:focus, select:focus, textarea:focus{border-color: rgba(124,92,255,.55); box-shadow: 0 0 0 4px rgba(124,92,255,.12)}

/* Tables */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}
.table th, .table td{
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  text-align:left;
  font-size:13px;
  color: var(--muted);
}
.table th{color: rgba(255,255,255,.85); font-size:12px; letter-spacing:.04em; text-transform:uppercase}
.table tr:hover td{background: rgba(255,255,255,.04)}
.table td .tag{
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  font-weight:700;
  color: rgba(255,255,255,.80);
}
.tag.ok{border-color: rgba(55,214,122,.35); background: rgba(55,214,122,.10)}
.tag.warn{border-color: rgba(255,204,0,.35); background: rgba(255,204,0,.10)}
.tag.danger{border-color: rgba(255,77,109,.35); background: rgba(255,77,109,.10)}
.tag.soft{border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.05)}

.two-col{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
.hr{height:1px; background: rgba(255,255,255,.10); margin:16px 0}

/* Footer */
.footer{padding:22px 0 40px; border-top:1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.10)}
.footer-inner{display:flex; justify-content:space-between; gap:14px; align-items:center; flex-wrap:wrap}
.footer-right{display:flex; gap:14px; color:var(--muted); font-weight:650}

/* Admin */
.admin-body{background: radial-gradient(1200px 800px at 10% 0%, rgba(124,92,255,.28), transparent 55%),
              radial-gradient(900px 700px at 90% 10%, rgba(23,230,178,.18), transparent 60%),
              radial-gradient(1000px 800px at 50% 120%, rgba(255,77,109,.12), transparent 60%),
              var(--bg);}
.admin-layout{display:flex; min-height:100vh}
.admin-sidebar{
  width: 270px;
  padding: 16px;
  border-right:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.16);
  backdrop-filter: blur(18px);
  position: sticky; top:0; height:100vh;
}
.admin-brand{display:flex; gap:10px; align-items:center; padding:10px; border:1px solid rgba(255,255,255,.10); border-radius: 16px; background: rgba(255,255,255,.04)}
.admin-nav{margin-top:12px; display:flex; flex-direction:column; gap:6px}
.admin-nav a{
  padding:10px 12px; border-radius: 14px;
  color: var(--muted);
  border:1px solid transparent;
  background: transparent;
  font-weight:700;
}
.admin-nav a.active, .admin-nav a:hover{
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}
.admin-sidebar-footer{margin-top:auto; padding-top:12px; display:flex; flex-direction:column; gap:10px}
.pill{display:flex; align-items:center; gap:8px; padding:10px 12px; border-radius: 999px; border:1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); color: var(--muted); font-weight:650; font-size:13px}
.dot{width:8px; height:8px; border-radius:99px; background: rgba(55,214,122,.9); box-shadow:0 0 0 4px rgba(55,214,122,.16)}
.admin-main{flex:1; display:flex; flex-direction:column}
.admin-topbar{
  position:sticky; top:0; z-index:30;
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(18px);
}
.admin-topbar-title{font-weight:900}
.admin-topbar-actions{display:flex; gap:8px; align-items:center}
.admin-content{padding:16px 0 36px}
.stat-grid{display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:12px}
.stat{padding:14px}
.stat .num{font-size:24px; font-weight:900}
.stat .lbl{color:var(--muted); font-weight:650}

.admin-toolbar{display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin:10px 0 12px}
.search{display:flex; gap:8px; align-items:center}
.search input{padding:10px 12px; border-radius: 999px}
.search button{border-radius: 999px}
.actions{display:flex; gap:8px}

/* Chat */
.chat-shell{display:grid; grid-template-columns: 320px 1fr; gap:12px; align-items:stretch}
.chat-left{padding:16px}
.chat-right{display:flex; flex-direction:column; min-height: 520px}
.chat-log{flex:1; overflow:auto; padding:16px; display:flex; flex-direction:column; gap:10px}
.msg{max-width: 80%; padding:12px 14px; border-radius: 16px; border:1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: rgba(255,255,255,.92); line-height:1.55; white-space:pre-wrap; word-wrap:break-word}
.msg.me{margin-left:auto; background: rgba(124,92,255,.14); border-color: rgba(124,92,255,.35)}
.msg.sys{max-width: 100%; color: var(--muted); font-size:13px; background: rgba(255,255,255,.04)}
.chat-input{display:flex; gap:10px; padding:12px; border-top:1px solid rgba(255,255,255,.10); background: rgba(0,0,0,.12)}
.chat-input textarea{flex:1; min-height:52px; max-height:160px}
.chat-input button{white-space:nowrap}

.code-inline{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace; font-size: .95em; padding: 2px 6px; border-radius: 10px; background: rgba(0,0,0,.26); border:1px solid rgba(255,255,255,.08)}

@media (max-width: 980px){
  .hero{grid-template-columns: 1fr; }
  .pricing-grid{grid-template-columns: 1fr}
  .grid3{grid-template-columns: 1fr}
  .faq{grid-template-columns: 1fr}
  .stat-grid{grid-template-columns: 1fr 1fr}
  .chat-shell{grid-template-columns: 1fr}
  .admin-sidebar{position:fixed; left:-290px; top:0; height:100vh; z-index:50; transition:left .22s ease}
  .admin-sidebar.open{left:0}
  .admin-main{margin-left:0}
  .mobile-menu{display:inline-flex}
  .nav{display:none}
  .mobile-drawer.open{display:block}
}

@media (max-width: 520px){
  .hero h1{font-size: 34px}
  .stat-grid{grid-template-columns: 1fr}
  .container{width: calc(100% - 26px)}
}
