/* C v2.2 — Metas y proyección. Esta hoja define las clases .ofv2-* que
   V3 (ownerForecastGoalsV3.js) REUTILIZA directamente como su render
   final (.ofv2-shell.ofv3-shell, .ofv2-head, .ofv2-kpis.ofv3-kpis,
   .ofv2-takeaway, .ofv2-details, .ofv2-detail-grid, .ofv2-method) — por
   eso se migra aquí con la misma prioridad que ownerForecastGoalsV3.css.
   Reescritura completa: hex embebidos → tokens del sistema. Cero
   cambios de RPC/fórmulas/cálculos. #ofhv1Root... no, aquí el host es
   #ofv1Root (ya existe en ownerForecastV1.js) — se usa junto con
   #ownerDashboardV1Root como doble ID para ganar por especificidad a
   visualAuditV1/V2/V3 / ownerVisualCleanupV1.css / ownerVisualHierarchyV2.css
   sin editar esos archivos. */

#ownerDashboardV1Root #ofv1Root{font-family:'Instrument Sans', var(--sans)}

.ofv2-shell{
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  background:var(--card);
  padding:24px;
  box-shadow:var(--shadow-card);
}

/* ===================== Cabecera única ===================== */
.ofv2-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}
.ofv2-head>div:first-child>span{display:block;font-size:10px;letter-spacing:.14em;font-weight:700;color:var(--brand)}
.ofv2-head h4{font-size:23px;line-height:1.2;margin:5px 0 7px;color:var(--brand-text);font-weight:700}
.ofv2-head p{margin:0;color:var(--muted);max-width:760px;font-size:13px;line-height:1.5}
.ofv2-actions{display:flex;gap:8px;flex-wrap:wrap}

/* ownerVisualCleanupV1.js (cleanModuleHeaders) envuelve el h4 en
   <span class="vui-help-wrap"> + botón "?", pero
   ownerVisualCleanupV1.css línea 13/14 oculta CUALQUIER span/p hijo
   directo de .ofv2-head>div:first-child sin excluir .vui-help-wrap —
   confirmado con getBoundingClientRect: el título quedaba en 0x0,
   invisible por completo. Se corrige mostrando el wrap. El <p> se
   fuerza visible aparte: el subtítulo consolidado del brief debe
   leerse siempre, no quedar detrás de un clic "?". */
#ownerDashboardV1Root #ofv1Root .ofv2-head>div:first-child>.vui-help-wrap{
  display:inline-flex!important;
  color:var(--brand-text);
}
#ownerDashboardV1Root #ofv1Root .ofv2-head>div:first-child>.vui-help-wrap h4{color:inherit;font-size:inherit;font-weight:inherit;margin:0}
#ownerDashboardV1Root #ofv1Root .ofv2-head p.vui-explainer-hidden{
  display:block!important;
  margin-top:7px!important;
}
/* ownerVisualCleanupV1.css fuerza h4{font-size:25px!important} (0 ID) y
   a ≤760px 22px!important — C v2.2 usa un tamaño propio ≤700 de peso;
   doble ID para ganar sin tocar ese archivo. */
#ownerDashboardV1Root #ofv1Root .ofv2-head h4{
  font-weight:700!important;
  font-size:23px!important;
  letter-spacing:-.01em!important;
}

/* "Configurar metas" con más jerarquía que Actualizar/Cerrar, pero
   usando el verde primario del sistema (--brand) — nunca el lime
   reservado para el POS. */
.ofv3-config-btn{display:inline-flex;align-items:center;gap:7px}
.ofv3-config-btn svg{width:16px;height:16px}

/* ===================== KPIs ===================== */
/* Las 4 variantes (.primary/.forecast definidas aquí; .equilibrium/
   .target definidas en ownerForecastGoalsV3.css) comparten el mismo
   criterio: tarjeta blanca + acento de borde izquierdo + chip de
   ícono con color — nunca la tarjeta completa teñida de verde/ámbar. */
.ofv2-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:22px}
.ofv2-kpis article{
  position:relative;
  border:1px solid var(--line);border-radius:var(--radius);
  padding:16px 18px;background:var(--card);
  overflow:hidden;
}
.ofv2-kpis article.primary,
.ofv2-kpis article.forecast{padding-left:20px}
.ofv2-kpis article.primary::before,
.ofv2-kpis article.forecast::before{
  content:"";position:absolute;inset:0 auto 0 0;width:3px;border-radius:var(--radius) 0 0 var(--radius);
}
.ofv2-kpis article.primary::before{background:var(--brand)}
.ofv2-kpis article.forecast::before{background:var(--info)}
.ofv2-kpis article.compare{background:var(--card)}
.ofv2-kpis article.previous{background:var(--card)}
.ofv2-kpis i{position:absolute;top:16px;right:16px;width:36px;height:36px;border-radius:11px;display:grid;place-items:center;background:var(--brand-tint);color:var(--brand-dk);font-style:normal}
.ofv2-kpis article.forecast i{background:var(--info-tint);color:var(--info)}
.ofv2-kpis article.compare i{background:var(--line-soft);color:var(--muted)}
.ofv2-kpis article.previous i{background:var(--line-soft);color:var(--muted)}
.ofv2-kpis svg{width:19px;height:19px}
.ofv2-kpis span{display:block;padding-right:44px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.03em}
.ofv2-kpis b{display:block;color:var(--ink);font-size:26px;line-height:1.18;margin:12px 0 6px;overflow-wrap:anywhere}
.ofv2-kpis article.forecast b{font-size:22px}
.ofv2-kpis small{display:block;color:var(--muted-2);line-height:1.35;font-size:11.5px}

/* ownerVisualCleanupV1.css fuerza min-height:96px!important (0 ID).
   ownerVisualHierarchyV2.css fuerza font-weight:800!important en label
   (línea 9/83, vía .vui-help-wrap también) y valor (línea 43) — C v2.2
   exige peso ≤700. Selector de DESCENDIENTE (no hijo directo) porque
   ownerVisualCleanupV1.js (cleanForecast) envuelve 2 de los 4 labels
   ("Punto de equilibrio","Cierre estimado") en .vui-help-wrap + botón
   "?", sacándolos de ser hijo directo de <article>. visualAuditV2/V3
   fuerzan además padding/tamaño de valor/radio/sombra/min-height. */
#ownerDashboardV1Root #ofv1Root .ofv2-kpis article span{font-weight:700!important}
#ownerDashboardV1Root #ofv1Root .ofv2-kpis article b{font-weight:700!important}
#ownerDashboardV1Root #ofv1Root .ofv2-kpis article{
  min-height:128px!important;
  padding:16px 18px!important;
  border-radius:var(--radius)!important;
  box-shadow:none!important;
}
#ownerDashboardV1Root #ofv1Root .ofv2-kpis article.primary,
#ownerDashboardV1Root #ofv1Root .ofv2-kpis article.forecast{padding-left:20px!important}

@media(max-width:1080px){.ofv2-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ===================== Escenario (contenedor compartido) ===================== */
.ofv2-visual{margin-top:16px;border:1px solid var(--line);border-radius:var(--radius-lg);padding:18px 20px;background:var(--card)}
.ofv2-section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.ofv2-section-head span{display:block;color:var(--brand);font-size:10px;letter-spacing:.14em;font-weight:700}
.ofv2-section-head h5{font-size:16px;color:var(--brand-text);margin:4px 0 0;font-weight:700}
.ofv2-section-head strong{font-size:11px;color:var(--warn);background:var(--warn-tint);border:1px solid #eed7a4;border-radius:999px;padding:6px 10px;white-space:nowrap;font-weight:600}

/* .ofv2-progress: solo visible en el estado intermedio de V2, antes de
   que V3 reemplace #ofv1Root con su propio escenario (scenarioHTML).
   Se mantiene tokenizado para que, aunque sea una transición breve, no
   haya flash visual con colores antiguos mientras carga el bundle
   final V3. */
.ofv2-progress{display:grid;gap:13px}
.ofv2-progress-row{display:grid;grid-template-columns:120px minmax(180px,1fr) 200px;gap:14px;align-items:center}
.ofv2-progress-row>span{font-size:12px;font-weight:700;color:var(--muted)}
.ofv2-progress-row>div{height:16px;border-radius:999px;background:var(--line-soft);position:relative;overflow:visible}
.ofv2-progress-row>div i{display:block;height:100%;border-radius:999px;background:var(--brand);min-width:2px}
.ofv2-progress-row.forecast>div i{background:var(--info)}
.ofv2-progress-row.forecast>div em{position:absolute;top:-3px;width:3px;height:22px;background:var(--brand-dk);border-radius:3px;transform:translateX(-1px)}
.ofv2-progress-row.previous>div i{background:var(--muted-2)}
.ofv2-progress-row.empty>div i{display:none}
.ofv2-progress-row>b{text-align:right;font-size:13px;color:var(--ink);font-weight:700}
@media(max-width:700px){
  .ofv2-progress-row{grid-template-columns:1fr}
  .ofv2-progress-row>b{text-align:left}
}

/* ===================== Lectura principal ===================== */
/* Bloque ligero, nunca hero oscuro. */
.ofv2-takeaway{margin-top:14px;display:flex;align-items:flex-start;gap:12px;border-radius:var(--radius);padding:15px 17px;background:var(--line-soft);border:1px solid var(--line)}
.ofv2-takeaway>i{width:36px;height:36px;border-radius:11px;background:var(--brand-tint);display:grid;place-items:center;color:var(--brand-dk);font-style:normal;flex:0 0 auto}
.ofv2-takeaway svg{width:19px;height:19px}
.ofv2-takeaway b,.ofv2-takeaway span{display:block}
.ofv2-takeaway b{font-size:13px;margin-bottom:3px;color:var(--brand-text);font-weight:700}
.ofv2-takeaway span{font-size:13px;line-height:1.5;color:var(--ink)}

.ofv2-goal-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}
.ofv2-goal-row article{border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;background:var(--card)}
.ofv2-goal-row span{display:block;font-size:11px;font-weight:700;color:var(--muted)}
.ofv2-goal-row b{display:block;font-size:20px;color:var(--ink);margin:5px 0;font-weight:700}
.ofv2-goal-row small{color:var(--muted-2);line-height:1.35;font-size:11px}

/* ===================== Detalles secundarios ===================== */
.ofv2-details{display:grid;gap:10px;margin-top:16px}
.ofv2-details details{border:1px solid var(--line);border-radius:var(--radius);background:var(--card);overflow:hidden}
.ofv2-details summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:36px 1fr 20px;gap:12px;align-items:center;padding:13px 15px}
.ofv2-details summary::-webkit-details-marker{display:none}
.ofv2-details summary>i{width:32px;height:32px;border-radius:10px;background:var(--line-soft);color:var(--muted);display:grid;place-items:center;font-style:normal}
.ofv2-details summary svg{width:17px;height:17px}
.ofv2-details summary b,.ofv2-details summary small{display:block}
.ofv2-details summary b{font-size:12.5px;color:var(--ink);font-weight:700}
.ofv2-details summary small{font-size:11px;color:var(--muted);margin-top:2px}
.ofv2-details summary>em{font-size:18px;font-style:normal;color:var(--muted);text-align:center;transition:transform .18s ease}
.ofv2-details details[open] summary>em{transform:rotate(45deg)}
.ofv2-detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;border-top:1px solid var(--line-soft);padding:14px 16px;background:var(--line-soft)}
.ofv2-detail-grid article{padding:11px;border-radius:var(--radius-sm);background:var(--card);border:1px solid var(--line)}
.ofv2-detail-grid span,.ofv2-detail-grid b,.ofv2-detail-grid small{display:block}
.ofv2-detail-grid span{font-size:11px;font-weight:700;color:var(--muted)}
.ofv2-detail-grid b{font-size:17px;color:var(--ink);margin:4px 0;font-weight:700}
.ofv2-detail-grid small{font-size:11px;color:var(--muted-2)}
.ofv2-method{border-top:1px solid var(--line-soft);padding:14px 16px;background:var(--line-soft)}
.ofv2-method b{color:var(--brand-dk);font-weight:700}
.ofv2-method p{margin:5px 0;color:var(--muted);font-size:12px;line-height:1.5}

@media(max-width:700px){
  .ofv2-shell{padding:16px;border-radius:18px}
  .ofv2-head{display:block}
  .ofv2-actions{margin-top:12px}
  .ofv2-kpis{grid-template-columns:1fr}
  .ofv2-goal-row{grid-template-columns:1fr}
  .ofv2-detail-grid{grid-template-columns:1fr}
  .ofv2-section-head{align-items:flex-start;flex-direction:column}
  .ofv2-kpis b{font-size:24px}
}
