/* Tablas de datos y notas al pie. */

.data-table-wrap {
  overflow: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 500px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  /* Sin ancho mínimo fijo: las celdas no cortan línea, así que cada tabla ya mide
     lo que necesita. Con 1220px, tablas de 7 columnas (historial anual, barrios)
     obligaban a scrollear de costado en cualquier notebook. */
  min-width: 0;
  background: #fff;
}

th, td {
  padding: 9px 9px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child, td:first-child,
th:nth-child(2), td:nth-child(2) { text-align: left; }
td.source-cell, td.note-cell { max-width: 190px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}
#energyView table tbody tr:nth-child(even) td { background: #f7f9fc; }
#energyView table th:nth-child(n+3):nth-child(-n+10),
#energyView table td:nth-child(n+3):nth-child(-n+10) { text-align: right; }
tbody tr:hover td { background: #f9fafb; }
tbody tr.is-selected-year td { background: #fbfdff; }
tbody tr.is-selected-year:hover td { background: #f7fbff; }
td.metric-good { color: #047857; font-weight: 850; }
td.metric-bad { color: #b91c1c; font-weight: 850; }
td.row-action { text-align: center; }
td.empty-table {
  text-align: center;
  color: var(--muted);
  padding: 22px;
  font-weight: 750;
}
tr:last-child td { border-bottom: 0; }

.footer-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
