/* =====================================================================
 * Flujo de Fondos (BeroPortfolio) — flat, paleta Bero, claro/oscuro
 * ===================================================================== */
.bport {
    --bp-navy: #001D3B;
    --bp-teal: #59C2AB;
    --bp-teal-d: #2f9c86;
    --bp-ink: #1b2430;
    --bp-muted: #6b7785;
    --bp-line: #e3e7ec;
    --bp-soft: #f5f7f9;
    --bp-card: #ffffff;
    --bp-good: #12805c;
    --bp-bad: #c2362b;
    --bp-bad-bg: #fcecea;
    --bp-warn: #8a5a00;
    --bp-warn-bg: #fff6e0;
    --bp-ars: #7a5c00;
    --bp-mep: #2a5d9c;
    --bp-ccl: #2f7d6d;
    color: var(--bp-ink);
    font-family: 'Plus Jakarta Sans', sans-serif;
    position: relative;
    padding-bottom: 8px;
}
[data-theme="dark"] .bport {
    --bp-navy: #58a6ff;
    --bp-ink: #d6dde5;
    --bp-muted: #8b949e;
    --bp-line: #30363d;
    --bp-soft: #161b22;
    --bp-card: #0d1117;
    --bp-good: #3fb98a;
    --bp-bad: #f07167;
    --bp-bad-bg: rgba(240, 113, 103, .12);
    --bp-warn: #e3b341;
    --bp-warn-bg: rgba(227, 179, 65, .10);
    --bp-ars: #e3b341;
    --bp-mep: #7da2ef;
    --bp-ccl: #59C2AB;
}
.bport .bp-mono, .bport table, .bport .bp-kpi-v, .bport .bp-num { font-variant-numeric: tabular-nums; }

/* ---------- encabezado ---------- */
.bp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.bp-title { margin: 0 0 2px; font-weight: 700; color: var(--bp-navy); }
.bp-lead { margin: 0; color: var(--bp-muted); font-size: .9rem; }
.bp-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

.bp-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
    font-size: .82rem; font-weight: 600; color: var(--bp-ink); background: var(--bp-card);
    border: 1px solid var(--bp-line); border-radius: 0; cursor: pointer; white-space: nowrap;
}
.bp-btn:hover { border-color: var(--bp-teal); }
.bp-btn:disabled { opacity: .55; cursor: progress; }
.bp-btn-primary { color: #fff; background: var(--bp-navy); border-color: var(--bp-navy); }
[data-theme="dark"] .bp-btn-primary { color: #0d1117; }
.bp-btn-primary:hover { filter: brightness(1.12); }
.bp-icon { width: 34px; justify-content: center; padding: 0; }
.bp-link { border: none; background: none; padding: 0 0 0 6px; color: var(--bp-teal-d); font-size: .7rem; font-weight: 600; text-transform: none; letter-spacing: 0; text-decoration: underline; cursor: pointer; }

/* ---------- barra de ajustes ---------- */
.bp-bar {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px 14px; padding: 12px 14px; background: var(--bp-soft); border: 1px solid var(--bp-line); margin-bottom: 12px;
}
.bp-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bp-field > label { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bp-muted); margin: 0; }
.bp-inline { display: flex; gap: 6px; }
.bp-inline .bp-input { flex: 1; min-width: 0; }
.bp-input {
    width: 100%; height: 34px; padding: 4px 10px; font-size: .9rem; font-weight: 600;
    color: var(--bp-ink); background: var(--bp-card); border: 1px solid var(--bp-line); border-radius: 0; outline: none;
}
select.bp-input { font-weight: 500; }
.bp-input:focus { border-color: var(--bp-teal); box-shadow: 0 0 0 2px rgba(89, 194, 171, .25); }
.bp-input.need { border-color: var(--bp-bad); box-shadow: 0 0 0 2px rgba(194, 54, 43, .2); }
.bp-num { text-align: right; }
.bp-suffix-wrap { display: flex; align-items: stretch; }
.bp-suffix-wrap .bp-input { flex: 1; min-width: 0; }
.bp-suffix-wrap span {
    display: flex; align-items: center; padding: 0 8px; font-weight: 600; color: var(--bp-muted);
    background: var(--bp-card); border: 1px solid var(--bp-line); border-left: none;
}
.bp-suffix-wrap span.pre { border-left: 1px solid var(--bp-line); border-right: none; }
.bp-static { height: 34px; display: flex; align-items: center; font-weight: 600; font-size: .88rem; }
.bp-f-name, .bp-f-modo, .bp-f-tc { grid-column: span 2; }
.bp-f-liq { grid-column: span 4; }
.bp-f-canje { grid-column: span 3; }
.bp-f-tc.dim, .bp-f-canje.dim { opacity: .55; }
.bp-field-hint { font-size: .72rem; color: var(--bp-muted); min-height: 1em; }
.bp-help { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 4px;
    font-size: .62rem; border: 1px solid currentColor; border-radius: 50%; cursor: help; text-transform: none; letter-spacing: 0; }
.bp-modo { display: flex; }
.bp-modo .bp-seg-btn { flex: 1; }
.bp-vn-calc { font-size: .72rem; color: var(--bp-muted); margin-top: 4px; text-align: right; min-height: 1em; }
.bp-vn-calc b { color: var(--bp-ink); }
.bp-canje-valor { flex: 0 0 96px !important; }
.bp-inline-sel { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--bp-muted); margin: 0; white-space: nowrap; }
.bp-inline-sel .bp-input { width: auto; height: 30px; }

/* ---------- pegar ---------- */
.bp-paste { padding: 12px 14px; border: 1px dashed var(--bp-teal); background: rgba(89, 194, 171, .06); margin-bottom: 12px; }
.bp-paste-help { font-size: .85rem; margin-bottom: 8px; }
.bp-paste textarea.bp-input { height: auto; font-family: ui-monospace, Consolas, monospace; font-weight: 500; font-size: .85rem; resize: vertical; }
.bp-paste-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; flex-wrap: wrap; }
.bp-paste-actions > div { display: flex; gap: 8px; }
.bp-check { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--bp-muted); margin: 0; cursor: pointer; }

/* ---------- tabla de carga ---------- */
.bp-table-wrap { overflow-x: auto; }
.bp-input-wrap { border: 1px solid var(--bp-line); margin-bottom: 16px; }
.bp-input-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.bp-input-table th {
    font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bp-muted);
    padding: 8px 10px; text-align: center; background: var(--bp-soft); border-bottom: 1px solid var(--bp-line); white-space: nowrap;
}
.bp-input-table th.l { text-align: left; }
.bp-unit { font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .8; }
.bp-input-table td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--bp-line); }
.bp-input-table tfoot td { border-bottom: none; vertical-align: middle; }
.bp-row.has-error .bp-ticker { border-color: var(--bp-bad); }
.bp-c-ticker { width: 34%; min-width: 230px; }
.bp-c-mon { width: 1%; white-space: nowrap; }
.bp-c-vn { width: 14%; }
.bp-c-px { width: 13%; }
.bp-c-inv { width: 16%; text-align: right; font-weight: 700; white-space: nowrap; padding-top: 15px !important; }
.bp-c-del { width: 1%; padding-top: 12px !important; }
.bp-ticker { text-transform: uppercase; }
.bp-ticker::placeholder { text-transform: none; }
.bp-info { font-size: .74rem; color: var(--bp-muted); margin-top: 4px; line-height: 1.35; min-height: 1em; }
.bp-info.bad { color: var(--bp-bad); font-weight: 600; }
.bp-tcimp { color: var(--bp-ars); font-weight: 600; }
.bp-pxsrc { font-size: .72rem; margin-top: 4px; text-align: right; min-height: 1em; }
.bp-src-ok { color: var(--bp-teal-d); font-weight: 600; }
[data-theme="dark"] .bp-src-ok { color: var(--bp-teal); }
.bp-src-muted { color: var(--bp-muted); }
.bp-src-bad { color: var(--bp-bad); font-weight: 600; }
.bp-mkt-chip {
    padding: 0 6px; font-size: .72rem; font-weight: 600; color: var(--bp-teal-d); background: transparent;
    border: 1px dashed var(--bp-teal); border-radius: 0; cursor: pointer;
}
[data-theme="dark"] .bp-mkt-chip { color: var(--bp-teal); }
.bp-inv-usd { font-size: .72rem; font-weight: 500; color: var(--bp-muted); margin-top: 3px; }
.bp-del { width: 30px; height: 30px; border: 1px solid transparent; background: none; color: var(--bp-muted); cursor: pointer; }
.bp-del:hover { color: var(--bp-bad); border-color: var(--bp-line); }
.bp-add { border-style: dashed; }
.bp-hint { margin-left: 10px; font-size: .75rem; color: var(--bp-muted); }

/* selector de moneda */
.bp-seg { display: inline-flex; }
.bp-seg-btn {
    height: 34px; padding: 0 12px; font-size: .8rem; font-weight: 600; color: var(--bp-muted);
    background: var(--bp-card); border: 1px solid var(--bp-line); border-radius: 0; cursor: pointer;
}
.bp-seg-btn + .bp-seg-btn { border-left: none; }
.bp-seg-btn:hover { color: var(--bp-ink); }
.bp-seg-btn.on { color: #fff; background: var(--bp-navy); border-color: var(--bp-navy); }
[data-theme="dark"] .bp-seg-btn.on { color: #0d1117; }
.bp-seg-btn.nomkt:not(.on) { text-decoration: line-through; opacity: .6; }

/* ---------- resultados ---------- */
.bp-results { transition: opacity .15s; }
.bp-results.loading { opacity: .55; }
.bp-alert { padding: 10px 14px; margin-bottom: 14px; font-size: .85rem; border-left: 3px solid; }
.bp-alert ul { margin: 4px 0 0; padding-left: 18px; }
.bp-alert.warn { background: var(--bp-warn-bg); border-color: var(--bp-warn); color: var(--bp-ink); }
.bp-alert.bad { background: var(--bp-bad-bg); border-color: var(--bp-bad); }
.bp-empty { padding: 28px 22px; text-align: center; border: 1px dashed var(--bp-line); color: var(--bp-muted); font-size: .9rem; }
.bp-empty-t { font-weight: 700; color: var(--bp-ink); font-size: 1rem; margin-bottom: 6px; }
.bp-empty-hint { margin-top: 8px; font-size: .82rem; }

.bp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--bp-line); margin-bottom: 16px; }
.bp-kpi { padding: 12px 14px; border-right: 1px solid var(--bp-line); border-bottom: 1px solid var(--bp-line); margin-bottom: -1px; min-width: 0; }
.bp-kpi:last-child { border-right: none; }
.bp-kpi-l { font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bp-muted); }
.bp-kpi-v { font-size: 1.3rem; font-weight: 700; color: var(--bp-navy); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-kpi-v.good { color: var(--bp-good); }
.bp-kpi-v.bad { color: var(--bp-bad); }
.bp-kpi-n { font-size: .72rem; color: var(--bp-muted); margin-top: 2px; }
.bp-kpi-main { background: rgba(89, 194, 171, .08); box-shadow: inset 0 3px 0 var(--bp-teal); }

.bp-grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
@media (min-width: 1700px) { .bp-grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.bp-card { border: 1px solid var(--bp-line); background: var(--bp-card); padding: 12px 14px; margin-bottom: 16px; min-width: 0; }
.bp-grid2 .bp-card { margin-bottom: 0; }
.bp-card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.bp-card-h h5 { margin: 0; font-size: .95rem; font-weight: 700; color: var(--bp-navy); }
.bp-card-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bp-tabs { display: inline-flex; flex-wrap: wrap; }
.bp-tabs button {
    height: 28px; padding: 0 10px; font-size: .76rem; font-weight: 600; color: var(--bp-muted);
    background: var(--bp-card); border: 1px solid var(--bp-line); border-radius: 0; cursor: pointer; margin-left: -1px;
}
.bp-tabs button.on { color: var(--bp-ink); background: var(--bp-soft); box-shadow: inset 0 -2px 0 var(--bp-teal); }
.bp-chart { width: 100%; min-height: 330px; }
.bp-chart-note { font-size: .72rem; color: var(--bp-muted); }

.bp-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.bp-table th {
    font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bp-muted);
    padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--bp-line); white-space: nowrap;
}
.bp-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--bp-line); white-space: nowrap; }
.bp-table .l { text-align: left; }
.bp-table tbody tr:hover td { background: var(--bp-soft); }
.bp-table tfoot td { font-weight: 700; border-top: 2px solid var(--bp-line); border-bottom: none; }
.bp-sub2 { font-size: .7rem; color: var(--bp-muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.bp-crono { max-height: 460px; overflow-y: auto; }
.bp-crono thead th { position: sticky; top: 0; background: var(--bp-card); z-index: 1; }
.bp-crono tfoot td { position: sticky; bottom: 0; background: var(--bp-card); }
.bp-pill { display: inline-block; padding: 1px 7px; font-size: .7rem; font-weight: 700; border: 1px solid currentColor; }
.bp-pill.m-ARS { color: var(--bp-ars); }
.bp-pill.m-MEP { color: var(--bp-mep); }
.bp-pill.m-CCL { color: var(--bp-ccl); }

.bp-toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 1080; max-width: 360px; padding: 10px 14px;
    font-size: .85rem; color: #fff; background: #001D3B; border-left: 3px solid #59C2AB;
}

/* tasas del bloque pesos */
.bp-rates { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--bp-line); margin-bottom: 6px; }
.bp-rate { padding: 12px 14px; border-right: 1px solid var(--bp-line); min-width: 0; }
.bp-rate:last-child { border-right: none; }
.bp-rate-main { background: rgba(89, 194, 171, .08); box-shadow: inset 0 3px 0 var(--bp-teal); }
.bp-est-pill { display: inline-block; margin-left: 4px; padding: 0 5px; font-size: .62rem; letter-spacing: 0; text-transform: none; color: var(--bp-warn); border: 1px solid currentColor; vertical-align: 1px; }
.bp-explain.warn { background: var(--bp-warn-bg); border-left-color: var(--bp-warn); }
.bp-cer-tag { display: inline-block; margin-left: 4px; padding: 0 5px; font-size: .64rem; font-weight: 700; border: 1px solid currentColor; vertical-align: 1px; }
.bp-cer-tag.est { color: var(--bp-warn); }
.bp-cer-tag.pub { color: var(--bp-good); }
.bp-cer-tag.fija { color: var(--bp-muted); }

/* bloques Dólares / Pesos */
.bp-split { display: grid; grid-template-columns: 1fr 1fr 1fr; border: 1px solid var(--bp-line); margin-bottom: 6px; }
.bp-split-b, .bp-split-tot {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; text-align: left;
    background: var(--bp-card); border: none; border-right: 1px solid var(--bp-line); color: var(--bp-ink); font: inherit;
}
.bp-split-tot { border-right: none; background: var(--bp-soft); }
.bp-split-b { cursor: pointer; }
.bp-split-b:hover { background: var(--bp-soft); }
.bp-split-b.on { box-shadow: inset 0 -3px 0 var(--bp-teal); background: rgba(89, 194, 171, .08); }
.bp-split-t { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bp-muted); }
.bp-split-v { font-size: 1.2rem; font-weight: 700; color: var(--bp-navy); font-variant-numeric: tabular-nums; }
.bp-split-n { font-size: .74rem; color: var(--bp-muted); }
.bp-note { font-size: .76rem; color: var(--bp-muted); margin: 0 0 14px; }
.bp-explain {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 10px 14px; margin-bottom: 14px; font-size: .82rem; background: var(--bp-soft); border-left: 3px solid var(--bp-teal);
}
.bp-explain > div { flex: 1 1 480px; }
.bp-canje { color: var(--bp-mep); font-weight: 600; }
.bp-src-est { color: var(--bp-warn); font-weight: 600; cursor: help; }
.bp-seg-btn.est:not(.on) { font-style: italic; }
.bp-seg-btn:disabled { opacity: .35; cursor: not-allowed; text-decoration: none; }
.bp-sub2.est { color: var(--bp-warn); }
.bp-proy { color: var(--bp-warn); font-weight: 600; cursor: help; }
.bp-rem-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; }
.bp-rem-txt { font-size: .83rem; }
.bp-rem-txt p { margin: 0 0 8px; }
.bp-rem-txt a { color: var(--bp-teal-d); }
.bp-rem-table { max-height: 340px; overflow-y: auto; border: 1px solid var(--bp-line); }
.bp-rem-table thead th { position: sticky; top: 0; background: var(--bp-card); }
.bp-src-tag { display: inline-block; padding: 0 6px; font-size: .7rem; font-weight: 600; border: 1px solid currentColor; }
.bp-src-tag.s-indec { color: var(--bp-good); }
.bp-src-tag.s-rem { color: var(--bp-mep); }
.bp-src-tag.s-der { color: var(--bp-muted); }

@media (max-width: 1200px) {
    .bp-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bp-f-name, .bp-f-modo, .bp-f-canje { grid-column: span 2; }
    .bp-f-tc { grid-column: auto; }
    .bp-rem-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .bp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bp-kpi { border-right: none; border-bottom: 1px solid var(--bp-line); }
    .bp-bar { grid-template-columns: minmax(0, 1fr); }
    .bp-f-name, .bp-f-modo, .bp-f-canje, .bp-f-tc { grid-column: auto; }
    .bp-split { grid-template-columns: minmax(0, 1fr); }
}
