:root {
  --bg: #0b0f17;
  --bg-2: #111725;
  --panel: #141b2b;
  --panel-2: #1a2336;
  --border: #243049;
  --text: #e6ebf5;
  --muted: #8a97b1;
  --accent: #6d8bff;
  --accent-2: #4f6bff;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #16203a 0%, var(--bg) 60%);
  color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.45;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 26px; border-bottom: 1px solid var(--border);
  background: rgba(10,14,22,.6); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 22px; box-shadow: 0 6px 18px rgba(79,107,255,.35);
}
.topbar h1 { margin: 0; font-size: 18px; }
.sub { margin: 0; color: var(--muted); font-size: 12.5px; }
.datenav { display: flex; align-items: center; gap: 8px; }

.btn {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
}
.btn:hover { border-color: var(--accent); }
.btn.ghost { background: transparent; }
select {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font-size: 14px; font-family: var(--mono);
}

main { max-width: 1000px; margin: 0 auto; padding: 22px 18px 10px;
  display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { main { grid-template-columns: 1.05fr .95fr; align-items: start; } }

.mapcard, .detailcard {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 16px;
}
.maphead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#map-date { font-weight: 700; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legend .bar { width: 120px; height: 10px; border-radius: 6px;
  background: linear-gradient(90deg,#2fbf71,#9acb3c,#f2c14e,#ef8a3c,#e5484d); }

.map-wrap { width: 100%; }
#map { width: 100%; height: auto; display: block; }
.clabel { fill: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 2px;
  text-anchor: middle; opacity: .6; }

.zone { cursor: pointer; }
.zbox { fill: #263149; stroke: #36456a; stroke-width: 1.5;
  transition: fill .2s, stroke .2s, transform .1s; }
.zone:hover .zbox { stroke: #fff; stroke-width: 2.5; }
.zone.active .zbox { stroke: var(--accent); stroke-width: 3; }
.zcode { fill: #fff; font-size: 17px; font-weight: 800; text-anchor: middle;
  pointer-events: none; paint-order: stroke; }
.zname { fill: rgba(255,255,255,.82); font-size: 10.5px; text-anchor: middle; pointer-events: none; }
.zprice { fill: #fff; font-size: 13px; font-weight: 700; text-anchor: middle; pointer-events: none;
  font-variant-numeric: tabular-nums; }
.zone:focus { outline: none; }
.zone:focus .zbox { stroke: var(--accent); stroke-width: 3; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 2px 2px; }

.detailhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detailhead h2 { margin: 0 0 2px; font-size: 18px; }
.stats { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; min-width: 90px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.stat-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stat-value { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }

.chart-wrap { position: relative; margin-top: 6px; }
#chart { width: 100%; height: 300px; display: block; }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, -115%);
  background: #05070d; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; white-space: nowrap; z-index: 5;
  font-variant-numeric: tabular-nums; box-shadow: 0 6px 18px rgba(0,0,0,.4);
}

.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1000px; margin: 10px auto 30px; padding: 0 18px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }

/* admin */
.admincard { background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; max-width: 720px; margin: 24px auto; }
.admincard h2 { margin-top: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin: 14px 0; }
.row .field { display: flex; flex-direction: column; gap: 5px; }
.row label { font-size: 12px; color: var(--muted); }
input[type=text], input[type=number], input[type=password] {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: var(--mono); }
.btn.danger { background: #3a1a22; border-color: #e5484d; color: #ffb4b8; }
.btn.danger:hover { background: #4a2029; }
.msg { margin: 12px 0; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.msg.ok { background: #0f2e22; color: #8bf0c2; border: 1px solid #1f6b4c; }
.msg.err { background: #3a1a22; color: #ffb4b8; border: 1px solid #7a2a32; }
.divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.adminnote { color: var(--muted); font-size: 12.5px; }
