/* Plan de acción: KPIs, leyenda y Gantt. */
/* Plan de acción */
.nowrap { white-space: nowrap; }
.row-links { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.plan-controls input[type="date"] { min-width: 140px; }
.plan-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.plan-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gantt-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-muted); margin-bottom: 10px; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.lg.phase { background: var(--text); } .lg.none { background: var(--sev-info); }
.lg.ms { width: 10px; height: 10px; background: var(--text); transform: rotate(45deg); border-radius: 1px; }
.lg.today { width: 2px; height: 14px; background: var(--sev-critical); }
.gantt { --left: 520px; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; position: relative; }
.g-row { display: flex; min-height: 30px; border-bottom: 1px solid var(--border); width: max-content; min-width: 100%; }
.g-row:not(.g-head):not(.k-summary) { cursor: pointer; }
.g-row:not(.g-head):hover .g-left, .g-row.open .g-left { background: var(--surface-2); }
.g-left { position: sticky; left: 0; z-index: 2; flex: 0 0 var(--left); width: var(--left); display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; background: var(--surface); border-right: 1px solid var(--border); }
.g-wbs { flex: 0 0 34px; color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.g-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.g-name > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.g-dur { flex: 0 0 34px; text-align: right; font-variant-numeric: tabular-nums; }
.g-dates { flex: 0 0 96px; text-align: right; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.caret { color: var(--text-muted); width: 10px; flex: 0 0 10px; }
.p-pill { font-size: 10px; padding: 0 5px; color: #fff; flex: 0 0 auto; }
.k-summary .g-left { font-weight: 600; background: var(--surface-2); }
.k-milestone .g-name { font-style: italic; }
.g-right { position: relative; flex: 0 0 auto; }
.g-head { position: sticky; top: 0; z-index: 3; min-height: 44px; }
.g-head .g-left { font-weight: 600; font-size: 12px; color: var(--text-muted); background: var(--surface); }
.g-head .g-right { display: flex; background: var(--surface); }
.g-day { flex: 0 0 var(--dayw); width: var(--dayw); font-size: 10px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column;
  justify-content: flex-end; padding-bottom: 4px; position: relative; }
.g-day.off { background: var(--surface-2); }
.g-day.mstart { border-left: 1px solid var(--border); }
.g-month { position: absolute; top: 4px; left: 3px; font-weight: 600; color: var(--text); white-space: nowrap; text-transform: capitalize; }
.g-off { position: absolute; top: 0; bottom: 0; width: var(--dayw); background: var(--surface-2); opacity: .7; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--sev-critical); opacity: .7; z-index: 1; }
.g-bar { position: absolute; top: 8px; height: 14px; border-radius: 3px; z-index: 1; }
.g-bar.phase { top: 11px; height: 8px; background: var(--text); border-radius: 1px; }
.g-bar.p-none { background: var(--sev-info); }
.g-ms { position: absolute; top: 9px; width: 12px; height: 12px; margin-left: -6px; background: var(--text); transform: rotate(45deg); z-index: 1; }
.g-detail { position: sticky; left: 0; width: min(100%, 900px); border-bottom: 1px solid var(--border); background: var(--surface); }
.g-detail-body { padding: 10px 14px 12px 52px; }
.g-detail-body p { margin: 6px 0; }
.kv-inline { display: flex; gap: 18px; flex-wrap: wrap; }
.g-findings { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.g-findings li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; }
.g-findings .sev { font-size: 10px; padding: 0 6px; border-radius: 8px; color: #fff; }
.g-findings .sev.sev-critical { background: var(--sev-critical); color: #fff; } .g-findings .sev.sev-high { background: var(--sev-high); color: #fff; }
.g-findings .sev.sev-medium { background: var(--sev-medium); color: #1c2230; } .g-findings .sev.sev-low { background: var(--sev-low); color: #fff; }
.g-findings .sev.sev-info { background: var(--sev-info); color: #fff; }
.pill.p-pill.p-P1 { background: var(--sev-critical); } .pill.p-pill.p-P2 { background: var(--sev-high); }
.pill.p-pill.p-P3 { background: var(--sev-medium); color: #1c2230; } .pill.p-pill.p-P4 { background: var(--sev-low); }
@media (max-width: 720px) {
  .gantt { --left: 230px; }
  .g-dates, .g-wbs { display: none; }
  .g-detail-body { padding-left: 14px; }
}
.plan-controls { flex-wrap: wrap; }
.plan-controls label.inline { min-width: 0; max-width: 100%; }
.plan-controls select { max-width: min(420px, calc(100vw - 110px)); }
.g-findings li { flex-wrap: nowrap; min-width: 0; }
.g-findings li a { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-findings li .mono { flex: 0 0 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
/* Hallazgos de negocio con código impactado: el bloque ocupa su propia línea bajo el hallazgo */
.g-findings li:has(> .code-ev-plan) { flex-wrap: wrap; }
.g-findings li > .code-ev-plan { flex: 1 0 100%; min-width: 0; }
.code-ev-plan { margin: 2px 0 6px 0; }
.code-ev-plan summary { cursor: pointer; color: var(--text-muted-strong); }
.code-ev-plan pre.code { max-height: 260px; }
.plan-sources ul { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.plan-proj { background: var(--blue-soft); color: var(--accent); }
