:root {
  --bg: #0a0a0c;
  --bg-2: #0f0f13;
  --panel: #121217;
  --panel-2: #16161c;
  --border: #1f1f27;
  --border-2: #262630;
  --text: #e8e8ee;
  --muted: #8a8a98;
  --muted-2: #5f5f6e;
  --accent: #a78bfa;
  --accent-2: #7c3aed;
  --accent-glow: rgba(167, 139, 250, 0.25);
  --pink: #ec4899;
  --green: #10b981;
  --red: #ef4444;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --amber: #f59e0b;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 40px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(124, 58, 237, .08), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(236, 72, 153, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}
::selection { background: var(--accent-glow); color: #fff; }

button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }

/* Layout */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 40%), var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 8px;
}
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--accent);
  background: radial-gradient(60% 60% at 50% 40%, rgba(167, 139, 250, .28), rgba(167, 139, 250, 0) 70%), #17171f;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, .15), 0 6px 20px rgba(124, 58, 237, .2);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-weight: 700; letter-spacing: .12em; font-size: 14px; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: .28em; margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.03); }
.nav-item.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(167, 139, 250, .16), rgba(167, 139, 250, .06));
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .25);
}
.nav-icon { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.plan-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.plan-label { color: var(--muted-2); letter-spacing: .14em; font-size: 10px; font-weight: 600; }
.plan-value { color: var(--muted); }
.badge {
  padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: .08em;
}
.badge-gold {
  background: linear-gradient(180deg, #fde68a, #f59e0b); color: #3a2a00;
}
.status-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; }
.status-dot i { width: 6px; height: 6px; background: var(--green); border-radius: 99px; box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }

.user-card {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel);
}
.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  font-weight: 700; color: #fff; font-size: 14px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, .35);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.user-name { font-weight: 600; font-size: 13px; }
.user-email { font-size: 11px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }

/* Topbar */
.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, .7);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar-title h1 { font-size: 22px; font-weight: 600; }
.breadcrumb { font-size: 12px; color: var(--muted); }
.topbar-actions { display: inline-flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--muted);
  background: var(--panel); border: 1px solid var(--border);
  transition: color .15s, background .15s, transform .1s;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* Views */
.view-wrap { padding: 24px 28px 64px; }
.view { display: none; flex-direction: column; gap: 20px; }
.view.is-active { display: flex; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 4px;
}
.section-head h2 { font-size: 18px; font-weight: 600; }
.section-head p { margin: 4px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px;
  font-weight: 500; font-size: 13px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #8b5cf6, #7c3aed);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 6px 24px rgba(124, 58, 237, .35);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  color: var(--text);
  background: var(--panel); border-color: var(--border);
}
.btn-ghost:hover { background: var(--panel-2); border-color: var(--border-2); }
.btn-danger {
  color: #fff; background: linear-gradient(180deg, #ef4444, #b91c1c);
  box-shadow: 0 6px 20px rgba(239, 68, 68, .25);
}

/* Stat cards */
.stats {
  display: grid; gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1400px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 60%), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 110px;
  position: relative;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.stat-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.stat-head { display: flex; align-items: center; justify-content: space-between; }
.stat-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--border);
}
.stat-icon svg { width: 16px; height: 16px; fill: currentColor; }
.stat-icon.violet { color: var(--violet); }
.stat-icon.pink   { color: var(--pink); }
.stat-icon.green  { color: var(--green); }
.stat-icon.red    { color: var(--red); }
.stat-icon.cyan   { color: var(--cyan); }
.trend {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  font-weight: 600;
  background: rgba(16, 185, 129, .1); color: var(--green);
  border: 1px solid rgba(16, 185, 129, .2);
}
.trend.down { background: rgba(239, 68, 68, .08); color: var(--red); border-color: rgba(239, 68, 68, .18); }
.stat-label { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }

/* Panel */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-title { display: flex; align-items: center; gap: 10px; }
.panel-title h2 { font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.panel-ico { width: 16px; height: 16px; fill: var(--accent); }

/* Segmented */
.segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg {
  padding: 5px 12px; font-size: 12px; border-radius: 999px; color: var(--muted); font-weight: 500;
}
.seg.is-active { background: #fff; color: #111; }

/* Chart */
.chart { position: relative; padding: 10px 18px 0; }
.chart svg { width: 100%; height: 240px; display: block; }
.chart .grid line { stroke: var(--border); stroke-dasharray: 3 6; }
.chart .baseline { stroke: var(--accent); stroke-width: 1.5; opacity: .4; }
.chart-xaxis { display: flex; justify-content: space-between; padding: 4px 0 12px; font-size: 10px; color: var(--muted-2); font-family: "JetBrains Mono", monospace; }
.chart-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted);
  pointer-events: none;
  font-size: 12px;
}
.chart-empty .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 99px; box-shadow: 0 0 0 4px rgba(167, 139, 250, .15); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 18px 18px; border-top: 1px solid var(--border); }
.leg { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.leg i { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted-2); font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.mono-cells td { font-family: "JetBrains Mono", monospace; font-size: 12px; }
.empty-row td { padding: 36px 18px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); }
.empty p { margin: 0; }

/* Domains */
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1.2fr 1fr; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }
.domain-list { list-style: none; margin: 0; padding: 0; }
.empty-card { padding: 28px 18px; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--muted); }
.dns-docs { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.dns-row {
  display: grid; grid-template-columns: 70px 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  font-family: "JetBrains Mono", monospace; font-size: 12px;
}
.dns-row code { color: var(--text); }
.kbd {
  display: inline-flex; justify-content: center;
  padding: 3px 8px; background: var(--panel-2); border: 1px solid var(--border-2);
  color: var(--accent); border-radius: 6px; font-weight: 600;
}

/* Protections grid */
.pill-group { display: inline-flex; gap: 6px; }
.pill {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
}
.pill:hover { color: var(--text); }
.pill.is-active { color: #fff; background: var(--accent-2); border-color: transparent; }

.protections {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.protection-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.protection-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.protection-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.protection-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(167, 139, 250, .18), rgba(167, 139, 250, .05));
  color: var(--accent);
  border: 1px solid rgba(167, 139, 250, .2);
  display: grid; place-items: center;
}
.protection-icon svg { width: 18px; height: 18px; fill: currentColor; }
.protection-title { font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.protection-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.protection-tag {
  position: absolute; top: 14px; right: 14px;
  font-size: 9px; letter-spacing: .14em; font-weight: 700;
  padding: 3px 6px; border-radius: 5px;
  background: rgba(167, 139, 250, .12); color: var(--accent); border: 1px solid rgba(167, 139, 250, .25);
}
.protection-tag.ai {
  background: linear-gradient(135deg, rgba(124, 58, 237, .18), rgba(236, 72, 153, .18));
  border-color: rgba(236, 72, 153, .25); color: #f0abfc;
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; inset: 0; background: var(--border-2); border-radius: 999px;
  transition: background .2s;
}
.toggle .slider::before {
  content: ""; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px;
  background: #fff; border-radius: 99px; transition: transform .2s;
}
.toggle input:checked + .slider { background: var(--accent-2); }
.toggle input:checked + .slider::before { transform: translateX(16px); }

/* Integrations */
.integrations {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.int-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow);
}
.int-head { display: flex; align-items: center; gap: 10px; }
.int-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 14px; letter-spacing: -.02em;
}
.int-name { font-weight: 600; font-size: 13px; }
.int-sub { font-size: 11px; color: var(--muted); }
.int-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.int-status {
  font-size: 11px; color: var(--muted-2); display: inline-flex; align-items: center; gap: 6px;
}
.int-status i { width: 6px; height: 6px; background: var(--muted-2); border-radius: 99px; }

/* Forms */
.form-grid {
  display: grid; gap: 14px; padding: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; outline: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-actions { padding: 0 18px 18px; display: flex; justify-content: flex-end; gap: 8px; }

.danger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px;
}

/* Source picker (network chips) */
.source-picker { padding: 16px 18px 4px; display: flex; flex-direction: column; gap: 8px; }
.source-picker-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted); font-weight: 500;
}
.source-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
}
.source-row::-webkit-scrollbar { height: 6px; }
.source-row::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.source-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
}
.source-chip:hover { border-color: var(--border-2); background: var(--panel-2); }
.source-chip.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(167,139,250,.14), rgba(167,139,250,.05));
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.source-chip-logo {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 10px; letter-spacing: -.02em;
}

/* Param preview (tracking URL) */
.param-preview {
  margin: 6px 18px 12px;
  background: linear-gradient(180deg, rgba(167,139,250,.05), transparent 60%), var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.param-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.param-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.param-hint  { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.param-actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.phantom-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(167, 139, 250, .12);
  border: 1px solid rgba(167, 139, 250, .25);
  color: var(--accent);
  font-size: 11px; font-weight: 500;
}
.phantom-pill code {
  font-family: "JetBrains Mono", monospace;
  color: #fff; font-size: 11px;
  background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 5px;
}
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.ghost:hover { background: var(--panel-2); border-color: var(--border); }
.btn-xs { padding: 6px 10px; font-size: 12px; }
.param-code {
  margin: 0; padding: 12px 14px;
  font-family: "JetBrains Mono", monospace; font-size: 12px;
  color: var(--text);
  white-space: pre-wrap; word-break: break-all;
  background: transparent;
  max-height: 160px; overflow: auto;
}
.param-code code { color: inherit; }
.param-code .tok-key { color: var(--accent); }
.param-code .tok-val { color: #f0abfc; }
.param-code .tok-mac { color: #f59e0b; }
.param-code .tok-pid { color: var(--green); font-weight: 600; }
.param-code .tok-amp { color: var(--muted-2); }
.param-foot { padding: 8px 14px 12px; margin: 0; }
.copied { color: var(--green) !important; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 40; display: none; }
.modal[aria-hidden="false"] { display: block; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease-out;
}
.modal-card {
  position: relative;
  width: min(620px, calc(100% - 32px));
  margin: 7vh auto 0;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: popIn .18s cubic-bezier(.2,.7,.3,1.2);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 4px 0 12px; }
.modal-body > p { padding: 0 18px 6px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 18px; border-top: 1px solid var(--border); background: var(--bg-2);
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(.98) }
  to { opacity: 1; transform: translateY(0) scale(1) }
}

/* ---------- Campaigns list rows ---------- */
.campaign-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.net-cell { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.feat-flag {
  font-size: 9px; font-weight: 700; letter-spacing: .12em;
  padding: 2px 5px; border-radius: 4px;
  background: rgba(167,139,250,.15); color: var(--accent);
  border: 1px solid rgba(167,139,250,.25);
}

/* ---------- Modal steps + feature toggles ---------- */
.modal-step { display: none; flex-direction: column; gap: 0; }
.modal-step.is-active { display: flex; }
.modal-step[data-step="result"].is-active { display: flex; }

.feature-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 0 18px 12px;
}
.feature-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.feature-card:hover { border-color: var(--border-2); }
.feature-card[data-active="1"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(167,139,250,.10), rgba(167,139,250,.03));
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.feature-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.feature-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--accent);
  background: rgba(167,139,250,.12);
  border: 1px solid rgba(167,139,250,.2);
  flex-shrink: 0;
}
.feature-icon svg { width: 16px; height: 16px; }
.feature-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feature-text strong { font-size: 13px; font-weight: 600; }

.feature-config {
  margin: 0 18px 12px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.fc-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
}
.fc-head strong { font-weight: 600; }
.fc-row {
  display: grid; grid-template-columns: 26px 1fr auto auto;
  align-items: center; gap: 10px;
}
.fc-row.fallback-row { grid-template-columns: 26px 1fr auto; }
.fc-row input[type="text"], .fc-row input[type="number"] {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; outline: none; color: var(--text);
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.fc-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.fc-weight { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.fc-tag {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--panel-2); color: var(--accent);
  border: 1px solid var(--border-2);
  font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 12px;
}
.fc-add { align-self: flex-start; }
.fc-remove { width: 28px; height: 28px; }
.fc-remove svg { width: 12px; height: 12px; }

.created-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(16,185,129,.08), transparent 60%);
  border-bottom: 1px solid var(--border);
}
.created-check {
  width: 38px; height: 38px; border-radius: 99px;
  display: grid; place-items: center;
  background: rgba(16,185,129,.15);
  color: var(--green);
  border: 1px solid rgba(16,185,129,.3);
  flex-shrink: 0;
}
.created-check svg { width: 18px; height: 18px; }
.created-banner strong { font-size: 14px; font-weight: 600; }
.created-banner p { margin: 2px 0 0; }

/* ---------- Admin ---------- */
.nav-divider { height: 1px; background: var(--border); margin: 8px 12px; }
.nav-admin { color: var(--amber); }
.nav-admin .nav-icon { fill: var(--amber); }
.nav-admin.is-active {
  background: linear-gradient(180deg, rgba(245,158,11,.16), rgba(245,158,11,.05));
  box-shadow: inset 0 0 0 1px rgba(245,158,11,.3);
  color: #fbbf24;
}
.nav-flag {
  margin-left: auto;
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  padding: 2px 6px; border-radius: 5px;
  background: rgba(245,158,11,.18); color: var(--amber);
  border: 1px solid rgba(245,158,11,.28);
}

.impersonation-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 28px;
  background: linear-gradient(180deg, rgba(245,158,11,.18), rgba(245,158,11,.06));
  border-bottom: 1px solid rgba(245,158,11,.25);
  color: #fbbf24;
  font-size: 13px;
}
.impersonation-bar strong { color: #fff; font-weight: 600; }
.impersonation-bar svg { color: var(--amber); flex-shrink: 0; }
.impersonation-bar .btn { margin-left: auto; }
.impersonation-bar .btn + .btn { margin-left: 0; }

.admin-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 6px;
}
.admin-head h2 { font-size: 18px; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; }
.admin-badge {
  font-size: 10px; letter-spacing: .18em; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  color: #1a1100;
}

.admin-tabs {
  display: inline-flex; gap: 2px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px;
}
.admin-tab {
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.is-active {
  background: linear-gradient(180deg, rgba(245,158,11,.18), rgba(245,158,11,.05));
  color: #fbbf24;
  box-shadow: inset 0 0 0 1px rgba(245,158,11,.25);
}

.admin-pane { display: none; flex-direction: column; gap: 16px; }
.admin-pane.is-active { display: flex; }

.stats-admin { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1400px) { .stats-admin { grid-template-columns: repeat(3, 1fr); } }

.stat-icon.admin {
  color: var(--amber);
  background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.22);
}

.legend.inline { padding: 0; border: 0; gap: 14px; }

.admin-chart svg { height: 280px; }
.admin-chart path.line { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.admin-chart path.area { fill: url(#gAdm); }
.admin-chart .pt { opacity: 0; }

.ranked-list { list-style: none; margin: 0; padding: 0; }
.ranked-list li {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center;
  gap: 12px; padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.ranked-list li:last-child { border-bottom: 0; }
.ranked-list .rank { color: var(--muted-2); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.ranked-list .name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.ranked-list .name .flag { font-size: 16px; }
.ranked-list .net-dot {
  width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center;
  color: #fff; font-size: 9px; font-weight: 700;
}
.ranked-list .bar {
  position: relative; flex: 1; height: 4px; background: var(--bg-2); border-radius: 99px; max-width: 160px;
  margin-left: auto;
}
.ranked-list .bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 99px; }
.ranked-list .num { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--text); white-space: nowrap; }

.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .av {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: 11px;
}
.user-cell .meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-cell .meta b { font-weight: 600; font-size: 13px; }
.user-cell .meta span { font-size: 11px; color: var(--muted); }

.plan-tag {
  font-size: 10px; letter-spacing: .12em; font-weight: 700;
  padding: 3px 7px; border-radius: 5px; text-transform: uppercase;
}
.plan-tag.free      { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.plan-tag.pro       { background: rgba(167,139,250,.15); color: var(--accent); border: 1px solid rgba(167,139,250,.25); }
.plan-tag.unlimited { background: linear-gradient(180deg,#fde68a,#f59e0b); color: #3a2a00; }
.plan-tag.phantom   { background: linear-gradient(135deg,#7c3aed,#ec4899); color: #fff; }

.status-tag { font-size: 11px; display: inline-flex; align-items: center; gap: 6px; }
.status-tag i { width: 6px; height: 6px; border-radius: 99px; display: inline-block; }
.status-tag.active   { color: var(--green); }     .status-tag.active i   { background: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.status-tag.idle     { color: var(--muted); }     .status-tag.idle i     { background: var(--muted); }
.status-tag.suspended{ color: var(--red); }       .status-tag.suspended i{ background: var(--red); }

.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.btn-impersonate {
  font-size: 12px; padding: 6px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(245,158,11,.18), rgba(245,158,11,.05));
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,.28);
}
.btn-impersonate:hover { background: rgba(245,158,11,.22); }

.live-dot {
  width: 8px; height: 8px; border-radius: 99px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.2);
  animation: liveBlink 1.4s ease-in-out infinite;
  display: inline-block;
}
@keyframes liveBlink { 0%,100% { opacity:1; transform: scale(1) } 50% { opacity:.4; transform: scale(.8) } }

.live-log tr.row-new { animation: rowIn .25s ease-out; }
.live-log tr td:first-child { color: var(--muted); }
@keyframes rowIn {
  from { background: rgba(245,158,11,.12); transform: translateY(-4px); opacity: 0 }
  to   { background: transparent;          transform: translateY(0);   opacity: 1 }
}

.dec-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600; letter-spacing: .04em;
  font-family: "Inter", sans-serif;
}
.dec-tag.black { background: rgba(236,72,153,.15); color: #f0abfc; border: 1px solid rgba(236,72,153,.25); }
.dec-tag.safe  { background: rgba(16,185,129,.12); color: var(--green); border: 1px solid rgba(16,185,129,.25); }
.dec-tag.block { background: rgba(239,68,68,.12);  color: var(--red);   border: 1px solid rgba(239,68,68,.28); }

.search-input {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; outline: none; color: var(--text);
  font-size: 13px; min-width: 240px;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ---------- Auth pages (signup / login) ---------- */
.auth-body {
  min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 56px 20px 80px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(124,58,237,.12), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(236,72,153,.07), transparent 60%),
    var(--bg);
}
.auth-main { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 32px; }

.auth-brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.auth-logo {
  width: 76px; height: 76px;
  display: grid; place-items: center;
  color: var(--accent);
  background: radial-gradient(60% 60% at 50% 40%, rgba(167,139,250,.32), rgba(167,139,250,0) 70%), #17171f;
  border: 1px solid var(--border-2);
  border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(167,139,250,.18), 0 18px 48px rgba(124,58,237,.3);
}
.auth-brand h1 {
  font-size: 28px; font-weight: 700; letter-spacing: .14em;
  margin: 0; color: #fff;
}
.brand-tm { font-size: 13px; opacity: .55; vertical-align: super; margin-left: 2px; }
.auth-tagline {
  margin: 0; color: var(--accent);
  font-size: 14px; font-weight: 500;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px 28px 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 24px 60px rgba(0,0,0,.4);
}
.auth-card-head { text-align: center; margin-bottom: 22px; }
.auth-card-head h2 { font-size: 22px; font-weight: 700; margin: 0; }
.auth-card-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field-group { display: flex; flex-direction: column; gap: 6px; }
.auth-hint { margin: 0 4px; color: var(--muted-2); font-size: 11.5px; }

.auth-field {
  position: relative;
  display: flex; align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 16px 0 46px;
  height: 52px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.auth-field input {
  flex: 1; height: 100%; min-width: 0; width: 100%;
  background: transparent; border: 0; outline: 0;
  color: var(--text);
  font: inherit; font-size: 14px;
}
.auth-field input::placeholder { color: var(--muted-2); }
.auth-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--accent);
  width: 20px; height: 20px;
  display: grid; place-items: center;
}
.auth-icon svg { width: 18px; height: 18px; }

.auth-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; align-items: start; }
.auth-row.phone-row { grid-template-columns: 132px 1fr; }

/* Country code picker — flag sits at the same position as other field icons. */
.auth-cc { padding: 0 12px 0 46px; overflow: visible; }
.cc-flag {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 16px; object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
  pointer-events: none;
}
.cc-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 100%;
  padding: 0;
  background: transparent;
  font: inherit; font-size: 14px; color: var(--text);
  cursor: pointer;
}
.cc-btn .chevron {
  width: 14px; height: 14px;
  margin-left: auto;
  color: var(--muted-2);
  transition: transform .15s;
  flex-shrink: 0;
}
.cc-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.cc-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: auto;
  width: 320px; max-width: calc(100vw - 40px);
  background: var(--panel); border: 1px solid var(--border-2);
  border-radius: 14px; padding: 8px;
  max-height: 320px; overflow: hidden;
  z-index: 30;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  animation: popIn .15s ease-out;
}
/* `[hidden]` would normally hide via UA stylesheet, but `display: flex` above
   wins specificity. Re-assert hiding when the attribute is set. */
.cc-dropdown[hidden] { display: none; }
.cc-dropdown input[type="search"] {
  width: 100%;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px;
  outline: 0; color: var(--text);
  font-size: 13px;
  margin-bottom: 6px;
}
.cc-dropdown input[type="search"]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.cc-dropdown ul {
  list-style: none; margin: 0; padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.cc-dropdown ul::-webkit-scrollbar { width: 6px; }
.cc-dropdown ul::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.cc-dropdown li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font-size: 13px;
  user-select: none;
}
.cc-dropdown li:hover, .cc-dropdown li[aria-selected="true"] {
  background: var(--panel-2);
  color: #fff;
}
.cc-dropdown li img {
  width: 22px; height: 16px; object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
  flex-shrink: 0;
}
.cc-dropdown li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-dropdown li .dial {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace; font-size: 12px;
  flex-shrink: 0;
}
.cc-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }

/* Password show/hide */
.auth-pw input { padding-right: 38px; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--muted);
  border-radius: 6px;
}
.pw-toggle:hover { color: var(--accent); background: rgba(255,255,255,.04); }
.pw-toggle svg { width: 16px; height: 16px; }

/* Terms checkbox */
.auth-terms {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 4px;
  font-size: 13px; color: var(--muted);
  line-height: 1.5;
}
.auth-terms input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-2);
  border-radius: 5px;
  background: var(--bg-2);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  margin: 1px 0 0;
  transition: border-color .15s, background .15s;
}
.auth-terms input[type="checkbox"]:hover { border-color: var(--accent); }
.auth-terms input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.auth-terms input[type="checkbox"]:checked::after {
  content: "";
  position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.auth-terms a { color: var(--accent); }
.auth-terms a:hover { text-decoration: underline; }

/* Login extras */
.auth-extras {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
  margin: -2px 2px 4px;
}
.auth-remember {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); cursor: pointer;
}
.auth-remember input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-2);
  border-radius: 4px;
  background: var(--bg-2);
  cursor: pointer; flex-shrink: 0;
  position: relative;
  transition: border-color .15s, background .15s;
}
.auth-remember input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.auth-remember input[type="checkbox"]:checked::after {
  content: ""; position: absolute;
  left: 4px; top: 0px;
  width: 4px; height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.auth-forgot { color: var(--accent-2); font-weight: 600; }
.auth-forgot:hover { text-decoration: underline; }

.auth-error {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 13px;
}

/* Submit + foot */
.auth-submit {
  margin-top: 6px;
  height: 52px;
  font-size: 13px; font-weight: 700; letter-spacing: .16em;
  width: 100%; justify-content: center;
  border-radius: 14px;
  text-transform: uppercase;
}
.auth-submit:disabled { opacity: .55; cursor: progress; }

.auth-card-foot {
  text-align: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.auth-card-foot a { color: var(--accent); font-weight: 500; }
.auth-card-foot a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 520px) {
  .auth-card { padding: 24px 18px 18px; border-radius: 18px; }
  .auth-row { grid-template-columns: 1fr; }
  .auth-row.phone-row { grid-template-columns: 130px 1fr; }
  .cc-dropdown { width: 100%; }
}

/* Responsive */
@media (max-width: 860px) {
  .app { grid-template-columns: 72px 1fr; }
  .sidebar { padding: 16px 8px; }
  .brand-text, .nav-item span, .plan-card, .user-meta, .user-card .icon-btn { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .user-card { grid-template-columns: 1fr; padding: 8px; }
}

/* Plans grid */
.plans-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; }
.plan-tier { background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.01)); border:1px solid rgba(255,255,255,.07); border-radius:14px; padding:20px; display:flex; flex-direction:column; gap:14px; position:relative; }
.plan-tier.is-current { border-color:#a78bfa; box-shadow:0 0 0 2px rgba(167,139,250,.2); }
.plan-tier h3 { margin:0; font-size:18px; font-weight:600; }
.plan-tier .price { font-size:28px; font-weight:700; }
.plan-tier .price small { font-size:12px; font-weight:500; color:#9ca3af; }
.plan-tier ul { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; flex:1; }
.plan-tier ul li { font-size:13px; color:#cbd5e1; display:flex; gap:8px; align-items:flex-start; }
.plan-tier ul li::before { content:"✓"; color:#10b981; font-weight:700; }
.plan-tier .btn { margin-top:auto; }
.plan-tier .badge-current { position:absolute; top:12px; right:12px; background:#a78bfa; color:#000; padding:2px 8px; border-radius:6px; font-size:10px; font-weight:700; letter-spacing:.5px; }
