/* =========================================================
   TRADING LIFE JOURNAL · EVOLUCIÓN HISTÓRICA
   Rediseño visual alineado con Lista de Operaciones
   ========================================================= */

.evolucion-historica-container,
.evolucion-historica-container * {
  box-sizing: border-box;
}

.evolucion-historica-container {

  position: relative;
  isolation: isolate;
  min-height: 850px;
  overflow: hidden;

  color: var(--tlj-color-text);
}

.evolucion-historica-container button:not(.tlj-modal-action, .tlj-info, .tlj-dropdown__option, .tlj-data-menu__toggle),
.evolucion-historica-container input {
  font: inherit;
}

.evolucion-historica-container button:not(.tlj-modal-action),
.evolucion-historica-container a,
.evolucion-historica-container input {
  -webkit-tap-highlight-color: transparent;
}

.evolucion-historica-container button:not(.tlj-modal-action) {
  text-transform: none;
}

.evolucion-historica-container svg {
  display: block;
}

.evolucion-historica-container [hidden] {
  display: none !important;
}

/* =========================================================
   CABECERA
   ========================================================= */

@keyframes tlj-eh-pulse{
  0%, 100% {
    opacity: .45;
    box-shadow: 0 0 0 3px rgba(var(--tlj-color-accent-rgb), .055);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 7px rgba(var(--tlj-color-accent-rgb), .10);
  }
}

/* =========================================================
   SELECTOR MULTI-MARKET · FASE 3.4
   ========================================================= */
/* Selector de mercado · estilo visual centralizado en TLJ Tema. */

/* =========================================================
   RESUMEN
   ========================================================= */

.tlj-eh-summary {
  display: grid;
  
  gap: 12px;
  margin: 30px 0;
}

.tlj-eh-stat {
  position: relative;
  display: flex;
  min-height: 116px;
  gap: 15px;
  align-items: center;
  padding: 21px;
  overflow: hidden;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .42);
  border-radius: 11px;
  background: var(--tlj-color-surface);
  transition: border-color .5s ease, background-color .5s ease, box-shadow .5s ease;
}

.tlj-eh-stat::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--tlj-color-accent-rgb), .42), transparent);
  opacity: .55;
  content: "";
}

.tlj-eh-stat:hover {
  border-color: rgba(var(--tlj-color-accent-rgb), .72);
  background: var(--tlj-color-surface-2);
  box-shadow: var(--tlj-effect-shadow-md);
}

.tlj-eh-stat__icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .22);
  border-radius: 10px;
  background: rgba(var(--tlj-color-accent-rgb), .07);
  color: var(--tlj-color-accent-text);
}

.tlj-eh-stat__icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.tlj-eh-stat > div {
  display: flex;
  
  flex-direction: column;
  gap: 4px;
}

.tlj-eh-stat > div > span {
  overflow: visible;
  color: var(--tlj-color-text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .65px;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}

.tlj-eh-stat strong {
  color: var(--tlj-color-text);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
}

.tlj-eh-stat--positive .tlj-eh-stat__icon {
  border-color: rgba(var(--tlj-color-positive-vivid-rgb), .22);
  background: rgba(var(--tlj-color-positive-vivid-rgb), .065);
  color: var(--tlj-color-positive-text);
}

.tlj-eh-stat--negative .tlj-eh-stat__icon {
  border-color: rgba(var(--tlj-color-negative-vivid-rgb), .2);
  background: rgba(var(--tlj-color-negative-vivid-rgb), .055);
  color: var(--tlj-color-negative-text);
}

.tlj-eh-stat--breakeven .tlj-eh-stat__icon {
  border-color: rgba(var(--tlj-color-breakeven-vivid-rgb), .25);
  background: rgba(var(--tlj-color-breakeven-vivid-rgb), .07);
  color: var(--tlj-color-breakeven-text);
}

/* =========================================================
   ESPACIO DE TRABAJO Y ACCIONES
   ========================================================= */

.tlj-eh-workspace {
  overflow: hidden;
  border: 1px solid var(--tlj-color-border);
  border-radius: 14px;
  background: var(--tlj-color-surface);
  box-shadow: var(--tlj-effect-shadow-lg);
}

.evolucion-historica-container .boton-agregar-EH {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  
  padding: 20px 30px;
  border-bottom: 1px solid var(--tlj-color-border);
  background: var(--tlj-color-surface);
}

.tlj-eh-sync {
  display: inline-flex;
  min-width: 165px;
  min-height: 42px;
  gap: 9px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .17);
  border-radius: 8px;
  background: var(--tlj-color-surface-2);
  color: var(--tlj-color-text-soft);
  font-size: 10.5px;
  letter-spacing: .3px;
}

.tlj-eh-sync > span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--tlj-color-accent);
  box-shadow: 0 0 0 4px rgba(var(--tlj-color-accent-rgb), .07);
  animation: tlj-eh-pulse 3.2s ease-in-out infinite;
}

.tlj-eh-sync b {
  font-weight: 750;
}

.evolucion-historica-container .tlj-eh-action {
  display: inline-flex !important;
  width: auto !important;
  min-height: 46px !important;
  gap: 9px;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 16px !important;
  border: 1px solid var(--tlj-color-accent) !important;
  border-radius: 8px !important;
  background: var(--tlj-color-surface-2) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--tlj-color-text-soft) !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: .25px !important;
  cursor: pointer;
  transform: none !important;
  transition: color .45s ease, border-color .45s ease, background-color .45s ease !important;
}

.evolucion-historica-container .tlj-eh-action svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.evolucion-historica-container .tlj-eh-action:hover,
.evolucion-historica-container .tlj-eh-action:focus-visible {
  border-color: rgba(var(--tlj-color-accent-rgb), .45) !important;
  background: var(--tlj-color-surface-3) !important;
  color: var(--tlj-color-accent-text) !important;
  outline: none;
}

.evolucion-historica-container .tlj-eh-action--primary {
  border-color: var(--tlj-color-accent) !important;
  background: var(--tlj-color-accent) !important;
  color: var(--tlj-color-on-accent) !important;
}

.evolucion-historica-container .tlj-eh-action--primary:hover,
.evolucion-historica-container .tlj-eh-action--primary:focus-visible {
  border-color: rgb(var(--tlj-color-contrast-rgb)) !important;
  background: rgb(var(--tlj-color-contrast-rgb)) !important;
  color: var(--tlj-color-on-accent) !important;
}

.evolucion-historica-container .tlj-eh-action--ghost {
  border-color: var(--tlj-color-accent) !important;
  background: var(--tlj-color-surface) !important;
  color: var(--tlj-color-text-muted) !important;
}

.evolucion-historica-container .tlj-eh-action--utility {
  border-color: rgba(var(--tlj-color-accent-rgb), .17) !important;
  background: var(--tlj-color-surface-2) !important;
  color: var(--tlj-color-text-soft) !important;
}

.tlj-eh-actions__separator {
  width: 1px;
  height: 29px;
  margin: 0 4px;
  background: var(--tlj-color-divider);
}

/* =========================================================
   TABLA
   ========================================================= */

.tlj-eh-table-card {
  position: relative;
  background: var(--tlj-color-field);
}

.evolucion-historica-container .table-container {
  display: block;
  width: 100%;
  max-height: 570px;
  margin: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: var(--tlj-color-field);
  box-shadow: none;
}

.evolucion-historica-container #tablaEH {
  margin: 0;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  
  background: var(--tlj-color-field);
  color: var(--tlj-color-text-soft);
  font-size: 13px;
}

.evolucion-historica-container #tablaEH th,
.evolucion-historica-container #tablaEH td {
  width: 1%;
  padding: 15px 14px;
  border: 0;
  border-right: 1px solid var(--tlj-color-divider);
  border-bottom: 1px solid var(--tlj-color-divider);
  line-height: 1.45;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.evolucion-historica-container #tablaEH thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--tlj-effect-compare-header-bg);
  color: var(--tlj-color-accent-text);
  border-top: 1px solid rgba(var(--tlj-color-accent-rgb), .35);
  border-bottom: 1px solid rgba(var(--tlj-color-accent-rgb), .45);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .5px;
  text-transform: uppercase;
  box-shadow: none;
}

.evolucion-historica-container #tablaEH tbody tr {
  background: var(--tlj-color-surface);
}

.evolucion-historica-container #tablaEH tbody tr:nth-child(even) {
  background: var(--tlj-color-surface);
}

.evolucion-historica-container #tablaEH tbody tr:hover td:not(:first-child):not(:last-child) {
  filter: brightness(1.18);
}

.evolucion-historica-container #tablaEH tbody td {
  height: 62px;
  color: var(--tlj-color-text-soft);
  font-size: 12.5px;
  font-weight: 550;
}

/* Fondo de resultado solo en columnas intermedias */
.evolucion-historica-container #tablaEH tbody tr.tlj-eh--positive td:not(:first-child):not(:last-child) {
  background: rgba(var(--tlj-color-positive-vivid-rgb), .1);
}

.evolucion-historica-container #tablaEH tbody tr.tlj-eh--negative td:not(:first-child):not(:last-child) {
  background: rgba(var(--tlj-color-negative-vivid-rgb), .1);
}

.evolucion-historica-container #tablaEH tbody tr.tlj-eh--breakeven td:not(:first-child):not(:last-child) {
  background: rgba(var(--tlj-color-breakeven-vivid-rgb), .1);
}

/* Primera columna fija, como Lista de Operaciones */
.evolucion-historica-container #tablaEH th:first-child:not(.tlj-eh-select-column),
.evolucion-historica-container #tablaEH td:first-child:not(.tlj-eh-select-cell) {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 92px;
  background: var(--tlj-selection-column-bg) !important;
  white-space: nowrap;
}

.evolucion-historica-container #tablaEH thead th:first-child:not(.tlj-eh-select-column) {
  z-index: 15;
  color: var(--tlj-color-accent-text) !important;
}

/* Última columna fija */
.evolucion-historica-container #tablaEH th:last-child,
.evolucion-historica-container #tablaEH td:last-child {
  position: sticky;
  right: 0;
  z-index: 6;
  
  padding: 8px;
  border-right: 0;
  background: var(--tlj-color-surface) !important;
  box-shadow: none;
}

.evolucion-historica-container #tablaEH thead th:last-child {
  z-index: 16;
  background: var(--tlj-effect-compare-header-bg) !important;
}

/* Botones editar / eliminar */
.evolucion-historica-container .action-btn {
  display: inline-flex !important;
  width: 31px !important;
  height: 31px !important;
  min-height: 31px !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  margin: 2px !important;
  padding: 0 !important;
  border: 1px solid var(--tlj-color-border) !important;
  border-radius: 7px !important;
  background: var(--tlj-color-surface-2) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  cursor: pointer;
  transform: none !important;
  transition: color .4s ease, border-color .4s ease, background-color .4s ease !important;
}

.evolucion-historica-container .delete-btn {
  color: var(--tlj-color-negative-text) !important;
}

.evolucion-historica-container .edit-btn {
  color: var(--tlj-color-accent-text) !important;
}

.evolucion-historica-container .delete-btn:hover,
.evolucion-historica-container .delete-btn:focus-visible {
  border-color: rgba(var(--tlj-color-negative-vivid-rgb), .38) !important;
  background: rgba(var(--tlj-color-negative-vivid-rgb), .075) !important;
  color: var(--tlj-color-negative-text) !important;
  outline: none;
}

.evolucion-historica-container .edit-btn:hover,
.evolucion-historica-container .edit-btn:focus-visible {
  border-color: rgba(var(--tlj-color-accent-rgb), .4) !important;
  background: rgba(var(--tlj-color-accent-rgb), .075) !important;
  color: var(--tlj-color-button-hover-text) !important;
  outline: none;
}

.evolucion-historica-container .delete-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  font-size: 26px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.evolucion-historica-container .edit-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

/* Estado vacío */
.tlj-eh-empty {
  display: none;
  min-height: 255px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 24px 50px;
  border-top: 1px solid var(--tlj-color-divider);
  text-align: center;
}

.evolucion-historica-container.is-empty .tlj-eh-empty {
  display: flex;
}

.evolucion-historica-container.is-empty .table-container {
  max-height: none;
}

.tlj-eh-empty__icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  margin-bottom: 17px;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .18);
  border-radius: 14px;
  background: var(--tlj-color-surface-2);
  color: var(--tlj-color-accent-text);
}

.tlj-eh-empty__icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.tlj-eh-empty strong {
  margin-bottom: 5px;
  color: var(--tlj-color-input-text);
  font-size: 16px;
  font-weight: 850;
}

.tlj-eh-empty p {
  max-width: 470px;
  margin: 0 !important;
  color: var(--tlj-color-text-muted) !important;
  font-size: 12.5px !important;
  line-height: 1.65 !important;
}

/* =========================================================
   MODALES
   ========================================================= */

.evolucion-historica-container .modal-contenido {
  width: max-content;
  max-width: calc(100vw - 60px);
  max-height: calc(100vh - 80px);
  overflow: auto;
  --tlj-modal-pad-top: 34px;
  --tlj-modal-pad-x: 34px;
  padding: var(--tlj-modal-pad-top) var(--tlj-modal-pad-x);
  font-size: 13px;
  text-align: left;
}
/* Modal Añadir / Editar día */
.evolucion-historica-container #modalFormularioEH > .modal-contenido.modal-contenido--form {
  width: 530px;
}
/* La cabecera llega a los bordes con --tlj-modal-pad-* (TLJ Tema); la de la gráfica deja más aire debajo. */
.evolucion-historica-container .tlj-eh-chart-header.tlj-modal-header {
  margin-bottom: 25px;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */

.evolucion-historica-container .formulario {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  margin: 0;
}

/* Filtros a dos columnas: la lista de Resultado ocupa su sitio y el modal crece. */
.evolucion-historica-container .formulario--filter {
  --tlj-eh-options-position: static;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.evolucion-historica-container .form-column {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 9px;
  padding: 19px;
  border: 1px solid var(--tlj-color-border);
  border-radius: 11px;
  background: var(--tlj-color-surface);
}

.evolucion-historica-container .formulario input:not([type="file"]),
.evolucion-historica-container .custom-selectEH__selected {
  width: 100% !important;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 46px 0 15px;
  border: 1px solid var(--tlj-color-border) !important;
  border-radius: 8px !important;
  background: var(--tlj-color-field) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--tlj-color-text-secondary) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 46px;
  text-align: left !important;
  outline: none;
  transition: border-color .4s ease, background-color .4s ease, box-shadow .4s ease !important;
}

.evolucion-historica-container .formulario input:hover,
.evolucion-historica-container .formulario input:focus,
.evolucion-historica-container .custom-selectEH:hover .custom-selectEH__selected,
.evolucion-historica-container .custom-selectEH.open .custom-selectEH__selected {
  border-color: rgba(var(--tlj-color-accent-rgb), .70) !important;
  background: var(--tlj-color-surface-2) !important;
  box-shadow: 0 0 0 3px rgba(var(--tlj-color-accent-rgb), .055) !important;
}

.evolucion-historica-container .formulario input.filled,
.evolucion-historica-container .formulario input:not(:placeholder-shown),
.evolucion-historica-container .custom-selectEH__selected.filled {
  border-color: rgba(var(--tlj-color-accent-rgb), .28) !important;
  background: var(--tlj-color-surface-2) !important;
  color: var(--tlj-color-text) !important;
  font-weight: 700 !important;
}

.evolucion-historica-container input::placeholder {
  color: var(--tlj-color-input-placeholder) !important;
  font-size: 12.5px !important;
  font-weight: 550 !important;
  opacity: 1 !important;
}

.evolucion-historica-container .date-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  cursor: pointer;
}

.evolucion-historica-container .date-icon {
  position: absolute;
  right: 14px;
  display: flex;
  width: 21px;
  height: 21px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Custom select EH */
.evolucion-historica-container .custom-selectEH {
  position: relative;
  width: 100%;
  cursor: pointer;
  user-select: none;
}

.evolucion-historica-container .custom-selectEH__selected {
  position: relative;
  display: flex;
  align-items: center;
  padding-right: 43px;
  color: var(--tlj-color-input-placeholder) !important;
  cursor: pointer;
}

.evolucion-historica-container .custom-selectEH__selected::after {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--tlj-color-accent);
  border-bottom: 1.5px solid var(--tlj-color-accent);
  content: "";
  transform: translateY(-65%) rotate(45deg);
  transition: transform .35s ease;
}

.evolucion-historica-container .custom-selectEH.open .custom-selectEH__selected::after {
  transform: translateY(-25%) rotate(225deg);
}

.evolucion-historica-container .custom-selectEH__selected.filled {
  color: var(--tlj-color-text) !important;
}

.evolucion-historica-container .custom-selectEH__options {
  display: none;
  position: var(--tlj-eh-options-position, absolute);
  top: 100%;
  right: 0;
  left: 0;
  z-index: 120;
  margin-top: 6px;
  max-height: 210px;
  overflow-y: auto;
}

.evolucion-historica-container .custom-selectEH.open .custom-selectEH__options {
  display: block;
}

.evolucion-historica-container .custom-selectEH__option {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

/* Botones dentro de modales */
.evolucion-historica-container .botones-modal {
  display: flex;
  grid-column: 1 / -1;
  gap: 9px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 8px auto 0;
}

.evolucion-historica-container .botones-modal button:not(.tlj-modal-action) {
  display: inline-flex !important;
  min-width: 178px;
  min-height: 49px;
  gap: 9px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 20px !important;
  border: 1px solid var(--tlj-color-accent) !important;
  border-radius: 8px !important;
  background: var(--tlj-color-accent) !important;
  box-shadow: none !important;
  color: var(--tlj-color-on-accent) !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  letter-spacing: .25px;
  cursor: pointer;
  transition: color .45s ease, border-color .45s ease, background-color .45s ease !important;
}

.evolucion-historica-container .botones-modal button:not(.tlj-modal-action) svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.evolucion-historica-container .botones-modal button:not(.tlj-modal-action):hover,
.evolucion-historica-container .botones-modal button:not(.tlj-modal-action):focus-visible {
  border-color: rgb(var(--tlj-color-contrast-rgb)) !important;
  background: rgb(var(--tlj-color-contrast-rgb)) !important;
  color: var(--tlj-color-on-accent) !important;
  outline: none;
}

/* =========================================================
   MODAL GRÁFICA
   ========================================================= */

.tlj-eh-chart-toolbar {
  position: relative;
  z-index: 50;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.evolucion-historica-container .tlj-eh-chart-switch {
  display: inline-flex !important;
  height: 36px !important;
  min-height: 36px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px;
  padding: 0 12px !important;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .22) !important;
  border-radius: 7px !important;
  background: var(--tlj-color-surface-2) !important;
  color: var(--tlj-color-text-soft) !important;
  box-shadow: none !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: color .35s ease, border-color .35s ease, background-color .35s ease !important;
}

.evolucion-historica-container .tlj-eh-chart-switch svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.evolucion-historica-container .tlj-eh-chart-switch:hover,
.evolucion-historica-container .tlj-eh-chart-switch:focus-visible {
  border-color: rgba(var(--tlj-color-accent-rgb), .48) !important;
  background: var(--tlj-color-surface-3) !important;
  color: var(--tlj-color-accent-text) !important;
  outline: none !important;
}

.evolucion-historica-container .tlj-eh-chart-switch.active {
  border-color: var(--tlj-color-accent) !important;
  background: var(--tlj-color-accent) !important;
  color: var(--tlj-color-on-accent) !important;
}

.evolucion-historica-container .tlj-eh-chart-switch.active:hover,
.evolucion-historica-container .tlj-eh-chart-switch.active:focus-visible {
  border-color: rgb(var(--tlj-color-contrast-rgb)) !important;
  background: rgb(var(--tlj-color-contrast-rgb)) !important;
  color: var(--tlj-color-on-accent) !important;
}

.evolucion-historica-container .timeframe-selector {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.evolucion-historica-container .timeframe-selector button:not(.tlj-modal-action) {
  display: inline-flex;
  width: auto;
  min-width: 76px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--tlj-color-border);
  border-radius: 7px;
  background: var(--tlj-color-surface-2);
  color: var(--tlj-color-text-soft);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color .35s ease, border-color .35s ease, background-color .35s ease;
}

.evolucion-historica-container .timeframe-selector button:not(.tlj-modal-action):hover {
  border-color: rgba(var(--tlj-color-accent-rgb), .42);
  background: var(--tlj-color-surface-3);
  color: var(--tlj-color-accent-text);
}

.evolucion-historica-container .timeframe-selector button:not(.tlj-modal-action).active {
  border-color: var(--tlj-color-accent);
  background: var(--tlj-color-accent);
  color: var(--tlj-color-on-accent);
}

.evolucion-historica-container .sma-select {
  width: 175px;
  flex: 0 0 175px;
}

.evolucion-historica-container .sma-select .custom-selectEH__selected {
  height: 36px;
  min-height: 36px;
  padding-left: 12px;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 34px;
}

.evolucion-historica-container .sma-select .custom-selectEH__option {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: flex-start;
}

.evolucion-historica-container .sma-select .custom-selectEH__option::before {
  width: 16px;
  margin-right: 6px;
  color: var(--tlj-color-dropdown-selected-text);
  content: "✓";
  opacity: 0;
}

.evolucion-historica-container .sma-select .custom-selectEH__option.active::before {
  opacity: 1;
}

.evolucion-historica-container .sma-select .custom-selectEH__option.active {
  font-weight: 500;
}

.evolucion-historica-container .grafica-wrapper {
  position: relative;
  width: 1200px;
  max-width: calc(100vw - 128px);
  height: min(72vh, calc(100vh - 300px), 700px);
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .18);
  border-radius: 10px;
  background: var(--tlj-color-field);
}

.evolucion-historica-container #graficaEH {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--tlj-color-field);
}

.evolucion-historica-container .grafica-watermark {
  position: absolute;
  bottom: 26px;
  left: 74px;
  z-index: 10;
  width: 45px;
  height: 45px;
  object-fit: contain;
  opacity: .72;
  pointer-events: none;
}

/* =========================================================
   GRÁFICA DE MOVIMIENTOS · PAGOS / RETIROS
   ========================================================= */

.tlj-eh-movements-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
}

.tlj-eh-movements-legend__item {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--tlj-color-border);
  border-radius: 7px;
  background: var(--tlj-color-surface-2);
  color: var(--tlj-color-text-muted);
  font-size: 10.5px;
  line-height: 1;
}

.tlj-eh-movements-legend__item > span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.tlj-eh-movements-legend__item b {
  font-weight: 750;
}

.tlj-eh-movements-legend__item strong {
  margin-left: 3px;
  color: var(--tlj-color-text);
  font-size: 11.5px;
  font-weight: 850;
}

.tlj-eh-movements-legend__item--platform {
  border-color: rgba(var(--tlj-color-platform-rgb), .22);
}

.tlj-eh-movements-legend__item--platform > span {
  background: var(--tlj-color-platform);
  box-shadow: 0 0 0 4px rgba(var(--tlj-color-platform-rgb), .07);
}

.tlj-eh-movements-legend__item--withdrawal {
  border-color: rgba(var(--tlj-color-withdrawal-rgb), .22);
}

.tlj-eh-movements-legend__item--withdrawal > span {
  background: var(--tlj-color-withdrawal);
  box-shadow: 0 0 0 4px rgba(var(--tlj-color-withdrawal-rgb), .07);
}

.evolucion-historica-container .grafica-wrapper--movements {
  height: min(62vh, 570px);
}

.tlj-eh-chart-empty {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 24px;
  background: var(--tlj-color-field);
  text-align: center;
}

.tlj-eh-chart-empty[hidden] {
  display: none !important;
}

.tlj-eh-chart-empty strong {
  color: var(--tlj-color-text-secondary);
  font-size: 14px;
  font-weight: 850;
}

.tlj-eh-chart-empty span {
  max-width: 380px;
  color: var(--tlj-color-text-muted-2);
  font-size: 11.5px;
  line-height: 1.4;
}

.tlj-eh-movements-tooltip {
  position: absolute;
  z-index: 10000;
  display: none;
  min-width: 205px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .30);
  border-radius: 7px;
  background: var(--tlj-color-surface);
  box-shadow: var(--tlj-effect-shadow-popover);
  color: var(--tlj-color-text-secondary);
  font-size: 11.5px;
  line-height: 1.55;
  pointer-events: none;
}

.tlj-eh-movements-tooltip strong,
.tlj-eh-movements-tooltip span {
  display: block;
}

.tlj-eh-movements-tooltip strong {
  margin-bottom: 4px;
  color: var(--tlj-color-text);
  font-size: 12px;
}

.tlj-eh-movements-tooltip .is-platform {
  color: var(--tlj-color-warning-text);
}

.tlj-eh-movements-tooltip .is-withdrawal {
  color: var(--tlj-color-withdrawal);
}

.tlj-eh-movements-tooltip b {
  color: inherit;
  font-weight: 850;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px){

  .tlj-eh-sync {
    width: 100%;
    margin-left: 0;
  }

  .evolucion-historica-container .formulario--filter {
    --tlj-eh-options-position: absolute;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px){

  .tlj-eh-summary {
    gap: 9px;
    margin: 20px 0;
  }

  .tlj-eh-stat {
    min-height: 100px;
    gap: 11px;
    padding: 15px;
  }

  .tlj-eh-stat__icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .tlj-eh-stat__icon svg {
    width: 23px;
    height: 23px;
  }

  .tlj-eh-stat > div > span {
    font-size: 9px;
    letter-spacing: .4px;
  }

  .tlj-eh-stat strong {
    font-size: 23px;
  }

  .tlj-eh-workspace {
    border-radius: 11px;
  }

  .evolucion-historica-container .boton-agregar-EH {
    gap: 7px;
    padding: 16px 13px;
  }

  .evolucion-historica-container .tlj-eh-action {
    min-height: 43px !important;
    padding: 0 12px !important;
    font-size: 10.5px !important;
  }

  .tlj-eh-actions__separator {
    display: none;
  }

  .evolucion-historica-container .modal-contenido {
  max-height: calc(100vh - 34px);
  --tlj-modal-pad-top: 25px;
  --tlj-modal-pad-x: 17px;
  padding-bottom: 22px;
  --tlj-modal-radius: 11px;
}

  .evolucion-historica-container .form-column {
    padding: 13px;
  }

  .evolucion-historica-container .botones-modal {
    flex-direction: column;
  }

  .evolucion-historica-container .botones-modal button:not(.tlj-modal-action) {
    width: 100%;
  }

  .evolucion-historica-container .tlj-eh-chart-header.tlj-modal-header {
    margin-bottom: 20px;
  }

  .evolucion-historica-container .grafica-wrapper {
    height: 58vh;
    min-height: 360px;
  }
}

@media (max-width: 480px){
  .tlj-eh-stat {
    min-height: 94px;
    padding: 12px;
  }

  .tlj-eh-stat__icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .tlj-eh-stat strong {
    font-size: 21px;
  }

  .evolucion-historica-container .tlj-eh-action span {
    display: none;
  }

  .evolucion-historica-container .tlj-eh-action {
    width: 43px !important;
    padding: 0 !important;
  }

  .evolucion-historica-container .tlj-eh-action svg {
    width: 19px;
    height: 19px;
  }

  .tlj-eh-sync {
    width: auto;
    min-width: 155px;
    margin-left: auto;
  }
}

/* =========================================================
   MOVIMIENTOS DE CAPITAL · PAGO PLATAFORMA / RETIRO
   ========================================================= */

/* Mantiene las tarjetas originales cuando no hay movimientos y
   adapta automáticamente la misma fila cuando aparecen las nuevas. */

.tlj-eh-stat--platform .tlj-eh-stat__icon {
  border-color: rgba(var(--tlj-color-platform-rgb), .24);
  background: rgba(var(--tlj-color-platform-rgb), .07);
  color: var(--tlj-color-platform);
}

.tlj-eh-stat--withdrawal .tlj-eh-stat__icon {
  border-color: rgba(var(--tlj-color-withdrawal-rgb), .24);
  background: rgba(var(--tlj-color-withdrawal-rgb), .07);
  color: var(--tlj-color-withdrawal);
}

.evolucion-historica-container .tlj-eh-action--platform {
  border-color: var(--tlj-color-platform) !important;
  background: var(--tlj-color-button-bg) !important;
  color: var(--tlj-color-platform) !important;
}

.evolucion-historica-container .tlj-eh-action--platform:hover,
.evolucion-historica-container .tlj-eh-action--platform:focus-visible {
  border-color: var(--tlj-color-platform) !important;
  background: rgba(var(--tlj-color-platform-rgb), .22) !important;
  color: var(--tlj-color-platform) !important;
}

.evolucion-historica-container .tlj-eh-action--withdrawal {
  border-color: var(--tlj-color-withdrawal) !important;
  background: var(--tlj-color-button-bg) !important;
  color: var(--tlj-color-withdrawal) !important;
}

.evolucion-historica-container .tlj-eh-action--withdrawal:hover,
.evolucion-historica-container .tlj-eh-action--withdrawal:focus-visible {
  border-color: var(--tlj-color-withdrawal) !important;
  background: rgba(var(--tlj-color-withdrawal-rgb), .22) !important;
  color: var(--tlj-color-withdrawal) !important;
}

/* El modal de movimiento reutiliza exactamente la familia visual del resto. */
.evolucion-historica-container #modalMovimientoEH > .modal-contenido.modal-contenido--movement {
  width: 530px;
}

.evolucion-historica-container .formulario--movement {
  grid-template-columns: 1fr;
}

.tlj-eh-movement-note {
  margin: 3px 1px 0 !important;
  color: var(--tlj-color-text-muted-2) !important;
  font-size: 10.5px !important;
  line-height: 1.55 !important;
}

/* Filas especiales: mantienen la tabla intacta, pero se distinguen sin
   rellenar métricas de trading ni comisiones. */
.evolucion-historica-container #tablaEH tbody tr.tlj-eh--platform td:not(:first-child):not(:last-child) {
  background: var(--tlj-color-warning-bg);
}

.evolucion-historica-container #tablaEH tbody tr.tlj-eh--withdrawal td:not(:first-child):not(:last-child) {
  background: rgba(var(--tlj-color-withdrawal-rgb), .1);
}

.evolucion-historica-container #tablaEH .tlj-eh-movement-value {
  color: var(--tlj-color-text);
  font-weight: 800;
}

.evolucion-historica-container #tablaEH .tlj-eh-date-value {
  display: block;
}

.evolucion-historica-container #tablaEH .tlj-eh-movement-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  padding: 3px 6px;
  border: 1px solid var(--tlj-color-border);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .25px;
  text-transform: uppercase;
}

.evolucion-historica-container #tablaEH .tlj-eh-movement-badge--plataforma {
  border-color: rgba(var(--tlj-color-warning-rgb), .28);
  background: var(--tlj-color-warning-bg);
  color: var(--tlj-color-warning-text);
}

.evolucion-historica-container #tablaEH .tlj-eh-movement-badge--retiro {
  border-color: rgba(var(--tlj-color-withdrawal-rgb), .28);
  background: rgba(var(--tlj-color-withdrawal-rgb), .1);
  color: var(--tlj-color-withdrawal);
}

@media (max-width: 1100px){
  .tlj-eh-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   AJUSTES 2.4.0 · GRÁFICA ÚNICA CON TRES VISTAS
   ========================================================= */

.evolucion-historica-container .tlj-eh-sync-row {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  gap: 9px;
  align-items: center;
  justify-content: center;
  margin: 0 0 0 auto;
}

.evolucion-historica-container .tlj-eh-sync-row .tlj-eh-sync {
  width: auto !important;
  min-width: 165px;
  margin: 0 !important;
}

.evolucion-historica-container .tlj-eh-all-tooltip {
  position: absolute;
  z-index: 10000;
  display: none;
  min-width: 190px;
  padding: 9px 11px;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .38);
  border-radius: 7px;
  background: var(--tlj-color-surface);
  box-shadow: var(--tlj-effect-shadow-popover);
  color: var(--tlj-color-text-secondary);
  font-size: 12px;
  line-height: 1.55;
  pointer-events: none;
}

.evolucion-historica-container .tlj-eh-all-tooltip strong,
.evolucion-historica-container .tlj-eh-all-tooltip span {
  display: block;
}

.evolucion-historica-container .tlj-eh-all-tooltip strong {
  margin-bottom: 3px;
  color: var(--tlj-color-accent-text);
  font-weight: 850;
}

.evolucion-historica-container .tlj-eh-all-tooltip .is-platform {
  color: var(--tlj-color-warning-text);
}

.evolucion-historica-container .tlj-eh-all-tooltip .is-withdrawal {
  color: var(--tlj-color-withdrawal);
}

.evolucion-historica-container .tlj-eh-all-tooltip .is-platform b,
.evolucion-historica-container .tlj-eh-all-tooltip .is-withdrawal b {
  color: inherit;
}

/* =========================================================
   AJUSTES 2.5.0 · LEGIBILIDAD Y CENTRADO
   ========================================================= */

/* Las tarjetas crecen o saltan de fila antes de recortar texto. */
.tlj-eh-summary {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  justify-content: center;
}

.tlj-eh-stat {
  min-width: 0;
}

.tlj-eh-stat > div {
  min-width: max-content;
}

.tlj-eh-stat > div > span,
.tlj-eh-stat strong {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* Toda la fila de acciones queda centrada. */
.evolucion-historica-container .boton-agregar-EH {
  justify-content: center;
}

/* Temporalidades con nombres completos. */
.evolucion-historica-container #timeframeSelectorEH button:not(.tlj-modal-action) {
  width: auto !important;
  min-width: 76px !important;
  padding: 0 12px !important;
  white-space: nowrap;
}

@media (max-width: 680px){
  .tlj-eh-summary {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .evolucion-historica-container #timeframeSelectorEH {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px){
  .tlj-eh-summary {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   AJUSTES 2.6.0 · LEYENDA EN TOOLBAR Y RESUMEN EN UNA FILA
   ========================================================= */

/* Las tarjetas permanecen siempre en una sola fila y crecen según su contenido. */
.evolucion-historica-container .tlj-eh-summary {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.evolucion-historica-container .tlj-eh-summary .tlj-eh-stat {
  width: auto;
  min-width: max-content;
  flex: 1 1 0;
  white-space: nowrap;
}

.evolucion-historica-container .tlj-eh-summary .tlj-eh-stat > div {
  min-width: max-content;
  flex: 0 0 auto;
}

.evolucion-historica-container .tlj-eh-summary .tlj-eh-stat > div > span,
.evolucion-historica-container .tlj-eh-summary .tlj-eh-stat strong {
  display: block;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  word-break: normal !important;
}

@media (max-width: 900px){
  /* Incluso en pantallas estrechas las tarjetas no saltan a una segunda fila. */
  .evolucion-historica-container .tlj-eh-summary {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
}

/* =========================================================
   EVOLUCIÓN HISTÓRICA 3.0.0 · UX / COLUMNAS / MESES / PDF
   ========================================================= */

/* Contorno de tabla alineado con Lista de Trades. */
.evolucion-historica-container .tlj-eh-table-card {
  overflow: hidden;
  border: 1px solid var(--tlj-color-accent) !important;
  border-radius: 10px;
}

/* Cabeceras mensuales plegables. */
.evolucion-historica-container #tablaEH tbody tr.tlj-eh-month-group,
.evolucion-historica-container #tablaEH tbody tr.tlj-eh-month-group:hover {
  background: var(--tlj-color-surface-2) !important;
}
.evolucion-historica-container #tablaEH tbody tr.tlj-eh-month-group td {
  position: static !important;
  right: auto !important;
  left: auto !important;
  z-index: 4 !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border-right: 0 !important;
  border-bottom: 1px solid rgba(var(--tlj-color-accent-rgb), .28) !important;
  background: var(--tlj-color-surface-2) !important;
  box-shadow: none !important;
  color: inherit !important;
  overflow: visible !important;
}
.evolucion-historica-container .tlj-eh-month-toggle {
  display: flex !important;
  width: 100% !important;
  min-height: 43px !important;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin: 0 !important;
  padding: 8px 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: linear-gradient(90deg, rgba(var(--tlj-color-accent-rgb), .09), rgba(var(--tlj-color-accent-rgb), .025) 52%, transparent) !important;
  box-shadow: none !important;
  color: var(--tlj-color-text-secondary) !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
  text-align: left !important;
  cursor: pointer;
  transition: background-color .3s ease !important;
}
.evolucion-historica-container .tlj-eh-month-toggle:hover,
.evolucion-historica-container .tlj-eh-month-toggle:focus-visible {
  background: linear-gradient(90deg, rgba(var(--tlj-color-accent-rgb), .15), rgba(var(--tlj-color-accent-rgb), .045) 55%, transparent) !important;
  outline: none !important;
}
.evolucion-historica-container .tlj-eh-month-arrow {
  flex: 0 0 16px;
  color: var(--tlj-color-accent-text);
  font-size: 16px;
  text-align: center;
}
.evolucion-historica-container .tlj-eh-month-toggle strong {
  color: var(--tlj-color-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .35px;
}
.evolucion-historica-container .tlj-eh-month-toggle > span:not(.tlj-eh-month-arrow) {
  color: var(--tlj-color-text-muted);
  font-weight: 650;
}
.evolucion-historica-container .tlj-eh-month-toggle > b {
  margin-left: 0;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}
.evolucion-historica-container .tlj-eh-month-toggle > b.is-positive { background:rgba(var(--tlj-color-positive-vivid-rgb), .1); color:var(--tlj-color-positive-text); }
.evolucion-historica-container .tlj-eh-month-toggle > b.is-negative { background:rgba(var(--tlj-color-negative-vivid-rgb), .1); color:var(--tlj-color-negative-text); }
.evolucion-historica-container .tlj-eh-month-toggle > b.is-breakeven { background:rgba(var(--tlj-color-breakeven-vivid-rgb), .1); color:var(--tlj-color-breakeven-text); }

/* Acciones de cabecera: personalizar columnas + filtro de warnings. */
.evolucion-historica-container #tablaEH th:last-child { min-width: 108px; }
.evolucion-historica-container .tlj-eh-table-head-actions {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  width: 100%;
}
/* Personalizar columnas: el panel es el modal Personalizar de TLJ Tema (.tlj-customize); aquí el ancho. */
.evolucion-historica-container .tlj-eh-columns-modal {
  --tlj-customize-columns: 3;
  width: min(680px, 100%);
}

/* =========================================================
   EVOLUCIÓN HISTÓRICA 3.1 · MULTISELECCIÓN / COMPARAR / LÍNEAS
   ========================================================= */

/* Líneas internas turquesa finas, como Lista de Trades. */
.evolucion-historica-container #tablaEH th,
.evolucion-historica-container #tablaEH td {
  border-right-color: rgba(var(--tlj-color-accent-rgb), .16) !important;
  border-bottom-color: rgba(var(--tlj-color-accent-rgb), .16) !important;
}
.evolucion-historica-container #tablaEH thead th {
  border-bottom-color: rgba(var(--tlj-color-accent-rgb), .42) !important;
}
.evolucion-historica-container #tablaEH th:last-child,
.evolucion-historica-container #tablaEH td:last-child {
  border-right-color: transparent !important;
}
.evolucion-historica-container #tablaEH tbody tr.tlj-eh-month-group td {
  border-bottom-color: rgba(var(--tlj-color-accent-rgb), .28) !important;
}

/* Columna independiente de selección múltiple. */
.evolucion-historica-container #tablaEH .tlj-eh-select-column,
.evolucion-historica-container #tablaEH .tlj-eh-select-cell {
  text-align: center !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.evolucion-historica-container .tlj-eh-select-all,
.evolucion-historica-container .tlj-eh-select-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  cursor: pointer;
}
.evolucion-historica-container .tlj-eh-select-all input,
.evolucion-historica-container .tlj-eh-select-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.evolucion-historica-container .tlj-eh-row-check {
  display: inline-flex;

  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--tlj-color-accent-rgb), .68);
  border-radius: 5px;
  background: var(--tlj-color-surface-2);
  color: transparent;
  font-size: 11px;
  font-weight: 900;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
.evolucion-historica-container .tlj-eh-select-all input:checked + .tlj-eh-row-check,
.evolucion-historica-container .tlj-eh-select-row input:checked + .tlj-eh-row-check {
  border-color: var(--tlj-color-accent);
  background: var(--tlj-color-accent);
  color: var(--tlj-color-on-accent);
}
.evolucion-historica-container .tlj-eh-select-all input:indeterminate + .tlj-eh-row-check {
  border-color: var(--tlj-color-accent);
  background: rgba(var(--tlj-color-accent-rgb), .18);
  color: var(--tlj-color-accent-text);
}
.evolucion-historica-container.tlj-eh-hide-multiselect .tlj-eh-select-column,
.evolucion-historica-container.tlj-eh-hide-multiselect .tlj-eh-select-cell {
  display: none !important;
}

/* Mantener Fecha fija aunque Selección múltiple sea una columna independiente. */
.evolucion-historica-container #tablaEH tbody td:nth-child(2) {
  position: sticky;

  z-index: 5;

  background: var(--tlj-color-surface);
  white-space: nowrap;
}
.evolucion-historica-container #tablaEH thead th:nth-child(2) {
  z-index: 14;
  color: var(--tlj-color-accent-text) !important;
}

/* La cabecera mensual no participa en las columnas sticky. */
.evolucion-historica-container #tablaEH tbody tr.tlj-eh-month-group td:nth-child(1),
.evolucion-historica-container #tablaEH tbody tr.tlj-eh-month-group td:nth-child(2) {
  position: static !important;
  left: auto !important;
}

/* =========================================================
   EVOLUCIÓN HISTÓRICA 3.2.1 · COLUMNA SELECCIÓN BLOQUEADA
   ========================================================= */

/*
 * table-layout:fixed hace que el navegador respete la anchura del <col>
 * de selección aunque la tabla tenga min-width:100%. La primera columna
 * queda realmente fija y el espacio restante se reparte entre las demás.
 */

/* Anchuras orientativas del resto de columnas. */
.evolucion-historica-container #tablaEH col.tlj-eh-col-date { width: 100px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-bpbruta { width: 110px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-bpneto { width: 110px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-trades { width: 92px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-acciones { width: 100px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-ur { width: 82px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-comdia { width: 110px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-bpacum { width: 122px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-comacum { width: 132px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-resultado { width: 105px; }
.evolucion-historica-container #tablaEH col.tlj-eh-col-accionesfila { width: 105px; }

.evolucion-historica-container #tablaEH th:first-child.tlj-eh-select-column,
.evolucion-historica-container #tablaEH td:first-child.tlj-eh-select-cell {
  box-sizing: border-box;
  padding: 0;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  text-align: center !important;
}

.evolucion-historica-container #tablaEH th:first-child.tlj-eh-select-column .tlj-eh-select-all,
.evolucion-historica-container #tablaEH td:first-child.tlj-eh-select-cell .tlj-eh-select-row {
  display: inline-flex !important;
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 24px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

.evolucion-historica-container #tablaEH .tlj-eh-row-check {
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px !important;
}

/* Fecha sticky inmediatamente después del ancho canónico de selección. */
.evolucion-historica-container #tablaEH th:nth-child(2),
.evolucion-historica-container #tablaEH td:nth-child(2) {
  left: var(--tlj-ledger-selection-column-width);
}

.evolucion-historica-container.tlj-eh-hide-multiselect #tablaEH col.tlj-eh-col-select {
  visibility: collapse !important;
  width: 0 !important;
}

.evolucion-historica-container.tlj-eh-hide-multiselect #tablaEH th:nth-child(2),
.evolucion-historica-container.tlj-eh-hide-multiselect #tablaEH td:nth-child(2) {
  left: 0 !important;
}

/* =========================================================
   MODAL · FECHA DUPLICADA
   ========================================================= */

/* =========================================================
   EVOLUCIÓN HISTÓRICA 3.2.2 · WARNING / GRÁFICA
   ========================================================= */

/* Warning de registro incompleto: a la derecha del lápiz. */
.evolucion-historica-container #tablaEH .tlj-eh-actions-cell {
  white-space: nowrap !important;
}

.evolucion-historica-container .tlj-eh-incomplete-warning {
  display: inline-flex;
  width: 27px;
  height: 31px;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  vertical-align: middle;
  color: var(--tlj-color-warning-text);
  line-height: 1;
  cursor: help;
}

.evolucion-historica-container .tlj-eh-incomplete-warning svg {
  width: 18px;
  height: 18px;
  fill: rgba(var(--tlj-color-warning-vivid-rgb), .06);
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Temporalidades: mismo borde turquesa claro que Todo / Movimientos. */
.evolucion-historica-container #timeframeSelectorEH button:not(.tlj-modal-action) {
  border-color: rgba(var(--tlj-color-accent-rgb), .22) !important;
}

.evolucion-historica-container #timeframeSelectorEH button:not(.tlj-modal-action):hover,
.evolucion-historica-container #timeframeSelectorEH button:not(.tlj-modal-action):focus-visible {
  border-color: rgba(var(--tlj-color-accent-rgb), .48) !important;
}

.evolucion-historica-container #timeframeSelectorEH button:not(.tlj-modal-action).active {
  border-color: var(--tlj-color-accent) !important;
}

/* Medias móviles (modo oscuro): borde turquesa claro en el control cerrado. */
html[data-tlj-theme="dark"] .evolucion-historica-container #smaSelect .custom-selectEH__selected {
  border-color: rgba(var(--tlj-color-accent-rgb), .22) !important;
  transition: color .35s ease, border-color .35s ease, background-color .35s ease !important;
}

html[data-tlj-theme="dark"] .evolucion-historica-container #smaSelect:hover .custom-selectEH__selected,
html[data-tlj-theme="dark"] .evolucion-historica-container #smaSelect.open .custom-selectEH__selected {
  border-color: rgba(var(--tlj-color-accent-rgb), .48) !important;
  background: var(--tlj-color-surface-3) !important;
  color: var(--tlj-color-accent-text) !important;
}

/* =========================================================
   EVOLUCIÓN HISTÓRICA 3.2.5 · AVISO ALTA MANUAL DE DÍA
   ========================================================= */

/* =========================================================
   EVOLUCIÓN HISTÓRICA 3.5.1 · CABECERAS ADAPTABLES ES / EN
   =========================================================
   La tabla deja de forzar anchos fijos en las columnas de datos.
   Cada columna puede crecer según el título o el contenido y, si el
   conjunto supera el ancho disponible, se mantiene el scroll horizontal.
   Selección, Fecha y Acciones conservan su comportamiento especial.
*/
.evolucion-historica-container #tablaEH {
  width: max-content !important;
  min-width: 100% !important;
  table-layout: auto !important;
}

/* Los anchos definidos en <colgroup> pasan a ser solo orientativos.
   En las columnas de datos dejamos que mande el contenido real. */
.evolucion-historica-container #tablaEH col:not(.tlj-eh-col-select) {
  width: auto !important;
}

.evolucion-historica-container #tablaEH thead th:not(.tlj-eh-select-column) {
  width: auto !important;
  min-width: max-content;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.evolucion-historica-container #tablaEH tbody td:not(.tlj-eh-select-cell) {
  width: auto !important;
}

/* Fecha mantiene un ancho mínimo cómodo y sigue fija tras Selección. */
.evolucion-historica-container #tablaEH th:nth-child(2),
.evolucion-historica-container #tablaEH td:nth-child(2) {
  min-width: 100px !important;
}

/* La columna de acciones conserva espacio suficiente para sus botones. */
.evolucion-historica-container #tablaEH th:last-child,
.evolucion-historica-container #tablaEH td:last-child {
  min-width: 108px !important;
}

/* Evolución Histórica 3.14.0 · Unidades de Riesgo */
.evolucion-historica-container #tablaEH td.tlj-eh-ur-cell{font-variant-numeric:tabular-nums;font-weight:550}
.evolucion-historica-container #tablaEH td.tlj-eh-ur-cell.is-positive{color:var(--tlj-color-positive-text)}
.evolucion-historica-container #tablaEH td.tlj-eh-ur-cell.is-negative{color:var(--tlj-color-negative-text)}
.evolucion-historica-container #tablaEH td.tlj-eh-ur-cell.is-breakeven{color:var(--tlj-color-breakeven-text)}


/* Filtro de warnings dentro del módulo Filtrar operaciones/días. */
.evolucion-historica-container .tlj-warning-filter-row {
  grid-column: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  width: 100%;
  margin: 0;
}
.evolucion-historica-container .tlj-warning-filter-row .tlj-warning-filter-toggle {
  display: inline-flex !important;
  width: auto !important;
  max-width: 100%;
  min-width: 0 !important;
  min-height: 40px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px;
  margin: 0 !important;
  padding: 9px 13px !important;
  border: 1px solid rgba(var(--tlj-color-warning-vivid-rgb), .2) !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: var(--tlj-color-warning-copy-muted) !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 12px !important;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.evolucion-historica-container .tlj-warning-filter-toggle svg {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.evolucion-historica-container .tlj-warning-filter-row .tlj-warning-filter-toggle:hover,
.evolucion-historica-container .tlj-warning-filter-row .tlj-warning-filter-toggle:focus-visible {
  border-color: rgba(var(--tlj-color-warning-vivid-rgb), .42) !important;
  background: rgba(var(--tlj-color-warning-vivid-rgb), .045) !important;
  color: var(--tlj-color-warning-copy-soft) !important;
  outline: none;
}
.evolucion-historica-container .tlj-warning-filter-row .tlj-warning-filter-toggle.is-active {
  border-color: rgba(var(--tlj-color-warning-vivid-rgb), .62) !important;
  background: rgba(var(--tlj-color-warning-vivid-rgb), .1) !important;
  color: var(--tlj-color-warning-text) !important;
}
.evolucion-historica-container .tlj-warning-filter-row .tlj-warning-filter-toggle.is-active svg {
  stroke-width: 2.25;
  filter: drop-shadow(0 0 5px rgba(var(--tlj-color-warning-vivid-rgb), .24));
}
@media (max-width: 540px) {
  .evolucion-historica-container .tlj-warning-filter-row .tlj-warning-filter-toggle {
    width: 100% !important;
  }
}

