:root {
  --bg: #0f0718;
  --bg-2: #160a24;
  --panel: rgba(52, 28, 74, .72);
  --panel-2: rgba(73, 39, 100, .66);
  --line: rgba(255,255,255,.12);
  --line-strong: rgba(255,255,255,.22);
  --text: #f8f4ff;
  --muted: #bdaeca;
  --soft: #8f7c9d;
  --accent: #d56bff;
  --accent-2: #ffb1dd;
  --accent-3: #8f54ff;
  --good: #76f2bf;
  --warn: #ffd27d;
  --danger: #ff7f9f;
  --shadow: 0 24px 80px rgba(0,0,0,.28);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 78% -5%, rgba(158, 65, 255, .28), transparent 70%),
    radial-gradient(900px 600px at 0% 16%, rgba(255, 170, 216, .16), transparent 70%),
    linear-gradient(180deg, #170c22 0%, #0c0612 100%);
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

.bg-orb {
  position: fixed; inset: auto auto 5vh -15vw; width: 46vw; height: 46vw;
  border-radius: 50%; filter: blur(90px); background: rgba(154, 58, 255, .08); pointer-events: none; z-index: -1;
}

.shell { width: min(1480px, calc(100% - 32px)); margin: 0 auto; }

.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(22px);
  background: rgba(14, 7, 22, .72);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-inner { min-height: 76px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 12px; margin-left: auto; direction: ltr; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  color: #1a0e23; font-weight: 950; font-size: 20px;
  box-shadow: 0 8px 28px rgba(191,92,255,.22);
}
.brand-copy strong { display: block; font-size: 18px; line-height: 1; }
.brand-copy span { display: block; color: var(--soft); font-size: 11px; margin-top: 4px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { color: var(--muted); padding: 10px 13px; border-radius: 12px; font-size: 14px; }
.nav-links a:hover, .nav-links a.active { color: white; background: rgba(255,255,255,.07); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; }

.btn {
  border: 1px solid var(--line); color: white; background: rgba(255,255,255,.07);
  border-radius: 14px; padding: 11px 16px; font-weight: 750; transition: .18s ease;
  display: inline-flex; gap: 8px; align-items: center; justify-content: center;
}
.btn:hover { transform: translateY(-1px); border-color: var(--line-strong); background: rgba(255,255,255,.11); }
.btn.primary { background: linear-gradient(135deg, #b761ff, #e977ce); border-color: transparent; color: #14081e; }
.btn.good { background: rgba(118,242,191,.12); border-color: rgba(118,242,191,.32); color: var(--good); }
.btn.danger { background: rgba(255,127,159,.10); border-color: rgba(255,127,159,.25); color: var(--danger); }
.btn.small { padding: 8px 11px; border-radius: 11px; font-size: 12px; }
.btn.block { width: 100%; }

.hero { padding: 72px 0 36px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 34px; align-items: center; }
.kicker { color: var(--accent-2); font-size: 13px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { margin: 12px 0 16px; font-size: clamp(42px, 6vw, 86px); line-height: .98; letter-spacing: -.045em; direction: ltr; text-align: right; }
.hero p { margin: 0; color: var(--muted); font-size: clamp(16px, 2vw, 20px); line-height: 1.9; max-width: 780px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-note { margin-top: 16px; color: var(--soft); font-size: 13px; }

.live-board {
  padding: 18px; border: 1px solid var(--line); border-radius: 32px;
  background: linear-gradient(150deg, rgba(104,49,129,.74), rgba(42,20,63,.82));
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.live-board::before { content:""; position:absolute; width:230px; height:230px; border-radius:50%; left:-60px; top:-80px; background:rgba(235,133,255,.18); filter: blur(30px); }
.live-head { display:flex; justify-content:space-between; align-items:center; position:relative; z-index:1; margin-bottom:14px; }
.live-pill { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--good); }
.live-dot { width:8px; height:8px; background:var(--good); border-radius:50%; box-shadow: 0 0 0 6px rgba(118,242,191,.08); animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 5px rgba(118,242,191,.08)} 50%{box-shadow:0 0 0 10px rgba(118,242,191,.02)} }
.mini-server { position:relative; z-index:1; display:grid; grid-template-columns:54px 1fr auto; gap:12px; align-items:center; padding:13px; margin-top:9px; border-radius:18px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08); }
.avatar { width:54px; height:54px; border-radius:17px; object-fit:cover; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14); }
.avatar.lg { width:96px; height:96px; border-radius:28px; }
.server-name { font-weight:900; font-size:17px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.server-meta { color:var(--muted); font-size:12px; margin-top:4px; }
.mini-score { text-align:left; direction:ltr; }
.mini-score strong { display:block; font-size:19px; }
.mini-score span { color:var(--soft); font-size:11px; }

.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin: 24px 0 48px; }
.stat-box { min-height:114px; border:1px solid var(--line); border-radius:22px; padding:18px; background:rgba(255,255,255,.045); backdrop-filter: blur(10px); }
.stat-box span { display:block; color:var(--muted); font-size:12px; }
.stat-box strong { display:block; direction:ltr; text-align:right; font-size:30px; margin-top:8px; letter-spacing:-.03em; }
.stat-box small { color:var(--soft); display:block; margin-top:5px; }

.section { padding: 34px 0 48px; }
.section-head { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:20px; }
.section-title h2 { margin:0; font-size:30px; letter-spacing:-.02em; }
.section-title p { margin:7px 0 0; color:var(--muted); }

.server-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px; }
.server-card {
  position:relative; padding:18px; border:1px solid var(--line); border-radius:24px;
  background:linear-gradient(145deg, rgba(65,34,88,.72), rgba(37,19,53,.78));
  min-width:0; transition:.2s ease; overflow:hidden;
}
.server-card:hover { transform:translateY(-3px); border-color:rgba(229,144,255,.32); box-shadow:0 18px 50px rgba(0,0,0,.2); }
.server-card.featured::after { content:"مميز"; position:absolute; top:12px; left:12px; font-size:10px; color:#16081f; background:var(--accent-2); padding:5px 8px; border-radius:999px; font-weight:900; }
.card-top { display:grid; grid-template-columns:64px 1fr; gap:13px; align-items:center; min-width:0; }
.card-top .avatar { width:64px; height:64px; border-radius:19px; }
.card-name-row { display:flex; align-items:center; gap:7px; min-width:0; }
.card-name { font-size:20px; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.verified { color:var(--good); font-size:13px; }
.card-desc { color:var(--muted); font-size:12px; margin-top:5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin-top:16px; }
.metric { border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.045); border-radius:15px; padding:10px 8px; text-align:center; min-width:0; }
.metric span { display:block; color:var(--soft); font-size:10px; }
.metric strong { display:block; direction:ltr; font-size:16px; margin-top:5px; overflow:hidden; text-overflow:ellipsis; }
.metric.real strong { color:var(--good); }
.metric.sus strong { color:var(--danger); }
.card-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:14px; color:var(--soft); font-size:11px; }
.rank-badge { display:inline-flex; min-width:31px; height:31px; align-items:center; justify-content:center; border-radius:10px; font-weight:950; background:rgba(255,255,255,.07); color:var(--accent-2); }

.toolbar { display:grid; grid-template-columns:minmax(220px,1fr) auto auto; gap:10px; margin:18px 0; }
.input, .select, .textarea {
  width:100%; border:1px solid var(--line); color:var(--text); background:rgba(255,255,255,.05);
  border-radius:14px; padding:12px 14px; outline:none; transition:.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color:rgba(213,107,255,.5); box-shadow:0 0 0 4px rgba(213,107,255,.07); }
.select option { background:#1a0d26; color:white; }
.textarea { min-height:120px; resize:vertical; }
.field label { display:block; font-size:12px; color:var(--muted); margin-bottom:7px; }

.pagination { display:flex; align-items:center; justify-content:center; gap:8px; margin-top:24px; }
.pagination button { min-width:40px; }

.server-hero { padding:42px 0 24px; }
.server-profile { display:grid; grid-template-columns:1fr auto; gap:24px; align-items:end; border:1px solid var(--line); border-radius:30px; padding:24px; background:linear-gradient(135deg,rgba(76,39,102,.72),rgba(30,15,43,.8)); position:relative; overflow:hidden; }
.server-profile::before { content:""; position:absolute; inset:0; background:linear-gradient(90deg, rgba(0,0,0,.12), rgba(0,0,0,.48)); pointer-events:none; }
.profile-main, .profile-actions { position:relative; z-index:1; }
.profile-main { display:flex; gap:18px; align-items:center; min-width:0; }
.profile-title h1 { margin:0; font-size:42px; letter-spacing:-.03em; overflow-wrap:anywhere; }
.profile-title p { color:var(--muted); margin:9px 0 0; line-height:1.7; }
.profile-tags { display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }
.tag { border:1px solid var(--line); background:rgba(255,255,255,.05); color:var(--muted); border-radius:999px; padding:6px 9px; font-size:11px; }
.profile-actions { display:flex; gap:9px; flex-wrap:wrap; justify-content:flex-start; }

.detail-grid { display:grid; grid-template-columns:1fr 340px; gap:18px; }
.panel { border:1px solid var(--line); border-radius:24px; background:rgba(255,255,255,.04); padding:20px; }
.panel h3 { margin:0 0 16px; font-size:18px; }
.chart-wrap { min-height:330px; position:relative; }
.chart-svg { width:100%; height:310px; overflow:visible; }
.chart-grid-line { stroke:rgba(255,255,255,.08); stroke-width:1; }
.chart-line-real { fill:none; stroke:#76f2bf; stroke-width:3; }
.chart-line-voice { fill:none; stroke:#d56bff; stroke-width:3; }
.chart-area { fill:rgba(213,107,255,.08); }
.chart-label { fill:#8f7c9d; font-size:10px; }
.chart-legend { display:flex; gap:14px; color:var(--muted); font-size:11px; margin-bottom:10px; }
.legend-dot { width:8px; height:8px; border-radius:50%; display:inline-block; margin-left:6px; }
.legend-dot.real { background:var(--good); }
.legend-dot.voice { background:var(--accent); }
.range-tabs { display:flex; gap:7px; flex-wrap:wrap; margin-right:auto; }
.range-tabs button.active { background:rgba(213,107,255,.15); color:var(--accent-2); border-color:rgba(213,107,255,.28); }
.info-list { display:grid; gap:10px; }
.info-row { display:flex; justify-content:space-between; gap:14px; border-bottom:1px solid rgba(255,255,255,.06); padding-bottom:10px; color:var(--muted); font-size:13px; }
.info-row strong { color:var(--text); text-align:left; direction:ltr; max-width:65%; overflow-wrap:anywhere; }

.admin-wrap { padding:40px 0 70px; }
.admin-grid { display:grid; grid-template-columns:360px 1fr; gap:18px; align-items:start; }
.admin-side { position:sticky; top:96px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-grid .full { grid-column:1 / -1; }
.check-row { display:flex; gap:14px; flex-wrap:wrap; }
.check { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:13px; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:20px; }
.table { width:100%; border-collapse:collapse; min-width:960px; }
.table th, .table td { text-align:right; padding:12px; border-bottom:1px solid rgba(255,255,255,.07); font-size:12px; vertical-align:middle; }
.table th { color:var(--soft); background:rgba(255,255,255,.04); font-weight:800; position:sticky; top:0; }
.table td { color:var(--muted); }
.table td strong { color:var(--text); }
.table-actions { display:flex; gap:6px; }
.status-dot { display:inline-flex; width:8px; height:8px; border-radius:50%; margin-left:6px; background:var(--soft); }
.status-dot.on { background:var(--good); }

.auth-card { max-width:560px; margin:90px auto; text-align:center; padding:36px; border:1px solid var(--line); border-radius:28px; background:rgba(255,255,255,.045); }
.auth-card h1 { margin:0 0 12px; }
.auth-card p { color:var(--muted); line-height:1.8; }

.toast { position:fixed; left:22px; bottom:22px; z-index:100; max-width:360px; border:1px solid var(--line); background:rgba(25,13,35,.94); color:white; border-radius:15px; padding:12px 15px; box-shadow:var(--shadow); opacity:0; transform:translateY(10px); pointer-events:none; transition:.2s; }
.toast.show { opacity:1; transform:translateY(0); }
.toast.error { border-color:rgba(255,127,159,.35); }

.empty { padding:48px 20px; text-align:center; color:var(--muted); border:1px dashed var(--line); border-radius:22px; }
.skeleton { background:linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:18px; min-height:180px; }
@keyframes shimmer { to { background-position:-200% 0; } }

.footer { margin-top:48px; border-top:1px solid rgba(255,255,255,.07); padding:24px 0 40px; color:var(--soft); font-size:12px; }
.footer-inner { display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; }

@media (max-width: 1100px) {
  .server-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-grid { grid-template-columns:1fr; }
  .admin-grid { grid-template-columns:1fr; }
  .admin-side { position:static; }
}

@media (max-width: 820px) {
  .shell { width:min(100% - 22px, 1480px); }
  .nav-inner { min-height:68px; gap:10px; }
  .nav-links { display:none; position:absolute; top:68px; right:11px; left:11px; padding:10px; flex-direction:column; align-items:stretch; background:rgba(20,10,30,.98); border:1px solid var(--line); border-radius:18px; }
  .nav-links.open { display:flex; }
  .menu-btn { display:inline-flex; }
  .nav-actions .btn.primary { display:none; }
  .hero { padding-top:42px; }
  .hero-grid { grid-template-columns:1fr; }
  .hero h1 { font-size:52px; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .toolbar { grid-template-columns:1fr 1fr; }
  .toolbar .search { grid-column:1 / -1; }
  .server-profile { grid-template-columns:1fr; align-items:start; }
  .profile-main { align-items:flex-start; }
  .profile-title h1 { font-size:34px; }
  .metrics { grid-template-columns:repeat(2,1fr); }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .full { grid-column:auto; }
}

@media (max-width: 560px) {
  .brand-copy span { display:none; }
  .brand-mark { width:36px; height:36px; border-radius:12px; }
  .hero h1 { font-size:42px; }
  .server-grid { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .stat-box { min-height:96px; padding:14px; }
  .stat-box strong { font-size:25px; }
  .section-head { align-items:flex-start; flex-direction:column; }
  .toolbar { grid-template-columns:1fr; }
  .toolbar .search { grid-column:auto; }
  .profile-main { flex-direction:column; }
  .profile-actions { width:100%; }
  .profile-actions .btn { flex:1; }
  .avatar.lg { width:82px; height:82px; }
}
