:root {
  --bg: #07060d;
  --panel: rgba(20, 17, 34, 0.72);
  --panel-solid: #141122;
  --border: rgba(148, 120, 255, 0.18);
  --border-strong: rgba(148, 120, 255, 0.38);
  --text: #ece9ff;
  --muted: #9a94b8;
  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-2: #22d3ee;
  --good: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;
  --radius: 18px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
}

.glow-a {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 68%);
  top: -180px;
  left: -140px;
}

.glow-b {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.28), transparent 70%);
  bottom: -200px;
  right: -120px;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), #4c1d95);
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.55);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.34em;
  font-weight: 800;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #cfc9e8;
  font-size: 12.5px;
  font-family: var(--mono);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.dot.online {
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
}

.dot.offline {
  background: var(--bad);
  box-shadow: 0 0 10px var(--bad);
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 48px;
  align-items: start;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), transparent 42%);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head h2 {
  margin: 0 0 3px;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.small {
  font-size: 12.5px;
}

.hidden {
  display: none !important;
}

.tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.tab.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #c7c1e2;
}

input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(7, 6, 13, 0.65);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

input::placeholder {
  color: #6f688c;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  width: fit-content;
}

.btn:hover {
  border-color: var(--border-strong);
  background: rgba(139, 92, 246, 0.12);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  box-shadow: 0 12px 30px rgba(109, 40, 217, 0.35);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #9d75f8, #7c3aed);
}

.btn.ghost {
  background: transparent;
  font-size: 13px;
  padding: 7px 12px;
}

.btn.mini {
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 8px;
}

.btn.danger {
  color: var(--bad);
  border-color: rgba(251, 113, 133, 0.4);
}

.form-msg {
  min-height: 18px;
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.form-msg.error {
  color: var(--bad);
}

.form-msg.ok {
  color: var(--good);
}

.account-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.06);
  margin-bottom: 16px;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(140deg, #2a1b4d, #0f0b1c);
  border: 1px solid var(--border-strong);
  color: #d8ccff;
  text-transform: uppercase;
}

.account-meta h3 {
  margin: 0 0 2px;
  font-size: 18px;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  word-break: break-all;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat span {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat strong {
  font-family: var(--mono);
  font-size: 18px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}

.section-title h3 {
  margin: 0;
  font-size: 14px;
}

.section-title .muted {
  font-size: 12px;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.device {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 12.5px;
}

.device code {
  font-family: var(--mono);
  color: #cfc9e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device .uagent {
  color: var(--muted);
  font-size: 11px;
}

.secret {
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #0b0813;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  color: #d8ccff;
}

.endpoint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(148, 120, 255, 0.14);
  font-size: 13px;
}

.endpoint:last-of-type {
  border-bottom: 0;
}

.endpoint span {
  color: var(--muted);
}

.endpoint code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: #d8ccff;
  text-align: right;
  word-break: break-all;
}

.kv {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.kv > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 120, 255, 0.1);
}

.kv > div:last-child {
  border-bottom: 0;
}

.kv dt {
  color: var(--muted);
  font-size: 13px;
}

.kv dd {
  margin: 0;
  font-size: 13px;
  text-align: right;
}

.badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--good);
  background: rgba(52, 211, 153, 0.08);
}

.badge.offline {
  color: var(--bad);
  background: rgba(251, 113, 133, 0.08);
}

.badge.warn {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.08);
}

.discord-card {
  border-color: var(--border-strong);
}

.discord-card.locked {
  border-color: rgba(251, 191, 36, 0.35);
}

.discord-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.discord-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.discord-user strong {
  font-size: 14px;
}

.avatar-sm {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 16px;
  flex-shrink: 0;
}

.discord-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.discord-actions .btn {
  text-decoration: none;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form input {
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.admin-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 120, 255, 0.08);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table .name {
  font-weight: 600;
  color: var(--text);
}

.admin-table .sub {
  color: var(--muted);
  font-size: 11px;
}

.admin-table .actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.status-pill {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--good);
}

.status-pill.banned {
  color: var(--bad);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 22px 12px !important;
}

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: #6f688c;
  font-size: 12px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-top: 22px;
  }

  .brand h1 {
    font-size: 23px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 18px;
  }

  .endpoint {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .endpoint code {
    text-align: left;
  }
}
