:root {
  --ink: #141820;
  --muted: #667085;
  --line: #e4e7ec;
  --paper: #f4f6f8;
  --card: #ffffff;
  --brand: #4e84f7;
  --brand-ink: #2d5fd0;
  --ok: #16875d;
  --warn: #b45309;
  --bad: #c23b3b;
  --side: #11151c;
  --side-text: #c8ced8;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.5 "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }

.app { display: flex; min-height: 100vh; }
.side {
  width: 220px;
  background: var(--side);
  color: var(--side-text);
  padding: 22px 16px;
  flex-shrink: 0;
}
.brand {
  display: block;
  color: #fff;
  font-weight: 650;
  letter-spacing: 0.04em;
  font-size: 15px;
  margin: 0 8px 28px;
  text-decoration: none;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: #8b93a1;
  font-weight: 400;
  letter-spacing: 0.12em;
  font-size: 10px;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  color: var(--side-text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}
.nav a:hover, .nav a.active { background: #1c2330; color: #fff; text-decoration: none; }
.nav a.active { box-shadow: inset 2px 0 0 var(--brand); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.top h1 { margin: 0; font-size: 15px; font-weight: 600; }
.who { color: var(--muted); display: flex; gap: 12px; align-items: center; }
.who button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}
.content { padding: 24px; }

.flash, .err {
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.flash { background: #e8f7ef; color: var(--ok); }
.err { background: #fdecec; color: var(--bad); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat b { display: block; font-size: 28px; letter-spacing: -0.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-h {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.card-h h2 { margin: 0; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input, .filters select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  min-width: 0;
}
.filters button, .btn {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.warn { background: #b45309; }
.btn.bad { background: var(--bad); }
.btn.sm { padding: 3px 8px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 36px; text-align: center; color: var(--muted); }

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2f6;
  color: #3f4a5a;
}
.pill.ok { background: #e8f7ef; color: var(--ok); }
.pill.warn { background: #fff4e5; color: var(--warn); }
.pill.bad { background: #fdecec; color: var(--bad); }
.pill.brand { background: #eaf1fe; color: var(--brand-ink); }

.pager { display: flex; justify-content: space-between; padding: 12px 16px; color: var(--muted); font-size: 13px; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; padding: 18px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 18px; }
.mono { font-variant-numeric: tabular-nums; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(78,132,247,.18), transparent 50%),
    var(--paper);
}
.login {
  width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
}
.login h1 { margin: 0 0 6px; font-size: 22px; }
.login p { margin: 0 0 22px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--muted); }
.field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.login button { width: 100%; padding: 10px; }

.form { padding: 18px; max-width: 520px; }
.form .hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form .field label { font-size: 12px; color: var(--muted); }
.form .field input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
.form-actions { display: flex; gap: 8px; }

@media (max-width: 960px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .side { width: 180px; }
  .content { overflow-x: auto; }
}
