body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: #f8f9fa;
}
.watermark {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: url('../img/watermark.png') no-repeat center center/100% 100%;
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}
.sidebar {
  width: 250px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: #263238;
  color: #fff;
  z-index: 2;
  overflow-y: auto;
}
.sidebar-content {
  padding: 1rem;
}
.sidebar-content h2 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #fff;
}
.tree {
  list-style: none;
  padding-left: 0;
}
.tree > li {
  margin-bottom: 0.5rem;
}
.tree a {
  color: #fff;
  text-decoration: none;
  display: block;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}
.tree a:hover {
  background: #37474f;
}
.tree ul {
  list-style: none;
  padding-left: 1rem;
}
.main-content {
  margin-left: 250px;
  padding: 2rem;
  z-index: 1;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 20px;
}
.dashboard-heatmap {
  grid-column: span 1;
}
.dashboard-chart,
.dashboard-producers {
  grid-column: span 1;
}
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-heatmap,
  .dashboard-chart,
  .dashboard-producers {
    grid-column: span 1;
  }
}
.dashboard-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 1rem;
  flex: 1 1 400px;
  min-width: 320px;
}
@media (max-width: 900px) {
  .dashboard-grid {
    flex-direction: column;
  }
  .sidebar {
    width: 100vw;
    height: 60px;
    position: relative;
  }
  .main-content {
    margin-left: 0;
    margin-top: 60px;
  }
}
.producer-dossier {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.producer-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 1rem 2rem;
  min-width: 250px;
  max-width: 350px;
}
.producer-graph {
  flex: 1 1 350px;
  min-width: 300px;
}
.table-responsive {
  overflow-x: auto;
}
.producer-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.95em;
}
.producer-table th, .producer-table td {
  padding: 0.4em 0.5em;
  border: 1px solid #e0e0e0;
  text-align: center;
}
.producer-table th {
  background: #263238;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}
.sidebar-home-link {
  display: block;
  margin: 1em 0 1.5em 0;
  padding: 0.5em 1em;
  color: #fff;
  background: #37474f;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s;
}
.sidebar-home-link:hover {
  background: #1976d2;
  color: #fff;
}

.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.fullscreen-modal.active {
  display: flex;
}

.fullscreen-modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  height: 90%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.fullscreen-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.fullscreen-modal-close {
  cursor: pointer;
  font-size: 24px;
  color: #333;
}

.fullscreen-modal-chart-container {
  flex-grow: 1;
  position: relative;
}

.fullscreen-expand-btn {
  background: #2196f3;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fullscreen-expand-btn i {
  font-size: 16px;
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 30, 30, 0.4); /* Atenuación */
  z-index: 9999; /* Encima de todo */
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  /* El margin auto ya no es necesario */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Water Need Indicator Styles */
.water-need-indicator-container {
  margin-top: 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
}

.water-need-indicator-container h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
  font-size: 1.2em;
}

.traffic-light {
  display: inline-block;
  background-color: #333;
  padding: 10px;
  border-radius: 20px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.1);
}

.traffic-light .light {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin: 5px;
  background-color: #555; /* Default off state */
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
  transition: background-color 0.3s ease;
}

.traffic-light .light.red.active {
  background-color: #FF4136; /* Red */
  box-shadow: 0 0 15px #FF4136, inset 0 1px 3px rgba(0,0,0,0.5);
}

.traffic-light .light.yellow.active {
  background-color: #FFDC00; /* Yellow */
  box-shadow: 0 0 15px #FFDC00, inset 0 1px 3px rgba(0,0,0,0.5);
}

.traffic-light .light.green.active {
  background-color: #2ECC40; /* Green */
  box-shadow: 0 0 15px #2ECC40, inset 0 1px 3px rgba(0,0,0,0.5);
}

/* DataTables Button Styling */
.dt-button {
  background-color: #263238 !important; /* Use !important to override default DT styles if necessary */
  color: #fff !important;
  border: 1px solid #546e7a !important; /* Slightly lighter border than pure white for better visibility on dark background */
  padding: 0.5em 0.8em !important;
  margin: 0 2px !important; /* Add a little space between buttons */
  border-radius: 4px !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transition: background-color 0.2s ease !important;
}

.dt-button:hover {
  background-color: #37474f !important; /* Darken slightly on hover, similar to your sidebar links */
  color: #fff !important;
  border-color: #78909c !important;
}

/* Styling for the container of the buttons, if needed */
.dt-buttons {
  margin-bottom: 10px; /* Add some space below the button group */
}