.finance-hero {
  background:
    radial-gradient(circle at 80% 18%, rgba(79, 179, 191, 0.18), transparent 28%),
    radial-gradient(circle at 18% 76%, rgba(43, 76, 126, 0.08), transparent 34%),
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.hero-terminal {
  display: grid;
  gap: 12px;
  margin: 36px 0;
}

.hero-terminal div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(43, 76, 126, 0.12);
  background:
    linear-gradient(90deg, rgba(79, 179, 191, 0.14), transparent 58%),
    #f8fafc;
}

.hero-terminal span,
.dash-head span,
.filter-bar label,
.simulator-panel label {
  color: #2b4c7e;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-terminal strong {
  color: #0f2744;
  font-size: 24px;
  font-weight: 900;
}

.director-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.director-grid article {
  min-height: 150px;
  padding: 20px;
  border: 1px solid rgba(43, 76, 126, 0.13);
  background: #fff;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.director-grid article:hover,
.dash-card:hover {
  transform: translateY(-5px);
  border-color: rgba(79, 179, 191, 0.68);
  box-shadow: 0 24px 68px rgba(15, 39, 68, 0.12);
}

.director-grid strong {
  display: block;
  color: #0f2744;
  font-size: 21px;
}

.director-grid span {
  display: block;
  margin-top: 12px;
  color: #526174;
  line-height: 1.5;
}

.finance-dashboard {
  margin-top: 32px;
  border: 1px solid rgba(43, 76, 126, 0.14);
  background:
    linear-gradient(rgba(43, 76, 126, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 76, 126, 0.045) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
  padding: 18px;
  box-shadow: 0 30px 90px rgba(15, 39, 68, 0.12);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.filter-bar label {
  display: grid;
  gap: 7px;
}

.filter-bar select {
  min-height: 42px;
  border: 1px solid rgba(43, 76, 126, 0.16);
  background: #fff;
  color: #0f2744;
  font: 800 13px "Inter", Arial, sans-serif;
  padding: 0 10px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.kpi-grid div,
.dash-card {
  border: 1px solid rgba(43, 76, 126, 0.13);
  background: rgba(255, 255, 255, 0.92);
}

.kpi-grid div {
  padding: 14px;
}

.kpi-grid span {
  color: #2b4c7e;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi-grid strong {
  display: block;
  margin-top: 9px;
  color: #0f2744;
  font-size: 22px;
  font-weight: 900;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.dash-card {
  min-height: 280px;
  padding: 16px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.map-card,
.time-card {
  grid-column: span 6;
}

.waterfall-card,
.sankey-card,
.radial-card,
.heatmap-card,
.treemap-card,
.bubble-card {
  grid-column: span 6;
}

.dash-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.dash-head strong {
  color: #0f2744;
  font-size: 15px;
  font-weight: 900;
}

.colombia-map {
  width: min(420px, 100%);
  display: block;
  margin: 8px auto 0;
}

.real-colombia-map {
  height: 430px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(43, 76, 126, 0.12);
  background:
    linear-gradient(rgba(43, 76, 126, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 76, 126, 0.045) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
}

.map-card.has-real-map .map-fallback {
  display: none;
}

.leaflet-container {
  font-family: "Inter", Arial, sans-serif;
  background: #f8fafc;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.leaflet-tooltip.bdi-map-tooltip {
  border: 1px solid rgba(43, 76, 126, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: #0f2744;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 16px 42px rgba(15, 39, 68, 0.12);
}

.bdi-map-marker {
  filter: drop-shadow(0 8px 18px rgba(79, 179, 191, 0.32));
}

.colombia-outline-real {
  fill: rgba(15, 39, 68, 0.035);
  stroke: rgba(15, 39, 68, 0.42);
  stroke-width: 8;
  stroke-linejoin: round;
  filter: drop-shadow(0 22px 34px rgba(15, 39, 68, 0.12));
}

.colombia-internal-line {
  fill: none;
  stroke: rgba(43, 76, 126, 0.16);
  stroke-width: 4;
  stroke-linecap: round;
}

.map-performance-layer {
  mix-blend-mode: multiply;
}

.region {
  fill: rgba(79, 179, 191, 0.28);
  stroke: rgba(15, 39, 68, 0.58);
  stroke-width: 3;
  cursor: pointer;
  transition: fill 180ms ease, transform 180ms ease, filter 180ms ease, stroke 180ms ease;
  transform-origin: center;
}

.region:hover,
.region.active {
  fill: rgba(79, 179, 191, 0.68);
  stroke: #0f2744;
  filter: drop-shadow(0 12px 18px rgba(79, 179, 191, 0.28));
  transform: scale(1.035);
}

.map-labels text {
  fill: #0f2744;
  font-size: 28px;
  font-weight: 900;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 8px;
}

.waterfall {
  height: 222px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding-top: 10px;
}

.waterfall div {
  flex: 1;
  min-height: 36px;
  position: relative;
  background: linear-gradient(180deg, #4fb3bf, rgba(79, 179, 191, 0.16));
}

.waterfall div.negative {
  background: linear-gradient(180deg, rgba(15, 39, 68, 0.78), rgba(15, 39, 68, 0.16));
}

.waterfall span {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  color: #526174;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

#sankey-chart,
#radial-chart,
#time-series {
  width: 100%;
  display: block;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.heatmap div {
  min-height: 48px;
  display: grid;
  place-items: center;
  background: rgba(79, 179, 191, var(--a));
  color: #0f2744;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.treemap {
  height: 238px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  grid-template-rows: 1fr 0.8fr;
  gap: 8px;
}

.treemap div {
  display: flex;
  align-items: end;
  padding: 12px;
  background: rgba(79, 179, 191, var(--a));
  color: #0f2744;
  font-size: 12px;
  font-weight: 900;
}

.treemap div:first-child {
  grid-row: span 2;
}

.bubble-chart {
  height: 238px;
  position: relative;
  border: 1px solid rgba(43, 76, 126, 0.1);
  background:
    linear-gradient(rgba(43, 76, 126, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 76, 126, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bubble-chart button {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border: 1px solid rgba(15, 39, 68, 0.25);
  border-radius: 50%;
  background: rgba(79, 179, 191, 0.34);
  color: #0f2744;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.bubble-chart button:hover {
  transform: scale(1.12);
  background: #4fb3bf;
}

.metric-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-tabs button {
  border: 1px solid rgba(43, 76, 126, 0.16);
  background: #fff;
  color: #2b4c7e;
  font-size: 10px;
  font-weight: 900;
  padding: 6px 8px;
  cursor: pointer;
}

.metric-tabs button.active {
  border-color: #4fb3bf;
  background: rgba(79, 179, 191, 0.16);
  color: #0f2744;
}

.simulator-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid rgba(43, 76, 126, 0.14);
  background: #f8fafc;
}

.simulator-panel label {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(43, 76, 126, 0.1);
}

.simulator-panel input {
  accent-color: #4fb3bf;
}

.simulator-panel span {
  color: #0f2744;
  font-size: 20px;
  font-weight: 900;
}

.is-changing {
  color: #4fb3bf !important;
  transform: translateY(-1px);
  transition: color 180ms ease, transform 180ms ease;
}

@media (max-width: 1120px) {
  .filter-bar,
  .kpi-grid,
  .simulator-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .map-card,
  .time-card,
  .waterfall-card,
  .sankey-card,
  .radial-card,
  .heatmap-card,
  .treemap-card,
  .bubble-card {
    grid-column: span 12;
  }

  .director-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .finance-dashboard {
    padding: 12px;
  }

  .filter-bar,
  .kpi-grid,
  .simulator-panel,
  .director-grid {
    grid-template-columns: 1fr;
  }

  .dash-head {
    display: grid;
  }

  .heatmap {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .map-card,
  .time-card,
  .waterfall-card,
  .sankey-card,
  .radial-card,
  .heatmap-card,
  .treemap-card,
  .bubble-card {
    grid-column: auto;
    min-height: auto;
  }

  .real-colombia-map {
    height: 320px;
  }

  .colombia-map {
    width: 100%;
  }

  .waterfall {
    height: 190px;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 28px;
  }

  .waterfall div {
    min-width: 48px;
  }

  .treemap,
  .bubble-chart {
    height: 210px;
  }

  .metric-tabs {
    width: 100%;
  }

  .metric-tabs button {
    flex: 1 1 calc(50% - 6px);
  }
}
