:root {
  --forest-900: #0f2617;
  --forest-800: #123521;
  --forest-700: #1d5b35;
  --forest-500: #2b8a4b;
  --forest-200: #d9eddc;
  --bg-soft: #f4f8f4;
  --panel-text: #ecf5ee;
  --muted: #a8c2af;
  --warn: #f5d66d;
  --accent-blue: #72b6ff;
  --accent-red: #ff8a7a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #1d1d1d;
  background: var(--bg-soft);
}

.layout {
  height: 100vh;
  display: grid;
  grid-template-columns: 380px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--forest-900), var(--forest-800));
  color: var(--panel-text);
  padding: 1rem;
  overflow-y: auto;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
}

h2 {
  margin-top: 0;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0.25rem 0 0.9rem;
  color: var(--muted);
}

.warning {
  border: 1px solid #a8871f;
  background: rgba(245, 214, 109, 0.15);
  color: #fff1bc;
  border-radius: 8px;
  padding: 0.65rem;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
}

.panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.9rem;
}

.stats-grid,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.stats-grid div,
.insight-card {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

.stats-grid span,
.insight-card span {
  font-size: 0.75rem;
  color: var(--muted);
}

.stats-grid strong,
.insight-card strong {
  margin-top: 0.2rem;
  font-size: 1.1rem;
  color: #fff;
}

.insight-card small {
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.controls label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.controls input[type="range"] {
  width: 100%;
  margin-top: 0.3rem;
}

.controls input[type="text"],
.controls input[type="number"],
.controls select {
  margin-top: 0.3rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.45rem;
  background: rgba(0, 0, 0, 0.2);
  color: var(--panel-text);
}

.controls input::placeholder {
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.button-row.single {
  grid-template-columns: 1fr;
}

.latlon-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.latlon-row label {
  margin-bottom: 0;
}

.latlon-row input {
  margin-top: 0.3rem;
}

.latlon-row input::placeholder {
  color: var(--muted);
}

button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #1f6e3b;
  color: #fff;
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
}

button:hover {
  background: var(--forest-500);
}

.meta {
  margin: 0.35rem 0 0;
  font-size: 0.83rem;
  color: var(--muted);
}

.compact-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--panel-text);
}

.compact-list li {
  margin-bottom: 0.45rem;
}

.secondary-line {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.batch-actions {
  margin-top: 0.35rem;
}

.batch-bikes {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.compact-list details > summary {
  cursor: pointer;
  list-style: none;
}

.compact-list details > summary::-webkit-details-marker {
  display: none;
}

.recommend-btn,
.history-jump-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  margin-right: 0.35rem;
}

.bike-id-chip {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bike-id-chip-btn {
  cursor: pointer;
}

.bike-id-chip-btn:hover {
  background: rgba(114, 182, 255, 0.22);
  border-color: rgba(114, 182, 255, 0.8);
}

.chart-wrap {
  position: relative;
  height: 190px;
  margin-top: 0.75rem;
}

.chart-wrap:first-of-type {
  margin-top: 0.5rem;
}

main {
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  background: #dbe7e0;
}

.user-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    max-height: 52vh;
  }
}
