/* ====== /report (scoped) ====== */
body.report-page {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  background-color: #0a0a0d;
  color: #f1f1f1;
}

/* ---------- Header / Nav (solo en report) ---------- */
body.report-page nav {
  background: #111;
  padding: 10px 0;
  text-align: center;
}
body.report-page nav a {
  color: #00e5ff;
  margin: 0 12px;
  text-decoration: none;
  font-weight: bold;
}
body.report-page nav a:hover { text-decoration: underline; }

/* ---------- Título + Exportar ---------- */
body.report-page h1 {
  font-size: 16px;
  font-weight: 600;
  margin: 10px 0 8px;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-align: center;
}
body.report-page .contenedor-exportar {
  margin: 8px 0 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* ahora a la izquierda */
  gap: 15px;
}
body.report-page .boton-excel-verde {
  background: #00b74a;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}
body.report-page .boton-excel-verde:hover { background: #009b3c; }
body.report-page .mensaje-confirmacion {
  display: none;
  color: #00e5ff;
  font-weight: bold;
}

/* ---------- DataTables (desktop) ---------- */
/* Desktop: cards anchos y centrados */

@media (min-width: 1024px) {
  /* Cards anchos y centrados */
  body.report-page .report-card,
  body.report-page .card-notes {
    max-width: 1600px;  /* súbelo a 1700/1800 si quieres más */
    width: 95%;
    margin: 30px auto;
  }

  /* Wrapper sin escalado */
  body.report-page #tabla-indicadores_wrapper { transform: none; }

  /* Que el contenido defina el ancho de columnas */
  body.report-page #tabla-indicadores { table-layout: auto; }

  /* Quitar tope de 200px a Empresa/Sector en desktop */
  body.report-page #tabla-indicadores th:nth-child(2),
  body.report-page #tabla-indicadores td:nth-child(2),
  body.report-page #tabla-indicadores th:nth-child(3),
  body.report-page #tabla-indicadores td:nth-child(3) {
    max-width: none;
  }

  /* Aire en celdas y mínimo para Sector */
  .report-card table td { padding: 10px 16px; }
  .report-card table th:nth-child(3),
  .report-card table td:nth-child(3) { min-width: 220px; }

  /* Evita cortes feos y muestra “…” si algo se pasa */
  .report-card table td,
  .report-card table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

body.report-page #tabla-indicadores th,
body.report-page #tabla-indicadores td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Empresa(2) y Sector(3) multilínea */
body.report-page #tabla-indicadores th:nth-child(2),
body.report-page #tabla-indicadores td:nth-child(2),
body.report-page #tabla-indicadores th:nth-child(3),
body.report-page #tabla-indicadores td:nth-child(3) {
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  max-width: 200px;
}


/* UI DataTables (solo en report) */
body.report-page .dataTables_wrapper .dataTables_length select,
body.report-page .dataTables_wrapper .dataTables_filter input,
body.report-page .dataTables_wrapper .dataTables_info,
body.report-page .dataTables_wrapper .dataTables_paginate .paginate_button {
  font-size: 13px;
}
body.report-page .dataTables_wrapper .dataTables_filter { 
  display:block; 
  text-align:right; 
  margin-bottom:10px; 
}

/* Evita roturas por % largos */
table.dataTable td { white-space: nowrap; }

/* ---------- Resaltado columnas 8–11 ---------- */
body.report-page #tabla-indicadores thead th:nth-child(8),
body.report-page #tabla-indicadores tbody td:nth-child(8),
body.report-page #tabla-indicadores thead th:nth-child(9),
body.report-page #tabla-indicadores tbody td:nth-child(9),
body.report-page #tabla-indicadores thead th:nth-child(10),
body.report-page #tabla-indicadores tbody td:nth-child(10),
body.report-page #tabla-indicadores thead th:nth-child(11),
body.report-page #tabla-indicadores tbody td:nth-child(11) {
  background: linear-gradient(180deg, rgba(0,191,255,0.12) 0%, rgba(0,0,0,0) 100%);
  box-shadow: inset 1px 0 0 rgba(0,229,255,0.35), inset -1px 0 0 rgba(0,229,255,0.35);
  color: #e3f8ff;
}
body.report-page #tabla-indicadores tbody tr:hover td:nth-child(8),
body.report-page #tabla-indicadores tbody tr:hover td:nth-child(9),
body.report-page #tabla-indicadores tbody tr:hover td:nth-child(10),
body.report-page #tabla-indicadores tbody tr:hover td:nth-child(11){
  background: linear-gradient(180deg, rgba(0,229,255,0.22) 0%, rgba(0,0,0,0) 100%);
}

/* ---------- Nota de fuente / animación ---------- */
@keyframes bounce { 
  0%,100%{transform:translateY(0)} 
  50%{transform:translateY(4px)} 
}
.bounce { animation: bounce 1.5s infinite; }

body.report-page .data-source-note {
  margin: 10px 0 24px;
  font-size: 12.5px;
  color: #9ad4ff;
  background: #151a1f;
  border: 1px solid #223;
  padding: 8px 12px;
  border-radius: 6px;
  display: inline-block;
  text-align: center;
}

/* ---------- Sección de notas ---------- */
body.report-page .report-notes h2 {
  color: #00e5ff;
  margin-bottom: 5px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}
body.report-page .report-notes ul {
  line-height: 1.8;
  font-size: 15px;
  list-style-type: none;
  padding-left: 0;
  margin-top: 10px;
}

/* ====== MÓVIL (<=768px) ====== */

/* --- Hover visible de fila sin pisar columnas 8–11 --- */
body.report-page #tabla-indicadores tbody tr {
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.12s ease;
}

/* Aplica hover a TODAS las celdas EXCEPTO 8–11 (que ya tienen su gradiente) */
body.report-page #tabla-indicadores tbody tr:hover td:not(:nth-child(8)):not(:nth-child(9)):not(:nth-child(10)):not(:nth-child(11)) {
  background: linear-gradient(90deg, rgba(0,229,255,0.08) 0%, rgba(0,229,255,0.03) 100%);
}

@media (hover:hover) {
  body.report-page #tabla-indicadores tbody tr:hover { 
    box-shadow: 0 0 12px rgba(0,229,255,0.18);
    transform: translateZ(0) scale(1.003);
  }
}

/* Encabezado marcado */
body.report-page #tabla-indicadores thead th{
  background:#0f141b;
  color:#cfefff;
  border-bottom:2px solid rgba(255,255,255,0.15);
}
/* Opcional: cabecera fija al hacer scroll */
@media (min-height:500px){
  body.report-page #tabla-indicadores thead th{
    position: sticky; top:0; z-index:2;
  }
}

/* Alineación numérica columnas 4–16 (desktop) */
@media (min-width: 769px){
  body.report-page #tabla-indicadores td:nth-child(n+4),
  body.report-page #tabla-indicadores th:nth-child(n+4){
    text-align: right;
  }
  /* Mantén texto a la izq en Empresa/Sector */
  body.report-page #tabla-indicadores td:nth-child(2),
  body.report-page #tabla-indicadores td:nth-child(3),
  body.report-page #tabla-indicadores th:nth-child(2),
  body.report-page #tabla-indicadores th:nth-child(3){
    text-align: left;
  }
}

/* Filtro y paginación coherentes con modo oscuro */
body.report-page .dataTables_wrapper .dataTables_filter input{
  background:#222; color:#fff; border:1px solid #444;
  padding:6px 8px; border-radius:6px;
}
body.report-page .dataTables_wrapper .dataTables_paginate .paginate_button{
  color:#cfefff !important; border:1px solid #223; background:#111;
  border-radius:6px; margin:0 2px;
}
body.report-page .dataTables_wrapper .dataTables_paginate .paginate_button.current{
  background:#0b2230 !important; border-color:#00e5ff !important;
}
body.report-page .dataTables_wrapper .dataTables_paginate .paginate_button:hover{
  background:#0e2a3a !important; border-color:#27d1ff !important;
}
body.report-page .dataTables_wrapper .dataTables_info{ color:#9ad4ff; }

/* Enfoque por teclado */
body.report-page .boton-excel-verde:focus-visible{
  outline:2px solid #27d1ff; outline-offset:2px;
}
/* Zebra + hover solo en desktop (evita pisar el card de móvil) */
@media (min-width: 769px){
  body.report-page #tabla-indicadores tbody tr:nth-child(even)
    td:not(:nth-child(8)):not(:nth-child(9)):not(:nth-child(10)):not(:nth-child(11)){
    background-color: rgba(255,255,255,0.015);
  }
}


/* ====== Cards (tabla y detalle) ====== */
body.report-page .report-card,
body.report-page .card-notes{
  background: linear-gradient(180deg, rgba(12,18,26,0.96) 0%, rgba(10,10,13,0.96) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  padding: 14px 14px 10px;
  margin: 10px auto 18px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .1s ease;
}

body.report-page .report-card:hover,
body.report-page .card-notes:hover{
  border-color: rgba(0,229,255,0.45);
  box-shadow: 0 0 18px rgba(0,229,255,0.20);
  transform: translateZ(0) scale(1.002);
}

/* Título del bloque detalle */
body.report-page .card-notes h2{
  color:#00e5ff;
  font-size:18px;
  margin: 0 0 8px 0;
  text-align:center;
}

/* Palabras/conceptos en celeste dentro del detalle (no necesitas backend) */
body.report-page .report-notes strong{
  color:#00e5ff;           /* ← aqui pones el celeste */
  font-weight:700;
}

/* Líneas de tabla más blancas (override dentro del card) */
body.report-page .report-card #tabla-indicadores{
  border: 1px solid rgba(255,255,255,0.18);
}
body.report-page .report-card #tabla-indicadores th,
body.report-page .report-card #tabla-indicadores td{
  border-bottom: 1px solid rgba(255,255,255,0.16);
  border-right: 1px solid rgba(255,255,255,0.10);
}

/* Encabezado marcado, consistente con el card */
body.report-page .report-card #tabla-indicadores thead th{
  background:#0f141b;
  color:#cfefff;
  border-bottom:2px solid rgba(255,255,255,0.22);
}

/* Hover de fila: leve glow */
body.report-page .report-card #tabla-indicadores tbody tr{
  transition: background .25s ease, box-shadow .25s ease, transform .12s ease;
}
body.report-page .report-card #tabla-indicadores tbody tr:hover td:not(:nth-child(8)):not(:nth-child(9)):not(:nth-child(10)):not(:nth-child(11)){
  background: linear-gradient(90deg, rgba(0,229,255,0.08) 0%, rgba(0,229,255,0.03) 100%);
}
@media (hover:hover){
  body.report-page .report-card #tabla-indicadores tbody tr:hover{
    box-shadow: 0 0 12px rgba(0,229,255,0.18);
    transform: translateZ(0) scale(1.002);
  }
}

/* Mobile: los cards sin cambios visuales fuertes */
@media (max-width:768px){
  body.report-page .report-card,
  body.report-page .card-notes{
    padding: 12px;
    width: 96%;
  }
}




.report-card table {
  width: 100%;
}



/* ===== Ajustes MOBILE específicos ===== */
/* ====== MÓVIL (<=768px) ====== */
@media (max-width: 768px){
  /* Ajuste general de escala del wrapper */
  body.report-page #tabla-indicadores_wrapper { transform: scale(0.93); }

  /* Navbar compacta */
  body.report-page nav{
    padding: 4px 6px !important;
    line-height: 0.85 !important;
  }
  body.report-page nav a{
    display: inline-block;
    font-size: 11.8px !important;
    padding: 1px 1.5px !important;
    margin: 1px 2px !important;
    word-spacing: -0.35ch !important;
    letter-spacing: -0.1px !important;
    white-space: nowrap !important;
  }

  /* Layout tipo tarjeta */
  body.report-page #tabla-indicadores thead{ display:none; }
  body.report-page #tabla-indicadores,
  body.report-page #tabla-indicadores tbody,
  body.report-page #tabla-indicadores tr,
  body.report-page #tabla-indicadores td{ display:block; width:100%; }

  body.report-page #tabla-indicadores tbody tr{
    background:#101826;
    border:1px solid #1f2a3a;
    border-radius:14px;
    margin:12px 8px;
    overflow:hidden;
    box-shadow:0 6px 14px rgba(0,0,0,.35);
  }

  /* Celda etiqueta + valor */
  body.report-page #tabla-indicadores tbody td{
    display:flex !important;
    align-items:flex-start;
    justify-content:flex-start !important; /* pegado a la izq */
    gap:8px;
    padding:10px 12px !important;
    border-bottom:1px solid #182233;
    color:#e6eefc;
    line-height:1.35;
    font-size:12px;
    white-space:normal;
    word-break: break-word;
    min-width:0; /* evita desbordes raros dentro del flex */
    text-align:left !important;
  }
  body.report-page #tabla-indicadores tbody td:last-child{ border-bottom:0; }

  /* Etiquetas por posición */
  body.report-page #tabla-indicadores tbody td::before{
    margin-right:12px;
    color:#8fc8ff;
    font-weight:700;
    font-size:12.5px;
    white-space:nowrap !important;
    flex:0 0 84px; /* más angosta para acercar el valor */
    text-align:left;
    content:"";
  }
  body.report-page #tabla-indicadores tbody td:nth-child(1)::before  { content:"Ticker"; }
  body.report-page #tabla-indicadores tbody td:nth-child(2)::before  { content:"Empresa"; }
  body.report-page #tabla-indicadores tbody td:nth-child(3)::before  { content:"Sector"; }
  body.report-page #tabla-indicadores tbody td:nth-child(4)::before  { content:"Retorno (%)"; }
  body.report-page #tabla-indicadores tbody td:nth-child(5)::before  { content:"Alpha (%)"; }
  body.report-page #tabla-indicadores tbody td:nth-child(6)::before  { content:"CAPM (%)"; }
  body.report-page #tabla-indicadores tbody td:nth-child(7)::before  { content:"Spot"; }
  body.report-page #tabla-indicadores tbody td:nth-child(8)::before  { content:"Vol. 25D (%)"; }
  body.report-page #tabla-indicadores tbody td:nth-child(9)::before  { content:"RiskTone (%)"; }
  body.report-page #tabla-indicadores tbody td:nth-child(10)::before { content:"Mkt 3M (%)"; }
  body.report-page #tabla-indicadores tbody td:nth-child(11)::before { content:"FT 3M (%)"; }
  body.report-page #tabla-indicadores tbody td:nth-child(12)::before { content:"Beta"; }
  body.report-page #tabla-indicadores tbody td:nth-child(13)::before { content:"Sharpe"; }
  body.report-page #tabla-indicadores tbody td:nth-child(14)::before { content:"Treynor"; }
  body.report-page #tabla-indicadores tbody td:nth-child(15)::before { content:"P/E"; }
  body.report-page #tabla-indicadores tbody td:nth-child(16)::before { content:"Ratio Div. (%)"; }

  /* Texto izq en 1–3; numéricos centrados desde 4 */
  body.report-page #tabla-indicadores tbody td:nth-child(-n+3){
    justify-content:space-between !important;
  }
  body.report-page #tabla-indicadores tbody td:nth-child(n+4){
    text-align:center !important;
    justify-content:center !important;
    font-variant-numeric: tabular-nums;
    font-feature-settings:"tnum" 1;
  }

  /* Resaltado 8–11 en móvil */
  body.report-page #tabla-indicadores tbody td:nth-child(8),
  body.report-page #tabla-indicadores tbody td:nth-child(9),
  body.report-page #tabla-indicadores tbody td:nth-child(10),
  body.report-page #tabla-indicadores tbody td:nth-child(11){
    background: linear-gradient(180deg, rgba(0,191,255,0.12) 0%, rgba(0,0,0,0) 100%) !important;
    box-shadow: inset 1px 0 0 rgba(0,229,255,0.35), inset -1px 0 0 rgba(0,229,255,0.35) !important;
    color:#e3f8ff;
  }
  body.report-page #tabla-indicadores tbody tr:hover td:nth-child(8),
  body.report-page #tabla-indicadores tbody tr:hover td:nth-child(9),
  body.report-page #tabla-indicadores tbody tr:hover td:nth-child(10),
  body.report-page #tabla-indicadores tbody tr:hover td:nth-child(11){
    background: linear-gradient(180deg, rgba(0,229,255,0.22) 0%, rgba(0,0,0,0) 100%) !important;
  }

  /* Evitar desbordes y centrar tabla */
  body.report-page { overflow-x: hidden !important; }
  body.report-page #tabla-indicadores{
    width:95% !important;
    margin:0 auto !important;
    overflow-x:hidden !important;
  }

  /* Botón full-width opcional */
  body.report-page .boton-excel-verde { width:100%; }
}

/* ===== Ajustes finos MOBILE: etiqueta/valor y centrado real ===== */
@media (max-width: 768px){

  /* Cada celda = 2 columnas: [etiqueta | valor] */
  body.report-page #tabla-indicadores tbody td{
    display: grid !important;
    grid-template-columns: 68px 1fr;   /* etiqueta más angosta = valor más cerca */
    align-items: center;
    gap: 6px;
    padding: 10px 12px !important;
    min-width: 0;
    text-align: left !important;       /* base a la izq, afinamos abajo */
  }

  /* La “etiqueta” (::before) ocupa la 1ª columna y no agrega margen extra */
  body.report-page #tabla-indicadores tbody td::before{
    grid-column: 1;
    margin-right: 0;
    white-space: nowrap !important;
    font-weight: 700;
    color: #8fc8ff;
    text-align: left;
  }

  /* 1–3 (Ticker, Empresa, Sector): valor pegado a la izquierda */
  body.report-page #tabla-indicadores tbody td:nth-child(-n+3){
    text-align: left !important;       /* valor columna 2 a la izquierda */
  }

  /* Ticker más visible y “cerca” de la etiqueta */
  body.report-page #tabla-indicadores tbody td:nth-child(1){
    font-weight: 700;
    color: #eaf7ff;
    letter-spacing: .2px;
  }

  /* Desde 4 en adelante: valor centrado de verdad (columna 2) */
  body.report-page #tabla-indicadores tbody td:nth-child(n+4){
    text-align: center !important;     /* centra el contenido en col 2 */
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
  }
}

/* ===== Cuadro de detalle un poco más pequeño en móvil ===== */
@media (max-width: 768px){
  body.report-page #tabla-indicadores_wrapper {
    transform: scale(0.95);     /* reduce todo un ~10% */
    transform-origin: top center;  /* mantiene alineado visualmente */
  }
}

/* ===== Desktop: simetría entre tabla y cuadro de detalle ===== */
@media (min-width: 769px){
  /* Escala general */
  body.report-page #tabla-indicadores_wrapper {
    transform: scale(0.95);
    transform-origin: top center;
    margin: 0 auto;                  /* centra el bloque */
    max-width: 1600px;               /* mismo ancho que el cuadro */
  }

  /* Cuadro de detalle de campos */
  body.report-page .detalle-campos {
    transform: scale(0.95);
    transform-origin: top center;
    margin: 20px auto;
    max-width: 1600px;               /* igual ancho que la tabla */
  }
}

/* ===== Ajuste de tamaño de letra para la tabla ===== */
#tabla-indicadores,
#tabla-indicadores th,
#tabla-indicadores td {
  font-size: 13px !important;  /* reduce el texto */
  line-height: 1.2em;
}

/* Opcional: si usás DataTables */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-size: 12px;
}
