:root {
  --bg: #ffffff;
  --panel: #f8f9fa;
  --text: #000000;
  --muted: #555555;
  --accent: #4aa3ff;
  --accent-2: #27d07d;
  --danger: #ff5c7a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* Bandeau */
.banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: white;
  color: black;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  z-index: 2000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border-bottom: 1px solid #eee;
}
.banner-text h1 { margin: 0; font-size: 18px; font-weight: 600; }
.banner-text p { margin: 4px 0 0 0; font-size: 14px; }
.banner a { color: #0066cc; text-decoration: none; }
.banner a:hover { text-decoration: underline; }
.banner-logo img { height: 40px; max-width: 140px; object-fit: contain; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 80px;
  left: 0;
  bottom: 0;
  width: 220px;
  background: white;
  color: black;
  padding: 16px;
  z-index: 1500;
  box-shadow: 2px 0 6px rgba(0,0,0,0.15);
  overflow-y: auto;
}
.sidebar h2 { margin: 0 0 12px 0; font-size: 16px; }
.legend { list-style: none; padding: 0; margin: 0 0 16px 0; }
.legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.legend-color {
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 50%;
}
.legend-color.idee { background: #4aa3ff; }     /* bleu */
.legend-color.probleme { background: #ff5c7a; } /* rouge */

/* Carte */
#map {
  position: absolute;
  top: 80px;
  left: 220px;
  right: 0;
  bottom: 0;
  background: #ffffff;
}

/* Boutons */
.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: #cccccc; color: #000000; }
#addBtn.active { background: var(--accent-2); }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.45);
  z-index: 1600;
}
.hidden { display: none; }

.modal-content {
  width: min(520px, 92vw);
  background: var(--panel);
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.modal-content h2 { margin: 0 0 12px 0; font-size: 18px; }

.row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
label { color: var(--muted); font-size: 14px; }
input[type="text"], select, textarea {
  width: 100%;
  background: #ffffff;
  color: #000000;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
}
textarea { resize: vertical; }

.actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 14px;
}
.msg {
  min-height: 1.2em;
  color: var(--danger);
  font-size: 14px;
  margin-top: 8px;
}

/* Leaflet tweaks */
.leaflet-control-attribution {
  background: rgba(255,255,255,0.85);
  color: #333;
  border-radius: 6px;
  padding: 2px 6px;
}
.leaflet-control-zoom a {
  background: rgba(255,255,255,0.85);
  color: #000;
  border: 1px solid #ccc;
}

/* Responsive */
@media (max-width: 720px) {
  .sidebar {
    position: relative;
    width: 100%;
    top: 80px;
    height: auto;
  }
  #map {
    top: calc(80px + 200px);
    left: 0;
  }
}
