:root {
  --bg: #f1f5f9;
  --sider: #0f172a;
  --primary: #2563eb;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --card: #fff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.badge {
  position: fixed; top: 10px; right: 12px; z-index: 20;
  background: rgba(15,23,42,.7); color: #fff; font-size: 11px;
  padding: 4px 8px; border-radius: 999px;
}
.sider {
  width: 220px; background: var(--sider); color: #cbd5e1;
  display: flex; flex-direction: column; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-weight: 700; padding: 8px 10px 18px;
}
.logo .dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(from 180deg, #60a5fa, #fb923c, #34d399, #60a5fa);
}
#menu a {
  display: block; padding: 10px 12px; border-radius: 10px;
  margin-bottom: 4px; color: #94a3b8; font-size: 14px;
}
#menu a:hover, #menu a.on { background: rgba(37,99,235,.25); color: #fff; }
.sider-foot { margin-top: auto; padding: 12px; font-size: 12px; }
.sider-foot a { display: block; color: #64748b; margin-top: 8px; }
.main { flex: 1; padding: 18px 22px 28px; min-width: 0; }
.top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.top h1 { font-size: 22px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.top-right { display: flex; gap: 8px; align-items: center; }
.role-tag {
  background: #dbeafe; color: #1d4ed8; padding: 6px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
#btn-switch-role, .btn {
  border: none; background: var(--primary); color: #fff;
  border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px;
}
.btn.ghost { background: #e2e8f0; color: #334155; }
.btn.danger { background: #ef4444; }
.btn.ok { background: #059669; }
.kpi {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px;
}
.kpi .card, .card {
  background: var(--card); border-radius: 14px; padding: 14px;
  box-shadow: 0 6px 18px rgba(15,23,42,.05);
}
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; color: var(--primary); }
.kpi .hint { font-size: 12px; color: #16a34a; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center;
}
.toolbar input, .toolbar select {
  height: 36px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; background: #fff; min-width: 140px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: #eff6ff; color: #2563eb;
}
.tag.warn { background: #fff7ed; color: #ea580c; }
.tag.danger { background: #fef2f2; color: #dc2626; }
.tag.ok { background: #ecfdf5; color: #059669; }
.tag.mute { background: #f1f5f9; color: #64748b; }
.list-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.list-row:last-child { border-bottom: none; }
.muted { color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: rgba(15,23,42,.9); color: #fff; padding: 10px 16px;
  border-radius: 999px; font-size: 13px; opacity: 0; transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.f input, .f select, .f textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; background: #fff;
}
.f textarea { min-height: 80px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 960px) {
  body { flex-direction: column; }
  .sider { width: 100%; height: auto; position: relative; }
  #menu { display: flex; flex-wrap: wrap; gap: 4px; }
  .kpi, .grid2, .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .kpi, .grid2, .form-grid { grid-template-columns: 1fr; }
}
