:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #16202a; --muted: #5d6b78; --line: #dde2e7;
  --accent: #0f6cbd; --danger: #c4314b; --ok: #1f8a4c; --warn: #b7791f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161c; --card: #1a2129; --text: #e6ebf0; --muted: #94a3b2; --line: #2b3540;
    --accent: #4ea1f3; --danger: #f06a80; --ok: #4cc27f; --warn: #e2b04a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
h1 { font-size: 17px; margin: 0; } h1 span { color: var(--muted); font-weight: 400; margin-left: 6px; }
h2 { font-size: 16px; margin: 0 0 4px; } h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 6px; }
.muted { color: var(--muted); } .error { color: var(--danger); }
.card { max-width: 420px; margin: 48px auto; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
form { display: flex; gap: 8px; } .stack { flex-direction: column; } .row { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea, button { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); }
input[type=number] { width: 90px; } textarea { width: 100%; resize: vertical; }
button { background: var(--accent); color: #fff; border: 0; cursor: pointer; } button.link { background: none; color: var(--accent); padding: 0; margin-top: 16px; }
button.small { padding: 3px 8px; font-size: 12px; }
#app { display: grid; grid-template-columns: 1fr 380px; height: calc(100vh - 49px); }
#map { min-height: 300px; }
aside { overflow-y: auto; padding: 12px 16px 24px; background: var(--card); border-left: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stats div { background: var(--bg); border-radius: 8px; padding: 8px; text-align: center; }
.stats b { display: block; font-size: 20px; } .stats small { color: var(--muted); font-size: 11px; }
.list { list-style: none; margin: 0; padding: 0; } .list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; } th, td { text-align: left; padding: 4px 3px; border-bottom: 1px solid var(--line); }
.tag { display: inline-block; padding: 0 6px; border-radius: 10px; font-size: 11px; background: var(--bg); }
.tag.jam, .tag.sos, .tag.disaster { color: var(--danger); } .tag.pending_approval { color: var(--warn); }
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; height: auto; } #map { height: 55vh; }
  aside { border-left: 0; border-top: 1px solid var(--line); }
  header { padding: 10px 16px; }
}
