* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #10241c;
  --muted: #6a7a70;
  --line: #dce6df;
  --bg: #eef3ee;
  --card: #fff;
  --green: #176a38;
  --teal: #0e9f8f;
  --red: #d9363f;
  --shadow: 0 12px 32px rgba(14, 46, 32, .1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-width: 1100px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.admin-app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex: none;
  background: #0a2b1f;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}
.side-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 28px; }
.side-brand .mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #1d9c56, #0e9f8f); font-weight: 800; font-size: 18px;
}
.side-brand .txt { display: flex; flex-direction: column; line-height: 1.25; }
.side-brand strong { font-size: 15px; }
.side-brand em { font-style: normal; font-size: 11px; color: rgba(255,255,255,.55); }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-link {
  text-align: left; border: 0; background: transparent; color: rgba(255,255,255,.78);
  padding: 11px 12px; border-radius: 10px; font-size: 14px;
}
.side-link:hover, .side-link.active { background: rgba(255,255,255,.12); color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-user, .side-logout {
  border: 0; background: rgba(255,255,255,.08); color: #fff;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; text-align: left;
}
.side-logout { background: rgba(217,54,63,.18); }

.admin-main { flex: 1; padding: 28px 36px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.topbar h1 { font-size: 28px; }
.topbar p, .top-meta { color: var(--muted); font-size: 13px; }

[hidden] { display: none !important; }
.login-wrap { min-height: 62vh; display: grid; place-items: center; }
.login-card {
  width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 36px 32px; box-shadow: var(--shadow);
}
.login-mark {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #1d9c56, #0e9f8f); color: #fff; font-weight: 800; font-size: 22px;
  margin-bottom: 16px;
}
.login-card h2 { font-size: 22px; margin-bottom: 8px; }
.login-card p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-card label { display: block; font-size: 13px; margin-bottom: 6px; }
.login-card input {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; margin-bottom: 16px; font-size: 15px;
}

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card .num { font-size: 32px; font-weight: 800; color: var(--green); }
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card.accent { background: linear-gradient(135deg, #176a38, #0e9f8f); border: 0; }
.stat-card.accent .num, .stat-card.accent .label { color: #fff; }
.hint-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.hint-card h3 { margin-bottom: 10px; font-size: 16px; }
.hint-card li { color: var(--muted); font-size: 14px; margin: 6px 0 6px 18px; }
.block-title { margin: 28px 0 14px; font-size: 18px; }
.visit-list { display: flex; flex-direction: column; gap: 14px; }
.empty-tip { background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 36px; text-align: center; color: var(--muted); }
.visit-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 16px;
  box-shadow: 0 6px 18px rgba(14, 46, 32, .05);
}
.who { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar {
  width: 48px; height: 48px; border-radius: 14px; background: #14532d; color: #fff;
  display: grid; place-items: center; font-size: 20px; font-weight: 800; flex: none;
}
.who-main { flex: 1; min-width: 0; }
.who .name { font-size: 22px; font-weight: 800; line-height: 1.2; }
.who .phone { margin-top: 4px; font-size: 16px; color: #14532d; font-weight: 700; letter-spacing: .4px; }
.pay {
  flex: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.pay.unpaid { background: #fdeaea; color: #d9363f; }
.pay.paid { background: #e2f5e9; color: #176a38; }
.pay.free { background: #eef3ee; color: #5b6b62; }
.facts {
  display: grid; grid-template-columns: 1.1fr 1.4fr .9fr .8fr; gap: 12px 16px;
  background: #f7faf7; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.facts dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.facts dd { font-size: 15px; font-weight: 700; }
.facts dd small { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--muted); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; color: #375043;
}
.chip.active { background: #176a38; color: #fff; border-color: #176a38; }
.search-input {
  margin-left: auto; width: 320px; height: 38px; border: 1px solid var(--line);
  border-radius: 10px; padding: 0 12px;
}
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: #f8faf8;
}
.card-head span { font-size: 12px; color: #9ca3af; }
.table-wrap { overflow: auto; max-height: 68vh; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 980px; }
th { text-align: left; background: #f2f6f1; color: #5b6b62; padding: 12px 14px; font-size: 12.5px; }
td { padding: 12px 14px; border-bottom: 1px solid #f1f4f0; vertical-align: middle; }
tbody tr:hover td { background: #f6fbf7; }
.code-cell { font-family: "Courier New", monospace; font-weight: 700; color: #14532d; }
.ops { white-space: nowrap; }
.ops .btn { margin-right: 6px; }
.empty-row td { text-align: center; color: var(--muted); padding: 42px 0; }
.muted-cell { color: #9ca3af; font-size: 12.5px; }
td small { color: #9ca3af; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600;
}
.btn-primary { background: linear-gradient(135deg, #1d9c56, #0e9f8f); color: #fff; }
.btn-outline { background: #fff; color: var(--green); border: 1px solid #9bd6af; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f0b9bd; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.status {
  display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.status.confirmed { background: #e2f5e9; color: #176a38; }
.status.used { background: #d7f4ef; color: #0e9f8f; }
.status.cancelled { background: #f1f5f2; color: #6a7a70; }
.status.expired { background: #fdeaea; color: #d9363f; }

.toast-box { position: fixed; right: 24px; top: 24px; z-index: 40; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #10241c; color: #fff; padding: 10px 14px; border-radius: 10px;
  opacity: 0; transform: translateY(-6px); transition: .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { background: #176a38; }
.toast-error { background: #d9363f; }
