:root {
  --bg: #0f1419;
  --bg-2: #171e26;
  --bg-3: #1e2732;
  --line: #2a3542;
  --text: #e8eef4;
  --muted: #8b9aab;
  --green: #3dcc7a;
  --green-2: #2ea862;
  --red: #ef5d5d;
  --amber: #f0b429;
  --blue: #5aa7ff;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 "PingFang SC", "Noto Sans SC", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }

#app { min-height: 100%; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 400px at 20% -10%, rgba(61, 204, 122, 0.16), transparent 60%),
    radial-gradient(700px 360px at 90% 110%, rgba(90, 167, 255, 0.12), transparent 55%),
    var(--bg);
}
.login-card {
  width: 380px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 8px 0 4px; font-size: 22px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background:
    radial-gradient(circle at 50% 50%, #9ff0c0 0 7px, transparent 8px),
    linear-gradient(135deg, #3dcc7a, #1e8a4c);
}

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column;
}
.side .brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 22px; }
.side .brand b { display: block; font-size: 15px; }
.side .brand span { color: var(--muted); font-size: 12px; }
.nav a {
  display: block; padding: 10px 12px; border-radius: 8px; color: var(--muted); margin-bottom: 4px;
}
.nav a:hover, .nav a.active { background: var(--bg-3); color: var(--text); }
.nav a.active { box-shadow: inset 3px 0 0 var(--green); }
.side .foot { margin-top: auto; padding: 12px 8px 4px; }
.main { padding: 28px 32px 48px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.top h2 { margin: 0; font-size: 22px; }
.top .sub { color: var(--muted); margin-top: 4px; }

.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.stat .label { color: var(--muted); font-size: 12px; }
.stat .num { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.03em; }
.stat .num.green { color: var(--green); }
.stat .num.blue { color: var(--blue); }
.stat .num.amber { color: var(--amber); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 180px; }

input, textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--green-2); }
textarea { min-height: 88px; resize: vertical; }

.btn {
  border: 0; border-radius: 8px; padding: 9px 14px; background: var(--bg-3); color: var(--text);
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary { background: var(--green); color: #062214; font-weight: 600; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:hover td { background: rgba(255,255,255,0.02); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--bg-3); color: var(--muted);
}
.pill.on { background: rgba(61,204,122,.15); color: var(--green); }
.user {
  display: flex; gap: 10px; align-items: center;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg-3); object-fit: cover; flex: none;
}
.avatar.lg { width: 56px; height: 56px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); }

.detail { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px 10px; }
.kv b { color: var(--muted); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { color: var(--muted); font-size: 12px; }
.toast {
  position: fixed; right: 20px; bottom: 20px; background: #111; border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); z-index: 20;
}
.toast.err { border-color: var(--red); }
.link { color: var(--green); cursor: pointer; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
pre.json {
  margin: 0; max-height: 360px; overflow: auto; background: var(--bg); border-radius: 8px;
  padding: 12px; font-size: 12px; line-height: 1.45;
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .stats, .detail, .form-grid { grid-template-columns: 1fr; }
}
