/* ---------------- Reset léger ---------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: #f5f6f8; color: #111; font-size: 14px; }

/* ---------------- Top bar ---------------- */
.topbar {
  height: 50px;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.brand strong { font-size: 16px; letter-spacing: 0.5px; }
.brand .muted { margin-left: 8px; color: #94a3b8; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #1e293b;
  color: #cbd5e1;
}

/* ---------------- Layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - 50px);
  position: relative;
}
.sidebar {
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 16px;
  overflow-y: auto;
}
.sidebar h2 { font-size: 14px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 1px; color: #475569; }
.sidebar h3 { font-size: 13px; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: 1px; color: #475569; display: flex; align-items: center; gap: 8px; }
.sidebar label { display: block; margin: 12px 0; font-size: 13px; color: #334155; }
.sidebar select, .sidebar input[type="range"] {
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}
.sidebar fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 12px 0;
}
.sidebar fieldset legend { font-size: 12px; color: #64748b; padding: 0 6px; }
.sidebar fieldset label { margin: 6px 0; font-size: 13px; }
.checkbox-inline { display: flex; align-items: center; gap: 8px; }

button.primary {
  width: 100%;
  background: #4f46e5;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}
button.primary:hover { background: #4338ca; }
button.primary:disabled { background: #94a3b8; cursor: not-allowed; }

.muted { color: #94a3b8; font-size: 12px; }

/* ---------------- Map ---------------- */
#map {
  height: 100%;
  width: 100%;
}

/* ---------------- Result list ---------------- */
#results-list { margin-top: 8px; }
.result-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #4f46e5;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}
.result-card:hover { background: #eef2ff; }
.result-card .nom { font-weight: 600; font-size: 13px; color: #0f172a; }
.result-card .info { font-size: 11px; color: #64748b; margin-top: 2px; }
.result-card .score {
  float: right;
  background: #4f46e5;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}
.result-card .score.low { background: #94a3b8; }
.result-card .score.mid { background: #f59e0b; }
.result-card .score.high { background: #dc2626; }

/* ---------------- Detail panel ---------------- */
.detail {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  padding: 20px;
  overflow-y: auto;
  box-shadow: -4px 0 12px rgba(0,0,0,0.06);
  z-index: 1000;
}
.detail.hidden { display: none; }
.detail .close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
}
.detail h2 { font-size: 16px; margin: 0 0 6px; }
.detail .sub { font-size: 12px; color: #64748b; margin-bottom: 14px; }
.detail .section { margin-bottom: 14px; }
.detail .section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  margin: 0 0 6px;
}
.detail .field { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; border-bottom: 1px dashed #f1f5f9; }
.detail .field .key { color: #64748b; }
.detail .field .val { color: #0f172a; font-weight: 500; text-align: right; }
.detail .signaux { margin: 0; padding-left: 18px; font-size: 13px; }
.detail .signaux li { margin: 3px 0; color: #475569; }

.detail textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px;
  font-size: 13px;
  font-family: inherit;
}
.detail .note-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.detail .fav-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.detail .fav-btn.active { background: #fef3c7; border-color: #f59e0b; }

.score-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.score-pill.low { background: #94a3b8; }
.score-pill.mid { background: #f59e0b; }
.score-pill.high { background: #dc2626; }
