* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #13151f;
  border-bottom: 1px solid #2a2d3a;
  padding: 0 20px;
  height: 52px;
  flex-shrink: 0;
  z-index: 100;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #378ADD;
}

.app-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

/* ── Tabs ── */
.tab-bar {
  display: flex;
  gap: 6px;
}

.tab-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #2a2d3a;
  border-radius: 6px;
  background: #1a1d27;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  border-color: #378ADD;
  color: #c0c0c0;
}

.tab-btn.active {
  background: #378ADD;
  color: #fff;
  border-color: #378ADD;
}

/* ── Body ── */
.app-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-content {
  display: none;
  height: 100%;
  flex-direction: row;
}

.tab-content.active {
  display: flex;
}

/* ── Sidebar ── */
.sidebar {
  width: 320px;
  min-width: 320px;
  background: #1a1d27;
  border-right: 1px solid #2a2d3a;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.section {
  padding: 14px 16px;
  border-bottom: 1px solid #2a2d3a;
}

.step-title {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #378ADD;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
  flex-shrink: 0;
}

.btn-group { display: flex; gap: 6px; }

.btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid #3a3d4a;
  border-radius: 6px;
  background: #252833;
  color: #c0c0c0;
  cursor: pointer;
}

.btn.active {
  background: #378ADD;
  color: #fff;
  border-color: #378ADD;
}

.upload-box {
  border: 1px dashed #3a3d4a;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: #888;
  margin-top: 8px;
  cursor: pointer;
}

.upload-box:hover { border-color: #378ADD; color: #378ADD; }

.area-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #2d5a1b;
  background: #1a2e10;
}

.area-display.over { border-color: #8B2020; background: #2e1010; }
.area-value { font-size: 13px; font-weight: 500; color: #7acc50; }
.area-value.over { color: #e05050; }
.area-limit { font-size: 11px; color: #5a8a3a; }
.area-limit.over { color: #e05050; }

.error-msg {
  margin-top: 8px;
  padding: 8px 10px;
  background: #2e1010;
  border: 1px solid #8B2020;
  border-radius: 6px;
  font-size: 11px;
  color: #e05050;
  line-height: 1.5;
}

.loading-text { font-size: 12px; color: #888; }

.dataset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #2a2d3a;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  background: #252833;
}

.dataset-item:hover { border-color: #378ADD; }
.dataset-item.selected { border-color: #378ADD; background: #1a2d42; }

.dataset-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #378ADD;
  flex-shrink: 0;
}

.dataset-dot.gray { background: #555; }
.dataset-name { font-size: 12px; color: #e0e0e0; flex: 1; }
.dataset-year { font-size: 11px; color: #888; margin-left: auto; }

.crs-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid #3a3d4a;
  border-radius: 6px;
  background: #252833;
  color: #e0e0e0;
}

.crs-input:focus { outline: none; border-color: #378ADD; }

.point-stats { display: flex; gap: 6px; margin-bottom: 10px; }

.stat-box {
  flex: 1;
  background: #252833;
  border: 1px solid #2a2d3a;
  border-radius: 6px;
  padding: 8px;
}

.stat-label { font-size: 10px; color: #888; margin-bottom: 2px; }
.stat-value { font-size: 12px; font-weight: 500; color: #e0e0e0; }
.slider-label { font-size: 11px; color: #888; }

input[type="range"] {
  flex: 1;
  accent-color: #378ADD;
}

.slider-desc { font-size: 11px; color: #888; margin-top: 6px; }
.class-desc { font-size: 11px; color: #888; margin-bottom: 10px; line-height: 1.5; }

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #e0e0e0;
  margin-bottom: 6px;
  cursor: pointer;
}

.check-item input[type="checkbox"] { accent-color: #378ADD; }
.check-count { font-size: 11px; color: #888; margin-left: auto; }

.warning-box {
  background: #2a1f0a;
  border: 1px solid #7a5a1a;
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
}

.warning-title { font-size: 11px; font-weight: 600; color: #d4a030; margin-bottom: 4px; }
.warning-text { font-size: 10px; color: #b08030; line-height: 1.5; }

.submit-btn {
  margin: 14px 16px 16px;
  padding: 12px;
  background: #378ADD;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.submit-btn:hover { background: #2a6db0; }

.order-status { padding: 14px 16px; }
.status-text { font-size: 12px; color: #888; margin-bottom: 8px; }

.progress-bar {
  height: 4px;
  background: #2a2d3a;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #378ADD;
  width: 0%;
  transition: width 0.3s;
}

/* ── Map ── */
.map-wrapper { flex: 1; position: relative; }
#dem-map, #lx-map { width: 100%; height: 100%; }

.basemap-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
  background: #1a1d27;
  border: 1px solid #2a2d3a;
  border-radius: 6px;
  padding: 4px;
  z-index: 1000;
}

.basemap-btn {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  color: #888;
  border: none;
  background: transparent;
}

.basemap-btn.active { background: #378ADD; color: #fff; }

.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1000;
}

.map-btn {
  background: #1a1d27;
  border: 1px solid #2a2d3a;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 11px;
  color: #c0c0c0;
  cursor: pointer;
  white-space: nowrap;
}

.map-btn.active { background: #378ADD; color: #fff; border-color: #378ADD; }

.draw-tools {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 1000;
}

.draw-btn {
  background: #1a1d27;
  border: 1px solid #2a2d3a;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 11px;
  color: #c0c0c0;
  cursor: pointer;
}

.draw-btn:hover { border-color: #378ADD; color: #378ADD; }

/* ── Added: required tag + field hints ── */
.required-tag {
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #3a2418;
  border: 1px solid #7a4a1a;
  color: #d4a030;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.field-hint {
  font-size: 11px;
  color: #888;
  margin-top: 6px;
  line-height: 1.45;
}
