:root {
  --gdv-green: #2f7d4f;
  --gdv-green-dark: #205537;
  --gdv-green-light: #e8f3ec;
  --gdv-sand: #f6f4ee;
  --gdv-bark: #6b5b4a;
  --gdv-ink: #1f2a24;
  --gdv-accent: #d98b2b;
}

* { box-sizing: border-box; }

body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--gdv-ink);
  background: var(--gdv-sand);
}

.text-gdv { color: var(--gdv-green) !important; }
.bg-gdv-light { background: var(--gdv-green-light) !important; }

/* Boutons */
.btn-gdv {
  background: var(--gdv-green);
  border: 1px solid var(--gdv-green);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-gdv:hover { background: var(--gdv-green-dark); border-color: var(--gdv-green-dark); color: #fff; transform: translateY(-1px); }
.btn-gdv-outline {
  background: transparent;
  border: 1px solid var(--gdv-green);
  color: var(--gdv-green);
  font-weight: 700;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
}
.btn-gdv-outline:hover { background: var(--gdv-green); color: #fff; }

/* Actions propriétaire spot (Modifier / Supprimer) */
.gdv-spot-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.gdv-spot-actions form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.btn-gdv-spot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.2;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn-gdv-spot:hover { transform: translateY(-1px); }
.btn-gdv-spot-edit {
  background: #fff;
  border-color: rgba(47, 125, 79, 0.4);
  color: var(--gdv-green);
}
.btn-gdv-spot-edit:hover {
  background: var(--gdv-green);
  border-color: var(--gdv-green);
  color: #fff;
}
.btn-gdv-spot-delete {
  background: #fff;
  border-color: rgba(184, 69, 69, 0.35);
  color: #b84545;
}
.btn-gdv-spot-delete:hover {
  background: #c75c5c;
  border-color: #c75c5c;
  color: #fff;
}

/* Menu trois points (liste des spots) */
.gdv-menu-btn {
  color: var(--gdv-bark);
  border: none;
  background: transparent;
  padding: 0.1rem 0.35rem;
  line-height: 1;
  font-size: 1.25rem;
  border-radius: 6px;
}
.gdv-menu-btn:hover,
.gdv-menu-btn:focus,
.gdv-menu-btn.show {
  color: var(--gdv-green-dark);
  background: var(--gdv-green-light);
  box-shadow: none;
}

/* Navbar */
.gdv-navbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.gdv-navbar .navbar-brand { color: var(--gdv-green-dark); }
.gdv-navbar .nav-link { color: var(--gdv-ink); font-weight: 600; }
.gdv-navbar .nav-link.active { color: var(--gdv-green); }
.gdv-logo { font-size: 1.4rem; }

/* Hero */
.gdv-hero {
  background: linear-gradient(135deg, var(--gdv-green-light) 0%, #ffffff 60%);
  border-radius: 0 0 32px 32px;
}
.gdv-hero h1 { font-weight: 800; letter-spacing: -0.02em; }
.gdv-hero .lead { color: var(--gdv-bark); }

/* Stats */
.gdv-stat { text-align: center; padding: 1rem; }
.gdv-stat .num { font-size: 2rem; font-weight: 800; color: var(--gdv-green); line-height: 1; }
.gdv-stat .label { color: var(--gdv-bark); font-weight: 600; font-size: 0.9rem; }

/* Cartes */
.gdv-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
/* Hauteur pleine uniquement dans les grilles de cartes cliquables. */
.gdv-card.h-100,
.gdv-card-grid > .gdv-card { height: 100%; }
.gdv-card-fit { height: auto; }
/* Effet de survol uniquement sur les cartes cliquables (lien direct enfant).
   Evite que les cartes statiques (QR code, stats, etc.) passent au-dessus du footer. */
.gdv-card:has(> a):hover {
  box-shadow: 0 12px 28px rgba(32, 85, 55, 0.12);
  transform: translateY(-2px);
  position: relative;
  z-index: 1;
}
.gdv-card .gdv-card-media {
  aspect-ratio: 16 / 10;
  background: var(--gdv-green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--gdv-green);
}
.gdv-card .gdv-card-media img { width: 100%; height: 100%; object-fit: cover; }

.gdv-chip {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--gdv-green-light);
  color: var(--gdv-green-dark);
}
.gdv-chip-state { background: #fff3e0; color: #a85b0c; }

/* Type badge pastille */
.gdv-type-dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

/* Interventions (historique spot, mes interventions) */
.gdv-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.gdv-history-photo {
  margin-top: 0.75rem;
}
.gdv-history-photo .gdv-photo-frame img {
  max-height: 160px;
}

/* Notice */
.gdv-notice {
  background: var(--gdv-green-light);
  border-left: 4px solid var(--gdv-green);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.gdv-notice-planned {
  background: #eef4fc;
  border-left: 4px solid #2b6cb0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

/* Intro page scan QR */
.gdv-scan-hero {
  background: linear-gradient(145deg, var(--gdv-green-light) 0%, #fff 85%);
  border: 1px solid rgba(47, 125, 79, 0.18);
  border-left: 4px solid var(--gdv-green);
  color: var(--gdv-ink);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 6px 20px rgba(47, 125, 79, 0.08);
}
.gdv-scan-hero-lead {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--gdv-bark);
}

/* Alerte responsabilite */
.gdv-warning {
  background: #fff8e6;
  border: 1px solid #f0d68a;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

/* Carte / map */
.gdv-map { height: 320px; border-radius: 14px; overflow: hidden; z-index: 0; }
.gdv-map-sm { height: 200px; }
#dashboardMap .leaflet-marker-pane path { cursor: pointer; }

.gdv-map-tooltip.leaflet-tooltip {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 0;
  color: inherit;
}
.gdv-map-tooltip.leaflet-tooltip-top::before { border-top-color: #fff; }
.gdv-map-tooltip.leaflet-tooltip-bottom::before { border-bottom-color: #fff; }
.gdv-map-tooltip.leaflet-tooltip-left::before { border-left-color: #fff; }
.gdv-map-tooltip.leaflet-tooltip-right::before { border-right-color: #fff; }
.gdv-map-tooltip-card {
  display: block;
  padding: 0.5rem 0.65rem;
  min-width: 140px;
  max-width: 220px;
}
.gdv-map-tooltip-card:hover { color: inherit; }
.gdv-map-tooltip-name {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}
.gdv-map-tooltip-type { margin-bottom: 0.35rem; }

.gdv-gps-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.gdv-gps-links .btn { font-size: 0.8rem; padding: 0.25rem 0.65rem; }

.gdv-qr-preview {
  max-width: 140px;
  margin: 0 auto;
}

/* Photos (fiche spot, timeline) */
.gdv-photo-frame {
  display: inline-block;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--gdv-green-light);
  cursor: zoom-in;
  padding: 0;
  font: inherit;
  line-height: 0;
}
.gdv-photo-frame img {
  display: block;
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.gdv-photo-frame:hover img { opacity: 0.92; }
.gdv-photo-caption { font-size: 0.8rem; color: var(--gdv-bark); margin-top: 0.35rem; }

/* Footer */
.gdv-footer {
  background: var(--gdv-green-dark);
  color: #e9f2ec;
  flex-shrink: 0;
}
.gdv-footer-muted { color: #b9d4c3; }
.gdv-footer-link { color: #d7e8dd; text-decoration: none; margin-left: 1rem; font-weight: 600; }
.gdv-footer-link:hover { color: #fff; }

/* Auth cards */
.gdv-auth-card {
  max-width: 460px;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 2rem;
}

.gdv-charter-card {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 2rem;
}

.gdv-charter-item {
  background: #fbfaf6;
  border: 1px solid rgba(47, 125, 79, 0.14);
  border-radius: 14px;
  padding: 1rem 1.15rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--gdv-green);
  box-shadow: 0 0 0 0.2rem rgba(47, 125, 79, 0.15);
}

.section-title { font-weight: 800; letter-spacing: -0.01em; }
