:root{
  --bg:#0b1220;
  --bg2:#0d162b;
  --card:#101c33cc;
  --stroke:#ffffff14;
  --text:#eaf0ff;
  --muted:#b7c2e6;
  --muted2:#92a1d6;
  --accent:#5cffb3;
  --accent2:#ffd95c;
  --danger:#ff5c7a;
  --ok:#5cffb3;
  --info:#2a6cff;
  --shadow:0 20px 60px rgba(0,0,0,.45);
  --shadow2:0 14px 38px rgba(0,0,0,.35);
  --radius:18px;
  --radius2:22px;
  --max:1180px;
  --gap:18px;
  --ease:cubic-bezier(.2,.8,.2,1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, #1b2f6b55, transparent 60%),
    radial-gradient(900px 700px at 85% 15%, #1b6b4b40, transparent 55%),
    radial-gradient(900px 700px at 65% 85%, #6b4b1b35, transparent 55%),
    linear-gradient(180deg, var(--bg), #070b14 65%, #070b14);
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
.container{width:min(var(--max), calc(100% - 40px)); margin:0 auto;}
.hidden{display:none !important;}

/* ===== Topbar ===== */
.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(11,18,32,.78), rgba(11,18,32,.35));
  border-bottom:1px solid var(--stroke);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
  gap:16px;
  flex-wrap:wrap;
}
.brand{display:flex; align-items:center; gap:12px; font-weight:850; letter-spacing:.2px;}
.logo{
  min-width:64px;
  height:64px;
  padding:0 14px;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:21px;
  font-weight:900;
  letter-spacing:.4px;
  color:var(--accent);
  background: linear-gradient(135deg, rgba(42,108,255,.22), rgba(92,255,179,.20));
  box-shadow:0 16px 36px rgba(90,120,255,.30);
  border:1px solid rgba(255,255,255,.18);
}
.brand small{display:block; color:var(--muted2); font-weight:650; margin-top:2px}
.brand:hover{opacity:.96}
.top-actions{display:flex; align-items:center; gap:10px; flex-wrap:wrap}

.pill{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color:var(--muted);
  font-weight:800;
  display:inline-flex;
  gap:10px;
  align-items:center;
  white-space:nowrap;
}
.dot{width:10px;height:10px;border-radius:999px;background:var(--accent);box-shadow:0 0 0 6px rgba(92,255,179,.12)}
.avatar{
  width:38px;height:38px;border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  box-shadow:0 10px 26px rgba(0,0,0,.28);
  display:flex; align-items:center; justify-content:center;
  font-weight:950;
}

/* ===== Buttons ===== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding:12px 14px;
  border-radius:14px;
  font-weight:900;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  color: var(--text);
}
.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
}
.btn:active{ transform: translateY(0) scale(.98); }
.btn-primary{
  background: linear-gradient(135deg, #2a6cff, #5cffb3);
  color:#081022; /* ✅ читабельно */
  border-color: rgba(255,255,255,.22);
}
.btn-primary:hover{ background: linear-gradient(135deg, #3b7bff, #7cffc8); }
.btn-outline{ background: rgba(0,0,0,.15); color: var(--text); }
.btn-danger{
  background: rgba(255,92,122,.14);
  border-color: rgba(255,92,122,.22);
  color: #ffd2db;
}
.btn-small{ padding:10px 12px; border-radius:12px; font-weight:900; }

/* ===== Layout ===== */
.shell{
  display:grid;
  grid-template-columns: 290px 1fr;
  gap: var(--gap);
  padding: 18px 0 42px;
  align-items:start;
}
.sidebar{
  position:sticky; top:86px;
  border-radius: var(--radius2);
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--shadow2);
  padding: 14px;
  overflow:hidden;
}
.sidebar::before{
  content:"";
  position:absolute; inset:-2px;
  background:
    radial-gradient(420px 240px at 15% 10%, rgba(92,255,179,.14), transparent 60%),
    radial-gradient(420px 240px at 90% 10%, rgba(42,108,255,.16), transparent 60%),
    radial-gradient(420px 240px at 70% 95%, rgba(255,217,92,.12), transparent 60%);
  filter: blur(10px);
  opacity:.9;
  pointer-events:none;
}
.sidebar > *{ position:relative; }

.nav-title{
  font-weight:950; letter-spacing:.2px;
  margin: 4px 6px 10px;
  color: var(--muted);
}
.menu{ display:grid; gap:8px; margin-top:8px; }
.menu a{
  display:flex; align-items:center; gap:10px;
  padding: 12px 12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-weight:900;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
  cursor:pointer;
}
.menu a:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.20); background: rgba(255,255,255,.06); }
.menu a.active{
  background: linear-gradient(135deg, rgba(92,255,179,.16), rgba(42,108,255,.14));
  color: var(--text);
  border-color: rgba(255,255,255,.22);
}
.menu a.is-disabled{
  opacity: .55;
  cursor: not-allowed;
  border-color: rgba(255,255,255,.08);
}
.menu a.is-disabled:hover{
  transform: none;
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
}
.menu .ico{
  width: 34px; height: 34px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 12px 26px rgba(0,0,0,.22);
  font-size: 16px;
  flex: 0 0 auto;
}

.content{
  border-radius: var(--radius2);
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  padding: 18px;
  overflow:hidden;
  position:relative;
  min-height: 620px;
}
.content::before{
  content:"";
  position:absolute; inset:-2px;
  background:
    radial-gradient(520px 280px at 20% 10%, rgba(92,255,179,.12), transparent 60%),
    radial-gradient(520px 280px at 90% 10%, rgba(42,108,255,.14), transparent 60%);
  filter: blur(10px);
  opacity:.85;
  pointer-events:none;
}
.content > *{ position:relative; }

.page-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap: 16px; flex-wrap:wrap;
  margin-bottom: 14px;
}
.page-head h1{
  margin:0;
  font-size: clamp(22px, 2.6vw, 34px);
  letter-spacing: -0.02em;
}
.page-head p{ margin:6px 0 0; color:var(--muted); font-weight:700; line-height:1.6; max-width:70ch;}
.head-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* ===== Cards & grid ===== */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  align-items:stretch;
  margin-top: 14px;
}
.card{
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.12);
  background: rgba(5,9,18,.35);
  box-shadow: 0 14px 28px rgba(0,0,0,.35);
  padding: 16px;
  overflow:hidden;
  position:relative;
  transition: transform .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease);
}
.card:hover{
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.22);
  background: rgba(5,9,18,.42);
}
.span-4{ grid-column: span 4; }
.span-5{ grid-column: span 5; }
.span-6{ grid-column: span 6; }
.span-7{ grid-column: span 7; }
.span-8{ grid-column: span 8; }
.span-12{ grid-column: span 12; }

.kpi{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
}
.kpi .label{ color: var(--muted2); font-weight:900; font-size: 12px; letter-spacing:.18px; text-transform:uppercase; }
.kpi .value{ font-weight:950; font-size: 26px; margin-top:6px; letter-spacing:-.02em; }
.kpi .hint{ color: var(--muted); font-weight:750; margin-top:6px; line-height:1.5; }
.status{
  padding: 8px 10px;
  border-radius: 999px;
  font-weight:950;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  white-space:nowrap;
}
.status.ok{ color: var(--ok); border-color: rgba(92,255,179,.22); background: rgba(92,255,179,.12); }
.status.warn{ color: var(--accent2); border-color: rgba(255,217,92,.22); background: rgba(255,217,92,.12); }
.status.bad{ color: var(--danger); border-color: rgba(255,92,122,.22); background: rgba(255,92,122,.12); }

.bar{
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  overflow:hidden;
}
.bar > div{
  height:100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a6cff, #5cffb3);
  transition: width .9s var(--ease);
}
.row{
  display:flex; gap: 12px; flex-wrap:wrap; align-items:center;
  margin-top: 12px;
}
.sep{ height:1px; background: rgba(255,255,255,.10); margin: 14px 0; }

/* ===== Forms ===== */
.form{
  display:grid;
  gap: 12px;
  margin-top: 10px;
}
.field{display:grid; gap: 8px;}
label{font-weight:900; color: var(--muted); letter-spacing:.1px;}
input, select{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--text);
  outline:none;
  transition: border-color .2s var(--ease), background .2s var(--ease);
  font-weight: 750;
}
input::placeholder{ color: rgba(183,194,230,.62); font-weight:700; }
input:focus, select:focus{
  border-color: rgba(92,255,179,.38);
  background: rgba(255,255,255,.06);
}
.hint{
  color: var(--muted2);
  font-weight:750;
  line-height:1.5;
  font-size: 13px;
}
.inline{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===== Table ===== */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
}
th, td{
  padding: 12px 12px;
  text-align:left;
  border-bottom:1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-weight: 750;
  vertical-align:middle;
}
th{
  color: var(--muted2);
  font-weight: 950;
  font-size: 12px;
  letter-spacing:.16px;
  text-transform:uppercase;
  background: rgba(255,255,255,.04);
}
tr:last-child td{ border-bottom:none; }
.mono{ font-family: var(--mono); color: var(--text); font-weight: 850; }
.right{ text-align:right; }

.tag{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  font-weight: 900;
  white-space:nowrap;
}
.tag.ok{ color: var(--ok); border-color: rgba(92,255,179,.22); background: rgba(92,255,179,.10); }
.tag.warn{ color: var(--accent2); border-color: rgba(255,217,92,.22); background: rgba(255,217,92,.10); }
.tag.bad{ color: var(--danger); border-color: rgba(255,92,122,.22); background: rgba(255,92,122,.10); }

/* ===== Overlay (Login/Register screen) ===== */
.auth-wrap{
  min-height: calc(100vh - 62px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
}
.auth-card{
  width: min(920px, 100%);
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(700px 300px at 20% 20%, rgba(92,255,179,.14), transparent 60%),
    radial-gradient(700px 300px at 90% 20%, rgba(42,108,255,.16), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  overflow:hidden;
  display:grid;
  grid-template-columns: 1.05fr .95fr;
}
.auth-left{
  padding: 22px;
  border-right:1px solid rgba(255,255,255,.10);
}
.auth-right{
  padding: 22px;
  background: rgba(5,9,18,.25);
}
.auth-kicker{
  display:inline-flex; gap:10px; align-items:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-weight: 900;
  width: fit-content;
  margin-bottom: 10px;
}
.auth-title{
  margin: 6px 0 10px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.08;
}
.auth-sub{ margin: 0; color: var(--muted); font-weight: 750; line-height:1.6; max-width: 55ch; }
.auth-tabs{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.tab{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-weight: 950;
  cursor:pointer;
  user-select:none;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.tab:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.22); }
.tab.active{
  background: linear-gradient(135deg, rgba(92,255,179,.16), rgba(42,108,255,.14));
  color: var(--text);
  border-color: rgba(255,255,255,.22);
}

/* ===== Modal (Plans) ===== */
.overlay{
  position:fixed; inset:0; z-index:99;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
}
.overlay.show{ display:flex; }
.modal{
  width: min(900px, 100%);
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(700px 300px at 20% 20%, rgba(92,255,179,.14), transparent 60%),
    radial-gradient(700px 300px at 90% 20%, rgba(42,108,255,.16), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  padding: 18px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.modal-head h3{ margin:0; font-size: 18px; letter-spacing:-.01em; }
.modal-head p{ margin:6px 0 0; color: var(--muted); font-weight:750; line-height:1.55; max-width: 70ch; }
.modal-body{ padding: 18px; }
.modal-grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gap);
}
.plan{
  border-radius: 22px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(5,9,18,.35);
  padding: 16px;
  position:relative;
  overflow:hidden;
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.plan:hover{ transform: translateY(-2px); border-color: rgba(255,255,255,.22); background: rgba(5,9,18,.42); }
.plan .top{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.plan .name{ font-weight:950; }
.plan .price{ font-size: 26px; font-weight: 950; margin-top: 10px; letter-spacing:-.02em;}
.plan .per{ color: var(--muted2); font-weight: 750; margin-top: 2px; }
.plan ul{ margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-weight: 750; line-height:1.7; }
.plan .badge{
  padding:6px 10px;
  border-radius: 999px;
  font-weight: 950;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  white-space:nowrap;
  font-size: 12px;
}
.plan.featured{
  border-color: rgba(92,255,179,.26);
  background: linear-gradient(180deg, rgba(92,255,179,.10), rgba(255,255,255,.03));
}
.plan.featured .badge{
  color: var(--ok);
  border-color: rgba(92,255,179,.22);
  background: rgba(92,255,179,.12);
}

/* ===== Toast ===== */
.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  width: min(420px, calc(100% - 32px));
  border-radius: 20px;
  border:1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(500px 220px at 20% 30%, rgba(92,255,179,.14), transparent 60%),
    radial-gradient(500px 220px at 90% 20%, rgba(42,108,255,.16), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  padding: 14px 14px;
  display:none;
  gap: 10px;
  align-items:flex-start;
}
.toast.show{ display:flex; animation: pop .22s var(--ease) both; }
@keyframes pop{
  from{ transform: translateY(10px); opacity:0; }
  to{ transform: translateY(0); opacity:1; }
}
.toast .t-ico{
  width: 30px; height: 30px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  display:flex; align-items:center; justify-content:center;
  font-weight: 950;
  flex: 0 0 auto;
}
.toast .t-body b{ display:block; }
.toast .t-body span{ color: var(--muted); font-weight: 750; line-height:1.5; }
.toast .t-close{ margin-left:auto; }

/* ===== Chat ===== */
.chat-box{
  min-height: 360px;
  max-height: 540px;
  overflow:auto;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  padding: 12px;
  display:grid;
  gap:10px;
}
.chat-msg{
  max-width: 86%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}
.chat-msg.mine{
  margin-left:auto;
  border-color: rgba(92,255,179,.28);
  background: rgba(92,255,179,.12);
}
.chat-msg.theirs{
  margin-right:auto;
}
.chat-meta{
  font-size:12px;
  color: var(--muted2);
  margin-bottom: 6px;
}
.confirm-actions{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.confirm-actions .btn{
  width: 100%;
}
.support-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  margin-left:8px;
  font-size:12px;
  font-weight:900;
  color:#081022;
  background: var(--accent2);
}
.tg-verify-widget{
  margin-top:10px;
  min-height:42px;
}
.tg-verify-widget.hidden{
  display:none !important;
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .sidebar{ position:relative; top:auto; }
  .inline{ grid-template-columns: 1fr; }
  .modal-grid{ grid-template-columns: 1fr; }
  .auth-card{ grid-template-columns: 1fr; }
  .auth-left{ border-right:none; border-bottom:1px solid rgba(255,255,255,.10); }
}
@media (max-width:520px){
  .btn{ width:100%; }
  .head-actions{ width:100%; }
  .topbar-inner{ justify-content:center; }
}
