/* 🧾 Cuenta de préstamos (ficha del empleado, fase B). Todo bajo .la */
.la {
    --la-cap: #1fb6ff; --la-int: #ffc61a; --la-refi: #a855f7; --la-pay: #10d98a; --la-payint: #0a8f5b;
    --la-bad: #ef4444; --la-warn: #fb923c;
    --la-surface: #1e293b; --la-surface-2: #172033; --la-app: #0f172a; --la-line: #334155; --la-line-2: #475569;
    --la-text: #f1f5f9; --la-dim: #cbd5e1; --la-faint: #94a3b8;
    max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; color: var(--la-text);
}
.la b { font-weight: 700; }
.la-c-cap { background: var(--la-cap); } .la-c-int { background: var(--la-int); } .la-c-refi { background: var(--la-refi); }
.la-c-pay { background: var(--la-pay); } .la-c-payint { background: var(--la-payint); } .la-c-bad { background: var(--la-bad); } .la-c-warn { background: var(--la-warn); }
.la-t-cap { color: var(--la-cap); } .la-t-int { color: var(--la-int); } .la-t-refi { color: #c084fc; } .la-t-pay { color: var(--la-pay); }
.la-t-payint { color: #34d399; } .la-t-bad { color: #ff8585; } .la-t-warn { color: var(--la-warn); } .la-t-faint { color: var(--la-faint); }

.la-head { display: flex; align-items: center; gap: 12px; }
.la-head__who { flex: 1; min-width: 0; }
.la-head__who b { display: block; font-size: 1.05rem; }
.la-head__who small { color: var(--la-faint); font-size: .8rem; }
.la-link { background: none; border: 0; color: var(--la-cap); font-weight: 600; font-size: .8rem; cursor: pointer; padding: 4px; }
.la-classic-note { font-size: .8rem; color: var(--la-faint); margin: -6px 0 12px; }

.la-hub { background: var(--la-surface); border: 1px solid var(--la-line); border-radius: 14px; overflow: hidden; }
.la-hub__top { padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; }
.la-hub__lab { font-size: .82rem; color: var(--la-dim); }
.la-hub__big { font-size: 2rem; font-weight: 800; line-height: 1.15; grid-column: 1 / -1; font-variant-numeric: tabular-nums; }
.la-hub__bar { grid-column: 1 / -1; margin-top: 6px; }
.la-hub__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--la-line); }
.la-hub__facts > div { padding: 10px 16px; display: flex; flex-direction: column; }
.la-hub__facts > div + div { border-left: 1px solid var(--la-line); }
.la-hub__facts span { font-size: .75rem; color: var(--la-faint); }
.la-hub__facts b { font-size: .95rem; font-variant-numeric: tabular-nums; }
.la-hub__facts small { font-size: .75rem; color: var(--la-dim); }
@media (max-width: 620px) {
    .la-hub__facts { grid-template-columns: 1fr; }
    .la-hub__facts > div + div { border-left: 0; border-top: 1px solid var(--la-line); }
    .la-hub__top { grid-template-columns: 1fr; }
}
.la-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; justify-self: end; }
.la-chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.la-chip--warn { color: var(--la-warn); background: rgba(251, 146, 60, .14); }
.la-chip--agree { color: var(--la-int); background: rgba(255, 198, 26, .12); }
@media (max-width: 620px) { .la-chip { justify-self: start; grid-row: 1; } }

.la-bar { display: flex; flex-direction: column; gap: 5px; }
.la-bar__track { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--la-line); }
.la-bar--big .la-bar__track { height: 10px; }
.la-bar__track i { display: block; height: 100%; }
.la-bar__track i + i { box-shadow: inset 2px 0 0 var(--la-surface); }
.la-bar__legend { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .75rem; color: var(--la-dim); align-items: center; }
.la-bar__legend span { display: inline-flex; align-items: center; gap: 5px; }
.la-bar__legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.la-bar__pct { margin-left: auto; color: var(--la-pay); font-weight: 700; }

.la-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.la-btn { border: 1px solid var(--la-line-2); background: none; border-radius: 8px; padding: 7px 13px; font-weight: 700; font-size: .82rem; cursor: pointer; color: var(--la-text); font-family: inherit; }
.la-btn:disabled { opacity: .45; cursor: not-allowed; }
.la-btn--pay { background: var(--la-pay); border-color: var(--la-pay); color: #04140d; }
.la-btn--refi { background: var(--la-refi); border-color: var(--la-refi); color: #fff; }
.la-btn--new { background: var(--la-int); border-color: var(--la-int); color: #1c1503; }
.la-btn--cap { background: var(--la-cap); border-color: var(--la-cap); color: #03131c; }
.la-btn--edit { border-color: var(--la-dim); background: rgba(255, 255, 255, .06); }
.la-btn--danger { background: rgba(239, 68, 68, .16); border-color: var(--la-bad); color: #ffb0b0; }
.la-btn--ghost { color: var(--la-dim); }
.la-btn--sm { padding: 5px 10px; font-size: .78rem; }

.la-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--la-line); }
.la-tabs button { background: none; border: 0; padding: 8px 0 10px; font-weight: 700; font-size: .9rem; color: var(--la-faint); cursor: pointer; font-family: inherit; }
.la-tabs button[aria-selected="true"] { color: var(--la-text); box-shadow: inset 0 -3px 0 var(--la-int); }
.la-tabs em { font-style: normal; font-weight: 600; margin-left: 5px; font-size: .78rem; color: var(--la-faint); }

.la-list { background: var(--la-surface); border: 1px solid var(--la-line); border-radius: 12px; overflow: hidden; }
.la-more { margin-top: 4px; }
.la-more summary { cursor: pointer; font-weight: 600; font-size: .82rem; color: var(--la-dim); padding: 6px 0; }
.la-empty { text-align: center; padding: 30px 16px; color: var(--la-faint); background: var(--la-surface); border: 1px dashed var(--la-line); border-radius: 12px; }
.la-empty--inline { border: 0; border-radius: 0; padding: 16px; }

.la-row { border-top: 1px solid var(--la-line); }
.la-row:first-child { border-top: 0; }
.la-row__head { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 24px; gap: 4px 12px; align-items: center; padding: 11px 14px; cursor: pointer; }
.la-row.is-closed .la-row__head { opacity: .65; }
.la-idx { width: 30px; height: 30px; border-radius: 8px; background: var(--la-surface-2); border: 1px solid var(--la-line-2); display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: var(--la-dim); }
.la-row.is-open .la-idx { background: var(--la-int); border-color: var(--la-int); color: #1c1503; }
.la-row__title b { font-size: .86rem; }
.la-row__title small { display: block; color: var(--la-faint); font-size: .75rem; }
.la-row__amt { text-align: right; }
.la-row__amt b { display: block; font-size: .92rem; font-variant-numeric: tabular-nums; }
.la-row__amt small { font-size: .75rem; color: var(--la-faint); }
.la-chev { color: var(--la-faint); text-align: center; }
.la-row__body { padding: 0 14px 14px 62px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.la-row__body::before { content: ""; position: absolute; left: 28px; top: -6px; bottom: 16px; width: 2px; border-radius: 2px; background: rgba(255, 198, 26, .45); }
@media (max-width: 560px) { .la-row__body { padding-left: 14px; } .la-row__body::before { display: none; } }
.la-own { font-size: .75rem; font-weight: 700; color: var(--la-int); display: flex; align-items: center; gap: 8px; }
.la-own::after { content: ""; flex: 1; height: 1px; background: rgba(255, 198, 26, .3); }
.la-kv { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 10px; background: var(--la-surface-2); border: 1px solid rgba(255, 198, 26, .3); border-radius: 10px; padding: 8px 10px; font-size: .75rem; }
.la-kv--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); border-color: var(--la-line); }
@media (max-width: 640px) { .la-kv { grid-template-columns: repeat(3, minmax(0, 1fr)); } .la-kv--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.la-kv span { display: block; color: var(--la-faint); }
.la-kv b { font-size: .82rem; font-variant-numeric: tabular-nums; }
.la-act-h { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--la-faint); }
.la-inner { border: 1px solid rgba(255, 198, 26, .22); border-radius: 10px; overflow: hidden; }
.la-inner .la-mv { padding: 8px 10px; background: var(--la-surface-2); }
.la-loan-acts { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.la-loan-acts .la-btn--danger { margin-left: auto; }
@media (max-width: 560px) { .la-loan-acts .la-btn { flex: 1; min-width: 130px; } .la-loan-acts .la-btn--danger { margin-left: 0; } }

.la-pill { display: inline-block; font-size: .68rem; font-weight: 600; border-radius: 4px; padding: 0 6px; border: 1px solid var(--la-line-2); color: var(--la-dim); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.la-pill--acc, .la-pill--int { color: var(--la-int); border-color: rgba(255, 198, 26, .45); }
.la-pill--pay { color: var(--la-pay); border-color: rgba(16, 217, 138, .4); }
.la-pill--refi { color: #c084fc; border-color: rgba(168, 85, 247, .45); }
.la-pill--warn { color: var(--la-warn); border-color: rgba(251, 146, 60, .5); }
.la-pill--bad { color: #ff8585; border-color: rgba(239, 68, 68, .5); }

.la-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--la-dim); }
.la-toolbar label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.la-mv { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 30px; gap: 2px 12px; align-items: start; padding: 10px 14px; border-top: 1px solid var(--la-line); }
.la-mv:first-child { border-top: 0; }
.la-mv.is-void { opacity: .5; }
.la-mv.is-void .la-mv__a { text-decoration: line-through; }
.la-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.la-mv__w b { font-size: .84rem; font-weight: 600; }
.la-mv__w small { display: block; color: var(--la-faint); font-size: .75rem; }
.la-mv__a { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .85rem; }
.la-mv__a small { display: block; font-weight: 500; color: var(--la-faint); font-size: .72rem; }
.la-x { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--la-line-2); background: none; color: var(--la-dim); cursor: pointer; }
.la-x:hover { border-color: rgba(239, 68, 68, .6); color: #ff8585; }
.la-confirm { grid-column: 1 / -1; background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .4); border-radius: 8px; padding: 8px 10px; font-size: .8rem; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.la-confirm--lock { background: rgba(251, 146, 60, .07); border-color: rgba(251, 146, 60, .45); }
.la-fix { border: 1px solid var(--la-line-2); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; gap: 4px; background: var(--la-surface-2); }
.la-fix small { color: var(--la-dim); font-size: .75rem; }
.la-fix__row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.la-fix__row .la-input { flex: 1; min-width: 180px; }

.la-extra { margin-top: 8px; }

/* Ventanas */
.la-ov { position: fixed; inset: 0; background: rgba(5, 8, 10, .66); display: flex; align-items: flex-start; justify-content: center; padding: 20px 12px; overflow-y: auto; z-index: 1200; }
.la-md { background: #111827; border: 1px solid var(--la-line-2); border-radius: 16px; width: min(640px, 100%); display: flex; flex-direction: column; box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .9); color: var(--la-text); }
@media (max-width: 560px) { .la-ov { padding: 0; align-items: flex-end; } .la-md { border-radius: 16px 16px 0 0; } }
.la-md__h { padding: 10px 14px; border-bottom: 1px solid var(--la-line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.la-md__h h2 { margin: 0; font-size: .95rem; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.la-md__h h2 small { font-size: .75rem; font-weight: 500; color: var(--la-faint); }
.la-tag { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.la-closex { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--la-line-2); background: none; color: var(--la-dim); cursor: pointer; flex: none; }
.la-md__b { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.la-md__f { padding: 8px 14px; border-top: 1px solid var(--la-line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--la-surface-2); border-radius: 0 0 16px 16px; }
.la-md__tot { font-size: .82rem; color: var(--la-dim); }
.la-md__tot b { color: var(--la-text); }
.la-md__acts { display: flex; gap: 6px; flex-wrap: wrap; }
.la-fl { display: flex; flex-direction: column; gap: 3px; font-size: .72rem; font-weight: 600; color: var(--la-dim); min-width: 0; }
.la-input { background: var(--la-app); border: 1px solid var(--la-line-2); border-radius: 8px; padding: 6px 8px; font-size: .82rem; color: var(--la-text); font-family: inherit; width: 100%; }
.la-input--big { font-size: 1.05rem; font-weight: 700; }
.la-row3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; align-items: end; }
.la-row4 { display: grid; grid-template-columns: 1.5fr 1.5fr .6fr .9fr; gap: 8px; align-items: end; }
.la-row2b { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.la-row2b > .la-fl { flex: 1; min-width: 180px; }
@media (max-width: 560px) { .la-row3, .la-row4 { grid-template-columns: 1fr 1fr; } .la-row3 > :first-child { grid-column: 1 / -1; } }
.la-inl { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; color: var(--la-dim); }
.la-inl .la-input { width: auto; }
.la-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.la-chips button { border: 1px dashed var(--la-line-2); background: none; border-radius: 999px; padding: 2px 9px; font-size: .75rem; font-weight: 600; color: var(--la-dim); cursor: pointer; font-family: inherit; }
.la-seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.la-seg button { border: 1px solid var(--la-line-2); background: none; border-radius: 8px; padding: 4px 9px; font-size: .75rem; font-weight: 600; color: var(--la-dim); cursor: pointer; font-family: inherit; }
.la-seg button[aria-pressed="true"] { border-color: var(--la-int); color: var(--la-int); background: rgba(255, 198, 26, .1); }
.la-tbl { border: 1px solid var(--la-line); border-radius: 10px; overflow-x: auto; }
.la-tbl table { border-collapse: collapse; width: 100%; font-size: .75rem; }
.la-tbl th { text-align: right; font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--la-faint); padding: 5px 8px; background: var(--la-surface-2); border-bottom: 1px solid var(--la-line); }
.la-tbl th:first-child { text-transform: none; letter-spacing: 0; font-size: .7rem; text-align: left; }
.la-tbl td { text-align: right; padding: 4px 8px; border-top: 1px solid var(--la-line); color: var(--la-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.la-tbl td:first-child { text-align: left; }
.la-tbl tr:first-child td { border-top: 0; }
.la-tbl .la-tot td { color: var(--la-text); font-weight: 700; border-top: 1px solid var(--la-line-2); }
.la-split { display: block; font-size: .65rem; font-weight: 500; line-height: 1.2; }
.la-strike { text-decoration: line-through; }
.la-check { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.la-check input { accent-color: var(--la-refi); margin: 0; }
.la-line { font-size: .8rem; color: var(--la-dim); }
.la-line b { color: var(--la-text); }
.la-warnbox { border: 1px solid rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .08); border-radius: 9px; padding: 6px 8px; font-size: .78rem; }
.la-warnbox--lock { border-color: rgba(251, 146, 60, .5); background: rgba(251, 146, 60, .08); }
.la-meter { display: flex; flex-direction: column; gap: 4px; background: var(--la-surface); border: 1px solid var(--la-line); border-radius: 10px; padding: 6px 10px; font-size: .75rem; color: var(--la-dim); }
.la-meter__t { display: flex; justify-content: space-between; gap: 8px; }
.la-meter__sc { position: relative; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--la-pay) 0 35%, var(--la-int) 35% 60%, var(--la-bad) 60% 100%); }
.la-meter__sc span { position: absolute; top: -3px; width: 3px; height: 12px; background: var(--la-text); border-radius: 2px; }
.la-lbl { font-size: .72rem; font-weight: 600; color: var(--la-dim); }
.la-opt { display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px; border: 1px solid var(--la-line-2); border-radius: 9px; padding: 8px 10px; cursor: pointer; font-size: .82rem; }
.la-opt input { accent-color: var(--la-int); margin: 2px 0 0; }
.la-opt small { grid-column: 2; color: var(--la-faint); font-size: .75rem; }
.la-opt.is-on { border-color: var(--la-int); background: rgba(255, 198, 26, .07); }
.la-opt.is-dis { opacity: .5; cursor: not-allowed; }
.la-hint { margin: 0; font-size: .75rem; color: var(--la-faint); }
.la-wsum { background: var(--la-app); border: 1px solid var(--la-line-2); border-radius: 8px; padding: 7px 9px; font-size: .8rem; font-weight: 400; color: var(--la-text); line-height: 1.45; }

/* Historial del saldo y aviso de repetidos dentro de la tarjeta principal */
.la-hub__hist { grid-column: 1 / -1; justify-self: end; margin-top: 2px; }
.la-hub__history { border-top: 1px solid var(--la-line); padding: 12px 16px; }
.la-hub__history .loan-history.is-embedded { margin: 0; background: none; border: 0; box-shadow: none; padding: 0; }
.la-hub__dup .loan-dup--embedded { margin: 0; border: 0; border-top: 1px solid rgba(245, 158, 11, .45); border-radius: 0; }
.la-hub__dup .loan-dup--embedded .loan-dup__summary { padding: 10px 16px; }

/* 📊 Historial «Por mes» / «Por periodo» (LoanFlowChart) — también en la vista general */
.loan-history__views { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lf-tabs { display: inline-flex; gap: 4px; background: rgba(15, 23, 42, .6); border: 1px solid #334155; border-radius: 10px; padding: 3px; }
.lf-tabs button { border: 0; background: none; color: #94a3b8; font: inherit; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.lf-tabs button[aria-selected="true"] { background: #334155; color: #f1f5f9; }
.lf-card .lf-chart { width: 100%; height: auto; display: block; }
.lf-chart .lf-sel { fill: rgba(255, 255, 255, .06); }
.lf-chart .lf-hit { cursor: pointer; }
.lf-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .72rem; color: #cbd5e1; margin: 4px 0 6px; }
.lf-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lf-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.lf-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; background: rgba(15, 23, 42, .55); border: 1px solid #334155; border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: .8rem; color: #cbd5e1; }
.lf-panel__t { grid-column: 1 / -1; color: #f1f5f9; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.lf-panel__t small { color: #94a3b8; font-size: .74rem; }
.lf-panel h5 { margin: 0 0 4px; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
@media (max-width: 620px) { .lf-panel { grid-template-columns: 1fr; } }
.lf-r { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 2px 0; }
.lf-r i { width: 10px; height: 10px; border-radius: 2px; }
.lf-r b { color: #f1f5f9; font-variant-numeric: tabular-nums; font-weight: 600; }
.lf-r.is-sub { grid-template-columns: 1fr auto; padding-left: 18px; font-size: .74rem; color: #94a3b8; }
.lf-r.is-sub2 { padding-left: 14px; font-size: .76rem; }
.lf-r.is-tot { border-top: 1px solid #334155; margin-top: 4px; padding-top: 5px; }
.lf-r.is-tot span, .lf-r.is-tot b { font-weight: 800; color: #f1f5f9; }
.lf-note { margin: 4px 0; font-size: .74rem; color: #94a3b8; }

.la-hub__cons { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid rgba(168, 85, 247, .45); background: rgba(168, 85, 247, .08); font-size: .8rem; color: var(--la-dim); }
.la-hub__cons b { color: #d8b4fe; }

.la-cons-banner { --la-refi: #a855f7; --la-line-2: #475569; --la-text: #f1f5f9; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; border: 1px solid rgba(168, 85, 247, .45); background: rgba(168, 85, 247, .08); border-radius: 12px; font-size: .82rem; color: #cbd5e1; }
.la-cons-banner b { color: #d8b4fe; }
.la-cons-banner .la-btn { font-family: inherit; }

.la-fill-banner { --la-cap: #1fb6ff; border-color: rgba(31, 182, 255, .45); background: rgba(31, 182, 255, .07); }
.la-fill-banner b { color: #7dd3fc; }
.la-review { --la-line-2: #475569; --la-text: #f1f5f9; margin-bottom: 16px; border: 1px solid rgba(251, 146, 60, .45); background: rgba(251, 146, 60, .06); border-radius: 12px; font-size: .82rem; color: #cbd5e1; }
.la-review summary { cursor: pointer; padding: 12px 16px; }
.la-review summary b { color: #fdba74; }
.la-review__list { border-top: 1px solid rgba(251, 146, 60, .3); }
.la-review__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid #334155; }
.la-review__row:first-child { border-top: 0; }
.la-review__acts { display: inline-flex; gap: 6px; }
.la-review__row > span:first-child { flex: 1; min-width: 220px; }
.la-review__acts { flex: none; }

/* 📒 Pantalla principal de Préstamos (LoanPortfolioView + LoanPortfolioList)
   Paleta 5 «Neón» de la maqueta: grises neutros, acento amarillo; capital azul,
   interés amarillo, refinanciamiento morado, pagos verde, avisos rojo. */
.is-portfolio {
    --lp-surface: #1e252b; --lp-surface-2: #1a2025; --lp-app: #171d22; --lp-line: #2a3239; --lp-line-2: #363f47;
    --lp-text: #ebeef0; --lp-dim: #a2abb3; --lp-faint: #6f7a84;
    --lp-accent: #ffc61a; --lp-on-accent: #1c1503; --lp-accent-soft: rgba(255, 198, 26, .15); --lp-accent-2: rgba(255, 198, 26, .55);
    --la-cap: #1fb6ff; --la-int: #ffc61a; --la-refi: #a855f7; --la-pay: #10d98a; --la-bad: #ef4444;
    --la-surface: var(--lp-surface); --la-surface-2: var(--lp-surface-2); --la-app: var(--lp-app);
    --la-line: var(--lp-line); --la-line-2: var(--lp-line-2); --la-text: var(--lp-text); --la-dim: var(--lp-dim); --la-faint: var(--lp-faint);
    color: var(--lp-text); font-variant-numeric: tabular-nums;
}
.is-portfolio .loans-overview__main { display: flex; flex-direction: column; gap: 12px; }
.is-portfolio .loans-overview__main > * { margin-top: 0; margin-bottom: 0; }
.is-portfolio .la-btn { border-color: var(--lp-line-2); color: var(--lp-text); }
.is-portfolio .la-pill { border-color: var(--lp-line-2); color: var(--lp-dim); }

/* Línea del mes */
.lp-month { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: 10px; padding: 9px 12px; color: var(--lp-text); font-size: .86rem; }
.lp-month small { color: var(--lp-faint); font-size: .76rem; }
.lp-tip { position: relative; display: inline-flex; margin-left: auto; }
.lp-tip > button { width: 22px !important; height: 22px !important; min-width: 0 !important; min-height: 0 !important; border-radius: 50%; border: 1px solid var(--lp-line-2); background: none; color: var(--lp-dim); font: inherit; font-weight: 700; font-size: .72rem; cursor: pointer; display: grid; place-items: center; padding: 0; }
.lp-tip > button[aria-expanded="true"] { border-color: var(--lp-accent); color: var(--lp-accent); }
.lp-pop { position: absolute; z-index: 20; top: calc(100% + 8px); right: -6px; width: min(310px, 80vw); background: var(--lp-app); border: 1px solid var(--lp-line-2); border-radius: 10px; padding: 10px 12px; font-size: .78rem; line-height: 1.45; color: var(--lp-dim); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8); display: flex; flex-direction: column; gap: 6px; }
.lp-pop strong { color: var(--lp-text); font-weight: 600; }
.lp-pop ul { margin: 0; padding-left: 15px; }
.lp-pop small { color: var(--lp-faint); }
.lp-tip.is-inline { margin-left: 4px; vertical-align: middle; }
.lp-tip.is-inline > button { width: 18px !important; height: 18px !important; font-size: .64rem; }
.lp-tip.is-inline .lp-pop { right: auto; left: -140px; width: 260px; font-weight: 400; }
.lp-ex { margin: 0 0 4px; color: var(--lp-dim); font-size: .8rem; }
@media (max-width: 900px) { .lp-tip.is-inline { position: static; } .lp-tip.is-inline .lp-pop { left: 12px; right: 12px; width: auto; top: auto; margin-top: 26px; } .lp-mdetail { position: relative; } }
.lp-link { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--lp-accent); font: inherit; font-weight: 600; cursor: pointer; }

/* Avisos */
.lp-alerts { background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: 10px; color: var(--lp-text); overflow: hidden; }
.lp-alerts--empty { padding: 10px 12px; color: var(--la-pay); font-size: .84rem; }
.lp-alerts__head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; background: none; border: 0; color: inherit; font: inherit; font-size: .86rem; cursor: pointer; text-align: left; }
.lp-alerts__head b { font-weight: 500; }
.lp-alerts__toggle { margin-left: auto; font-weight: 600; font-size: .8rem; color: var(--lp-text); }
.lp-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--la-bad); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: .72rem; flex: none; box-shadow: 0 0 0 2px var(--lp-surface); }
.lp-alerts.is-open .lp-alerts__head { border-bottom: 1px solid var(--lp-line); }
.lp-alert { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--lp-line); background: var(--lp-surface-2); font-size: .82rem; }
.lp-alerts__head + .lp-alert { border-top: 0; }
.lp-dot { width: 8px; height: 8px; border-radius: 50%; }
.lp-alert__txt b { display: block; font-weight: 500; font-size: .84rem; }
.lp-alert__txt small { display: block; color: var(--lp-faint); font-size: .76rem; }
.lp-alert__txt .lp-hint { color: var(--lp-dim); margin-top: 2px; }
.lp-alert .la-btn { padding: 4px 10px; font-size: .76rem; font-weight: 600; border-radius: 7px; }
.lp-alert__panel { padding: 10px 12px; background: var(--lp-surface-2); border-top: 1px solid var(--lp-line); }
.lp-alert__panel .loan-dup { margin: 0; }
@media (max-width: 520px) { .lp-alert { grid-template-columns: 8px minmax(0, 1fr); } .lp-alert > .la-btn { grid-column: 2; justify-self: start; } }
.lp-list { border: 1px solid var(--lp-line); border-radius: 10px; overflow: hidden; background: var(--lp-surface); }
.lp-list__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--lp-line); font-size: .82rem; color: var(--lp-dim); }
.lp-list__row:first-child { border-top: 0; }
.lp-list__row > span:first-child { flex: 1; min-width: 200px; }
.lp-list__row b { color: var(--lp-text); }
.lp-list__acts { display: inline-flex; gap: 6px; }

/* Riesgo */
.lp-risk { display: flex; flex-direction: column; gap: 10px; }
.lp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lp-chips button { border: 1px solid var(--lp-line-2); background: none; color: var(--lp-dim); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lp-chips button[aria-pressed="true"] { background: var(--lp-line-2); color: var(--lp-text); }
.lp-chips i { width: 8px; height: 8px; border-radius: 50%; }
.lp-how { font-size: .76rem; color: var(--lp-faint); }
.lp-how summary { cursor: pointer; color: var(--lp-dim); font-weight: 600; }
.lp-how ul, .lp-rk ul { margin: 6px 0 0; padding-left: 17px; }
.lp-rk { border: 1px solid var(--lp-line); border-left: 3px solid var(--c); border-radius: 8px; padding: 10px 12px; background: var(--lp-surface); font-size: .8rem; color: var(--lp-dim); display: flex; flex-direction: column; gap: 6px; }
.lp-rk ul { margin: 0; line-height: 1.5; }
.lp-rk__h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--lp-text); font-size: .85rem; }
.lp-rk__lvl { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #111; background: var(--c); border-radius: 4px; padding: 1px 6px; }
.lp-rk__bal { margin-left: auto; font-weight: 700; }
.lp-rk__ctx { color: var(--lp-faint); font-size: .76rem; list-style: "– "; }
.lp-rk__adv { margin-top: 0; background: var(--lp-surface-2); border-radius: 6px; padding: 7px 10px; }
.lp-rk__adv b { display: block; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--lp-faint); font-weight: 600; }
.lp-rk__adv ul { color: var(--lp-text); margin-top: 2px; }
.lp-rk__acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lp-rk__acts .la-btn { padding: 4px 10px; font-size: .76rem; font-weight: 600; border-radius: 7px; }
.lp-rk__acts small { color: var(--lp-faint); }
.lp-note { margin: 4px 0 0; font-size: .74rem; color: var(--lp-faint); }

/* Historial del saldo (variante de la pantalla principal) */
.is-portfolio .loan-history { --lh-capital: #1fb6ff; --lh-interest: #ffc61a; --lh-payment: #10d98a; --lh-loan: #1fb6ff; --lh-refinancing: #a855f7; --lh-off: #6f7a84; background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: 12px; color: var(--lp-text); }
.lp-hist-s { display: grid !important; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; width: 100%; padding: 14px !important; background: none !important; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lp-hist-s:hover { background: var(--lp-surface-2) !important; }
.lp-hist-s__t small { display: block; font-size: .76rem; color: var(--lp-dim); }
.lp-hist-s__t strong { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
.lp-hist-s__go { font-weight: 600; font-size: .8rem; color: var(--lp-text); }
.lp-hist-s__legend { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.lp-hist-s__bar { display: flex; gap: 0; height: 6px; border-radius: 999px; overflow: hidden; background: var(--lp-line); }
.lp-hist-s__bar i { display: block; height: 100%; margin: 0; flex: none; }
.lp-hist-s i.is-capital { background: #1fb6ff; } .lp-hist-s i.is-interest { background: #ffc61a; }
.lp-hist-s__lg { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--lp-dim); }
.lp-hist-s__lg i { display: inline-block; width: 12px; height: 9px; border-radius: 2px; margin-right: 6px; }
.lp-hist-s__lg b { color: var(--lp-text); font-weight: 600; }
.is-portfolio .loan-history__body { border-top: 1px solid var(--lp-line); padding: 12px 14px 14px; background: none; }
.is-portfolio .loan-history__ranges button { background: var(--lp-surface-2); border-color: var(--lp-line); color: var(--lp-dim); }
.is-portfolio .loan-history__ranges button[aria-pressed="true"] { background: var(--lp-line-2); border-color: var(--lp-line-2); color: var(--lp-text); }
.is-portfolio .loan-history__chart-card, .is-portfolio .loan-history__snapshot { background: var(--lp-surface-2); border-color: var(--lp-line); }
.is-portfolio .lf-tabs { background: var(--lp-surface); border-color: var(--lp-line); border-radius: 9px; }
.is-portfolio .lf-tabs button { color: var(--lp-dim); font-weight: 600; }
.is-portfolio .lf-tabs button[aria-selected="true"] { background: var(--lp-line-2); color: var(--lp-text); }
.is-portfolio .lf-legend { color: var(--lp-dim); font-size: .76rem; }
.lf-plot svg { display: block; width: 100%; height: auto; }
.is-portfolio .lf-panel { background: none; border-color: var(--lp-line); border-radius: 10px; color: var(--lp-dim); }
.is-portfolio .lf-panel__t { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.is-portfolio .lf-panel h5 { color: var(--lp-faint); }
.is-portfolio .lf-r b, .is-portfolio .lf-r.is-tot span, .is-portfolio .lf-r.is-tot b { color: var(--lp-text); }
.is-portfolio .lf-r.is-sub { color: var(--lp-faint); }
.is-portfolio .lf-r.is-tot { border-top-color: var(--lp-line); }
.lf-foot { margin: 0; font-size: .76rem; color: var(--lp-dim); line-height: 1.5; }
/* Teléfono: la gráfica se desliza y empieza mostrando lo más reciente (a la derecha). */
@media (max-width: 600px) { .lf-plot { overflow-x: auto; direction: rtl; } .lf-plot svg { min-width: 620px; direction: ltr; } }

/* Barra de filtros y lista (LoanPortfolioList) */
.lp-tb { background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.lp-tb__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lp-seg { display: inline-flex; background: var(--lp-surface-2); border: 1px solid var(--lp-line); border-radius: 8px; padding: 2px; gap: 2px; }
.lp-seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font: inherit; font-size: .78rem; font-weight: 600; color: var(--lp-dim); cursor: pointer; }
.lp-seg button[aria-pressed="true"] { background: var(--lp-line-2); color: var(--lp-text); }
.lp-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.lp-vt { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font: inherit; font-size: .78rem; font-weight: 600; color: var(--lp-dim); cursor: pointer; }
.lp-vt em { font-style: normal; color: var(--lp-faint); margin-left: 4px; font-weight: 500; }
.lp-vt[aria-selected="true"] { background: var(--lp-line-2); color: var(--lp-text); }
.lp-add { margin-left: auto; padding: 7px 13px; background: var(--lp-accent); color: var(--lp-on-accent); border: 0; border-radius: 8px; font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; }
.lp-search { flex: 1; min-width: 170px; display: flex; }
.lp-search input { width: 100%; padding: 8px 11px; background: var(--lp-surface-2); border: 1px solid var(--lp-line); border-radius: 8px; color: var(--lp-text); font: inherit; font-size: .82rem; outline: none; }
.lp-search input::placeholder { color: var(--lp-faint); }
.lp-search input:focus { border-color: var(--lp-accent-2); }
.lp-sort { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; background: var(--lp-surface-2); border: 1px solid var(--lp-line); border-radius: 8px; padding: 2px; }
.lp-sort > span { font-size: .75rem; color: var(--lp-faint); padding: 0 6px; }
.lp-sort button { border: 0; background: none; padding: 4px 9px; border-radius: 6px; font: inherit; font-size: .78rem; font-weight: 600; color: var(--lp-dim); cursor: pointer; }
.lp-sort button[aria-pressed="true"] { background: var(--lp-accent-soft); color: var(--lp-accent); }
.lp-fbtn { border: 1px solid var(--lp-line-2); background: none; border-radius: 8px; padding: 6px 11px; font: inherit; font-size: .78rem; font-weight: 600; color: var(--lp-dim); cursor: pointer; }
.lp-fbtn[aria-expanded="true"] { border-color: var(--lp-accent); color: var(--lp-accent); }
.lp-fbtn em { font-style: normal; background: var(--lp-accent); color: var(--lp-on-accent); border-radius: 999px; padding: 0 6px; margin-left: 5px; font-size: .7rem; }
.lp-adv { border-top: 1px solid var(--lp-line); padding-top: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lp-adv h5 { margin: 0 0 6px; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--lp-faint); }
.lp-adv select { width: 100%; background: var(--lp-surface-2); border: 1px solid var(--lp-line); border-radius: 7px; padding: 6px 8px; font: inherit; font-size: .8rem; color: var(--lp-text); }
.lp-adv__foot { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; color: var(--lp-faint); }
.lp-adv__foot button { background: none; border: 0; color: var(--lp-accent); font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 620px) { .lp-adv { grid-template-columns: 1fr; } }
.lp-emps { background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: 12px; overflow: hidden; }
.lp-emp { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--lp-line); cursor: pointer; color: var(--lp-text); }
.lp-emp:first-child { border-top: 0; }
.lp-emp:hover, .lp-emp:focus-visible { background: var(--lp-surface-2); outline: none; }
.lp-emp.is-empty { cursor: default; color: var(--lp-faint); font-size: .84rem; }
.lp-av { width: 34px; height: 34px; border-radius: 8px; background: var(--lp-surface-2); border: 1px solid var(--lp-line); color: var(--lp-dim); font-weight: 600; font-size: .74rem; display: grid; place-items: center; flex: none; }
.lp-who2 { flex: 1; min-width: 0; }
.lp-who2 b { display: block; font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-who2 small { display: block; color: var(--lp-faint); font-size: .75rem; }
.lp-tag { font-size: .66rem; color: var(--lp-dim); border: 1px solid var(--lp-line-2); border-radius: 4px; padding: 0 5px; margin-left: 6px; font-weight: 500; vertical-align: 1px; }
.lp-rdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #a855f7; margin: 0 5px 0 6px; vertical-align: 1px; }
.lp-bal { text-align: right; flex: none; }
.lp-bal b { display: block; font-size: .94rem; font-weight: 700; }
.lp-bal b.is-paid { color: var(--la-pay); }
.lp-bal small { font-size: .72rem; color: var(--lp-faint); }
.lp-settled { display: flex; flex-direction: column; gap: 8px; }
.lp-settled > button { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font: inherit; font-weight: 600; font-size: .84rem; color: var(--lp-dim); background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: 10px; cursor: pointer; text-align: left; }
.lp-settled > button span:last-child { color: var(--lp-accent); font-size: .78rem; }

/* Resumen de cartera */
.lp-aside { overflow: visible !important; padding: 0; background: var(--lp-surface) !important; border: 1px solid var(--lp-line) !important; border-radius: 12px; }
.lp-summary__h { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 10px; color: var(--lp-dim); font-size: .76rem; }
.lp-summary__h b { font-weight: 600; }
.lp-summary__h small { color: var(--lp-faint); font-size: .72rem; }
.lp-card { border-top: 1px solid var(--lp-line); color: var(--lp-dim); }
.lp-card__s { width: 100%; background: none; border: 0; padding: 12px 14px; text-align: left; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; font: inherit; color: inherit; min-height: 0; }
.lp-card__s > :not(.lp-card__chev) { grid-column: 1; }
.lp-card__chev { grid-column: 2; grid-row: 1 / 4; align-self: center; color: var(--lp-faint); font-size: .7rem; }
.lp-card__s:hover { background: var(--lp-surface-2); }
.lp-card.is-open { background: var(--lp-surface-2); box-shadow: inset 2px 0 0 var(--lp-accent); }
.lp-card__t { font-size: .76rem; color: var(--lp-dim); font-weight: 500; }
.lp-card__big { font-size: 1.25rem; font-weight: 700; color: var(--lp-text); letter-spacing: -.01em; }
.lp-card__s small, .lp-mcard small { font-size: .74rem; color: var(--lp-faint); }
.lp-card__b { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.lp-card__b h5, .lp-mdetail h5 { margin: 10px 0 4px; font-size: .68rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--lp-faint); }
.lp-bar { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--lp-line); margin: 2px 0 6px; }
.lp-bar i { display: block; height: 100%; }
.lp-r { display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; align-items: center; font-size: .8rem; padding: 6px 0; border-top: 1px solid var(--lp-line); color: var(--lp-text); }
.lp-bar + .lp-r { border-top: 0; }
.lp-r i { width: 8px; height: 8px; border-radius: 2px; }
.lp-r b { color: var(--lp-text); font-weight: 600; }
.lp-r.is-plain i { display: none; }
.lp-r.is-plain { grid-template-columns: 1fr auto; }
.lp-r em { display: block; font-style: normal; font-size: .72rem; color: var(--lp-faint); }
.lp-r.is-sub { color: var(--lp-faint); }
.lp-r.is-sub b { font-weight: 500; color: var(--lp-faint); }
.lp-r.is-tot span, .lp-r.is-tot b { font-weight: 700; color: var(--lp-text); }
.lp-who { display: grid; grid-template-columns: auto minmax(30px, 1fr) auto; gap: 8px; align-items: center; width: 100%; background: none; border: 0; color: var(--lp-text); font: inherit; font-size: .78rem; padding: 2px 0; cursor: pointer; text-align: left; }
.lp-who em { font-style: normal; font-size: .66rem; color: var(--lp-dim); border: 1px solid var(--lp-line-2); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.lp-who__bar .lp-bar { margin: 0; }
.lp-who b { font-weight: 600; }
.lp-legend { display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: .72rem; color: var(--lp-dim); margin-top: 4px; }
.lp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lp-legend i { width: 12px; height: 9px; border-radius: 2px; }
.lp-todo { margin-top: 10px; border-left: 2px solid var(--lp-accent); padding: 2px 0 2px 10px; font-size: .78rem; color: var(--lp-dim); }
.lp-todo b { display: block; color: var(--lp-text); font-weight: 600; }
.lp-todo ul { margin: 2px 0 0; padding-left: 15px; }

/* Teléfono: 4 cifras en 2×2 y el detalle de la que se toca debajo */
.lp-mobile { display: none; }
.lp-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lp-mcard { background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: 10px; padding: 10px 11px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 1px; font: inherit; color: var(--lp-text); }
.lp-mcard .lp-card__t { font-size: .72rem; }
.lp-mcard .lp-card__big { font-size: 1.03rem; }
.lp-mcard[aria-expanded="true"] { border-color: var(--lp-accent-2); box-shadow: inset 0 2px 0 var(--lp-accent); }
.lp-mdetail { margin-top: 8px; background: var(--lp-surface); border: 1px solid var(--lp-line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: .84rem; }
/* Mismo corte que la vista general (payroll-redesign.css): sin panel lateral, resumen arriba. */
@media (max-width: 900px) {
    .is-portfolio .lp-mobile { display: block; }
    .is-portfolio .lp-aside { display: none; }
}
@media (max-width: 340px) { .lp-cards { grid-template-columns: 1fr; } }

/* Exportar (LoanExportPanel): botón en la línea del mes y panel desplegable */
.lp-xbtn { background: none; border: 1px solid var(--lp-line-2); border-radius: 8px; padding: 5px 12px; font: inherit; font-weight: 600; font-size: .8rem; color: var(--lp-text); cursor: pointer; min-height: 0; }
.lp-xbtn[aria-expanded="true"] { border-color: var(--lp-accent); color: var(--lp-accent); }
.lp-tip + .lp-xbtn { margin-left: 4px; }
.lp-xp { background: var(--lp-surface); border: 1px solid var(--lp-accent-2); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 16px; color: var(--lp-text); }
.lp-xp h5 { margin: 0 0 8px; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--lp-faint); }
.lp-xp label { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--lp-dim); padding: 3px 0; cursor: pointer; }
.lp-xp input[type="radio"], .lp-xp input[type="checkbox"] { accent-color: var(--lp-accent); margin: 0; }
.lp-xp select, .lp-xp input[type="date"] { background: var(--lp-surface-2); border: 1px solid var(--lp-line); border-radius: 7px; padding: 5px 7px; font: inherit; font-size: .8rem; color: var(--lp-text); max-width: 100%; color-scheme: dark; }
.lp-xp__sub { margin: 4px 0 6px 24px; display: flex; gap: 6px; flex-wrap: wrap; }
.lp-xp__sub small { color: var(--lp-faint); }
.lp-xp__fmt { display: flex; gap: 6px; margin-bottom: 12px; }
.lp-xp__fmt button { flex: 1; border: 1px solid var(--lp-line-2); background: none; border-radius: 8px; padding: 8px; font: inherit; font-weight: 700; font-size: .84rem; cursor: pointer; color: var(--lp-dim); }
.lp-xp__fmt button[aria-pressed="true"] { border-color: var(--lp-accent); color: var(--lp-accent); background: var(--lp-accent-soft); }
.lp-xp__gap { margin-top: 6px; }
.lp-xp__hint { margin: 8px 0 0; font-size: .76rem; color: var(--lp-faint); }
.lp-xp__prev { background: var(--lp-surface-2); border: 1px solid var(--lp-line); border-radius: 10px; padding: 10px 12px; font-size: .8rem; }
.lp-xp__prev div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; color: var(--lp-dim); }
.lp-xp__prev b { color: var(--lp-text); font-weight: 600; }
.lp-xp__prev b.is-cap { color: var(--la-cap); } .lp-xp__prev b.is-refi { color: #c084fc; } .lp-xp__prev b.is-pay { color: var(--la-pay); } .lp-xp__prev b.is-bad { color: var(--la-bad); }
.lp-xp__prev .is-tot { border-top: 1px solid var(--lp-line); margin-top: 4px; padding-top: 6px; }
.lp-xp__go { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--lp-line); padding-top: 10px; font-size: .78rem; color: var(--lp-faint); }
.lp-xp__go .lp-add { margin-left: 0; }
.lp-xp__go .lp-add:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) { .lp-xp { grid-template-columns: 1fr; } }

/* Puente de un mes o periodo (LoanFlowChart.renderFlowBridge) y la tabla plegada */
.lf-bridge { border: 1px solid var(--la-line, #334155); border-radius: 10px; padding: 10px 14px 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.lf-bridge__t { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; color: var(--la-text, #f1f5f9); font-size: .86rem; }
.lf-bridge__t small { color: var(--la-faint, #94a3b8); font-size: .74rem; }
.lf-bridge__s { margin: 0; font-size: .8rem; color: var(--la-dim, #cbd5e1); }
.lf-bridge__s b { color: var(--la-text, #f1f5f9); font-weight: 600; }
.lf-more { margin-top: 6px; font-size: .8rem; color: var(--la-dim, #cbd5e1); }
.lf-more summary { cursor: pointer; color: var(--la-dim, #cbd5e1); font-weight: 600; padding: 4px 0; }
.lf-more .lf-panel { margin-top: 6px; }
.lp-xp__list { margin: 0; padding-left: 17px; font-size: .8rem; color: var(--lp-dim); display: flex; flex-direction: column; gap: 3px; }
.lp-xp__hint b { color: var(--lp-text); }

/* ─── Revisar consolidaciones (maqueta 06/10) ─────────────────────────────── */
.lp-cr-pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.lp-cr-pill.is-bad { background: rgba(244, 63, 94, .18); color: #ff8fa3; }
.lp-cr-pill.is-ok { background: rgba(16, 217, 138, .15); color: #10d98a; }
.lp-cr-pill.is-lock { background: rgba(31, 182, 255, .15); color: #1fb6ff; }
.lp-cr-pill.is-pend { background: rgba(245, 165, 36, .16); color: #f5a524; }
.lp-cr-btn { display: inline-flex; gap: 6px; align-items: center; }
.lp-tip + .lp-cr-btn { margin-left: 4px; }
.lp-cr { background: var(--lp-surface); border: 1px solid var(--lp-accent-2); border-radius: 12px; color: var(--lp-text); overflow: hidden; }
.lp-cr .is-bad { color: #f43f5e; }
.lp-cr .is-ok { color: #10d98a; }
.lp-cr .is-lock { color: #1fb6ff; }
.lp-cr-h { padding: 12px 14px; border-bottom: 1px solid var(--lp-line); }
.lp-cr-h h5 { margin: 0; font-size: .95rem; }
.lp-cr-h p { margin: 4px 0 0; font-size: .8rem; color: var(--lp-dim); max-width: 70ch; }
.lp-cr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--lp-line); }
.lp-cr-stats span { padding: 8px 14px; border-left: 1px solid var(--lp-line); }
.lp-cr-stats span:first-child { border-left: 0; }
.lp-cr-stats small { display: block; font-size: .64rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--lp-faint); }
.lp-cr-stats b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.lp-cr-note { margin: 0; padding: 8px 14px; font-size: .78rem; color: var(--lp-dim); border-bottom: 1px solid var(--lp-line); }
.lp-cr-cols, .lp-cr-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 120px 120px 110px 200px; gap: 10px; align-items: center; padding: 9px 14px; }
.lp-cr-cols { font-size: .64rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--lp-faint); border-bottom: 1px solid var(--lp-line); padding-block: 6px; }
.lp-cr-row { font-size: .84rem; font-variant-numeric: tabular-nums; }
.lp-cr-row small { color: var(--lp-faint); }
.lp-cr-r { text-align: right; }
.lp-cr-n { font-weight: 800; color: var(--lp-dim); }
.lp-cr-st { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.lp-cr-tog { width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 7px; border: 1px solid var(--lp-line-2); background: var(--lp-surface-2); color: var(--lp-text); font-weight: 800; cursor: pointer; }
.lp-cr-emp { border-top: 1px solid var(--lp-line); }
.lp-cr-emp:first-child { border-top: 0; }
.lp-cr-emp.is-alert { background: linear-gradient(90deg, rgba(244, 63, 94, .08), transparent 60%); }
.lp-cr-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; padding: 2px 14px 14px 70px; }
.lp-cr-box { border: 1px solid var(--lp-line); border-radius: 10px; padding: 10px 12px; background: var(--lp-surface-2); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lp-cr-box h6 { margin: 0; font-size: .8rem; }
.lp-cr-box p { margin: 0; font-size: .76rem; color: var(--lp-dim); }
.lp-cr-tree { font-size: .8rem; display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.lp-cr-tree small { color: var(--lp-faint); }
.lp-cr-node .lp-cr-node { margin: 4px 0 0 6px; padding-left: 14px; border-left: 2px solid var(--lp-line-2); }
.lp-cr-chip { display: inline-block; border: 1px solid var(--lp-line-2); border-radius: 6px; padding: 0 6px; font-weight: 700; font-size: .75rem; }
.lp-cr-chip.is-cons { border-color: #a855f7; color: #d8b4fe; }
.lp-cr-cmp { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.lp-cr-cmp .is-sub { color: var(--lp-dim); padding-left: 10px; }
.lp-cr-cmp .is-tot { border-top: 1px solid var(--lp-line-2); padding-top: 6px; font-weight: 800; }
.lp-cr-bar { height: 10px; border-radius: 5px; background: var(--lp-line); position: relative; overflow: hidden; }
.lp-cr-bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 5px; background: #1fb6ff; }
.lp-cr-bar i.is-bad { background: #f43f5e; }
.lp-cr-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lp-cr-acts small { font-size: .74rem; color: var(--lp-faint); }
.lp-cr-fix { background: var(--lp-accent); border: 1px solid var(--lp-accent); color: var(--lp-on-accent); font: inherit; font-weight: 800; font-size: .8rem; border-radius: 8px; padding: 7px 12px; cursor: pointer; min-height: 0; }
.la-restore-block { flex-basis: 100%; font-size: .74rem; color: var(--la-dim, #9fb0cc); }
@media (max-width: 760px) {
    .lp-cr-cols { display: none; }
    .lp-cr-row { grid-template-columns: 44px minmax(0, 1fr) auto; row-gap: 4px; }
    .lp-cr-row .is-m { display: none; }
    .lp-cr-row .lp-cr-st { grid-column: 1 / -1; justify-content: flex-start; }
    .lp-cr-detail { grid-template-columns: 1fr; padding-left: 14px; }
    .lp-cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lp-cr-stats span:nth-child(3) { border-left: 0; }
    .lp-cr-stats span:nth-child(n+3) { border-top: 1px solid var(--lp-line); }
}
