:root {
  --bg-gradient-start: #ffffff;
  --bg-gradient-end: #ffffff;
  --accent: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --card-bg: #ffffff;
  --panel-bg: #ffffff;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --text-main: #0b1120;
  --text-muted: #64748b;
  --danger: #b91c1c;
  --warning: #b45309;
  --ok: #15803d;
  --sidebar-bg: #ffffff;
}

body.theme-dark {
  --bg-gradient-start: #020617;
  --bg-gradient-end: #0b1220;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --card-bg: #020617;
  --panel-bg: #020617;
  --border-subtle: rgba(148, 163, 184, 0.22);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;
  --warning: #facc15;
  --ok: #22c55e;
  --sidebar-bg: #020617;
  color: var(--text-main);
  background: radial-gradient(circle at top left, #1d283a, #020617 55%, #000 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: rgba(255, 246, 237, 0.82);
}

.predictor-body {
  background: rgba(255, 246, 237, 0.82);
}

.predictor-shell {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
}

.predictor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
  margin-bottom: 1.2rem;
}

.variables-actions {
  display: inline-flex;
  gap: 0.4rem;
}

.variables-action-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  padding: 0.3rem 0.9rem;
  font-size: 0.78rem;
  color: #0b1120;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.variables-action-primary {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #f9fafb;
}

.variables-action-icon {
  font-size: 0.9rem;
}

.predictor-header-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.predictor-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.predictor-export-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.4rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.predictor-export-btn:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: #2563eb;
}

.predictor-export-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.16);
}

.predictor-kpi-card {
  margin-bottom: 1rem;
}

.predictor-kpi-low {
  background: rgba(0, 153, 41, 0.08);
  border-color: rgba(0, 153, 41, 0.6);
}

.predictor-kpi-medium {
  background: rgba(255, 152, 53, 0.08);
  border-color: rgba(255, 152, 53, 0.7);
}

.predictor-kpi-high {
  background: rgba(224, 0, 0, 0.08);
  border-color: rgba(224, 0, 0, 0.7);
}

.predictor-header-icon {
  font-size: 1.3rem;
}

.predictor-title {
  margin: 0;
  font-size: 1.2rem;
  color: #45484a;
}

.predictor-gauge-card {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem 0.9rem;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.14);
}

.predictor-gauge-title {
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.predictor-gauge-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.predictor-gauge-svg {
  width: 100%;
  max-width: 260px;
}

.predictor-gauge-track {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 14;
  stroke-linecap: round;
}

.predictor-gauge-fill {
  fill: none;
  stroke: #22c55e;
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s ease, stroke 0.3s ease;
}

.predictor-gauge-needle {
  stroke: #0f172a;
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: 100px 120px;
}

.predictor-gauge-center {
  fill: #0f172a;
}

.predictor-gauge-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.predictor-gauge-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.predictor-gauge-level {
  font-size: 0.85rem;
  font-weight: 600;
  color: #16a34a;
}

.predictor-gauge-confidence {
  font-size: 0.8rem;
  color: #6b7280;
}

.predictor-gauge-level-medium {
  color: #d97706;
}

.predictor-gauge-level-high {
  color: #dc2626;
}

.predictor-gauge-details-toggle {
  margin-top: 0.75rem;
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f9fafb;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #111827;
}

.predictor-gauge-details-toggle:hover {
  background: #eff6ff;
}

.predictor-gauge-details-icon {
  font-size: 0.75rem;
  color: #6b7280;
}

.predictor-gauge-details {
  margin-top: 0.5rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: #f9fafb;
  padding: 0.6rem 0.75rem 0.7rem;
  font-size: 0.78rem;
  color: #4b5563;
}

.predictor-gauge-details-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.predictor-gauge-details-label {
  color: #6b7280;
}

.predictor-gauge-details-value {
  font-weight: 600;
}

.predictor-gauge-details-footnote {
  margin: 0.35rem 0 0;
  color: #9ca3af;
}

.predictor-gauge-legend {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.predictor-gauge-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.predictor-gauge-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.predictor-gauge-legend-dot-low {
  background: #22c55e;
}

.predictor-gauge-legend-dot-medlow {
  background: #fbbf24;
}

.predictor-gauge-legend-dot-medhigh {
  background: #f97316;
}

.predictor-gauge-legend-dot-high {
  background: #ef4444;
}

.predictor-time-card {
  margin-top: 0.9rem;
  border-radius: 1rem;
  background: rgba(151, 205, 250, 0.18);
  padding: 0.7rem 0.9rem 0.8rem;
}

.predictor-time-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.predictor-time-icon {
  font-size: 0.9rem;
}

.predictor-time-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
}

.predictor-time-main {
  font-size: 1rem;
  font-weight: 700;
  color: #1d4ed8;
}

.predictor-time-sub {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.predictor-subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.predictor-auto-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.78rem;
  color: inherit;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.predictor-auto-btn.predictor-auto-on {
  color: #166534;
}

.predictor-auto-track {
  position: relative;
  width: 70px;
  height: 28px;
  border-radius: 999px;
  background: #d4d4d8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.8);
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.predictor-auto-text {
  font-size: 0.7rem;
  font-weight: 600;
  color: #374151;
  z-index: 1;
}

.predictor-auto-thumb {
  position: absolute;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f9fafb;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease, right 0.18s ease;
}

.predictor-auto-btn.predictor-auto-on .predictor-auto-track {
  background: #22c55e;
  box-shadow: inset 0 0 0 1px #16a34a;
}

.predictor-auto-btn.predictor-auto-on .predictor-auto-text {
  color: #ecfdf5;
}

.predictor-auto-btn.predictor-auto-on .predictor-auto-thumb {
  right: auto;
  left: 4px;
}

.predictor-main {
  display: grid;
  grid-template-columns: 1.7fr 1fr; /* columna izquierda más ancha, similar al diseño de referencia */
  gap: 1.2rem;
}

.variables-kpi-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.variables-trend-card {
  grid-column: 1 / -1;
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.95rem 1.1rem 1.1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.variables-trend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.variables-trend-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.variables-trend-icon {
  font-size: 1rem;
}

.variables-trend-title {
  margin: 0;
  font-size: 0.98rem;
}

.variables-trend-chart-wrapper {
  margin-top: 0.4rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
  padding: 0.35rem 0.45rem 0.4rem;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.variables-trend-chart {
  width: 100%;
  height: 200px;
  display: block;
}

.variables-trend-grid-bg {
  /* Azul más notorio, similar a #2563eb con opacidad media */
  fill: rgba(37, 99, 235, 0.28);
}

.variables-trend-grid-lines line {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.variables-trend-line {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.4;
}

.variables-trend-point {
  fill: #0979b0;
  stroke: #ffffff;
  stroke-width: 1.2;
}

.variables-trend-point-low {
  fill: #22c55e;
}

.variables-trend-point-medium {
  fill: #facc15;
}

.variables-trend-point-high {
  fill: #f97316;
}

.variables-trend-point-critical {
  fill: #ef4444;
}

.variables-trend-axis-label {
  font-size: 0.7rem;
  fill: #64748b;
}

.variables-trend-xlabel {
  font-size: 0.6rem;
  fill: #64748b;
}

.variables-trend-legend {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.72rem;
  color: #64748b;
}

.variables-trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.variables-trend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.variables-trend-dot-low {
  background: #22c55e;
}

.variables-trend-dot-medium {
  background: #facc15;
}

.variables-trend-dot-high {
  background: #f97316;
}

.variables-trend-dot-critical {
  background: #ef4444;
}

.variables-kpi-card {
  background: rgba(189, 255, 174, 0.25);
  border-radius: 0.9rem;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16); /* sombra intensidad media */
  border: 2px solid #15803d; /* borde verde más oscuro */
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.variables-kpi-label {
  font-size: 0.78rem;
  color: #0b1120;
}

.variables-kpi-main {
  font-size: 1.1rem;
  font-weight: 600;
}

.variables-kpi-sub {
  font-size: 0.78rem;
  color: #64748b;
}

.variables-kpi-progress {
  margin-top: 0.3rem;
  height: 6px;
  border-radius: 999px;
  background: #ffffff;
  overflow: hidden;
}

.variables-kpi-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: #0ea5e9;
  transition: width 0.25s ease-out, background-color 0.25s ease-out;
}

.variables-kpi-badge {
  align-self: flex-start;
  margin-top: 0.3rem;
  padding: 0.18rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #ffffff;
  color: #0b1120;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.variables-kpi-badge-low {
  background: #dcfce7; /* verde claro */
  color: #166534;      /* verde oscuro */
  border-color: #22c55e;
}

.variables-kpi-badge-medium {
  background: #fef9c3; /* amarillo claro */
  color: #92400e;      /* ámbar oscuro */
  border-color: #facc15;
}

.variables-kpi-badge-high {
  background: #fee2e2; /* rojo claro */
  color: #b91c1c;      /* rojo oscuro */
  border-color: #ef4444;
}

.variables-kpi-card-risk {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.variables-kpi-card-risk .variables-kpi-label {
  width: 100%;
  text-align: left;
}

.variables-kpi-card-risk .variables-kpi-badge {
  align-self: center;
}

.predictor-form-card {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  grid-column: 1 / 2;
}

/* Tarjeta resumen interna de configuración de variables */
.variables-config-summary-card {
  margin-top: 0.9rem;
  margin-inline: auto;
  max-width: 92%; /* un poco más pequeña que la tarjeta principal */
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.variables-config-detail-card {
  margin-top: 1rem;
  margin-inline: auto;
  max-width: 96%;
  background: rgba(43, 154, 107, 0.12); /* color base para riesgo bajo/sin datos */
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  padding: 0.9rem 1.1rem 1.1rem;
}

.variables-config-detail-card-low {
  background: rgba(34, 197, 94, 0.12);  /* verde */
}

.variables-config-detail-card-medium {
  background: rgba(250, 204, 21, 0.16); /* amarillo */
}

.variables-config-detail-card-high {
  background: rgba(248, 113, 113, 0.16); /* rojo claro */
}

.variables-tabs {
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  padding-bottom: 0.35rem;
}

.variables-tab {
  border: none;
  background: transparent;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
}

.variables-tab-active {
  color: #1d4ed8;
  border-bottom: 2px solid #1d4ed8;
}

.variables-config-detail-header {
  text-align: center;
  margin: 0.7rem 0 0.8rem 0;
}

.variables-config-detail-title {
  margin: 0 0 0.2rem 0;
  font-size: 1rem;
  color: #0b1120;
}

.variables-config-detail-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: #0b1120;
}

.variables-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.variables-subsection-header {
  margin-top: 1.1rem;
  text-align: center;
}

.variables-tab-panel-hidden {
  display: none;
}

.variables-field-card {
  background: #f5f7ff;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.7rem 0.8rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.variables-progress-card {
  margin-top: 0.9rem;
  width: 100%;
  background: #f9fafb;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 0.75rem 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.variables-progress-wrapper {
  max-width: 100%;
  margin: 0.75rem 0 0;
}

.variables-recommend-card {
  margin-top: 0.9rem;
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.85rem 1rem 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.variables-recommend-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.variables-recommend-icon {
  font-size: 1rem;
}

.variables-recommend-title {
  margin: 0;
  font-size: 0.95rem;
}

.variables-recommend-body {
  font-size: 0.78rem;
}

.variables-recommend-empty {
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  background: #eff6ff;
  color: #1e40af;
}

.variables-recommend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.variables-recommend-chip {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  background: #fff7ed;
  color: #7c2d12;
  min-width: 140px;
}

.variables-recommend-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f97316;
  color: #fffbeb;
  font-size: 0.75rem;
  font-weight: 600;
}

.variables-recommend-text {
  font-size: 0.78rem;
  line-height: 1.25;
}

.variables-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.variables-progress-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.variables-progress-icon {
  font-size: 0.9rem;
}

.variables-progress-title {
  margin: 0;
  font-size: 0.9rem;
}

.variables-progress-status {
  font-size: 0.75rem;
  color: #64748b;
}

.variables-progress-bar-track {
  margin-top: 0.25rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.variables-progress-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #16a34a;
}

.variables-progress-metrics {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
}

.variables-progress-metric {
  text-align: center;
  font-size: 0.75rem;
}

.variables-progress-metric-value {
  display: block;
  font-weight: 600;
}

.variables-progress-metric-ok {
  color: #2563eb;
}

.variables-progress-metric-critical {
  color: #dc2626;
}

.variables-progress-metric-total {
  color: #16a34a;
}

.variables-progress-metric-label {
  color: #64748b;
}

.variables-field-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
}

.variables-field-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.variables-field-title {
  font-weight: 500;
  color: #0b1120;
}

.variables-field-required {
  color: #dc2626;
}

.variables-field-range {
  font-size: 0.7rem;
  color: #64748b;
}

.variables-field-input-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.variables-field-input {
  flex: 1 1 auto;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: #ffffff;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.variables-field-unit {
  font-size: 0.78rem;
  font-weight: 500;
  color: #0f172a;
}

.variables-field-bar {
  position: relative;
  height: 0.7rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.variables-field-bar-critical-left,
.variables-field-bar-optimal,
.variables-field-bar-critical-right {
  position: absolute;
  top: 0;
  bottom: 0;
}

.variables-field-bar-critical-left {
  left: 0;
  width: 25%;
  background: #fee2e2;
}

.variables-field-bar-optimal {
  left: 25%;
  width: 50%;
  background: #bbf7d0;
}

.variables-field-bar-critical-right {
  right: 0;
  width: 25%;
  background: #fee2e2;
}

.variables-field-slider {
  margin-top: 0.15rem;
  width: 100%;
  accent-color: #1d4ed8;
}

.variables-config-main {
  flex: 1 1 auto;
}

.variables-config-title {
  margin: 0 0 0.15rem 0;
  font-size: 1.05rem;
}

.variables-config-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}

.variables-config-center {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  margin-left: auto; /* empuja el bloque de completitud hacia la derecha */
}

.variables-config-label {
  font-size: 0.78rem;
  color: #64748b;
}

.variables-config-percentage {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
}

.variables-config-risk-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(245, 32, 25, 0.12); /* #f52019 con opacidad baja */
  color: #f52019;
  font-size: 0.72rem;
  font-weight: 500;
}

.variables-config-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.variables-config-save-btn {
  border-radius: 999px;
  border: none;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(189, 255, 174, 0.55); /* #bdffae con baja opacidad */
  color: #0b1120;
  cursor: pointer;
}

.predictor-welcome-card {
  grid-column: 2 / 3;
}

.predictor-section-title {
  margin: 0 0 0.8rem 0;
  font-size: 0.98rem;
}

/* Título más destacado dentro de la tarjeta de configuración de variables */
.predictor-form-card .predictor-section-title {
  font-size: 1.3rem;
  margin: 0 0 0.15rem 0; /* casi sin espacio hacia el texto siguiente */
  text-align: center;
}

.predictor-form-card .predictor-hint {
  margin-top: 0.1rem;
  text-align: center;
}

.predictor-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.predictor-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.predictor-label {
  font-size: 0.78rem;
  font-weight: 500;
}

.predictor-input {
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
}

.predictor-hint {
  font-size: 0.7rem;
  color: #64748b;
}

.predictor-submit-btn {
  margin-top: 0.8rem;
  border-radius: 0.55rem;
  border: none;
  padding: 0.55rem 0.9rem;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
}

.predictor-welcome-card {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.9rem;
}

.predictor-welcome-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
}

.predictor-welcome-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}

.predictor-welcome-icon {
  font-size: 2.2rem;
}

.predictor-welcome-title {
  margin: 0;
  font-size: 1.1rem;
}

.predictor-welcome-text {
  margin: 0;
  font-size: 0.9rem;
  max-width: 460px;
}

.predictor-welcome-footnote {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
}

.variables-risk-summary-pill {
  align-self: stretch;
  width: 100%;
  max-width: none;
  margin-left: 0.4rem;
  margin-right: 0.4rem;
  border-radius: 1.4rem;
  border: 2px solid #38bdf8;
  background: #eff6ff; /* estado neutro / sin datos: celeste suave */
  padding: 1rem 0.8rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.variables-risk-summary-low {
  border-color: #16a34a;
  background: #ecfdf5;
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.3);
}

.variables-risk-summary-medium {
  border-color: #facc15;
  background: #fffbeb;
  box-shadow: 0 10px 25px rgba(250, 204, 21, 0.35);
}

.variables-risk-summary-high {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.4);
}

.variables-risk-circle {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: #38bdf8; /* celeste por defecto (sin datos) */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eff6ff;
  font-size: 1.4rem;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.45);
  margin-bottom: 0.25rem;
}

.variables-risk-circle-low {
  background: #16a34a;
  color: #ecfdf5;
  box-shadow: 0 10px 26px rgba(22, 163, 74, 0.6);
}

.variables-risk-circle-medium {
  background: #facc15;
  color: #78350f;
  box-shadow: 0 10px 26px rgba(250, 204, 21, 0.7);
}

.variables-risk-circle-high {
  background: #dc2626;
  color: #fee2e2;
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.7);
}

.variables-risk-main-text {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.variables-risk-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.variables-risk-label {
  color: #4b5563;
}

.variables-risk-value {
  font-weight: 600;
  color: #111827;
}

.variables-risk-critical-wrapper {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.8rem;
  background: transparent;
}

.variables-risk-critical-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: #991b1b;
  margin-bottom: 0.25rem;
}

.variables-risk-critical-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.75rem;
  color: #b91c1c;
}

.variables-risk-critical-list li {
  margin-bottom: 0.12rem;
}

.variables-risk-critical-empty {
  list-style: none;
  padding-left: 0;
}

.predictor-result-extra {
  margin-top: 0.9rem;
  width: 100%;
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.predictor-subcard {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  margin-bottom: 0.6rem;
  flex: 1 1 0;
  min-width: 0;
}

.predictor-rec-section {
  margin-bottom: 0.7rem;
}

.predictor-rec-section h3 {
  margin: 0 0 0.35rem 0;
  font-size: 0.9rem;
}

.predictor-rec-section ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

.predictor-rec-section li {
  margin-bottom: 0.15rem;
}

.gradient-bg {
  position: fixed;
  inset: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

body.theme-dark .gradient-bg {
  background: radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(circle at 90% 100%, rgba(14, 165, 233, 0.15), transparent 60%);
  opacity: 0.9;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 25% 15%, #bfe6ff, #7dd3fc 45%, #38bdf8 100%);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
  font-weight: 600;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 0.95rem;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-card {
  padding: 0.9rem 0.8rem;
  border-radius: 1rem;
  background: rgba(191, 227, 255, 0.24);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
}

.nav-section-title {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0b1120;
  margin-bottom: 0.6rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.55rem;
  color: #0b1120;
  text-decoration: none;
  font-size: 0.85rem;
}

.nav-item:hover {
  background: var(--accent-soft);
}

.nav-item-active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.nav-item-anoxia {
  justify-content: space-between;
  gap: 0.35rem;
}

.nav-item-anoxia .nav-icon {
  font-size: 0.9rem;
}

.nav-item-anoxia .nav-link-anoxia {
  flex: 1;
  font-size: 0.85rem;
  color: #0b1120;
  font-weight: 600;
  text-decoration: none;
}

.nav-pill {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-pill-new {
  background: rgba(16, 185, 129, 0.15);
  color: #009929;
  border-color: #009929;
}

.nav-pill-version {
  background: rgba(59, 130, 246, 0.18);
  color: #003785;
  border-color: #003785;
}

.filter-chip {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.25rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  background: #ffffff;
  color: #0b1120;
  font-size: 0.8rem;
}

.filter-chip:hover {
  background: var(--accent-soft);
}

.filter-chip-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.main-area {
  padding: 1.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.topbar-left h1 {
  margin: 0 0 0.3rem 0;
  font-size: 1.5rem;
}

.topbar-left p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--text-main);
  font-size: 0.78rem;
  color: var(--text-main);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--text-main);
  font-size: 0.8rem;
  color: var(--text-main);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-toggle input {
  display: none;
}

.theme-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.theme-switch-track {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 1px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-switch-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--text-main);
  transform: translateX(0);
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle input:checked + .theme-switch-label .theme-switch-track {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.theme-toggle input:checked + .theme-switch-label .theme-switch-thumb {
  transform: translateX(14px);
  background: var(--accent);
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.user-name {
  color: var(--text-main);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--panel-bg);
  border-radius: 0.9rem;
  border: 2px solid #1d4ed8;
  padding: 0.9rem 1rem;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.6);
}

/* Overrides específicos para la card de riesgo del predictor */
.predictor-kpi-card {
  margin-bottom: 1rem;
}

.predictor-kpi-card.predictor-kpi-low {
  background: rgba(0, 153, 41, 0.08);
  border-color: rgba(0, 153, 41, 0.6);
}

.predictor-kpi-card.predictor-kpi-medium {
  background: rgba(255, 152, 53, 0.08);
  border-color: rgba(255, 152, 53, 0.7);
}

.predictor-kpi-card.predictor-kpi-high {
  background: rgba(224, 0, 0, 0.08);
  border-color: rgba(224, 0, 0, 0.7);
}

.kpi-card h2 {
  margin: 0 0 0.35rem 0;
  font-size: 0.9rem;
}

.kpi-main {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.kpi-warning {
  border-color: #f97316;
}

.content-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.25rem;
  transition: all 0.3s ease;
}

.content-row.content-row-map-expanded {
  grid-template-columns: 1fr;
}

.map-area {
  position: relative;
}

.map-container-overlay {
  position: fixed;
  inset: 3.5rem 3rem;
  z-index: 80;
  border-radius: 1.2rem;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.55);
  background: #ffffff;
}

.panel {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
  padding: 1.1rem 1.2rem;
}

.panel.panel-map {
  background: #ffffff;
  color: #0b1120;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

body.theme-dark .panel.panel-map {
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-main);
}

.panel.panel-map.map-panel-expanded {
  position: fixed;
  top: 8.5rem;
  left: 13rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4);
  transition: all 0.3s ease;
}

.panel.panel-right {
  background: #ffffff;
  color: #0b1120;
  box-shadow: none;
}

body.theme-dark .panel.panel-right {
  background: rgba(15, 23, 42, 0.96);
  color: var(--text-main);
  box-shadow: none;
}

.panel.panel-right .panel-header p,
.panel.panel-right .region-activity,
.panel.panel-right .region-label,
.panel.panel-right .oxygen-card-header p {
  color: #0b1120;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.panel-header h2 {
  margin: 0 0 0.2rem 0;
  font-size: 1rem;
}

.panel-header p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.time-range-group {
  display: inline-flex;
  background: rgba(191, 227, 255, 0.24);
  border-radius: 999px;
  padding: 0.15rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.time-chip {
  border: none;
  background: transparent;
  color: #0b1120;
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.time-chip-active {
  background: #ffffff;
  color: #0b1120;
  box-shadow: 0 0 0 1px #1d4ed8;
}

.map-placeholder {
  margin-top: 0.6rem;
  border-radius: 0.9rem;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(circle at 90% 100%, rgba(8, 47, 73, 0.8), #020617);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.85);
}

.map-area {
  position: relative;
  margin-top: 0.6rem;
  flex: 1;
  transition: all 0.3s ease;
}

.map-area.map-area-expanded-vertical {
  min-height: 750px;
  height: 750px;
  flex: none;
}

.map-container {
  border-radius: 0.9rem;
  overflow: hidden;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
}

.map-container .leaflet-container {
  width: 100%;
  height: 100%;
}

.sonar-cluster-wrapper {
  background: transparent;
}

.sonar-cluster {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5f9ff;
  overflow: visible;
}

.sonar-cluster::before,
.sonar-cluster::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-shadow:
    0 0 0 0 currentColor,
    0 0 0 8px transparent,
    0 0 0 16px currentColor,
    0 0 0 24px transparent;
  opacity: 0.7;
  animation: sonar-ping 3s infinite ease-out;
}

.sonar-cluster::after {
  animation-delay: 1.2s;
}

.cluster-count {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 600;
}

.cluster-ok {
  background: radial-gradient(circle at 30% 0%, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.9));
  color: #bbf7d0;
}

.cluster-warning {
  background: radial-gradient(circle at 30% 0%, rgba(250, 204, 21, 0.98), rgba(217, 119, 6, 0.9));
  color: #fef9c3;
}

.cluster-critical {
  background: radial-gradient(circle at 30% 0%, rgba(248, 113, 113, 0.98), rgba(185, 28, 28, 0.95));
  color: #fee2e2;
}

.map-legend {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 260px;
  padding: 0.75rem 0.8rem;
  border-radius: 0.9rem;
  background: rgba(191, 227, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25);
  z-index: 1000;
}

.map-legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.map-legend-title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.map-legend-icon {
  font-size: 0.95rem;
}

.map-legend-title-text {
  display: flex;
  flex-direction: column;
}

.map-legend-title {
  font-size: 0.86rem;
}

.map-legend-subtitle {
  font-size: 0.7rem;
  color: #0b1120;
}

.map-legend-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.map-legend-section {
  padding-top: 0.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.map-legend-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.status-inactive {
  background: #64748b;
}

.map-legend-label {
  color: #0b1120;
}

.map-legend-regions {
  margin-top: 0.4rem;
}

.map-legend-regions-title {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.map-legend-region-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  margin-top: 0.2rem;
}

.legend-toggle-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(191, 227, 255, 0.9);
  color: #0b1120;
  font-size: 0.72rem;
  cursor: pointer;
  z-index: 1100;
  display: none;
}

.map-expand-controls {
  position: absolute;
  right: 0.85rem;
  bottom: 0.75rem;
  display: inline-flex;
  gap: 0.5rem;
  z-index: 20;
}

.map-expand-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
  transition: all 0.2s ease;
}

.map-expand-btn:hover {
  background: rgba(37, 99, 235, 0.09);
  border-color: #2563eb;
  transform: scale(1.05);
}

.map-expand-btn:active {
  transform: scale(0.95);
}

.expand-icon {
  display: block;
}

.expand-icon-small {
  width: 16px;
  height: 16px;
}

.expand-icon-large {
  width: 22px;
  height: 22px;
}

body.theme-dark .map-expand-btn {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.5);
}

body.theme-dark .map-expand-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
}

.panel-right {
  display: flex;
  flex-direction: column;
}

.region-summary-card {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.region-row {
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #d0fdd7;
  padding: 0.6rem 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

body.theme-dark .region-row {
  background: radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.12), transparent 55%),
    rgba(15, 23, 42, 0.98);
}

.region-main h3 {
  margin: 0;
  font-size: 0.9rem;
  color: #000000;
}

body.theme-dark .region-main h3 {
  color: var(--text-main);
}

.region-activity {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: #000000;
}

body.theme-dark .region-activity {
  color: var(--text-muted);
}

.region-metrics {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.region-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.region-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.region-label {
  font-size: 0.72rem;
  color: #000000;
}

body.theme-dark .region-label {
  color: var(--text-muted);
}

.region-oxygen {
  color: #60a5fa;
}

.region-alerts {
  color: #fb923c;
}

.region-ton {
  color: #22c55e;
}

.oxygen-card {
  margin-top: 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border-subtle);
  background: #d0fdd7;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
  padding: 0.85rem 0.9rem 0.9rem;
}

body.theme-dark .oxygen-card {
  background: rgba(15, 23, 42, 0.96);
}

.oxygen-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.oxygen-card-header p {
  margin: 0.2rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.oxygen-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.oxygen-icon {
  font-size: 1rem;
}

.oxygen-chart-wrapper {
  margin-top: 0.6rem;
  border-radius: 0.8rem;
  background: #ffffff75;
  padding: 0.6rem 0.7rem 0.7rem 0.7rem;
  height: 270px;
}

body.theme-dark .oxygen-chart-wrapper {
  background: radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.15), transparent 60%),
    rgba(15, 23, 42, 0.98);
}

.anoxia-banner {
  margin-top: 1.4rem;
  display: flex;
  gap: 1.25rem;
}

.anoxia-card {
  border-radius: 1rem;
  padding: 1rem 1.2rem;
  background: #c6c6c6;
  border: 2px solid #6f6f6f;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.2rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
  width: 50%;
  position: relative;
}

body.theme-dark .anoxia-card {
  background: rgba(15, 23, 42, 0.85);
}

.anoxia-card::before,
.anoxia-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9), rgba(191, 219, 254, 0.2));
  pointer-events: none;
  z-index: 0;
}

body.theme-dark .anoxia-card::before,
body.theme-dark .anoxia-card::after {
  display: none;
}

.anoxia-card::before {
  width: 110px;
  height: 110px;
  bottom: 0.3rem;
  right: 0.3rem;
  box-shadow: 0 0 24px rgba(15, 23, 42, 0.18);
}

.anoxia-card::after {
  width: 70px;
  height: 70px;
  bottom: 1.5rem;
  right: 2.2rem;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(191, 219, 254, 0.25));
}

.anoxia-left {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.anoxia-icon-wrapper {
  display: none;
}

.anoxia-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, rgba(191, 219, 254, 0.9), rgba(59, 130, 246, 0.15));
  box-shadow:
    0 0 0 4px rgba(56, 189, 248, 0.12),
    6px -4px 0 0 rgba(56, 189, 248, 0.16),
    -5px 5px 0 0 rgba(56, 189, 248, 0.12);
}

.anoxia-icon::before,
.anoxia-icon::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(191, 219, 254, 0.8);
}

.anoxia-icon::before {
  width: 11px;
  height: 11px;
  top: -5px;
  right: -4px;
  background: rgba(191, 219, 254, 0.85);
}

.anoxia-icon::after {
  width: 9px;
  height: 9px;
  bottom: -4px;
  left: -3px;
  background: rgba(191, 219, 254, 0.7);
}

.anoxia-text {
  text-align: center;
}

.anoxia-text h2 {
  margin: 0 auto 0.2rem auto;
  font-size: 1.5rem;
  color: #3e4144;
}

body.theme-dark .anoxia-text h2 {
  color: var(--text-main);
}

.anoxia-text p {
  margin: 0 auto;
  font-size: 0.95rem;
  max-width: 520px;
  color: #3e4144;
}

body.theme-dark .anoxia-text p {
  color: var(--text-main);
}

.anoxia-highlights {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 0.9rem;
  justify-content: center;
  text-align: center;
}

.anoxia-highlight {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #3e4144;
}

body.theme-dark .anoxia-highlight {
  color: var(--text-main);
}

.anoxia-bullet-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #f9fafb;
  transform: scaleX(-1);
}

.anoxia-bullet-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 5px;
  border-right: 2px solid #f9fafb;
  border-bottom: 2px solid #f9fafb;
  transform: rotate(40deg);
}

.anoxia-right {
  display: flex;
  align-items: center;
  align-self: center;
  margin-top: 0.6rem;
}

.anoxia-cta {
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  background: rgba(56, 189, 248, 0.28);
  color: #f9fafb;
  padding: 0.6rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4);
}

.anoxia-cta-text span {
  display: block;
  line-height: 1.1;
}

.anoxia-cta-icon {
  font-size: 0.95rem;
}

.anoxia-cta-arrow {
  font-weight: 600;
}

@media (max-width: 960px) {
  .anoxia-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.alerts-card {
  width: 50%;
  border-radius: 1rem;
  background: transparent;
  box-shadow: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.8rem 0.9rem 0.9rem;
  color: #0b1120;
}

body.theme-dark .alerts-card {
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
  color: var(--text-main);
}

.alerts-header {
  padding-bottom: 0.6rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.alerts-title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.alerts-title-group h2 {
  margin: 0;
  font-size: 0.98rem;
}

.alerts-icon {
  font-size: 1.05rem;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.alert-item {
  border-radius: 0.8rem;
  padding: 0.55rem 0.6rem;
}

.alert-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.alert-icon-pill {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.alert-text {
  flex: 1;
}

.alert-title {
  font-size: 0.85rem;
}

.alert-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.alert-badge {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.alert-meta {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.alert-high {
  background: rgba(248, 113, 113, 0.16);
}

.alert-high .alert-icon-pill {
  background: rgba(248, 113, 113, 0.25);
}

.alert-badge-high {
  background: rgba(248, 113, 113, 0.9);
  color: #fef2f2;
}

.alert-medium {
  background: rgba(250, 204, 21, 0.12);
}

.alert-medium .alert-icon-pill {
  background: rgba(250, 204, 21, 0.25);
}

.alert-badge-medium {
  background: rgba(250, 204, 21, 0.9);
  color: #fefce8;
}

.alert-low {
  background: rgba(34, 197, 94, 0.12);
}

.alert-low .alert-icon-pill {
  background: rgba(34, 197, 94, 0.25);
}

.alerts-badge-low {
  background: rgba(34, 197, 94, 0.9);
  color: #ecfdf3;
}

.alerts-table-section {
  margin-top: 1.4rem;
}

.alerts-table-card {
  border-radius: 1rem;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: none;
  padding: 0.9rem 1rem 1rem;
  color: #0b1120;
}

body.theme-dark .alerts-table-card {
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
  color: var(--text-main);
}

.alerts-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.7rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.alerts-table-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.alerts-table-title-row h2 {
  margin: 0;
  font-size: 1rem;
}

.alerts-table-header p {
  margin: 0.2rem 0 0 1.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.alerts-table-icon {
  font-size: 1.1rem;
}

.alerts-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.alerts-pill-input {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(191, 227, 255, 0.5);
  color: #0b1120;
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
}

.alerts-filter-pill {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(191, 227, 255, 0.5);
  color: #0b1120;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.alerts-export {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(191, 227, 255, 0.5);
  color: #0b1120;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
}

body.theme-dark .alerts-pill-input {
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
}

body.theme-dark .alerts-filter-pill {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
}

body.theme-dark .alerts-export {
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
}

.alerts-table-wrapper {
  max-height: 260px;
  overflow: auto;
}

.alerts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.alerts-table thead tr {
  background: #d0fdd7;
}

body.theme-dark .alerts-table thead tr {
  background: rgba(15, 23, 42, 0.9);
}

.alerts-table th,
.alerts-table td {
  padding: 0.4rem 0.45rem;
  text-align: left;
}

.alerts-table th {
  font-size: 0.78rem;
  color: #0b1120;
  font-weight: 500;
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  position: sticky;
  top: 0;
  background: #d0fdd7;
  z-index: 1;
}

body.theme-dark .alerts-table th {
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.96);
}

.alerts-table tbody tr:nth-child(even) {
  background: rgba(191, 227, 255, 0.35);
}

.alerts-table tbody tr:nth-child(odd) {
  background: rgba(191, 227, 255, 0.2);
}

body.theme-dark .alerts-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.9);
}

body.theme-dark .alerts-table tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.86);
}

.alerts-table tbody tr.row-critical {
  background: rgba(248, 113, 113, 0.12);
}

.cell-subtitle {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.cell-bad {
  color: #fca5a5;
}

.cell-warning {
  color: #fde68a;
}

.badge-critical {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(248, 113, 113, 0.95);
  color: #fef2f2;
}

.badge-high {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(250, 204, 21, 0.95);
  color: #fefce8;
}

.badge-resolved {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.95);
  color: #ecfdf3;
}

.badge-new {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(251, 191, 36, 0.95);
  color: #fffbeb;
}

.badge-viewed {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(148, 163, 184, 0.9);
  color: #e5e7eb;
}

.cell-actions {
  text-align: center;
}

.global-metrics-section {
  margin-top: 1.3rem;
}

.global-metrics-card {
  border-radius: 1rem;
  background: rgba(191, 227, 255, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  padding: 0.9rem 1.2rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4rem;
  color: #0b1120;
}

body.theme-dark .global-metrics-card {
  background: radial-gradient(circle at 10% 0%, rgba(248, 250, 252, 0.06), transparent 55%),
    rgba(15, 23, 42, 0.98);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.9);
  color: var(--text-main);
}

.global-metric-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.global-metric-label {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.global-blue {
  color: #60a5fa;
}

.global-green {
  color: #4ade80;
}

.global-orange {
  color: #fb923c;
}

.global-purple {
  color: #a855f7;
}

.pool-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.pool-main h3 {
  margin: 0;
  font-size: 0.9rem;
}

.pool-meta {
  margin: 0.1rem 0 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-badge {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid var(--border-subtle);
}

.status-ok {
  color: var(--ok);
  background: rgba(34, 197, 94, 0.12);
}

.status-warning {
  color: var(--warning);
  background: rgba(250, 204, 21, 0.12);
}

.status-critical {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
}

.pool-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.72rem;
}

.metric-pill .label {
  color: var(--text-muted);
}

.metric-pill .value {
  color: var(--text-main);
}

.sonar-wrapper {
  position: relative;
}

.sonar-marker {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.85) 0%, transparent 55%);
}

.sonar-marker::before,
.sonar-marker::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-shadow:
    0 0 0 0 currentColor,
    0 0 0 6px transparent,
    0 0 0 12px currentColor,
    0 0 0 18px transparent,
    0 0 0 24px currentColor;
  opacity: 0.9;
  animation: sonar-ping 2.8s infinite ease-out;
}

.sonar-marker::after {
  animation-delay: 1.2s;
}

.sonar-marker::selection {
  background: transparent;
}

.sonar-marker::marker {
  content: "";
}

.sonar-marker span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff, rgba(15, 23, 42, 0));
}

.sonar-ok {
  color: #4ade80;
}

.sonar-warning {
  color: #facc15;
}

.sonar-critical {
  color: #f97373;
}

@keyframes sonar-ping {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    display: none;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
