:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d0d5dd;
  --accent: #0f766e;
  --accent-strong: #115e59;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

h1 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  width: 100%;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

select,
input,
button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
  background: #fff;
}

button {
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

button:hover {
  background: var(--accent-strong);
}

.logout-form { margin-left: auto; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }

.login-card {
  width: min(100%, 380px); padding: 28px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel); box-shadow: 0 8px 24px rgb(31 41 51 / 8%);
}

.login-card p { color: var(--muted); }
.login-form { display: grid; gap: 14px; }
.login-form input[type="email"], .login-form input[type="password"] { width: 100%; }
.remember { display: flex; align-items: center; gap: 8px; }
.remember input { height: auto; }
.login-error { color: #b42318 !important; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  height: calc(100vh - 65px);
}

.map-panel,
#map {
  min-height: 420px;
  height: 100%;
}

.side-panel {
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.stats div {
  min-height: 76px;
  padding: 12px;
  background: var(--panel);
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 6px 0 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.timeline li {
  padding: 10px 14px;
  border-bottom: 1px solid #eef0f3;
  cursor: pointer;
  font-size: 14px;
}

.timeline li:hover {
  background: #eef8f6;
}

@media (max-width: 860px) {
  .topbar {
    display: block;
  }

  h1 {
    margin-bottom: 10px;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .map-panel,
  #map {
    height: 58vh;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
