:root {
  --bg: #08090e;
  --bg-elev: #12141c;
  --bg-elev-2: #1a1e29;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f4f8;
  --muted: #9aa3b5;
  --accent: #8b7cff;
  --accent-2: #3ee0b0;
  --danger: #ff6b81;
  --warn: #ffc14d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --sidebar: 248px;
  --font: Aptos, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(139, 124, 255, 0.22), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(62, 224, 176, 0.12), transparent 50%),
    var(--bg);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

.nav, .topbar, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav, .site-footer { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.nav { padding: 22px 0; }
.site-footer { padding: 28px 0 36px; color: var(--muted); font-size: 0.92rem; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; letter-spacing: -0.03em; }
.logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--accent), #5a4adf);
  box-shadow: 0 8px 20px rgba(139, 124, 255, 0.35);
}
.logo svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 16px; text-decoration: none; background: var(--bg-elev-2);
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-primary { background: var(--accent); color: white; font-weight: 700; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: transparent; border-color: rgba(255, 107, 129, 0.45); color: #ffd0d7; }
.btn-sm { padding: 7px 11px; font-size: 0.86rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: 0.45; pointer-events: none; transform: none; }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 18px 0 54px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 42px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent-2); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 0.98; letter-spacing: -0.045em; margin: 12px 0; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 520px; line-height: 1.55; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.grid-3, .stats, .split { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); margin: 8px 0 40px; }
.feature, .card, .stat, .preview, .auth-card, .modal-card, .ad-card {
  background: rgba(18, 20, 28, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.feature { padding: 18px; }
.feature h2, .card-title { margin: 0; font-size: 1.05rem; letter-spacing: -0.02em; }
.feature p, .muted { color: var(--muted); line-height: 1.5; }
.feature span { color: var(--accent-2); font-weight: 700; font-size: 0.82rem; }

.preview { overflow: hidden; }
.preview-top { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #2a3142; }
.dot:nth-child(1) { background: #ff6b81; }
.dot:nth-child(2) { background: #ffc14d; }
.dot:nth-child(3) { background: #3ee0b0; }
.preview-body { padding: 22px; text-align: center; }
.fake-ring, .count-num {
  width: 128px; height: 128px; margin: 16px auto;
  border-radius: 50%; display: grid; place-items: center;
  border: 8px solid rgba(62, 224, 176, 0.85);
  font-size: 46px; font-weight: 760; font-variant-numeric: tabular-nums;
}
.fake-ad { text-align: left; padding: 12px; border-radius: 14px; background: var(--bg-elev-2); margin-bottom: 14px; color: var(--muted); }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); padding: 28px; }
.auth-card h1 { font-size: 2rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span, .check { color: var(--muted); font-size: 0.86rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, select, textarea {
  width: 100%; background: #0c0e14; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; outline: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.form-error { color: #ffd0d7; background: rgba(255, 107, 129, 0.1); padding: 8px 10px; border-radius: 10px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; }
.check input { width: auto; }

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px;
  border-right: 1px solid var(--line); background: rgba(8, 9, 14, 0.92);
  display: flex; flex-direction: column; gap: 16px;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  text-align: left; background: transparent; border: 0; border-radius: 12px;
  padding: 10px 12px; color: var(--muted);
}
.nav-btn.active, .nav-btn:hover { background: var(--bg-elev-2); color: var(--text); }
.side-foot { margin-top: auto; }
.shell-main { min-width: 0; }
.topbar { padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(8, 9, 14, 0.8); backdrop-filter: blur(12px); z-index: 2; }
.topbar h1 { font-size: 1.25rem; margin: 0; }
.menu-btn { display: none; }
.view { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.stats { grid-template-columns: repeat(6, 1fr); }
.stat { padding: 14px; }
.stat-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { display: block; margin-top: 6px; font-size: 1.55rem; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat-hint { color: var(--muted); font-size: 0.8rem; }
.card { padding: 16px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.toolbar, .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select, .filters select { width: auto; min-width: 0; }
.toolbar input { flex: 1; min-width: 180px; }
.split { grid-template-columns: 1.4fr 0.8fr; }
.chart-wrap { height: 260px; }
canvas { width: 100%; height: 240px; display: block; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 0.85rem; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.86rem; }
.badge { border-radius: 999px; padding: 3px 8px; font-size: 0.75rem; font-weight: 700; }
.badge-on { background: rgba(62, 224, 176, 0.15); color: var(--accent-2); }
.badge-off { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center; font-size: 0.88rem; }
.bar { height: 8px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.pager { display: flex; gap: 8px; align-items: center; }
.banner { background: rgba(255, 193, 77, 0.12); color: #ffe3a8; border: 1px solid rgba(255, 193, 77, 0.3); padding: 12px 14px; border-radius: 14px; }
.empty { color: var(--muted); padding: 18px; text-align: center; }
.fine { color: var(--muted); font-size: 0.82rem; text-align: center; margin: 0; }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 18px; z-index: 20; }
.modal-card { width: min(520px, 100%); padding: 18px; max-height: min(88vh, 760px); overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.toast {
  position: fixed; bottom: 18px; right: 18px; background: #1d2230; border: 1px solid var(--line);
  padding: 12px 14px; border-radius: 14px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px);
  pointer-events: none; transition: .2s ease; z-index: 30;
}
.toast.show { opacity: 1; transform: none; }

.land { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px 40px; }
.land-card { width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px; }
.land-card h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0; }
.count-wrap { position: relative; width: 180px; height: 180px; margin: 4px auto; }
.count-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.count-wrap circle { fill: none; stroke-width: 8; }
.count-wrap .track { stroke: rgba(255,255,255,.08); }
.count-wrap .prog { stroke: var(--accent-2); stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.count-num { position: absolute; inset: 0; width: auto; height: auto; border: 0; margin: 0; font-size: 56px; }
.ad-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; text-decoration: none; align-items: center; }
.ad-card img { width: 96px; height: 72px; object-fit: cover; border-radius: 10px; background: #0c0e14; }
.ad-card.no-image { grid-template-columns: 1fr; }
.ad-card strong { display: block; margin: 2px 0; }
.ad-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .hero-grid, .grid-3, .split, .field-row { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 10; transform: translateX(-105%); transition: transform .2s ease; width: min(280px, 86vw);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .view { padding: 16px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 72px 1fr auto; }
}
