/* 后台：中性灰阶 + 单一强调色，表格密度优先 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e6e8ee;
  --text: #171a1f;
  --muted: #6b7280;
  --accent: #2f6df6;
  --accent-soft: #eaf0fe;
  --ok: #0f8a4d;
  --ok-soft: #e6f6ee;
  --warn: #a8630a;
  --warn-soft: #fdf3e3;
  --danger: #c0392b;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 208px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; margin-bottom: 24px; padding: 0 6px; }
.brand img { width: 26px; height: 26px; border-radius: 8px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }

.nav-group { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 18px 6px 8px; }

.nav-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  color: #33383f;
  font-weight: 500;
}
.nav-link:hover { background: #f1f3f7; text-decoration: none; }
.nav-link[aria-current='page'] { background: var(--accent-soft); color: var(--accent); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.main-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h1 { font-size: 20px; font-weight: 700; }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card h2 { font-size: 14px; margin-bottom: 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
tbody tr:hover { background: #fafbfd; }
td code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

.tag { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.tag.paid { background: var(--ok-soft); color: var(--ok); }
.tag.pending { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.muted { background: #f1f3f7; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: #f4f6fa; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

.form-row { margin-bottom: 14px; }
label.field { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 5px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

input[type='text'], input[type='password'], input[type='search'], select, textarea {
  width: 100%;
  border: 1px solid #d6dae2;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 68px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; align-items: center; }
.toolbar input[type='search'] { width: 240px; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: 12.5px; }

.banner { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.err { background: #fdecea; color: var(--danger); }
.banner.warn { background: #fff8e1; color: #8a6100; }

.empty { text-align: center; color: var(--muted); padding: 36px 10px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login-card h1 { font-size: 18px; margin-bottom: 6px; }
.login-card p.sub { margin-bottom: 20px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 18px 16px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .toolbar input[type='search'] { width: 100%; }
  table { font-size: 12.5px; }
  .hide-sm { display: none; }
}
