
/* Cuadro de mandos */
.cdm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cdm-kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); }
.cdm-kpi-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(88,166,255,.12);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--blue); flex: none; }
.cdm-kpi-val { font-size: 2.2rem; font-weight: 600; color: var(--text0); line-height: 1.2; }
.cdm-kpi-lbl { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); margin-top: 2px; }
.cdm-kpi-sub { font-size: 1.1rem; color: var(--text2); margin-top: 3px; }
.cdm-kpi-skeleton { height: 76px; background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius); animation: cdm-pulse 1.4s ease-in-out infinite; }
@keyframes cdm-pulse { 0%,100%{opacity:1} 50%{opacity:.45} }
.cdm-card { background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.cdm-card-hdr { font-size: 1.2rem; font-weight: 600; color: var(--text1); margin-bottom: 14px;
  display: flex; align-items: center; gap: 7px; }

/* ── Proyectos (selector + detalle) ─────────────────────────────────── */
.pr-picker { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.pr-nodata { display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--text2); font-size: 1.2rem; text-align: center; }

/* Ficha del proyecto */
.pr-meta-card { background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.pr-meta-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pr-meta-title { font-size: 1.7rem; font-weight: 600; color: var(--text0); line-height: 1.25; }
.pr-meta-code { font-size: 1.2rem; color: var(--text2); font-family: var(--font-mono, monospace); margin-top: 2px; }
.pr-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pr-badge { font-size: 1.05rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; letter-spacing: .02em;
  border: 1px solid var(--border); color: var(--text1); background: var(--bg2); white-space: nowrap; }
.pr-badge.ok   { color: #2ea043; border-color: rgba(46,160,67,.4);  background: rgba(46,160,67,.12); }
.pr-badge.info { color: var(--blue); border-color: rgba(88,166,255,.4); background: rgba(88,166,255,.12); }
.pr-badge.warn { color: #d29922; border-color: rgba(210,153,34,.4); background: rgba(210,153,34,.12); }
.pr-badge.muted{ color: var(--text2); }
.pr-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; margin-top: 16px; }
.pr-meta-item { display: flex; align-items: center; gap: 10px; }
.pr-meta-item > i { font-size: 1.8rem; color: var(--text2); flex: none; }
.pr-meta-lbl { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text2); }
.pr-meta-val { font-size: 1.3rem; color: var(--text0); }

/* Cuadro de análisis con IA (AURORA) */
.pr-ai-body { font-size: 1.25rem; color: var(--text1); line-height: 1.55; }
.pr-ai-placeholder { color: var(--text2); font-size: 1.2rem; display: flex; align-items: center; gap: 6px; }
.pr-ai-body h1, .pr-ai-body h2, .pr-ai-body h3, .pr-ai-body h4 {
  font-size: 1.4rem; font-weight: 600; color: var(--text0); margin: 14px 0 6px; }
.pr-ai-body h3 { display: flex; align-items: center; gap: 6px; }
.pr-ai-body p { margin: 6px 0; }
.pr-ai-body ul, .pr-ai-body ol { margin: 6px 0 6px 22px; }
.pr-ai-body li { margin: 3px 0; }
.pr-ai-body strong { color: var(--text0); font-weight: 600; }
.pr-ai-body code { font-family: var(--font-mono, monospace); font-size: .95em;
  background: var(--bg3); padding: 1px 5px; border-radius: 4px; }
.pr-ai-spin { animation: pr-spin .9s linear infinite; display: inline-block; }
@keyframes pr-spin { to { transform: rotate(360deg); } }

/* Reparto de horas por categoría (tiles sobrios) */
.pr-catrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.pr-cat { display: flex; align-items: center; gap: 12px;
  background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.pr-cat-icon { width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; color: var(--blue); background: var(--blue-bg); }
.pr-cat-val { font-size: 1.7rem; font-weight: 600; color: var(--text0); }
.pr-cat-lbl { font-size: 1.1rem; color: var(--text2); margin-top: 2px; }

/* Tablas del detalle */
.pr-tbl-wrap { overflow-x: auto; }
.pr-tbl { width: 100%; border-collapse: collapse; font-size: 1.15rem; }
.pr-tbl th { text-align: left; font-weight: 600; color: var(--text2); font-size: 1rem; text-transform: uppercase;
  letter-spacing: .03em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.pr-tbl td { padding: 7px 8px; color: var(--text1); border-bottom: 1px solid var(--border); white-space: nowrap; }
.pr-tbl tr:last-child td { border-bottom: none; }
.pr-tbl .r { text-align: right; }
.pr-tbl .pr-empty { text-align: center; color: var(--text2); padding: 16px; }
.pr-count { font-size: 1.1rem; color: var(--text2); font-weight: 400; }

/* Filtro de fase + selector + filtro de tarea */
.pr-picker-row { display: flex; gap: 8px; max-width: 900px; align-items: stretch; flex-wrap: wrap; }
.pr-fase-sel { flex: 0 0 auto; width: 170px; }
.pr-tarea-sel { flex: 0 0 auto; width: 200px; }
.pr-tarea-sel:disabled { opacity: .55; cursor: not-allowed; }

/* Relojes de consumo (ofertadas → imputadas) del resumen. Cada uno enlaza
   al detalle del proyecto. El arco se rellena con min(pct,100) %; si se pasa
   del 100 % el anillo va completo y en rojo, y el % real se ve en el centro. */
.pr-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.pr-gauge { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 10px; cursor: pointer; font: inherit; text-align: center;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.pr-gauge:hover { border-color: var(--blue); transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.12); }

/* Exceso (>100 %): se resalta el problema — borde y fondo rojizos, pulso e
   icono de alerta — para que "salte a la vista" frente a los demás relojes. */
.pr-gauge.over { border-color: rgba(248,81,73,.55); background: var(--red-bg);
  animation: pr-gauge-pulse 1.9s ease-in-out infinite; }
.pr-gauge.over:hover { border-color: var(--red); }
@keyframes pr-gauge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,81,73,0); }
  50%      { box-shadow: 0 0 0 4px rgba(248,81,73,.16); }
}
@media (prefers-reduced-motion: reduce) {
  .pr-gauge.over { animation: none; box-shadow: 0 0 0 3px rgba(248,81,73,.16); }
}
.pr-gauge-warn { position: absolute; top: 8px; right: 9px; color: var(--red);
  font-size: 1.7rem; line-height: 1; }
.pr-gauge-diag { display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 1.02rem; line-height: 1.2; color: var(--red); font-weight: 600; }
.pr-gauge-diag i { font-size: 1.25rem; flex: none; }
.pr-gauge-svg { width: 108px; height: 108px; }
.pr-gauge-track { fill: none; stroke: var(--bg3); stroke-width: 11; }
.pr-gauge-arc { fill: none; stroke-width: 11; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 60px 60px; transition: stroke-dasharray .6s ease; }
.pr-gauge.ok   .pr-gauge-arc { stroke: #2ea043; }
.pr-gauge.near .pr-gauge-arc { stroke: #d29922; }
.pr-gauge.over .pr-gauge-arc { stroke: var(--red); }
.pr-gauge-pct { fill: var(--text0); font-size: 22px; font-weight: 700;
  text-anchor: middle; dominant-baseline: central; }
.pr-gauge.near .pr-gauge-pct { fill: #d29922; }
.pr-gauge.over .pr-gauge-pct { fill: var(--red); }
.pr-gauge-name { font-size: 1.15rem; font-weight: 600; color: var(--text1); line-height: 1.2; }
.pr-gauge-sub { font-size: 1.05rem; color: var(--text2); }

/* Barra de progreso ofertadas → imputadas */
.pr-prog { background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.pr-prog-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.pr-prog-title { font-size: 1.25rem; font-weight: 600; color: var(--text1); }
.pr-prog-sub { font-size: 1.5rem; font-weight: 700; color: var(--text0); }
.pr-prog-sub.ok   { color: #2ea043; }
.pr-prog-sub.near { color: #d29922; }
.pr-prog-sub.over { color: var(--red); }
.pr-prog-sub.muted{ color: var(--text2); font-weight: 600; font-size: 1.3rem; }
.pr-prog-track { height: 12px; background: var(--bg3); border-radius: 20px; overflow: hidden; }
.pr-prog-fill { height: 100%; border-radius: 20px; background: var(--blue); transition: width .5s ease; }
.pr-prog-fill.ok   { background: #2ea043; }
.pr-prog-fill.near { background: #d29922; }
.pr-prog-fill.over { background: var(--red); }
.pr-prog-legend { font-size: 1.1rem; color: var(--text2); margin-top: 8px; }
