/* Tokens de gráficos (paleta dataviz) sobre los temas de CoreUI */
:root, [data-coreui-theme="light"] {
  --viz-s1: #2a78d6;
  --viz-s2: #eb6834;
  --viz-grid: #e1e0d9;
  --viz-axis: #c3c2b7;
  --viz-muted: #898781;
}
[data-coreui-theme="dark"] {
  --viz-s1: #3987e5;
  --viz-s2: #d95926;
  --viz-grid: #2c2c2a;
  --viz-axis: #383835;
  --viz-muted: #898781;
}

[hidden] { display: none !important; }

/* offset del contenido por el sidebar fijo (desktop) */
@media (min-width: 992px) {
  .wrapper { padding-left: 16rem; }
}

/* KPI */
.kpi-value { font-size: 1.55rem; font-weight: 600; }
.kpi-hero { font-size: 3rem; font-weight: 650; line-height: 1.1; }

/* gráfico de columnas */
svg.chart { display: block; width: 100%; height: auto; }
svg.chart text { font: 11px var(--cui-body-font-family, system-ui); fill: var(--viz-muted); }
.bar { fill: var(--viz-s1); }
.hit { fill: transparent; outline: none; }
.hit:hover + .bar, .hit:focus + .bar { fill-opacity: .8; }

/* barras de desglose de costos */
.costo-bar { height: 12px; background: var(--viz-s1); border-radius: 0 4px 4px 0; min-width: 2px; }

/* tooltip */
#tt {
  position: fixed; z-index: 2000; pointer-events: none; display: none;
  background: var(--cui-body-bg); border: 1px solid var(--cui-border-color);
  border-radius: 8px; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.18); max-width: 320px;
}
#tt .t-title { font-size: 12px; color: var(--cui-secondary-color); margin-bottom: 4px; }
#tt .t-row { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
#tt .t-row b { font-weight: 600; }
#tt .t-row span { color: var(--cui-secondary-color); }

/* tabla de publicaciones: celdas de dos niveles, legibles de un vistazo */
.tabla-pubs { --alto-fila: 1; }
.tabla-pubs td { vertical-align: middle; padding: .55rem .5rem; }
.tabla-pubs th { padding: .5rem; white-space: nowrap; }
.tabla-pubs .val { font-variant-numeric: tabular-nums; line-height: 1.2; }
.tabla-pubs .val-fuerte { font-weight: 600; }
.tabla-pubs .sub { font-size: .72rem; color: var(--cui-secondary-color); line-height: 1.25; }
.tabla-pubs .titulo-pub {
  display: block; max-width: 34ch; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 500;
}
.tabla-pubs .chips { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: .15rem; }
.tabla-pubs .chip {
  font-size: .66rem; padding: .05rem .3rem; border-radius: 4px;
  border: 1px solid var(--cui-border-color); color: var(--cui-secondary-color); white-space: nowrap;
}
.tabla-pubs .chip-cuotas { border-color: #6f42c1; color: #8f6fd1; }
.tabla-pubs .chip-full { border-color: #1baf7a; color: #1baf7a; }
.tabla-pubs tr.fila-alerta td { background: color-mix(in srgb, var(--cui-danger) 6%, transparent); }
.tabla-pubs .accion { white-space: nowrap; font-size: .75rem; }

/* tablas */
td.name { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
input.costo-input { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
