/* C v2.2 — Caja y flujo futuro. Fondo claro, blanco + sage + verde Valen,
   Instrument Sans, pesos ≤700, sin hero oscuro, sin lime decorativo.
   #ownerCashflowProjectionArea es un ID estable y real del área (standalone,
   como Rentabilidad y oportunidades) — se usa directamente para scope,
   sin necesidad de agregar una clase extra. */

#ownerCashflowProjectionArea .ocfv1-shell{
  margin:18px 0 24px;
  padding:22px;
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  background:var(--card);
  box-shadow:var(--shadow-card);
  font-family:'Instrument Sans', var(--sans);
  color:var(--ink);
}

/* Cabecera única: el antiguo .ocfv1-head (kicker+h5+p duplicados, ocultos a
   medias por ownerVisualCleanupV1.css) se retira del markup — ya no existe,
   así que esa regla legacy deja de aplicar sin tocar el archivo. La
   identidad real vive en #odv1-detail-head de #ownerCashflowProjectionArea;
   aquí solo se pisa su peso heredado. */
#ownerDashboardV1Root #ownerCashflowProjectionArea .odv1-detail-head h4{
  font-weight:700!important;
  font-size:23px!important;
  color:var(--brand-text)!important;
}

/* Proyección = control principal, justo debajo de la cabecera. */
#ownerCashflowProjectionArea .ocfv1-horizon-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}
#ownerCashflowProjectionArea .ocfv1-horizon-label{
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--muted);
}
#ownerCashflowProjectionArea .ocfv1-horizon{
  display:flex;
  gap:4px;
  padding:4px;
  border-radius:var(--radius);
  background:var(--line-soft);
}
#ownerCashflowProjectionArea .ocfv1-horizon button{
  border:0;
  border-radius:8px;
  background:transparent;
  padding:8px 14px;
  font-family:inherit;
  color:var(--muted);
  font-size:12.5px;
  font-weight:600;
  cursor:pointer;
}
#ownerCashflowProjectionArea .ocfv1-horizon button.active{
  background:var(--card);
  color:var(--brand-dk);
  font-weight:700;
  box-shadow:var(--shadow-card);
}

/* Confianza de la proyección: línea informativa compacta, no un KPI. */
#ownerCashflowProjectionArea .ocfv1-trust{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:14px;
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--line-soft);
}
#ownerCashflowProjectionArea .ocfv1-trust b{color:var(--brand-text);font-size:12px;font-weight:600}
#ownerCashflowProjectionArea .ocfv1-trust span{color:var(--muted);font-size:11px}

/* Resumen ejecutivo: 4 KPIs. Doble ID para pisar font-weight:800!important
   (ownerVisualHierarchyV2.css, article>span y article b) sin tocar ese
   archivo — el resto de módulos no migrados conservan su peso. */
#ownerCashflowProjectionArea .ocfv1-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#ownerCashflowProjectionArea .ocfv1-kpis article{
  padding:16px 17px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--card);
}
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-kpis article>span:not(.vui-help-wrap){
  font-weight:600!important;
  font-size:11px!important;
  color:var(--muted)!important;
  text-transform:uppercase;
  letter-spacing:.03em;
}
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-kpis article b{
  font-weight:700!important;
  font-size:21px!important;
  color:var(--ink)!important;
  margin:8px 0 4px!important;
  letter-spacing:-.015em;
}
#ownerCashflowProjectionArea .ocfv1-kpis article small{display:block;color:var(--muted);font-size:10.5px;line-height:1.4}
/* Diferencia proyectada: señal discreta, sin fondo agresivo completo. */
/* visualAuditV2.css fuerza background+border-color!important sobre TODO
   .ocfv1-kpis article (sin distinguir tono); se pisa aquí con doble ID. */
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-kpis article.good{border-color:var(--sage-panel)!important;background:linear-gradient(180deg,#FFFFFF 0%,var(--sage-panel) 220%)!important}
#ownerCashflowProjectionArea .ocfv1-kpis article.good b{color:var(--brand-text)}
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-kpis article.warn{border-color:var(--warn)!important;background:var(--warn-tint)!important}
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-kpis article.bad{border-color:var(--neg)!important;background:var(--neg-tint)!important}

/* "No es tu saldo bancario": ownerVisualCleanupV1.css oculta .ocfv1-note
   (display:none!important, selector sin ID ni #ownerDashboardV1Root), se
   pisa aquí con un solo ID — ya es más específico. Se resuelve desde este
   componente, sin tocar el archivo legacy. */
#ownerCashflowProjectionArea .ocfv1-note{
  display:block!important;
  margin-top:14px;
  padding:11px 14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--card);
  color:var(--muted);
  font-size:11.5px;
  line-height:1.45;
}
#ownerCashflowProjectionArea .ocfv1-note b{color:var(--brand-text)}

/* Valen recomienda: antes hero oscuro con texto blanco (.ocfv1-reco.good/
   warn/bad{background:linear-gradient(verde/ámbar/rojo oscuro)}), que
   además quedaba con texto ilegible porque ownerVisualCleanupV1.css fuerza
   background:var(--va2-inset)!important sobre .ocfv1-reco sin tocar el
   color del texto (confirmado por render real: título casi invisible).
   Ahora es una tarjeta clara con acento lateral, igual que el resto de la
   migración C v2.2. Doble ID para fijar el fondo claro con !important y
   evitar que la regla legacy (o cualquier cambio futuro de --va2-inset)
   vuelva a mezclarse con un color de texto pensado para fondo oscuro. */
#ownerCashflowProjectionArea .ocfv1-reco{
  position:relative;
  margin-top:16px;
  padding:16px 18px 16px 20px;
  border-radius:var(--radius-lg);
  color:var(--ink);
  overflow:hidden;
}
#ownerCashflowProjectionArea .ocfv1-reco::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
}
#ownerCashflowProjectionArea .ocfv1-reco span{display:block;margin-bottom:5px;font-size:9.5px;font-weight:700;letter-spacing:.1em;color:var(--muted)}
#ownerCashflowProjectionArea .ocfv1-reco h6{margin:0;font-size:16px;font-weight:700;color:var(--brand-text)}
#ownerCashflowProjectionArea .ocfv1-reco p{margin:7px 0 0;font-size:12px;line-height:1.5;color:var(--muted)}
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-reco.good{background:linear-gradient(180deg,#FFFFFF 0%,var(--sage-panel) 220%)!important}
#ownerCashflowProjectionArea .ocfv1-reco.good::before{background:var(--pos)}
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-reco.warn{background:var(--warn-tint)!important}
#ownerCashflowProjectionArea .ocfv1-reco.warn::before{background:var(--warn)}
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-reco.bad{background:var(--neg-tint)!important}
#ownerCashflowProjectionArea .ocfv1-reco.bad::before{background:var(--neg)}
#ownerDashboardV1Root #ownerCashflowProjectionArea .ocfv1-reco.info{background:var(--info-tint)!important}
#ownerCashflowProjectionArea .ocfv1-reco.info::before{background:var(--info)}

/* Base de la proyección: 2 métricas secundarias agrupadas. */
#ownerCashflowProjectionArea .ocfv1-breakdown-wrap{margin-top:16px}
#ownerCashflowProjectionArea .ocfv1-breakdown-label{
  display:block;
  margin-bottom:8px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--muted);
}
#ownerCashflowProjectionArea .ocfv1-breakdown{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#ownerCashflowProjectionArea .ocfv1-breakdown article{padding:14px 15px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}
#ownerCashflowProjectionArea .ocfv1-breakdown span{display:block;color:var(--muted);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.03em}
#ownerCashflowProjectionArea .ocfv1-breakdown b{display:block;margin:7px 0 3px;color:var(--ink);font-size:18px;font-weight:700}
#ownerCashflowProjectionArea .ocfv1-breakdown small{color:var(--muted);font-size:10px}

/* Compromisos y cobros próximos: sección operativa, ancho completo en
   desktop; scroll interno (nunca del documento) en mobile si hace falta. */
#ownerCashflowProjectionArea .ocfv1-commitments{
  margin-top:16px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--card);
}
#ownerCashflowProjectionArea .ocfv1-commitments summary{
  padding:14px 16px;
  cursor:pointer;
  color:var(--brand-text);
  font-size:12.5px;
  font-weight:700;
  list-style:none;
}
#ownerCashflowProjectionArea .ocfv1-commitments summary::-webkit-details-marker{display:none}
#ownerCashflowProjectionArea .ocfv1-commitments[open] summary{border-bottom:1px solid var(--line);background:var(--line-soft)}
#ownerCashflowProjectionArea .ocfv1-table-wrap{overflow-x:auto}
#ownerCashflowProjectionArea .ocfv1-table{width:100%;border-collapse:collapse;font-size:11.5px}
#ownerCashflowProjectionArea .ocfv1-table th,
#ownerCashflowProjectionArea .ocfv1-table td{padding:11px 14px;border-bottom:1px solid var(--line-soft);text-align:left;white-space:nowrap}
#ownerCashflowProjectionArea .ocfv1-table th{color:var(--muted);font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
#ownerCashflowProjectionArea .ocfv1-table td:nth-child(2){white-space:normal;min-width:180px}
#ownerCashflowProjectionArea .ocfv1-table td b{display:block;color:var(--ink);font-weight:600}
#ownerCashflowProjectionArea .ocfv1-table td small{display:block;margin-top:2px;color:var(--muted);font-size:9.5px}
#ownerCashflowProjectionArea .ocfv1-table strong.in{color:var(--pos);font-weight:600}
#ownerCashflowProjectionArea .ocfv1-table strong.out{color:var(--neg);font-weight:600}
#ownerCashflowProjectionArea .ocfv1-empty{padding:18px;color:var(--muted);font-size:12px}
#ownerCashflowProjectionArea .ocfv1-foot{margin-top:12px;color:var(--muted-2);font-size:10px;line-height:1.45}
#ownerCashflowProjectionArea .ocfv1-icon{font-weight:700}

/* Affordance discreta de scroll horizontal interno en la tabla (nunca el
   documento), igual técnica usada en Rentabilidad/Ventas: sombra en los
   bordes que solo se nota si hay contenido oculto. */
@media(max-width:620px){
  #ownerCashflowProjectionArea .ocfv1-table-wrap{
    background:
      linear-gradient(90deg,var(--card) 0,rgba(255,255,255,0) 24px),
      linear-gradient(270deg,var(--card) 0,rgba(255,255,255,0) 24px) right,
      linear-gradient(90deg,rgba(16,33,26,.08),rgba(16,33,26,0) 10px),
      linear-gradient(270deg,rgba(16,33,26,.08),rgba(16,33,26,0) 10px) right;
    background-repeat:no-repeat;
    background-size:24px 100%,24px 100%,10px 100%,10px 100%;
    background-attachment:local,local,scroll,scroll;
  }
}

/* KPIs: 1440 4 cols / 1024 y 820 2x2 / 390 1 col. El breakpoint compartido
   histórico de este archivo usaba max-width:1000px (no cubre 1024px);
   confirmado por render real el mismo bug de truncamiento que en Ventas/
   Historial/Inventario, corregido aquí. */
@media(max-width:1180px){
  #ownerCashflowProjectionArea .ocfv1-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  #ownerCashflowProjectionArea .ocfv1-shell{padding:16px}
  #ownerCashflowProjectionArea .ocfv1-horizon-row{flex-wrap:wrap}
  #ownerCashflowProjectionArea .ocfv1-trust{flex-direction:column;align-items:flex-start;gap:4px}
}
@media(max-width:480px){
  #ownerCashflowProjectionArea .ocfv1-kpis,
  #ownerCashflowProjectionArea .ocfv1-breakdown{grid-template-columns:1fr}
}
