:root {
  --bg: #f3f4f6;
  --card: #fff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0d9488;
  --danger: #dc2626;
  --warn: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
a { color: #2563eb; text-decoration: none; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 10px; }
.auth-card h1 { margin: 0; font-size: 22px; }
.auth-card label { font-size: 13px; color: var(--muted); }
.auth-card input, .main input, .main select, .main textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
}
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; padding: 10px 14px; background: var(--brand); color: #fff;
  font-size: 14px; cursor: pointer;
}
.btn.secondary { background: #374151; }
.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.muted { color: var(--muted); font-size: 13px; }
.alert { background: #fef2f2; color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.ok { background: #ecfdf5; color: #047857; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #111827; color: #fff; padding: 20px 16px; }
.brand { font-weight: 700; margin-bottom: 24px; }
.brand small { display: block; font-weight: 400; color: #9ca3af; margin-top: 4px; }
.side nav { display: grid; gap: 6px; }
.side a { color: #d1d5db; padding: 10px 12px; border-radius: 8px; }
.side a.on, .side a:hover { background: #1f2937; color: #fff; }
.main { padding: 24px; }
.top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; gap: 12px; }
.top h1 { margin: 0; font-size: 22px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: end; }
.toolbar .field { display: grid; gap: 4px; min-width: 140px; }
.toolbar label { font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
th { background: #f9fafb; color: var(--muted); font-weight: 600; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #f3f4f6; }
.tag.pending { background: #fff7ed; color: #c2410c; }
.tag.active { background: #ecfdf5; color: #047857; }
.tag.disabled { background: #f3f4f6; color: #6b7280; }
.tag.expired { background: #fef2f2; color: #b91c1c; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; place-items: center; padding: 16px; }
.modal-bg.show { display: grid; }
.modal { background: #fff; border-radius: 14px; padding: 20px; width: min(420px, 100%); display: grid; gap: 10px; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
  .side nav { display: flex; flex-wrap: wrap; }
}
