:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1f2430; --muted: #6b7280;
  --line: #e5e7eb; --brand: #2563eb; --brand-d: #1d4ed8;
  --good: #16a34a; --warn: #d97706; --bad: #dc2626; --chip: #eef2ff;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topnav { display: flex; gap: 18px; align-items: center; background: #111827;
  padding: 0 20px; height: 52px; }
.topnav a { color: #d1d5db; font-weight: 500; }
.topnav a:hover { color: #fff; text-decoration: none; }
.topnav .brand { color: #fff; font-weight: 700; font-size: 16px; }
.topnav .right { margin-left: auto; }

.container { max-width: 1080px; margin: 24px auto; padding: 0 20px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.sub { color: var(--muted); margin: 0 0 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; } }

.btn { display: inline-block; background: var(--brand); color: #fff; border: none;
  padding: 8px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn:hover { background: var(--brand-d); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f3f4f6; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: var(--bad); }
.btn.warn { background: var(--warn); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 13px; }
input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; font-family: inherit; background: #fff; }
textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafbfc; }

.chip { display: inline-block; background: var(--chip); color: var(--brand-d);
  padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.chip.good { background: #dcfce7; color: var(--good); }
.chip.warn { background: #fef3c7; color: var(--warn); }
.chip.bad { background: #fee2e2; color: var(--bad); }
.chip.gray { background: #f3f4f6; color: var(--muted); }

.copy-box { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px;
  white-space: pre-wrap; font-size: 13px; line-height: 1.6; max-height: 340px; overflow: auto; }
.stat { text-align: center; }
.stat .num { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat .lbl { color: var(--muted); font-size: 13px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; }
.flash.err { background: #fee2e2; color: var(--bad); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
