* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0f1720;
  color: #e6edf3;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #16212c;
  border-bottom: 1px solid #22303c;
  flex-wrap: wrap;
  gap: 10px;
}
.app-header h1 { font-size: 20px; margin: 0; }

.tabs { display: flex; gap: 8px; }
.tab-btn {
  background: transparent;
  border: 1px solid #2a3b48;
  color: #9fb3c0;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.tab-btn.active { background: #2a72d4; color: #fff; border-color: #2a72d4; }

.tab-content { display: none; padding: 16px 20px; }
.tab-content.active { display: block; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.filters select, .filters button {
  background: #16212c;
  color: #e6edf3;
  border: 1px solid #2a3b48;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
#btn-add-station { background: #2a72d4; border-color: #2a72d4; }

.map-container {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 320px;
  background: #16212c;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #22303c;
}
.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: #9fb3c0;
  font-size: 14px;
}
.map-placeholder code { color: #ffb454; }

.station-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.station-card {
  background: #16212c;
  border: 1px solid #22303c;
  border-radius: 10px;
  padding: 12px;
}
.station-card h3 { margin: 0 0 4px; font-size: 15px; }
.station-card .meta { font-size: 12px; color: #9fb3c0; margin-bottom: 8px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.status-green { background: #34c759; }
.status-red { background: #ff453a; }
.status-yellow { background: #ffcc00; }
.status-grey { background: #6b7885; }

.station-card button {
  background: #2a72d4;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.leaderboard-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.lb-period {
  background: #16212c;
  color: #9fb3c0;
  border: 1px solid #2a3b48;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.lb-period.active { background: #2a72d4; color: #fff; border-color: #2a72d4; }

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: #16212c;
  border-radius: 10px;
  overflow: hidden;
}
.leaderboard-table th, .leaderboard-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #22303c;
  font-size: 14px;
}
.leaderboard-table th { color: #9fb3c0; font-weight: 600; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }
.modal-box {
  background: #16212c;
  border: 1px solid #2a3b48;
  border-radius: 12px;
  padding: 20px;
  width: 92%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h2 { margin-top: 0; font-size: 18px; }
.modal-subtitle { color: #9fb3c0; font-size: 13px; margin-top: -8px; }
.modal-box label { display: block; margin: 12px 0 6px; font-size: 13px; color: #9fb3c0; }
.modal-box input[type=text], .modal-box input[type=number], .modal-box input[type=file] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a3b48;
  background: #0f1720;
  color: #e6edf3;
  font-size: 14px;
}
.coord-row { display: flex; gap: 6px; }
.coord-row input { flex: 1; }

.btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-group button {
  background: #0f1720;
  border: 1px solid #2a3b48;
  color: #e6edf3;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.btn-group button.selected { background: #2a72d4; border-color: #2a72d4; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-primary { background: #2a72d4; color: #fff; border: none; padding: 10px 16px; border-radius: 8px; cursor: pointer; }
.btn-secondary { background: transparent; color: #9fb3c0; border: 1px solid #2a3b48; padding: 10px 16px; border-radius: 8px; cursor: pointer; }

.error-text { color: #ff6961; font-size: 13px; min-height: 18px; }
