:root {
  --main-bg: #f4f6fb;
  --card-bg: #fff;
  --card-border: #d0d4e4;
  --card-radius: 10px;
  --header-bg: #4461a8;
  --header-color: #fff;
  --header-radius: 10px;
  --input-bg: #f0f3fa;
  --input-border: #b3b8c5;
  --input-radius: 5px;
  --icon-blue: #1656b6;
  --icon-green: #198754;
  --icon-blue-hover: #0a2a5c;
  --icon-green-hover: #145c2a;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--main-bg);
  box-sizing: border-box;
  overflow-x: hidden;
}

.container-fluid {
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  padding: 10px !important;
  margin: 0 !important;
  overflow: hidden;
}

.row.flex-grow-1.h-100 {
  height: 100%;
  min-height: 0;
  margin: 0;
  --bs-gutter-x: 18px;
}

.col-md-6.d-flex.flex-column.h-100 {
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  margin: 0 !important;
}

.card.flex-grow-1 {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 18px !important;
  border-radius: var(--card-radius);
  border: 1.5px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: 0 4px 16px 0 rgba(44, 62, 80, 0.07);
}

.card-header {
  padding: 0.4rem 0.8rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--input-border);
  min-height: 36px;
  font-size: 1.1rem;
  color: var(--header-color);
  border-top-left-radius: var(--header-radius);
  border-top-right-radius: var(--header-radius);
}

.card .card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.card-body {
  flex: 1 1 0;
  min-height: 0;
  padding: 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
  overflow: hidden;
  background: #f7f8fa;
  border-bottom-left-radius: var(--card-radius);
  border-bottom-right-radius: var(--card-radius);
}

#map.flex-grow-1,
#timeSeriesChart.flex-grow-1,
#valueChart.flex-grow-1 {
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  border-radius: 6px;
  border: 1.5px solid var(--input-border);
  background: #fff;
  display: block;
}

form#configForm .row {
  margin-bottom: 0.2rem;
}

.form-label {
  margin-bottom: 0.1rem;
  font-size: 0.97rem;
  color: #222;
  font-weight: 600;
}

.form-control, .form-select {
  padding: 0.2rem 0.4rem;
  font-size: 0.97rem;
  height: 2rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--input-radius);
}

.form-control:focus, .form-select:focus {
  border-color: var(--header-bg);
  box-shadow: 0 0 0 0.1rem #4461a860;
}

fieldset {
  border: 1.5px solid #e0e3e8;
  background: #f9fafb;
  border-radius: 0.8rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(80,80,120,0.06);
}

legend {
  font-size: 1rem;
  font-weight: 600;
  color: #2b5caa;
  letter-spacing: 0.01em;
}

.bg-light { background: #f9fafb !important; }
.fw-semibold { font-weight: 600 !important; }

@media (max-width: 767px) {
  fieldset { padding: 1rem 0.5rem; }
  legend { font-size: 0.95rem; }
  .card .card-header h2 { font-size: 1.1rem; }
}

/* Iconos de los botones de charts */
.btn-chart-icon i {
  font-size: 1.1rem;
  font-weight: bold;
  vertical-align: middle;
  filter: brightness(1.2) drop-shadow(0 1px 0 #fff3);
  transition: color 0.15s, filter 0.15s;
}
.btn-outline-primary .btn-chart-icon i { color: var(--icon-blue); }
.btn-outline-primary:active .btn-chart-icon i,
.btn-outline-primary:focus .btn-chart-icon i,
.btn-outline-primary:hover .btn-chart-icon i { color: var(--icon-blue-hover); filter: brightness(1.5) drop-shadow(0 2px 2px #b8d0ff); }
.btn-outline-success .btn-chart-icon i { color: var(--icon-green); }
.btn-outline-success:active .btn-chart-icon i,
.btn-outline-success:focus .btn-chart-icon i,
.btn-outline-success:hover .btn-chart-icon i { color: var(--icon-green-hover); filter: brightness(1.5) drop-shadow(0 2px 2px #aef5c8); }
