/* RESET & BASE */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #333;
  display: flex;
  flex-direction: row;
  scroll-behavior: smooth;
}

/* === SIDEBAR === */
#sidebar {
  width: 250px;
  background: #fff;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 20px;
  border-right: 1px solid #ddd;
  flex-shrink: 0;
  z-index: 1000;
}

#sidebar h3 {
  margin-top: 0;
  font-size: 1.2rem;
}
#sidebar nav {
  display: flex;
  flex-direction: column;
}
#sidebar nav a {
  text-decoration: none;
  padding: 10px 0;
  color: #007bff;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}
#sidebar nav a:hover {
  border-left: 4px solid #007bff;
  background-color: #f5f5f5;
}

/* === CONTENUTO === */
main {
  flex-grow: 1;
  padding: 30px;
  max-width: 1000px;
  margin: auto;
}
section {
  background: #fff;
  padding: 25px;
  margin-bottom: 40px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
}
h2 {
  margin-top: 0;
}

/* === KPI BOX === */
.kpi-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.kpi-box {
  background: #007bff;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  flex-grow: 1;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* === MAPPA === */
#map {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}

/* === MOBILE MENU TOGGLE === */
#menuToggle {
  display: none;
  background: #007bff;
  color: white;
  border: none;
  font-size: 1.2rem;
  padding: 12px;
  width: 100%;
  cursor: pointer;
  z-index: 950;
}

/* === OVERLAY MOBILE === */
#overlay {
  display: none;
}
#overlay.show {
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 900;
}

/* === SIDEBAR MOBILE STYLE === */
#closeSidebar {
  background: none;
  border: none;
  font-size: 20px;
  text-align: right;
  width: 100%;
  margin-bottom: 10px;
  cursor: pointer;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #overlay {
    display: none;
  }
  #overlay.show {
    display: block;
  }
  #menuToggle {
    display: block;
  }
  .kpi-container {
    flex-direction: column;
  }
  .kpi-box {
    width: 100%;
  }
  #map {
    height: 300px;
  }
}


canvas {
  max-width: 100%;
  height: auto;
}

#proceduraDrill {
  padding-top: 10px;
}

#resetDrill {
  margin-bottom: 15px;
  padding: 8px 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

table.display {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table.display th, table.display td {
  padding: 10px;
  text-align: left;
}
