:root {
  --bg: #0e1116;
  --bg-soft: #151a21;
  --card: #171d26;
  --line: #232b36;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #4f9cf9;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); }

.btn {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #1e2530; border-color: #313c4b; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121f; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--red); border-color: #40201f; }
.btn.danger:hover { background: #2a1514; }

/* login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card { width: min(380px, 100%); }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card input {
  width: 100%;
  margin: 14px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.login-card .btn { width: 100%; }

/* layout */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

main { padding: 20px; display: grid; gap: 18px; max-width: 1400px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid #1c232d; vertical-align: middle; }
tbody tr:hover { background: #1a212b; }
td code { font-size: 12px; color: #9ecbff; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.online, .badge.active { background: rgba(63,185,80,.15); color: var(--green); }
.badge.offline, .badge.disabled { background: rgba(248,81,73,.15); color: var(--red); }
.badge.banned { background: rgba(210,153,34,.15); color: var(--yellow); }
.badge.pending { background: rgba(139,152,169,.15); color: var(--muted); }

/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 20px;
}
.modal-card { width: min(460px, 100%); }
.modal-card h2 { margin: 0 0 14px; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.result-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  margin-top: 8px;
}

/* toast */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 11px 16px;
  z-index: 30;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  max-width: 380px;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  main { padding: 14px; }
}
