:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --border: #e3e6ea;
  --text: #1a1d21;
  --muted: #6b7280;
  --accent: #3ecf8e;
  --accent-2: #2fae76;
  --red: #e05a5a;
  --amber: #d9a441;
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px 80px; }
header.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
header.top h1 { font-size: 20px; font-weight: 600; margin: 0; }
header.top .sub { color: var(--muted); font-size: 13px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
h2.section { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.input, select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}
.input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  cursor: pointer; border: none; border-radius: 12px;
  padding: 10px 16px; font-size: 14px; font-weight: 500;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--panel-2); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: transparent; color: var(--red); }
.btn-danger:hover { text-decoration: underline; }
.search-box { position: relative; }
.search-hits {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  max-height: 320px; overflow: auto; z-index: 10;
}
.hit {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.hit:last-child { border-bottom: none; }
.hit .meta { color: var(--muted); font-size: 12px; }
.match-card { margin-top: 14px; }
.match-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.match-head h3 { margin: 0; font-size: 16px; }
.match-head .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; background: var(--panel-2); color: var(--muted);
}
.badge.accent { background: rgba(62,207,142,.15); color: var(--accent-2); }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px; margin: 14px 0; }
.stat { background: var(--panel-2); border-radius: 12px; padding: 12px 14px; }
.stat .v { font-size: 18px; font-weight: 600; }
.stat .k { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; padding-bottom: 6px; }
td { padding: 7px 0; border-top: 1px solid var(--border); }
td.num, th.num { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.toggle-link { color: var(--accent-2); cursor: pointer; font-size: 13px; }
.toggle-link:hover { text-decoration: underline; }
svg.curve { width: 100%; height: auto; }
.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.login-wrap { max-width: 360px; margin: 14vh auto; }
.login-wrap h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-wrap .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.err { color: var(--red); font-size: 13px; margin-top: 8px; }
.ok { color: var(--accent-2); font-size: 13px; margin-top: 8px; }
