:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-2: #0369a1;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --sidebar: #0b1c24;
  --sidebar-ink: #d7e6ea;
  --radius: 14px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(180deg, #e8eef5 0%, var(--bg) 220px),
    var(--bg);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 12px;
}
.brand .mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #2dd4bf, #0284c7);
  color: #042f2e; font-weight: 800;
  display: grid; place-items: center;
}
.brand strong { display: block; font-size: 14px; }
.brand span { font-size: 11px; opacity: .7; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px; border-radius: 10px;
  color: #9fb4bc; font-size: 14px;
}
.nav a.active, .nav a:hover {
  background: rgba(45,212,191,.12);
  color: #ecfeff;
}
.main { padding: 28px 32px 48px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.topbar h1 { font-size: 24px; letter-spacing: -.3px; }
.topbar .user { color: var(--muted); font-size: 14px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.card h2, .card h3 { font-size: 15px; margin-bottom: 12px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 750; margin-top: 8px; letter-spacing: -.5px; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

.btn {
  height: 42px; padding: 0 16px; border-radius: 10px; border: 0;
  background: var(--brand); color: white; font-weight: 600; cursor: pointer;
}
.btn.secondary { background: #e2e8f0; color: var(--ink); }
.btn.block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select {
  height: 44px; border-radius: 10px; border: 1px solid var(--line);
  padding: 0 12px; background: #fff;
}

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; color: var(--muted); font-weight: 600;
  padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.table td { padding: 14px 8px; border-bottom: 1px solid var(--line); }
.pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; background: #ecfeff; color: var(--brand);
}
.pill.warn { background: #fffbeb; color: var(--warn); }
.pill.ok { background: #ecfdf5; color: var(--ok); }

.chart {
  height: 240px; border-radius: 12px; border: 1px solid var(--line);
  background:
    linear-gradient(#f8fafc, #f8fafc),
    repeating-linear-gradient(0deg, transparent, transparent 39px, #eef2f7 39px, #eef2f7 40px);
  position: relative; overflow: hidden;
}
.chart svg { width: 100%; height: 100%; }

.log {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; line-height: 1.6;
  background: #0b1220; color: #9fb4d9;
  border-radius: 12px; padding: 14px; min-height: 280px; max-height: 420px; overflow: auto;
}
.log .rx { color: #2dd4bf; }
.log .tx { color: #38bdf8; }

.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(15,118,110,.18), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(3,105,161,.16), transparent 30%),
    #eef3f8;
}
.auth-card {
  width: 420px; background: white; border: 1px solid var(--line);
  border-radius: 18px; padding: 28px; box-shadow: 0 20px 50px rgba(15,23,42,.08);
}
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { height: 40px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px; background: #fff; }

.page-note { text-align: center; color: #94a3b8; font-size: 12px; padding: 20px; }
.page-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding-bottom: 40px; }
.page-links a {
  font-size: 12px; color: var(--brand-2); border: 1px solid #bae6fd;
  padding: 6px 10px; border-radius: 999px; background: #f0f9ff;
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .grid-3 { grid-template-columns: 1fr; }
}
