/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #2c2c2c;
  color: white;
}

/* ================= HEADER ================= */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: linear-gradient(to bottom, #4c7cff, #1c3f91);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.topbar h1 {
  font-size: 18px;
}

.burger {
  position: absolute;
  left: 15px;
  width: 40px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.burger span {
  display: block;
  height: 4px;
  margin: 5px 0;
  background: black;
}

/* ================= SIDEBAR ================= */

.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100%;
  background: #5a8d3a;
  transition: left 0.3s ease;
  z-index: 999;
}

.sidebar.open {
  left: 0;
}

.sidebar-inner {
  padding-top: 80px;
}

.sidebar-title {
  text-align: center;
  font-size: 24px;
  margin-bottom: 20px;
  color: black;
}

/* ================= MENU ================= */

.menu {
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  gap: 8px;
}

.menu a,
.menu a:visited,
.menu a:hover,
.menu a:active,
.menu a:focus {
  text-decoration: none;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 16px 18px;
  background: #ffffff;
  color: #111111;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  position: relative;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.menu-item:hover {
  background: #eeeeee;
  transform: translateX(4px);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.22);
}

.active-link {
  background: #dddddd;
  box-shadow: inset 4px 0 0 #1c3f91;
}

/* ================= MENU DÉROULANT SIMPLE ================= */

.has-submenu {
  position: relative;
}

/* Zone invisible entre "Carte" et le menu déroulant.
   Elle empêche le menu de se fermer quand la souris passe entre les deux. */
.has-submenu::after {
  content: "";
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  width: 18px;
  height: 100%;
  background: transparent;
  z-index: 1000;
}

.has-submenu:hover::after {
  display: block;
}

.menu-btn {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-radius: 12px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.menu-btn:hover {
  background: #eeeeee;
  transform: translateX(4px);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.22);
}

.arrow {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.has-submenu:hover > .menu-btn .arrow {
  transform: rotate(90deg);
}

.submenu {
  display: none;
  position: absolute;
  top: 0;
  left: calc(100% - 2px);
  width: 245px;
  padding: 8px;
  margin-left: 0;
  background: rgba(45, 45, 45, 0.97);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 1001;
}

.has-submenu:hover > .submenu {
  display: block;
}

.submenu-item {
  position: relative;
}

.submenu-link {
  display: block;
  width: 100%;
  box-sizing: border-box;

  padding: 12px 14px;
  border-radius: 10px;
  border: none;

  color: #ffffff !important;
  text-decoration: none !important;
  background: transparent;

  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.submenu-link:hover {
  color: #ffffff !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
  transform: translateX(4px);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.65);
}

.submenu-link:visited,
.submenu-link:active,
.submenu-link:focus {
  color: #ffffff !important;
  text-decoration: none !important;
}

.active-map-link {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 #ffffff;
}

/* ================= MAIN ================= */

.main-content {
  padding: 100px 20px 30px;
  min-height: calc(100vh - 70px);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ================= CARD ================= */

.content-card {
  background: #666;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 1100px;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 950px) {
  .has-submenu::after {
    display: none;
  }

  .submenu {
    position: static;
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
    background: rgba(45, 45, 45, 0.97);
  }

  .menu-item:hover,
  .menu-btn:hover {
    transform: none;
  }

  .map-layout {
    flex-direction: column;
    align-items: left;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-main {
    flex-direction: column;
    text-align: left;
  }

  .dashboard-card h2 {
    font-size: 1.8rem;
  }

  .quality-summary strong {
    display: block;
    max-width: 100%;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
    text-align: center;
    color: inherit;

    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .quality-summary {
    min-width: 0;
    overflow: hidden;
    text-align: center;
  }
}