:root {
  --ink: #14212b;
  --muted: #63717d;
  --line: #d8dee3;
  --surface: #ffffff;
  --page: #f3f5f6;
  --accent: #0f766e;
  --accent-soft: #e8f3f1;
  --gold: #9b7416;
  --danger: #a52a2a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border-left: 5px solid #c9a94f;
  font-family: Georgia, serif;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.security-note { color: var(--accent); font-size: 12px; font-weight: 600; }

main { width: min(1420px, calc(100% - 40px)); margin: 28px auto 56px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 28px; }
h2 { margin: 0; font-size: 16px; }
.subtle { margin: 0; color: var(--muted); }

.access-panel {
  width: min(620px, 100%);
  margin: 90px auto;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.access-panel > p:not(.eyebrow) { color: var(--muted); line-height: 1.8; }
.access-panel label { display: block; margin-bottom: 8px; font-weight: 600; }
.access-row { display: grid; grid-template-columns: 1fr 140px; }
.access-row input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-right: 0;
  outline: 0;
}
.access-row input:focus { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.access-row button, .actions button, .pagination button {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.form-error { min-height: 20px; margin: 10px 0 0; color: var(--danger) !important; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.actions { display: flex; gap: 8px; }
.button-secondary {
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
}
.button-secondary:hover { border-color: var(--accent) !important; color: var(--accent) !important; }
.button-secondary.danger:hover { border-color: var(--danger) !important; color: var(--danger) !important; }
.status-line { min-height: 22px; margin: 12px 0 8px; color: var(--muted); }
.status-line.error { color: var(--danger); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.kpi {
  min-height: 112px;
  padding: 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong { display: block; margin: 10px 0 6px; font-size: 26px; }
.kpi small { color: var(--accent); }

.two-column { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.panel-head { min-height: 32px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.trend-chart { min-height: 220px; margin-top: 18px; display: flex; align-items: flex-end; gap: 8px; }
.trend-day { flex: 1; min-width: 20px; text-align: center; }
.trend-bars { height: 150px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.bar { width: 9px; min-height: 2px; background: var(--accent); }
.bar.applications { background: #a9b5bd; }
.trend-day strong { display: block; margin-top: 7px; font-size: 10px; }
.trend-day small { color: var(--muted); font-size: 9px; }

.funnel { margin-top: 18px; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr 52px; align-items: center; gap: 12px; margin: 12px 0; }
.funnel-track { height: 10px; background: #edf0f2; }
.funnel-value { height: 10px; background: var(--accent); }
.funnel-row strong { text-align: right; }

.rank-list { margin-top: 14px; }
.rank-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 11px 0; border-top: 1px solid #edf0f2; }
.rank-index { color: var(--gold); font-weight: 700; }
.rank-item small { color: var(--muted); }

.user-panel { margin-top: 0; padding: 0; }
.user-panel .panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.pagination { display: flex; align-items: center; gap: 10px; }
.pagination button { min-height: 32px; padding: 0 12px; }
.pagination button:disabled { cursor: not-allowed; opacity: .45; }
.pagination span { margin: 0; color: var(--ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1040px; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #e8ecef; white-space: nowrap; }
th { color: var(--muted); background: #f8f9fa; font-size: 11px; font-weight: 600; }
td { font-size: 12px; }
.member { display: inline-block; padding: 3px 7px; border: 1px solid var(--line); font-size: 10px; font-weight: 700; }
.member.SVIP { color: var(--gold); border-color: #d4bc7d; }
.member.VIP { color: var(--accent); border-color: #8ac0ba; }
.yes { color: var(--accent); font-weight: 600; }
.no { color: var(--muted); }

footer { padding: 24px; color: var(--muted); text-align: center; font-size: 11px; }

@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .security-note { display: none; }
  main { width: calc(100% - 24px); margin-top: 18px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .page-head { align-items: stretch; flex-direction: column; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
}

@media (max-width: 560px) {
  .access-panel { margin-top: 24px; padding: 22px; }
  .access-row { grid-template-columns: 1fr; gap: 8px; }
  .access-row input { border-right: 1px solid var(--line); }
  .kpi-grid { grid-template-columns: 1fr; }
  .trend-chart { gap: 3px; }
  .bar { width: 6px; }
}
