/* timeline.css — #viz-canvas, eje-x, slider, gantt, tl-*, vb-*, vc-*, vd-*, ve-* */

#viz-canvas { flex: 1; overflow: auto; padding: 8px 16px 0; min-height: 0; overflow-x: hidden; }

.eje-x-bar {
  display: flex; align-items: flex-start; gap: 0;
  flex-shrink: 0;
  padding: 8px 16px 0;
  border-bottom: 1.5px solid #ccccc8;
  background: #fafaf8;
}

.eje-x-label-col { display: none; } /* corría las marcas 152 px (~11 días) respecto de las barras */
.eje-x-track { flex: 1; position: relative; height: 24px; }
.eje-x-marca {
  position: absolute; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
}
.eje-x-marca-tick  { width: 1px; height: 4px; margin-bottom: 3px; background: #c4c4be; }
.eje-x-marca-mes .eje-x-marca-tick { height: 7px; margin-bottom: 0; background: #8a8a85; }
.eje-x-marca-label { font-size: 11px; color: #6b6b6b; white-space: nowrap; margin-top: 2px; font-weight: 500; }

/* — slider dual — */
.sd-wrap { display: flex; align-items: center; gap: 6px; width: 100%; }
.sd-label { font-size: 11px; color: #6b6b6b; white-space: nowrap; min-width: 36px; }
.sd-label-max { text-align: right; }
.sd-track-wrap { position: relative; flex: 1; height: 16px; display: flex; align-items: center; }
.sd-track-wrap::before {
  content: ""; position: absolute; width: 100%; height: 2px;
  background: #e0e0d8; border-radius: 2px;
}
.sd-track-fill { position: absolute; height: 2px; background: #1a1a1a; border-radius: 2px; pointer-events: none; }
.sd-input {
  position: absolute; width: 100%;
  -webkit-appearance: none; appearance: none;
  background: transparent; pointer-events: none; height: 2px;
}
.sd-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: #1a1a1a; border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2); cursor: pointer; pointer-events: all;
}
.sd-input::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%;
  background: #1a1a1a; border: 2px solid white; cursor: pointer; pointer-events: all;
}
.sd-input::-webkit-slider-thumb:active { background: #185FA5; }
.sd-input:focus { outline: none; }

/* — Gantt — */

.gantt-tooltip {
  position: fixed; z-index: 9999;
  background: rgba(38,38,40,.95); color: white;
  font-size: 11px; padding: 6px 9px;
  border-radius: 6px; pointer-events: none;
  line-height: 1.35; max-width: 320px;
  box-shadow: 0 3px 10px rgba(0,0,0,.16);
}
.gtt-titulo {
  font-weight: 600; font-size: 11px;
  margin-bottom: 3px;
  white-space: normal; line-height: 1.25;
}
.gtt-fecha {
  display: flex; justify-content: space-between; gap: 14px;
  font-size: 11px; white-space: nowrap;
}
.gtt-fecha span:first-child { color: rgba(255,255,255,.55); }

/* — Vista A (situaciones) — *//* — Vista general tl — */

/* Vista E (conclusiones/narrativo): grilla de tarjetas caso × momento */

/* — Vista B (barras de avance) — */

/* — Vista C (heatmap) — */
.vc-leyenda { display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 0 10px; border-bottom: 0.5px solid #f0f0ec; margin-bottom: 8px; }
.vc-ley-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #555; }
.vc-ley-dot  { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.vc-grid {
  display: grid;
  gap: 3px 4px;
  align-items: center;
}
.vc-corner { }
.vc-col-label {
  font-size: 11px; color: #6b6b6b; font-weight: 500;
  text-align: center; padding-bottom: 4px;
  border-bottom: 0.5px solid #f0f0ec;
}
.vc-grupo-header {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .07em; color: #6b6b6b;
  padding: 6px 0 2px;
}
.vc-sede-label {
  font-size: 11.5px; text-align: right; padding-right: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.vc-sede-label:hover { opacity: .7; }
.vc-cell {
  height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; overflow: hidden;
  transition: opacity .15s;
}
.vc-cell:hover { filter: brightness(1.08); }
.vc-cell-label {
  font-size: 9px; color: white; font-weight: 500;
  white-space: nowrap; pointer-events: none; padding: 0 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,.2);
}/* — Vista D (ribbons/grafo) — */

/* Nombre de fila del Gantt: tema arriba, (ODPE) debajo en gris. */

/* Subencabezado de ODPE dentro del árbol (Departamento › ODPE › temas). */

/* ── Árbol de agregación en la temporal (Perú › Depto › ODPE › tema) ───── *//* niveles más profundos un poco más chicos / tenues */

/* Indentación de niveles del árbol comprimido. */
/* Las hojas (temas) se indentan en _ganttFila vía depth=3. */

/* ── Gantt d3 (árbol jerárquico + hitos) ──────────────────────────────── */
.gantt-d3-svg { font-family: system-ui, sans-serif; }
.gantt-d3-hlabel { font-size: 11px; fill: #6b6b6b; }
.gantt-d3-bar { cursor: pointer; }
.gantt-d3-bar:hover { filter: brightness(1.08); }
.gantt-d3-dot { cursor: pointer; }
.gantt-d3-dot:hover { r: 6; }

/* Nombre del tema arriba de su barra de hitos. */

/* ── Gantt d3 unificado: pastillas + hitos + cuadrícula ────────────────── */
.gantt-d3-svg { font-family: system-ui, sans-serif; }
.gantt-pill { transition: filter .12s; }
.gantt-pill:hover { filter: brightness(0.97); }
.gantt-pill-txt { font-size: 11px; font-weight: 500; }
.pill-txt-pais, .pill-txt-departamento { font-weight: 600; }
.pill-txt-odpe { font-weight: 500; }
.gantt-d3-hlabel { font-size: 11px; fill: #6b6b6b; }
.gantt-d3-bar { cursor: pointer; }
.gantt-d3-bar:hover { filter: brightness(1.08); }
.gantt-d3-dot { cursor: pointer; }

/* ── Variable tipo A: números de seguimiento + leyenda ─────────────────── */

/* Bolitas de situaciones: vigentes al cierre del hito; «+n» gris al lado. */
.gantt-flow-dot { cursor: pointer; }
.gantt-flow-num { font-size: 11px; font-weight: 700; pointer-events: none; font-variant-numeric: tabular-nums; }
.gantt-flow-extra { font-size: 11px; font-weight: 600; fill: #6b6b6b; cursor: pointer; font-variant-numeric: tabular-nums; }
.gtt-linea { font-size: 11px; color: rgba(255,255,255,.88); margin-top: 2px; }

/* Leyenda de una línea encima de las filas del Gantt (sustituye a la «i»). */
.gantt-leyenda {
  position: sticky; top: 0; z-index: 2;
  background: #fff;
  font-size: 11.5px; line-height: 1.4; color: #6b6b6b;
  padding: 2px 0 4px;
}
.gantt-ley-pto {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin: 0 3px 0 1px; vertical-align: 0;
}
.gantt-ley-extra { font-weight: 600; }

/* Variable tipo B: barra de avance. */

/* Variable Personal contratado. */
/* ── V2: barra de la vista principal con el selector de variable ─────────── */
.zt-barra { justify-content: flex-start; flex-wrap: wrap; row-gap: 6px; }
.zt-conteo { white-space: nowrap; }
.zt-var { display: inline-flex; align-items: center; gap: 7px; margin-right: 6px; }
.zt-sel {
  height: 26px; padding: 0 26px 0 9px; font: inherit; font-size: 13px; color: var(--tinta);
  border: 1px solid var(--regla); border-radius: 3px; cursor: pointer; max-width: 220px;
  appearance: none; -webkit-appearance: none;
  background: var(--papel) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%235F6B7D' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 9px center;
}
.zt-sel:hover { border-color: var(--tinta-3); }
.zt-seg button[hidden] { display: none; }

/* ── V2: Hitos alineados con cualquier variable ──────────────────────────── */
.lh-val { font-size: 11px; fill: var(--tinta-2); font-variant-numeric: tabular-nums; pointer-events: none; }
.lh:not(.lh-todos) .lh-sel .lh-val { fill: var(--tinta); }
.lh-ultimo { font-size: 12.5px; color: var(--tinta); font-variant-numeric: tabular-nums; }
.lh-ultimo-vacio { color: var(--tinta-3); }
.lh-ley-tam, .lh-ley-fin { color: var(--tinta-3); }
.ct-sindato { vertical-align: middle; }

/* ── Foco de teclado en «Por fecha» ─────────────────────────────────────────── */
.gantt-fila:focus, .gantt-item:focus, .gantt-pill-g:focus { outline: none; }
.gantt-fila:focus-visible > .gantt-foco-fila { stroke: var(--cobalto, #285A97); stroke-width: 2; }
.gantt-item:focus-visible { outline: 2px solid var(--cobalto, #285A97); outline-offset: 2px; }
.gantt-flow-dot.gantt-item:focus-visible { stroke: var(--cobalto, #285A97); stroke-width: 3; outline: none; }
.gantt-d3-bar.gantt-item:focus-visible { stroke: var(--cobalto, #285A97); stroke-width: 2.5; outline: none; }
.gantt-pill-g:focus-visible .gantt-pill { stroke: var(--cobalto, #285A97); stroke-width: 2.5; }
.ctx-depto-menu .ctx-item:focus-visible { outline: 2px solid var(--cobalto, #285A97); outline-offset: -2px; background: #f1f4f9; }

/* ── Fase 4: «Evolución» con el interruptor «Fechas reales» ───────────────── */
.zt-fechas { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--tinta-2); cursor: pointer; margin-left: 4px; }
.zt-fechas[hidden] { display: none; }
.zt-fechas input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.zt-sw { position: relative; width: 30px; height: 16px; border-radius: 8px; background: var(--regla); transition: background .15s; flex: 0 0 auto; }
.zt-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s; }
.zt-fechas input:checked + .zt-sw { background: var(--tinta); }
.zt-fechas input:checked + .zt-sw::after { transform: translateX(14px); }
.zt-fechas input:focus-visible + .zt-sw { outline: 2px solid var(--cobalto); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .zt-sw, .zt-sw::after { transition: none; } }

/* Con fechas reales, la barra del control queda como contexto detrás de las bolitas. */
.gantt-d3-bar { fill: #D3D8DF !important; }

/* «Al final» en gris: solo el número de vigentes lleva color. */
.lh-final .ct-pill { background: none; box-shadow: none; color: var(--tinta-3); font-weight: 500; padding: 0 2px; }
.lh-final .ct-pill-rojo { color: var(--rojo); font-weight: 700; }
.lh-final .ct-pill.ct-sinconf { border: 1.5px dashed var(--gris); border-radius: 11px; padding: 0 7px; line-height: 17px; }
/* Las demás fechas del hito (inicio, notificación…) quedan como puntos chicos y tenues. */
.gantt-d3-dot { r: 2.6px; fill: #9AA6B4; }

/* Ayuda «?» de la leyenda: reemplaza las dos líneas de texto (21 nov 2026). */
.lh-ley-ayuda {
  width: 18px; height: 18px; border-radius: 50%; padding: 0; margin-left: 4px;
  border: 1px solid var(--regla, #C9D0D9); background: var(--papel, #fff);
  color: var(--tinta-2, #4A5567); font-size: 11px; line-height: 16px; cursor: help;
}
.lh-ley-ayuda:hover { border-color: var(--tinta-3, #5F6B7D); }
