:root {
  --bg: #07080d;
  --bg-2: #0c0e16;
  --panel: #11131d;
  --panel-2: #161927;
  --line: #22263a;
  --line-2: #2d3250;
  --text: #e8eaf4;
  --muted: #8b90ab;
  --dim: #5d627d;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --grad: linear-gradient(120deg, #7c5cff 0%, #4f8bff 50%, #22d3ee 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 14px;
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: rgba(124, 92, 255, .35); }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: 500 14px var(--sans); cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #444a72; background: #1b1f30; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 24px -8px rgba(124, 92, 255, .7); }
.btn.primary:hover { opacity: .92; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: rgba(248, 113, 113, .5); background: rgba(248, 113, 113, .08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

.input, select.input {
  height: 38px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: 14px var(--sans); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2); }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }

/* ---------- landing ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 18px 24px;
  backdrop-filter: blur(14px);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.logo svg { width: 28px; height: 28px; }
.site-nav nav { display: flex; gap: 6px; align-items: center; }

.hero { position: relative; overflow: hidden; padding: 72px 24px 40px; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 760px; z-index: -1;
  background:
    radial-gradient(closest-side at 30% 50%, rgba(124, 92, 255, .28), transparent),
    radial-gradient(closest-side at 70% 40%, rgba(34, 211, 238, .18), transparent);
  filter: blur(20px);
}
.grid-bg {
  position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 70%);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 99px;
  border: 1px solid var(--line-2); background: rgba(17, 19, 29, .7); color: var(--muted); font-size: 13px;
}
.pill b { background: var(--grad); color: #fff; padding: 1px 8px; border-radius: 99px; font-weight: 600; font-size: 12px; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -.045em; margin: 22px auto 18px; max-width: 900px; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.terminal {
  max-width: 760px; margin: 56px auto 0; text-align: left; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line-2); background: rgba(12, 14, 22, .92);
  box-shadow: 0 40px 120px -40px rgba(124, 92, 255, .45), 0 0 0 1px rgba(255, 255, 255, .02) inset;
}
.terminal .bar { display: flex; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.terminal .bar i { width: 11px; height: 11px; border-radius: 50%; background: #2e3247; }
.terminal .bar i:nth-child(1) { background: #ff5f57; } .terminal .bar i:nth-child(2) { background: #febc2e; } .terminal .bar i:nth-child(3) { background: #28c840; }
.terminal pre { margin: 0; padding: 20px 22px; font-size: 13.5px; line-height: 1.75; color: #c9cce0; white-space: pre-wrap; min-height: 300px; }
.t-dim { color: var(--dim); } .t-ok { color: var(--ok); } .t-acc { color: #a78bfa; } .t-cy { color: var(--accent-2); } .t-warn { color: var(--warn); }
.cursor { display: inline-block; width: 8px; height: 16px; background: #c9cce0; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.section { max-width: 1120px; margin: 0 auto; padding: 80px 24px; }
.section h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; margin: 0 0 10px; }
.section .sub { color: var(--muted); margin: 0 0 40px; font-size: 17px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature {
  padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--bg-2));
  transition: border-color .2s, transform .2s;
}
.feature:hover { border-color: var(--line-2); transform: translateY(-2px); }
.feature .ic {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(124, 92, 255, .12); color: #a78bfa; border: 1px solid rgba(124, 92, 255, .25);
}
.feature .ic svg { width: 20px; height: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.steps { display: grid; gap: 14px; counter-reset: step; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.step::before {
  counter-increment: step; content: counter(step); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 700; background: var(--panel-2); border: 1px solid var(--line-2);
}
.step h4 { margin: 0 0 8px; font-size: 16px; }
.code {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line);
  font: 13.5px var(--mono); color: #c9cce0; overflow-x: auto;
}
.code .copy { flex: none; }
.code .p { color: var(--dim); user-select: none; margin-right: 8px; }

.footer { border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.footer .in { max-width: 1120px; margin: 0 auto; padding: 28px 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- admin layout ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.app > div { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; border-right: 1px solid var(--line); background: var(--bg-2);
}
.sidebar .logo { padding: 4px 10px 22px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; opacity: .9; }
.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active { color: var(--text); background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--panel-2); padding: 0 8px; border-radius: 99px; }
.sidebar .spacer { flex: 1; }
.sidebar .server { padding: 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.sidebar .server b { color: var(--text); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; padding: 28px 36px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); }
.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.stat .hint { color: var(--dim); font-size: 12.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 12px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-body { padding: 18px 20px; }

.chart { display: flex; align-items: flex-end; gap: 5px; height: 160px; }
.chart .bar-wrap { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.chart .bar {
  width: 100%; min-height: 3px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #8b6dff, rgba(79, 139, 255, .55));
  transition: height .5s cubic-bezier(.2, .8, .2, 1), opacity .15s;
}
.chart .bar-wrap:hover .bar { opacity: .75; }
.chart .bar-wrap:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #000; border: 1px solid var(--line-2); padding: 3px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; z-index: 2;
}
.chart-axis { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; margin-top: 8px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 20px; border-bottom: 1px solid var(--line); }
td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .015); }
td.actions { text-align: right; white-space: nowrap; }
td .sub { color: var(--muted); font-size: 12.5px; }
.table-wrap { overflow-x: auto; }

.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; border: 1px solid var(--line-2); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .07); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .07); }
.badge.err { color: var(--err); border-color: rgba(248, 113, 113, .3); background: rgba(248, 113, 113, .07); }
.badge.acc { color: #a78bfa; border-color: rgba(124, 92, 255, .35); background: rgba(124, 92, 255, .08); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.method { font: 600 12px var(--mono); padding: 2px 7px; border-radius: 6px; background: var(--panel-2); color: var(--accent-2); }
.status { font: 600 13px var(--mono); }
.s2 { color: var(--ok); } .s3 { color: var(--accent-2); } .s4 { color: var(--warn); } .s5 { color: var(--err); }
.path { font: 13px var(--mono); color: #c9cce0; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.link { color: #a78bfa; } .link:hover { text-decoration: underline; }
.secret { font: 13px var(--mono); color: var(--muted); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 6px; }
.empty code { color: var(--text); background: var(--panel-2); padding: 3px 8px; border-radius: 6px; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input { width: 260px; }

/* live log */
.live-row { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: rgba(124, 92, 255, .14); } to { background: transparent; } }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 4, 8, .7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; animation: fade .15s; padding: 20px; }
.modal { width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 40px 100px -20px #000; animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); }
.modal .mh { padding: 20px 22px 0; } .modal .mh h3 { margin: 0; font-size: 18px; } .modal .mh p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.modal .mb { padding: 18px 22px; display: grid; gap: 14px; }
.modal .mf { padding: 0 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

.callout { padding: 12px 14px; border-radius: 10px; background: rgba(124, 92, 255, .07); border: 1px solid rgba(124, 92, 255, .25); font-size: 13.5px; color: #c9c3f5; }
.callout code { color: #fff; }
.dns { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 16px; font: 13px var(--mono); margin-top: 8px; }
.dns span:nth-child(3n+1) { color: var(--accent-2); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 60; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -10px #000; font-size: 14px; animation: pop .2s; display: flex; gap: 10px; align-items: center; }
.toast.ok::before { content: "✓"; color: var(--ok); font-weight: 700; }
.toast.err::before { content: "!"; color: var(--err); font-weight: 700; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(closest-side, rgba(124, 92, 255, .22), transparent); top: -200px; left: 50%; transform: translateX(-50%); }
.login .box { position: relative; width: 100%; max-width: 380px; padding: 32px; border-radius: 20px; background: rgba(17, 19, 29, .85); border: 1px solid var(--line-2); backdrop-filter: blur(10px); display: grid; gap: 16px; }
.login h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; }
.login p { margin: -8px 0 4px; color: var(--muted); font-size: 14px; }
.login .error { color: var(--err); font-size: 13px; min-height: 18px; }

.mobile-top { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .main { padding: 20px 16px 60px; }
  th, td { padding: 10px 12px; }
}
.modal .code span { word-break: break-all; }
