/* C v2.2 — Salud financiera. Reescritura completa migrando de hex
   embebidos a los tokens del sistema (--ink/--muted/--line/--card/
   --brand*/--sage-panel/--pos/--warn/--neg/--info + tints/--radius*/
   --shadow-card/--target-touch). Cero cambios de lógica — toda la
   estructura HTML que genera ownerFinancialHealthV1.js se conserva
   (misma jerarquía de clases), salvo el texto de `.ofhv1-head p` (ver
   nota más abajo) y el chip `em` del selector de subáreas, que se oculta
   aquí por CSS sin tocar el JS. RPCs/validaciones/relación con Caja no
   se tocan. #ofhv1Root es el ID propio del módulo (ya existe en el JS)
   y 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 #ofhv1Root{font-family:'Instrument Sans', var(--sans)}

.ofhv1-six-areas{grid-template-columns:repeat(6,minmax(0,1fr))!important}
.ofhv1-nav-button{position:relative}
.ofhv1-nav-icon svg{width:21px;height:21px}
.ofhv1-nav-copy{display:flex;min-width:0;flex:1;flex-direction:column;align-items:flex-start}
.ofhv1-nav-copy b{line-height:1.18}
.ofhv1-nav-copy small{margin-top:4px}

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

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

/* ownerVisualCleanupV1.js (cleanModuleHeaders) envuelve el h4 en un
   <span class="vui-help-wrap"> con un botón "?" y oculta el <p> original
   agregándole la clase vui-explainer-hidden — ese es el sistema estándar
   de Valen para mover explicaciones a un tooltip bajo demanda. Pero
   ownerVisualCleanupV1.css línea 13/14 oculta CUALQUIER span/p hijo
   directo de .ofhv1-head>div:first-child sin excluir .vui-help-wrap, así
   que también tapa el título+botón "?" (confirmado con getComputedStyle:
   display:none, 0x0). Se corrige mostrando el wrap. El <p> se fuerza
   visible aparte porque esta pantalla tiene una aclaración crítica
   ("Estos montos no representan el saldo disponible en Caja.") que el
   brief exige mantener SIEMPRE visible, no escondida detrás de un clic —
   a diferencia del resto de módulos, aquí no se deja que
   vui-explainer-hidden la oculte. */
#ownerDashboardV1Root #ofhv1Root .ofhv1-head>div:first-child>.vui-help-wrap{
  display:inline-flex!important;
  color:var(--brand-text);
}
#ownerDashboardV1Root #ofhv1Root .ofhv1-head>div:first-child>.vui-help-wrap h4{color:inherit;font-size:inherit;font-weight:inherit;margin:0}
#ownerDashboardV1Root #ofhv1Root .ofhv1-head p.vui-explainer-hidden{
  display:block!important;
  margin-top:7px!important;
}

/* ===================== KPIs (Resumen ejecutivo) ===================== */
.ofhv1-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:22px}
.ofhv1-kpis article{
  position:relative;
  min-height:120px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px 18px;
  background:var(--card);
}
/* Por cobrar / Por pagar = cifras principales, acento sage muy suave.
   Vencidos = señal de atención por BORDE IZQUIERDO (acento), nunca toda
   la tarjeta con fondo saturado — igual que .ociv1-recovery-card::before
   en Clientes. */
.ofhv1-kpis article.receivable{background:linear-gradient(180deg,#FFFFFF 0%,var(--sage-panel) 220%);border-color:#cfe6da}
.ofhv1-kpis article.payable{background:var(--card);border-color:var(--line)}
.ofhv1-kpis article.overdue,.ofhv1-kpis article.due{padding-left:20px}
.ofhv1-kpis article.overdue::before,.ofhv1-kpis article.due::before{
  content:"";position:absolute;inset:0 auto 0 0;width:3px;border-radius:var(--radius) 0 0 var(--radius);
}
.ofhv1-kpis article.overdue::before{background:var(--warn)}
.ofhv1-kpis article.due::before{background:var(--neg)}
.ofhv1-kpis i{position:absolute;right:16px;top:16px;width:36px;height:36px;border-radius:11px;display:grid;place-items:center;background:var(--brand-tint);color:var(--brand-dk);font-style:normal}
.ofhv1-kpis article.payable i{background:var(--line-soft);color:var(--muted)}
.ofhv1-kpis article.overdue i{background:var(--warn-tint);color:var(--warn)}
.ofhv1-kpis article.due i{background:var(--neg-tint);color:var(--neg)}
.ofhv1-kpis svg{width:19px;height:19px}
.ofhv1-kpis span{display:block;padding-right:44px;color:var(--muted);font-size:11px;letter-spacing:.03em;text-transform:uppercase}
.ofhv1-kpis b{display:block;margin:12px 0 6px;color:var(--ink);font-size:27px;line-height:1.1;overflow-wrap:anywhere}
.ofhv1-kpis small{display:block;color:var(--muted-2);line-height:1.35;font-size:11.5px}

/* ownerVisualHierarchyV2.css fuerza font-weight:800!important en el label
   (span, línea 12, vía .vui-kpi-label también) y el valor (b, línea 46)
   de .ofhv1-kpis article — C v2.2 exige peso ≤700. Doble ID para ganar
   sin tocar ese archivo. Selector de DESCENDIENTE (no hijo directo)
   porque ownerVisualHierarchyV2.js (cleanKnownCards→cleanCard) envuelve
   el span label en .vui-help-wrap + botón "?" — confirmado con
   getComputedStyle que esto saca al span de ser hijo directo de
   <article>, por lo que un selector article>span ya no lo alcanza. */
#ownerDashboardV1Root #ofhv1Root .ofhv1-kpis article span{font-weight:700!important}
#ownerDashboardV1Root #ofhv1Root .ofhv1-kpis article b{font-weight:700!important}

/* Bug confirmado con getComputedStyle: cuando hay cobros/pagos vencidos,
   el texto "Requieren seguimiento"/"Requieren atención" se vuelve
   invisible (display:none vía .vui-card-explainer-hidden). Esa misma
   función genérica (cleanCard) decide ocultar el <small> de una tarjeta
   KPI cuando su texto no matchea su lista de palabras "dinámicas" — este
   texto no tiene dígitos ni esas palabras clave, así que lo clasifica
   como estático y lo esconde, justo cuando más importa alertar. Se
   fuerza visible solo para esta tarjeta. */
#ownerDashboardV1Root #ofhv1Root .ofhv1-kpis small.vui-card-explainer-hidden{display:block!important}
/* visualAuditV2/V3 fuerzan min-height/padding/radius/box-shadow!important
   en .ofhv1-kpis article (112/110/96px, padding 18px 20px, radio
   --va3-radius-card, sombra --va3-shadow-card) — se homogeneiza con el
   resto del sistema (sin sombra, radio --radius) con el mismo doble ID. */
#ownerDashboardV1Root #ofhv1Root .ofhv1-kpis article{
  min-height:120px!important;
  padding:16px 18px!important;
  border-radius:var(--radius)!important;
  box-shadow:none!important;
}
#ownerDashboardV1Root #ofhv1Root .ofhv1-kpis article.overdue,
#ownerDashboardV1Root #ofhv1Root .ofhv1-kpis article.due{padding-left:20px!important}

/* ===================== Próximos 30 días ===================== */
/* Compacta, deliberadamente neutra (sage/gris) para no confundirse con
   "Caja y flujo futuro" (que usa su propia paleta en ownerCashflowProjectionV1).
   Esto es una lectura de vencimientos próximos, no una proyección de caja. */
.ofhv1-window{
  margin-top:14px;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--line-soft);padding:14px 16px;
  display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:12px;align-items:center;color:var(--ink);
}
.ofhv1-window>i{width:36px;height:36px;border-radius:10px;background:var(--card);border:1px solid var(--line);color:var(--brand-dk);display:grid;place-items:center;font-style:normal}
.ofhv1-window svg{width:18px;height:18px}
.ofhv1-window b,.ofhv1-window span{display:block}
.ofhv1-window>div:nth-child(2)>b{font-size:13px;margin-bottom:3px;font-weight:700;color:var(--brand-text)}
.ofhv1-window>div:nth-child(2)>span{font-size:12px;color:var(--muted)}
.ofhv1-window-values{display:flex;gap:20px}
.ofhv1-window-values span{font-size:11px;color:var(--muted)}
.ofhv1-window-values b{margin-top:2px;font-size:14px;color:var(--ink);font-weight:700}

/* ===================== Selector Cuentas por cobrar / por pagar ===================== */
/* Mismo patrón oficial C v2.2 consolidado en Clientes/Inventario: 2
   tarjetas hermanas, mismo alto, icono+label+monto, estado activo 100%
   gobernado por ownerDashboardConsistencyV1.css (--valen-active-2-*) —
   no se inventa otro sistema de activo. Hooks intactos: .ofhv1-subarea,
   data-nav-level="2", data-nav-group="finance", data-nav-key. */
.ofhv1-subareas{margin-top:18px;border:0;background:transparent;overflow:visible}
.ofhv1-subareas-head{padding:0 0 10px}
.ofhv1-subareas-head h5{font-size:14px;color:var(--brand-text);margin:0;font-weight:700}
#ownerDashboardV1Root #ofhv1Root .ofhv1-subareas-head .vui-help-wrap{display:inline-flex!important;color:var(--brand-text)}
#ownerDashboardV1Root #ofhv1Root .ofhv1-subareas-head .vui-help-wrap h5{color:inherit;font-size:inherit;font-weight:inherit;margin:0}

.ofhv1-subarea-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:0;align-items:stretch}
.ofhv1-subarea{
  border:1px solid var(--line);background:var(--card);border-radius:var(--radius);
  padding:16px 18px;display:grid;grid-template-columns:40px 1fr;gap:13px;align-items:center;
  text-align:left;cursor:pointer;color:var(--ink);
  transition:border-color .16s ease,background .16s ease,color .16s ease;
}
.ofhv1-subarea:hover:not(.active){border-color:#B9D9CB;background:var(--line-soft)}
.ofhv1-subarea>i{width:38px;height:38px;border-radius:10px;background:var(--brand-tint);color:var(--brand-dk);display:grid;place-items:center;font-style:normal}
.ofhv1-subarea svg{width:19px;height:19px}
.ofhv1-subarea b,.ofhv1-subarea small{display:block}
.ofhv1-subarea b{font-size:13.5px;font-weight:700;color:inherit}
.ofhv1-subarea small{margin-top:3px;color:var(--muted)}
.ofhv1-subarea em{display:none} /* chevron: no aplica al patrón de tarjeta compacta */

/* visualAuditV2 (línea 49) y visualAuditV3 (línea 94) fuerzan
   border-color/background/box-shadow !important en .ofhv1-subarea.active
   con valores propios (no --valen-active-2-*), con 1 ID — superan en
   especificidad a la regla 0-ID de ownerDashboardConsistencyV1.css que sí
   usa los tokens oficiales. Se gana con doble ID usando EXACTAMENTE esos
   mismos tokens (no se inventan valores nuevos), igual que se hizo para
   Clientes/Inventario. El ::after de 3px (visualAuditV2) ya aplica via el
   selector genérico [data-nav-level="2"].active::after — se deja intacto,
   es el acento compartido por todo el sistema. */
#ownerDashboardV1Root #ofhv1Root .ofhv1-subarea.active{
  border-color:var(--valen-active-2-border)!important;
  background:var(--valen-active-2-bg)!important;
  box-shadow:inset 0 3px 0 var(--valen-active-accent)!important;
  color:var(--valen-active-2-text);
}
#ownerDashboardV1Root #ofhv1Root .ofhv1-subarea.active b{color:var(--valen-active-2-text)!important}
#ownerDashboardV1Root #ofhv1Root .ofhv1-subarea.active small{color:var(--valen-active-2-text-soft)!important}

@media(max-width:1200px){.ofhv1-six-areas{grid-template-columns:repeat(3,minmax(0,1fr))!important}.ofhv1-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Bug preexistente confirmado por render real: #ownerDashboardV1Root (el
   layout general del dashboard, fuera de este archivo) deja solo ~516px
   de ancho de contenido a 820px de viewport — con la grilla de KPIs ya en
   2 columnas, cada tarjeta queda en ~147px, insuficiente para cifras de
   8+ dígitos al tamaño 27px (confirmado: overflow real, scrollWidth>
   clientWidth). Entre 1200 y 761px (donde 1024 SÍ entra cómodo pero 820
   no) se reduce tamaño/padding solo del valor numérico para que la cifra
   siga en una sola línea sin truncarse, sin tocar el layout general. */
@media(max-width:980px) and (min-width:761px){
  #ownerDashboardV1Root #ofhv1Root .ofhv1-kpis article{padding:14px 12px!important}
  #ownerDashboardV1Root #ofhv1Root .ofhv1-kpis b{font-size:18px!important;margin:10px 0 5px}
  #ownerDashboardV1Root #ofhv1Root .ofhv1-kpis i{width:30px;height:30px;right:12px;top:12px}
}

/* ===================== Lista de cuentas ===================== */
.ofhv1-list-section{margin-top:16px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--card);padding:18px}
.ofhv1-list-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.ofhv1-list-head h5{font-size:17px;color:var(--brand-text);margin:4px 0;font-weight:700}
#ownerDashboardV1Root #ofhv1Root .ofhv1-list-head .vui-help-wrap{display:inline-flex!important;color:var(--brand-text)}
#ownerDashboardV1Root #ofhv1Root .ofhv1-list-head .vui-help-wrap h5{color:inherit;font-size:inherit;font-weight:inherit;margin:0}
.ofhv1-add-btn{display:inline-flex;align-items:center;gap:8px}
.ofhv1-add-btn svg{width:17px;height:17px}

/* Fila operativa densa: quién → qué es → vence cuándo → cuánto falta →
   qué puedo hacer, en una sola línea de lectura, no una tarjeta grande. */
.ofhv1-rows{display:grid;gap:8px;margin-top:14px}
.ofhv1-row{
  display:grid;grid-template-columns:minmax(0,1.7fr) minmax(150px,.6fr) auto;
  gap:16px;align-items:center;border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:12px 14px;background:var(--card);
}
.ofhv1-row.overdue{border-color:#f0ddc5;background:var(--warn-tint)}
.ofhv1-row.paid{opacity:.68;background:var(--line-soft)}
.ofhv1-row-title{display:flex;align-items:center;gap:7px;flex-wrap:wrap;min-width:0}
.ofhv1-row-main b{color:var(--ink);font-size:13px;font-weight:700}
.ofhv1-row-main p{margin:3px 0 2px;color:var(--muted);font-size:12px}
.ofhv1-row-main small{color:var(--muted-2);font-size:11px}
/* Vencido: badge pequeño, reconocible de inmediato pero sin gritar.
   Pagado/Cobrado: secundario (ya cubierto por .ofhv1-row.paid{opacity}). */
.ofhv1-status{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;padding:3px 7px;border-radius:999px}
.ofhv1-status.open{background:var(--brand-tint);color:var(--brand-dk)}
.ofhv1-status.overdue{background:var(--warn);color:#fff}
.ofhv1-status.paid{background:var(--line-soft);color:var(--muted)}
.ofhv1-source{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;padding:3px 7px;border-radius:999px;background:var(--info-tint);color:var(--info)}
.ofhv1-row-money span,.ofhv1-row-money b,.ofhv1-row-money small{display:block;text-align:right}
.ofhv1-row-money span{font-size:10px;font-weight:700;color:var(--muted-2);text-transform:uppercase}
.ofhv1-row-money b{font-size:18px;color:var(--ink);margin:3px 0;font-weight:700}
.ofhv1-row-money small{font-size:10px;color:var(--muted)}
.ofhv1-row-actions{display:flex;gap:7px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.ofhv1-icon-btn{width:var(--target-touch);height:var(--target-touch);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--card);color:var(--muted);display:grid;place-items:center;cursor:pointer}
.ofhv1-icon-btn:hover{color:var(--neg);border-color:#e7d2b7}
.ofhv1-icon-btn svg{width:16px;height:16px}

.ofhv1-empty{margin-top:14px;padding:26px 18px;border:1px dashed var(--line);border-radius:var(--radius);text-align:center;background:var(--line-soft)}
.ofhv1-empty>i{width:44px;height:44px;margin:0 auto 10px;border-radius:12px;background:var(--brand-tint);color:var(--brand-dk);display:grid;place-items:center;font-style:normal}
.ofhv1-empty svg{width:22px;height:22px}
.ofhv1-empty b,.ofhv1-empty span{display:block}
.ofhv1-empty b{color:var(--ink);font-size:14px;font-weight:700}
.ofhv1-empty span{max-width:520px;margin:5px auto 0;color:var(--muted);font-size:12px;line-height:1.45}

/* Cuentas cerradas: sección secundaria colapsable, nunca mezclada
   visualmente con las pendientes. */
.ofhv1-paid{margin-top:14px;border-top:1px solid var(--line-soft);padding-top:12px}
.ofhv1-paid summary{cursor:pointer;color:var(--muted);font-size:12px;font-weight:600;list-style:none}
.ofhv1-paid summary::-webkit-details-marker{display:none}
.ofhv1-paid summary em{font-style:normal;margin-left:5px}
.ofhv1-paid[open] summary em{display:inline-block;transform:rotate(45deg)}
.ofhv1-paid .paid-list{margin-top:10px}

/* ===================== Definiciones y alcance ===================== */
/* Discreto al final, pero NUNCA se elimina: explica la diferencia entre
   obligación financiera y saldo de Caja. */
.ofhv1-definition{margin-top:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--card);overflow:hidden}
.ofhv1-definition summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:34px 1fr 20px;gap:11px;align-items:center;padding:12px 14px}
.ofhv1-definition summary::-webkit-details-marker{display:none}
.ofhv1-definition summary>i{width:32px;height:32px;border-radius:10px;background:var(--line-soft);color:var(--muted);display:grid;place-items:center;font-style:normal}
.ofhv1-definition svg{width:17px;height:17px}
.ofhv1-definition summary b,.ofhv1-definition summary small{display:block}
.ofhv1-definition summary b{font-size:12.5px;color:var(--ink);font-weight:700}
.ofhv1-definition summary small{font-size:11px;color:var(--muted);margin-top:2px}
.ofhv1-definition summary>em{font-style:normal;font-size:18px;color:var(--muted);text-align:center}
.ofhv1-definition[open] summary>em{transform:rotate(45deg)}
.ofhv1-definition>div{border-top:1px solid var(--line-soft);padding:12px 15px;background:var(--line-soft)}
.ofhv1-definition p{margin:5px 0;color:var(--muted);font-size:12px;line-height:1.45}

.ofhv1-loading,.ofhv1-error{padding:34px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--card);color:var(--muted)}
.ofhv1-error b,.ofhv1-error span{display:block}
.ofhv1-error b{color:var(--ink)}
.ofhv1-error span{margin-top:5px;font-size:12px}

/* Generic `details` de visualAuditV1/V2/V3 (1 ID, !important) fuerza su
   propio fondo/radio/sombra en TODO <details> del dashboard — se gana con
   doble ID para que .ofhv1-paid/.ofhv1-definition/.ofhv1-installments
   mantengan los tonos propios de este módulo. */
#ownerDashboardV1Root #ofhv1Root details{
  background:var(--card)!important;
  border-color:var(--line)!important;
  box-shadow:none!important;
  border-radius:var(--radius)!important;
}

/* ===================== Modal: wizard + detalle + pago ===================== */
.ofhv1-modal-backdrop{position:fixed;inset:0;z-index:10000;background:rgba(17,22,29,.4);backdrop-filter:blur(3px);display:grid;place-items:center;padding:20px}
.ofhv1-modal{width:min(560px,96vw);max-height:88vh;overflow:auto;background:var(--card);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:0 30px 90px rgba(0,0,0,.18);padding:20px}
.ofhv1-modal-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}
.ofhv1-modal-head span{font-size:10px;letter-spacing:.12em;font-weight:700;color:var(--brand)}
.ofhv1-modal-head h4{font-size:21px;color:var(--brand-text);margin:4px 0;font-weight:700}
.ofhv1-modal-head p{margin:0;color:var(--muted);font-size:12px}
.ofhv1-close{width:42px;height:42px;border:0;border-radius:var(--radius-sm);background:var(--line-soft);color:var(--ink);font-size:20px;cursor:pointer}

/* Touch targets ≥42px dentro del modal (wizard + pago): .btn base del
   sistema ya ronda 39-41px de alto con su padding por defecto — se fija
   el mínimo explícito, igual que el <select> de recuperación en
   Clientes. Inputs ya suelen dar 44px (var(--target-touch)) salvo el del
   paso 1 del wizard (medido ~41px); se homogeniza también. */
.ofhv1-modal .input,
.ofhv1-modal select,
.ofhv1-modal .btn{min-height:var(--target-touch)}

.ofhv1-stepbar{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;position:relative;margin:20px 0 20px;padding-bottom:20px}
.ofhv1-stepbar i{height:4px;border-radius:999px;background:var(--line-soft)}
.ofhv1-stepbar i.active{background:var(--brand)}
.ofhv1-stepbar span{position:absolute;left:0;bottom:0;font-size:10px;font-weight:700;color:var(--muted)}
.ofhv1-wizard section label,.ofhv1-payment-form label{display:block;color:var(--ink);font-size:12px;font-weight:700;margin-bottom:7px}
.ofhv1-wizard section>small,.ofhv1-payment-form>small{display:block;margin-top:7px;color:var(--muted);font-size:11px;line-height:1.4}
.ofhv1-second-label{margin-top:15px!important}
.ofhv1-money-field{position:relative}
.ofhv1-money-field>span{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:var(--muted);font-weight:700;z-index:1}
.ofhv1-money-field .input{padding-left:30px;font-size:16px}
.ofhv1-modal-foot{display:flex;justify-content:space-between;gap:10px;margin-top:20px;padding-top:14px;border-top:1px solid var(--line-soft)}
.ofhv1-payment-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.ofhv1-payment-note{margin-top:12px!important;padding:10px 12px;border-radius:var(--radius-sm);background:var(--line-soft);color:var(--muted)!important}

.ofhv1-detail-loading{padding:26px 0;color:var(--muted);font-size:13px}
.ofhv1-detail-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:18px}
.ofhv1-detail-summary>div{border:1px solid var(--line);border-radius:var(--radius-sm);padding:12px;background:var(--line-soft)}
.ofhv1-detail-summary span,.ofhv1-detail-summary b{display:block}
.ofhv1-detail-summary span{font-size:10px;text-transform:uppercase;font-weight:700;color:var(--muted)}
.ofhv1-detail-summary b{margin-top:4px;font-size:17px;color:var(--ink);font-weight:700}
.ofhv1-detail-summary .outstanding{background:var(--brand-tint);border-color:#cfe8dd}
.ofhv1-detail-summary .outstanding b{color:var(--brand-dk)}

.ofhv1-history{margin-top:18px}
.ofhv1-history-head span{font-size:10px;letter-spacing:.1em;font-weight:700;color:var(--brand)}
.ofhv1-history-head h5{margin:4px 0 0;color:var(--brand-text);font-size:15px;font-weight:700}
.ofhv1-history-list{display:grid;gap:8px;margin-top:10px}
.ofhv1-history-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;padding:11px 13px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--card)}
.ofhv1-history-row>div:last-child{text-align:right}
.ofhv1-history-row b,.ofhv1-history-row span,.ofhv1-history-row small{display:block}
.ofhv1-history-row b{color:var(--ink);font-size:14px;font-weight:700}
.ofhv1-history-row span{margin-top:3px;color:var(--muted);font-size:11px}
.ofhv1-history-row small{margin-top:4px;color:var(--muted-2);font-size:10px}
.ofhv1-history-empty{padding:16px;border:1px dashed var(--line);border-radius:var(--radius-sm);color:var(--muted);text-align:center;font-size:12px}

.ofhv1-installments{margin-top:16px;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden}
.ofhv1-installments summary{list-style:none;cursor:pointer;padding:11px 14px;font-size:12px;font-weight:700;color:var(--ink);background:var(--line-soft)}
.ofhv1-installments summary::-webkit-details-marker{display:none}
.ofhv1-installments summary em{font-style:normal;margin-left:5px}
.ofhv1-installments[open] summary em{display:inline-block;transform:rotate(45deg)}
.ofhv1-installments>div{border-top:1px solid var(--line-soft)}
.ofhv1-installments article{display:grid;grid-template-columns:1fr auto;gap:14px;padding:10px 14px;border-bottom:1px solid var(--line-soft)}
.ofhv1-installments article:last-child{border-bottom:0}
.ofhv1-installments article>div:last-child{text-align:right}
.ofhv1-installments b,.ofhv1-installments span{display:block}
.ofhv1-installments b{font-size:12px;color:var(--ink);font-weight:700}
.ofhv1-installments span{margin-top:2px;font-size:10px;color:var(--muted)}

/* Bug preexistente confirmado por render real (1024 y 820): la fila de
   3 columnas (minmax(0,1.7fr) minmax(150px,.6fr) auto) deja muy poco
   ancho a la columna principal una vez que la columna de acciones (auto)
   reserva espacio para 2 botones + ícono anular — el nombre de la
   contraparte y la fecha de vencimiento se envuelven en 3-4 líneas. Ya
   ocurría antes de esta migración (confirmado comparando antes/después
   con los mismos datos). Se corrige apilando la fila a 1 columna desde
   1100px en vez de 760px — 390 ya estaba cubierto por el breakpoint
   anterior, esto extiende el mismo layout a 1024/820. */
@media(max-width:1100px){
  .ofhv1-row{grid-template-columns:1fr}
  .ofhv1-row-money span,.ofhv1-row-money b,.ofhv1-row-money small{text-align:left}
  .ofhv1-row-actions{justify-content:flex-start}
}

@media(max-width:760px){
  .ofhv1-six-areas{grid-template-columns:1fr!important}
  .ofhv1-shell{padding:16px;border-radius:18px}
  .ofhv1-head{display:block}
  .ofhv1-head-actions{margin-top:12px}
  .ofhv1-kpis,.ofhv1-subarea-grid,.ofhv1-payment-grid{grid-template-columns:1fr}
  .ofhv1-window{grid-template-columns:36px 1fr}
  .ofhv1-window-values{grid-column:1/-1;padding-left:48px;margin-top:8px}
  .ofhv1-list-head{display:block}
  .ofhv1-add-btn{margin-top:12px;width:100%;justify-content:center}
  .ofhv1-detail-summary{grid-template-columns:1fr}
  .ofhv1-history-row{grid-template-columns:1fr}
  .ofhv1-history-row>div:last-child{text-align:left}
}
