/* Argenbons · estética Dark Liquid Glass */
:root {
  --bg-0: #15171b; --bg-1: #1d2025; --bg-2: #282c33;
  --ink: #f1f3f5; --ink-2: rgba(241, 243, 245, .68); --ink-3: rgba(241, 243, 245, .42);
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --pos: #8fe3c0; --neg: #ff4d55;
  --iri: conic-gradient(from 210deg, #7cf3ff, #9d8cff, #ff9ecf, #ffd08a, #b6ffcf, #7cf3ff);
  --r-lg: 30px; --r-md: 24px; --r-sm: 16px; --pill: 999px;
  --font: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: linear-gradient(180deg, var(--bg-2), var(--bg-1) 40%, var(--bg-0)) fixed; }
body {
  margin: 0; font: 14px/1.45 var(--font); color: var(--ink);
  background: transparent; /* el fondo lo pone html + el paisaje fijo */
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--ink); text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }

/* ---------- Paisaje fijo detrás del vidrio ---------- */
.landscape { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.landscape svg { width: 100%; height: 100%; display: block; }

/* ---------- Vidrio líquido ---------- */
.lg {
  position: relative; isolation: isolate; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .035));
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 1.5px 1.5px 0 -0.5px rgba(255, 255, 255, .55), inset -1px -1px 0 -0.5px rgba(255, 255, 255, .25),
    inset 0 0 18px rgba(255, 255, 255, .06), 0 18px 40px -18px rgba(0, 0, 0, .55);
}
.lg::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(135deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .08) 30%, rgba(255, 255, 255, .04) 65%, rgba(255, 255, 255, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.lg::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(120% 60% at 20% -10%, rgba(255, 255, 255, .16), transparent 55%);
}
.lg.dark { background: linear-gradient(180deg, rgba(18, 21, 26, .42), rgba(10, 12, 15, .30)); }
.lg.light { background: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, .08)); }
.lg.iri::before { background: var(--iri); opacity: .7; }
.lg > * { position: relative; z-index: 1; }
/* Paneles de datos: vidrio más denso para que las tablas se lean sobre el cielo claro */
.panel.lg { background: linear-gradient(180deg, rgba(20, 23, 28, .66), rgba(12, 14, 17, .58)); }
.panel.lg::after { background: radial-gradient(90% 40% at 15% -8%, rgba(255, 255, 255, .10), transparent 60%); }

/* ---------- Encabezado ---------- */
.hero { padding: 22px 24px 0; max-width: 1500px; margin: 0 auto; }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; min-height: 150px; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 10px; }
.hero h1 { margin: 0 0 10px; font-weight: 500; font-size: clamp(36px, 6vw, 64px); letter-spacing: -0.04em; line-height: .98; color: var(--ink); }
.hero h1 span { color: var(--ink-3); }
.hero-obj { position: relative; width: 168px; height: 168px; flex: none; margin-right: 6px; }
.hero-obj .render { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .35)); }

#controls { margin-top: 10px; padding: 16px 18px 16px 22px; }
#controls.lg.dark { background: linear-gradient(180deg, rgba(18, 21, 26, .58), rgba(10, 12, 15, .46)); }
#controls .field-label { color: var(--ink-2); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.toolbar-end { margin-left: auto; display: flex; gap: 14px; align-items: center; }

.tabs-wrap { position: sticky; top: 10px; z-index: 20; padding: 14px 24px 0; max-width: 1500px; margin: 0 auto; }
.tabs { display: flex; gap: 4px; padding: 6px; border-radius: var(--pill); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 16px; color: var(--ink-2); text-decoration: none; white-space: nowrap; border-radius: var(--pill); font-weight: 500; transition: color .15s, background .15s; }
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, .07); }
.tab.on { background: #f5f7f8; color: #15171b; }

/* ---------- Campos y controles ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.hint { font-size: 11px; color: var(--ink-3); }
.inline { display: flex; gap: 8px; align-items: center; }
.unit { color: var(--ink-3); font-size: 12px; font-family: var(--mono); }

input[type=date], input[type=number], select {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 7px 12px; min-height: 36px; color: var(--ink);
}
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--bg-1); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .6; }
input:focus-visible, select:focus-visible, button:focus-visible, .tab:focus-visible { outline: 2px solid rgba(255, 255, 255, .8); outline-offset: 2px; }
.num-input { width: 112px; font-family: var(--mono); text-align: right; font-size: 13px; }
.num-input.xs { width: 72px; }
input:disabled { opacity: .4; }

.seg { display: inline-flex; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; }
.seg button { background: none; border: 0; padding: 6px 13px; border-radius: var(--pill); cursor: pointer; color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #f5f7f8; color: #15171b; }
.seg-sm button { padding: 5px 11px; font-size: 13px; }

.btn { background: #f5f7f8; color: #15171b; border: 0; border-radius: var(--pill); padding: 9px 18px; font-weight: 600; cursor: pointer; transition: transform .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: rgba(255, 255, 255, .07); color: var(--ink); border: 1px solid var(--line-2); font-weight: 500; }
.icon-btn { background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); color: var(--ink-2); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; line-height: 1; }
.icon-btn:hover { color: var(--neg); border-color: var(--neg); }

.status { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.status.ok::before { background: var(--pos); box-shadow: 0 0 10px var(--pos); }
.status.error::before { background: var(--neg); box-shadow: 0 0 10px var(--neg); }
.status.loading::before { background: var(--ink); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- Contenido ---------- */
main { padding: 18px 24px 34px; max-width: 1500px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 22px 22px 20px; min-width: 0; }
.panel-head { margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 21px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; }
.panel .sub { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; max-width: 92ch; }
.mini { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); font-weight: 400; margin: 18px 0 10px; text-transform: uppercase; letter-spacing: .08em; }
.note { color: var(--ink-2); font-size: 12.5px; margin: 0 0 12px; }
.empty, .muted { color: var(--ink-3); padding: 14px 0; margin: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 14px; }
.inline-kpi { font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding-bottom: 9px; }
.row-end { display: flex; justify-content: flex-end; margin-top: 14px; }
.chart { position: relative; width: 100%; }

.kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.kpi { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 20px; padding: 10px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
.kpi.lg { border: 0; border-radius: var(--r-md); }
.kpis.big .kpi { flex: 1; padding: 18px 22px; min-width: 220px; }
.kpis.big .kpi-value { font-size: 44px; font-family: var(--font); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; }
.kpi-label { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.kpi-value { font-family: var(--mono); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi-sub { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.kpi.pos .kpi-value { color: var(--pos); }
.kpi.neg .kpi-value { color: var(--neg); }
.kpi.warn { border-color: rgba(255, 255, 255, .45); }
.kpi.alert { border-color: var(--neg); background: linear-gradient(180deg, rgba(255, 255, 255, .04) 10%, rgba(255, 60, 70, .22)); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: rgba(0, 0, 0, .14); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { padding: 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, .055); white-space: nowrap; }
.grid th { position: sticky; top: 0; background: rgba(28, 31, 37, .96); color: var(--ink-3); font-family: var(--mono); font-weight: 400; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; text-align: left; cursor: pointer; user-select: none; }
.grid th:hover { color: var(--ink); }
.grid td.num, .grid th.num { text-align: right; }
.grid td.num { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.grid tbody tr:hover td { background: rgba(255, 255, 255, .035); }
.grid tbody tr:last-child td { border-bottom: 0; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.strong { font-weight: 600; }
.tk { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }
sup.edited { color: var(--ink); margin-left: 3px; opacity: .7; }

.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.price-cell { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .045); border: 1px solid var(--line); border-radius: var(--pill); padding: 5px 6px 5px 14px; }
.price-cell .tk { width: 52px; font-size: 12.5px; }
.price-cell .num-input { flex: 1; width: auto; min-width: 0; border-radius: var(--pill); }
.price-cell .unit { padding-right: 6px; }
.price-cell.edited { border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .09); }

.toast { position: fixed; right: 18px; bottom: 18px; padding: 12px 18px; border-radius: var(--pill); z-index: 50; font-weight: 500; }
.toast.error { color: var(--neg); }

.foot { color: var(--ink-3); font-size: 12px; text-align: center; padding: 22px 16px 34px; font-family: var(--mono); }
.foot a { color: var(--ink-2); }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .toolbar-end { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (max-width: 560px) {
  .hero { padding: 16px 16px 0; }
  .hero-row { min-height: 110px; }
  .hero-obj { width: 104px; height: 104px; }
  #controls { padding: 14px 16px; border-radius: var(--r-md); }
  .tabs-wrap { padding: 12px 16px 0; }
  main { padding: 14px 16px 26px; }
  .panel { padding: 16px 14px; border-radius: var(--r-md); }
  .panel h2 { font-size: 18px; }
  .kpis.big .kpi { min-width: 100%; }
  .kpis.big .kpi-value { font-size: 34px; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-cell { padding-left: 10px; }
  .price-cell .tk { width: 44px; font-size: 11.5px; }
  .price-cell .unit { display: none; }
}

/* ---------- Curva pesos ---------- */
#pesos .ps-no { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; vertical-align: 3px; }
#pesos .ps-chart { height: 580px; margin-top: 4px; }
#pesos .ps-kn { margin: 8px 0 14px; color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; }
#pesos .ps-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
#pesos .ps-sum .kpi { padding: 16px 20px; border-radius: var(--r-md); gap: 6px; }
#pesos .ps-sum .kpi-value { font-family: var(--font); font-size: 32px; letter-spacing: -0.03em; }
#pesos .ps-sum .kpi-sub { white-space: normal; line-height: 1.4; }
#pesos table.ps td.nt { text-align: left; white-space: normal; color: var(--ink-3); font-size: 12px; min-width: 200px; font-family: var(--font); }
#pesos table.ps th { line-height: 1.25; vertical-align: bottom; }
#pesos table.ps td.tk { font-family: var(--mono); font-weight: 500; }
#pesos .tag { display: inline-block; padding: 2px 9px; border-radius: var(--pill); background: rgba(255, 255, 255, .08); font-family: var(--font); font-size: 12px; }
#pesos .tag.up { background: rgba(143, 227, 192, .16); color: var(--pos); }
#pesos .vdsup { color: var(--ink-3); font-size: 11px; margin-left: 4px; font-weight: 400; }
#pesos .ps-fwd { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
#pesos details > summary { cursor: pointer; font-weight: 500; color: var(--ink); font-size: 15px; list-style: none; display: flex; align-items: center; gap: 10px; }
#pesos details > summary::-webkit-details-marker { display: none; }
#pesos details > summary::before { content: "▸"; color: var(--ink-2); transition: transform .15s; }
#pesos details[open] > summary::before { transform: rotate(90deg); }
#pesos tr.fwx td { background: rgba(143, 227, 192, .09); }
#pesos tr.fwx td.fwv { color: var(--pos); font-weight: 700; }
#pesos td.fwc { color: var(--ink-3); }
#pesos .bemsg { min-height: 90px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 24px; color: var(--ink-3); font-size: 15px; line-height: 1.5; }
#pesos #psPath input { width: 88px; }
#pesos .controls .btn { align-self: flex-end; }
@media (max-width: 700px) { #pesos .ps-chart { height: 420px; } }

/* ---------- Tabla de retornos ---------- */
#retornos .tins { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
#retornos .ti { padding: 14px 18px; border-radius: var(--r-md); gap: 6px; }
#retornos .ti .kpi-value { font-family: var(--font); font-size: 22px; letter-spacing: -0.02em; }
#retornos .ti .kpi-sub { white-space: normal; line-height: 1.45; font-family: var(--font); font-size: 12.5px; }
#retornos i.n { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 8px; border-radius: 50%; background: #f5f7f8; color: #15171b; font-style: normal; font-size: 10.5px; font-weight: 700; }
#retornos .grid .mk { position: relative; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); border-radius: 6px; }
#retornos .grid .mk::after { content: attr(data-mk); position: absolute; top: 2px; right: 3px; font-size: 9px; font-weight: 700; color: #15171b; background: #f5f7f8; border-radius: 99px; padding: 0 4px; line-height: 13px; }
#retornos .grid th.mk::after { top: 4px; }
#retornos .grid td.b, #retornos .grid th.b { border-left: 1px solid var(--line-2); }
#retornos .grid th { line-height: 1.25; vertical-align: bottom; }
#retornos .rt-px { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
#retornos details > summary { cursor: pointer; color: var(--ink); font-weight: 500; }
.rt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.rt-stats .kpi { padding: 14px 18px; border-radius: var(--r-md); }
.rt-stats .kpi-value { font-family: var(--font); font-size: 22px; }
.rt-stats .kpi-sub { white-space: normal; line-height: 1.45; }
#retornos .rt-range { width: 150px; accent-color: #f5f7f8; }
.grid tr.dimr td { opacity: .45; }
.kpi-label i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }

/* ---------- Globales / Bonares ---------- */
#curva .cv-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; }
#curva .cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
#curva .cv-grid.sm { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
#curva .cv-box { padding: 14px 18px; border-radius: var(--r-md); gap: 6px; min-width: 0; }
#curva .cv-box .kpi-value { font-family: var(--font); font-size: 24px; letter-spacing: -0.02em; }
#curva .cv-box .kpi-sub { white-space: normal; line-height: 1.4; }
#curva .cv-preset { position: absolute; top: 6px; left: 8px; z-index: 5; min-height: 30px; padding: 4px 28px 4px 10px; font-size: 12.5px; }
#curva .cv-note { line-height: 1.55; }
#curva .cv-note b { color: var(--ink); font-weight: 600; }
#curva details summary { cursor: pointer; color: var(--ink); }

/* ---------- Portfolio ---------- */
#portfolio .pfc { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin-bottom: 14px; }
#portfolio .pfc select { min-width: 180px; }
#portfolio .pf-search { background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); border-radius: 14px; padding: 7px 12px; min-height: 36px; width: 210px; }
#portfolio .pfw { max-height: 520px; overflow: auto; border-radius: 18px; border: 1px solid var(--line); background: rgba(0, 0, 0, .14); }
#portfolio .pft { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
#portfolio .pft th, #portfolio .pft td { padding: 8px 10px; white-space: nowrap; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, .055); }
#portfolio .pft td { font-family: var(--mono); font-size: 12.5px; }
#portfolio .pft th { position: sticky; top: 0; z-index: 1; background: rgba(28, 31, 37, .97); color: var(--ink-3); font-family: var(--mono); font-weight: 400; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; user-select: none; }
#portfolio .pft th.on { color: var(--ink); }
#portfolio .pft td.l, #portfolio .pft th.l { text-align: left; }
#portfolio .pft td.k { font-weight: 600; text-align: left; color: var(--ink); }
#portfolio .pft td.f { white-space: normal; text-align: left; color: var(--ink-3); font-family: var(--font); font-size: 12px; min-width: 260px; max-width: 420px; }
#portfolio .pft td.mu { color: var(--ink-3); font-family: var(--font); font-size: 12px; }
#portfolio .pft tbody tr:hover td { background: rgba(255, 255, 255, .035); }
#portfolio .pft tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; }
#portfolio .pft caption { caption-side: bottom; text-align: left; color: var(--ink-3); font-size: 12px; padding: 10px 12px; line-height: 1.5; }
#portfolio .pfs { background: none; border: 0; cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink-3); padding: 0 2px; }
#portfolio .pfs.on { color: #ffd08a; }
#portfolio .pfn { width: 120px; text-align: right; font: 500 12.5px var(--mono); padding: 5px 9px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(255, 255, 255, .06); color: var(--ink); }
#portfolio .pfchips, .pf-ov .pfchips { display: flex; flex-wrap: wrap; gap: 12px; }
#portfolio .pfchip, .pf-ov .pfchip { flex: 1 1 170px; min-width: 0; padding: 14px 18px; border-radius: var(--r-md); gap: 4px; }
#portfolio .pfchip .kpi-value, .pf-ov .pfchip .kpi-value { font-family: var(--font); font-size: 22px; letter-spacing: -0.02em; }
#portfolio .pfchip .kpi-sub, .pf-ov .pfchip .kpi-sub { white-space: normal; line-height: 1.4; font-family: var(--font); font-size: 12px; }
#portfolio .pfg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-top: 14px; }
#portfolio .pfcv { position: relative; height: 320px; }
#portfolio .pfe { padding: 28px 10px; text-align: center !important; color: var(--ink-3); font-family: var(--font) !important; white-space: normal !important; }
.pfdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
#portfolio .pfnote, .pf-ov .pfnote { color: var(--ink-2); font-size: 12.5px; margin: 12px 0 0; line-height: 1.55; }
#portfolio .btn:disabled { opacity: .4; cursor: default; transform: none; }
.pf-ov { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 13, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pf-pn { display: flex; flex-direction: column; padding: 18px 22px 22px; border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(24, 27, 33, .92), rgba(14, 16, 20, .9)) !important; }
.pf-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 17px; }
.pf-hd b { font-weight: 500; letter-spacing: -0.01em; }
.pf-bx { position: relative; flex: 1; min-height: 0; }
.pf-shape { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; }

/* ---------- Variación diaria · Rotación · Volumen · Dólar ---------- */
.tabx .panel-head.rhd, #vard .panel-head.rhd { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: flex-end; }
.tabx .rhc { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.tabx .rhd h2 .tg { margin-left: 8px; vertical-align: 3px; }
.tabx .rt, #vard .vdt { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.tabx .rt th, .tabx .rt td, #vard .vdt th, #vard .vdt td { padding: 8px 10px; white-space: nowrap; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, .055); }
.tabx .rt td, #vard .vdt td { font-family: var(--mono); font-size: 12.5px; }
.tabx .rt th, #vard .vdt th { position: sticky; top: 0; z-index: 1; background: rgba(28, 31, 37, .97); color: var(--ink-3); font-family: var(--mono); font-weight: 400; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; user-select: none; white-space: normal; line-height: 1.25; vertical-align: bottom; }
.tabx .rt th.on, #vard .vdt th.on { color: var(--ink); }
.tabx .rt td.l, .tabx .rt th.l, #vard .vdt td.l, #vard .vdt th.l { text-align: left; }
.tabx .rt td.k, #vard .vdt td.k { text-align: left; font-weight: 600; color: var(--ink); }
.tabx .rt td.mu, #vard .vdt td.mu, .tabx small.mu { color: var(--ink-3); }
.tabx .rt tbody tr { cursor: pointer; }
.tabx .rt.nf tbody tr, #dol .rt tbody tr { cursor: default; }
.tabx .rt tbody tr:hover td, #vard .vdt tbody tr:hover td { background: rgba(255, 255, 255, .035); }
.tabx .rt tr.sel td { background: rgba(255, 255, 255, .08); }
.tabx .rt tr.lv td { background: rgba(255, 208, 138, .07); }
.tabx .rchips, #vard .vdchips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
#vard .vdchips { margin: 0 0 16px; }
.tabx .rchip, #vard .vdchip { flex: 1 1 170px; min-width: 0; padding: 14px 18px; border-radius: var(--r-md); gap: 4px; }
.tabx .rchip.q4 { flex: 1 1 calc(25% - 9px); min-width: 160px; }
.tabx .rchip .kpi-value, #vard .vdchip .kpi-value { font-family: var(--font); font-size: 22px; letter-spacing: -0.02em; }
.tabx .rchip .kpi-sub, #vard .vdchip .kpi-sub { white-space: normal; line-height: 1.4; font-family: var(--font); font-size: 12px; }
.tg { display: inline-block; padding: 2px 10px; border-radius: 99px; font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.tg.ok, .tg.up { background: rgba(143, 227, 192, .16); color: var(--pos); }
.tg.mg { background: rgba(255, 208, 138, .16); color: #ffd08a; }
.tg.no, .tg.dn { background: rgba(255, 77, 85, .16); color: var(--neg); }
.tg.na { background: rgba(241, 243, 245, .08); color: var(--ink-3); }
#dol .tg.up { background: rgba(255, 208, 138, .16); color: #ffd08a; }
#dol .tg.dn { background: rgba(124, 243, 255, .14); color: #7cf3ff; }
.tabx .rg { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
.tabx .rg.rg1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 1001px) { #vol .rg.rg2 { grid-template-columns: minmax(0, max-content) minmax(320px, 1fr); } }
@media (max-width: 1000px) { .tabx .rg, .tabx .rg.rg1 { grid-template-columns: minmax(0, 1fr); } }
.tabx .hl { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin: 14px 0 0; }
.tabx .hl p { margin: 0 0 6px; }
.tabx .hl ul { margin: 4px 0 0; padding-left: 20px; }
.tabx .hl li { margin: 3px 0; }
.tabx .hl b, .tabx .note b, #vard .note b { color: var(--ink); font-weight: 600; }
.tabx label.ck, #vard label.ck { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; padding-bottom: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tabx label.ck input { accent-color: #f5f7f8; }
.fdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.tabx .sp { font-size: 10.5px; color: var(--ink-3); font-weight: 500; margin-left: 6px; }
.tabx .hm td, .tabx .hm th { text-align: center; vertical-align: middle; padding: 6px 8px; line-height: 1.25; }
.tabx .hm td.l, .tabx .hm th.l { text-align: left; }
.tabx .hm td b { display: block; font-size: 13.5px; color: var(--ink); }
.tabx .hm td small { display: block; font-size: 10.5px; color: var(--ink-3); font-family: var(--font); }
.tabx .hm td small b.vc { display: inline; font-size: 11.5px; }
.tabx .hm tr.tt td { border-top: 1px solid var(--line-2); font-weight: 600; }
.tabx .hm td.e { color: var(--ink-3); }
.tabx .hm small.mu { display: block; font-weight: 400; font-size: 10.5px; }
.tabx .note.warn { color: #ffd08a; margin: 0 0 10px; }
.tabx #vlRotS, .tabx #vlFx { color: var(--ink); margin: 0 0 10px; }
#vard .vdleg { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12.5px; color: var(--ink-2); margin: 0 0 10px; }
#vard .vdleg i { display: inline-block; vertical-align: middle; margin-right: 6px; }
#vard .vdb { position: relative; width: 150px; height: 16px; margin: 0 auto; }
#vard .vdb:before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
#vard .vdb i { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; }
#vard .vdsup { color: var(--ink-3); font-size: 10.5px; margin-left: 4px; }
#vard .vdshift { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 4px; }
#vard .vdst { font-weight: 500; margin-bottom: 6px; color: var(--ink); }
#vard .vddet { margin-top: 16px; border: 1px solid var(--line); border-radius: 18px; padding: 0 16px; }
#vard .vddet > summary { cursor: pointer; padding: 12px 0; font-weight: 500; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 10px; }
#vard .vddet > summary::-webkit-details-marker { display: none; }
#vard .vddet > summary:before { content: "▸"; color: var(--ink-2); transition: transform .15s; }
#vard .vddet[open] > summary:before { transform: rotate(90deg); }
#vard .vddet[open] { padding-bottom: 14px; }
#vard .vdvol { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
#vard .vdvt { font-weight: 500; color: var(--ink); margin-bottom: 4px; font-size: 16px; }
#vard #vdVolS { color: var(--ink-2); margin: 0 0 10px; }
#lic { margin-top: -4px; }

/* ---------- Exportar (imagen HD y Excel) ---------- */
.tabs-wrap { display: flex; gap: 10px; align-items: center; }
.tabs-wrap > .tabs { flex: 1; min-width: 0; }
.xmenu-wrap { position: relative; flex: none; }
.xmenu-btn { display: flex; align-items: center; gap: 7px; height: 46px; padding: 0 18px; border: 0; border-radius: var(--pill); color: var(--ink); font-weight: 500; cursor: pointer; }
.xmenu-btn:hover { color: #fff; }
.xmenu { position: absolute; right: 0; top: calc(100% + 8px); width: 330px; padding: 8px; border-radius: 22px; display: flex; flex-direction: column; gap: 2px; z-index: 40;
  background: linear-gradient(180deg, rgba(24, 27, 33, .94), rgba(14, 16, 20, .92)) !important; }
.xmenu[hidden] { display: none; }
.xmi { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 11px 14px; border: 0; border-radius: 16px; background: transparent; cursor: pointer; }
.xmi b { font-weight: 600; color: var(--ink); }
.xmi span { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.xmi:hover, .xmi:focus-visible { background: rgba(255, 255, 255, .07); outline: none; }
.panel.xp-on { position: relative; }
.xbar { position: absolute; top: 12px; right: 14px; z-index: 5 !important; display: flex; gap: 4px; padding: 3px; border-radius: var(--pill);
  background: rgba(10, 12, 15, .55); border: 1px solid var(--line); opacity: .38; transition: opacity .15s; }
.panel.xp-on:hover > .xbar, .xbar:focus-within { opacity: 1; }
.xbtn { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.xbtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.panel.xp-on > .panel-head { padding-right: 112px; }
body.xp-busy, body.xp-busy * { cursor: progress !important; }
@media (pointer: coarse) { .xbar { opacity: .85; } }
@media (max-width: 720px) {
  .xmenu-btn span { display: none; }
  .xmenu-btn { width: 46px; padding: 0; justify-content: center; }
  .xmenu { width: min(330px, calc(100vw - 32px)); }
}
html.xp-snap .lg::before, html.xp-snap .lg::after { display: none !important; }

/* ---------- Ampliar gráfico ---------- */
.amp-btn { position: absolute; top: 6px; right: 6px; z-index: 4; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(10, 12, 15, .55); color: var(--ink-2); cursor: pointer; opacity: 0; transition: opacity .15s; }
*:hover > .amp-btn, .amp-btn:focus-visible { opacity: .9; }
.amp-btn:hover { color: #fff; background: rgba(255, 255, 255, .12); }
@media (pointer: coarse) { .amp-btn { opacity: .75; } }
html.amp-lock { overflow: hidden; }
.amp-ov { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 3vh 3vw; background: rgba(6, 7, 9, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.amp-pn { width: min(1600px, 94vw); height: min(900px, 90vh); display: flex; flex-direction: column; padding: 16px 20px 18px;
  background: linear-gradient(180deg, rgba(24, 27, 33, .96), rgba(14, 16, 20, .95)) !important; }
.amp-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.amp-hd b { font-weight: 600; font-size: 16px; }
.amp-act { display: flex; gap: 6px; }
.amp-x { font-size: 20px; line-height: 1; }
.amp-chart { position: relative; flex: 1; min-height: 0; }
@media (max-width: 720px) { .amp-ov { padding: 0; } .amp-pn { width: 100vw; height: 100dvh; border-radius: 0; } }

/* ---------- Aviso de bonos nuevos ---------- */
.nt-wrap[hidden] { display: none; }
.nt-pill { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border: 0; border-radius: var(--pill); color: #ffd08a; font-weight: 500; cursor: pointer; white-space: nowrap; }
.nt-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffd08a; box-shadow: 0 0 10px rgba(255, 208, 138, .8); }
.nt-pop { width: 380px; gap: 4px; padding: 12px; }
.nt-hd { margin: 2px 4px 8px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.nt-row { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 10px; align-items: baseline; padding: 7px 6px; border-top: 1px solid var(--line); font-size: 13px; }
.nt-row span { color: var(--ink-2); }
.nt-row .num { font-family: var(--mono); font-size: 12px; }
@media (max-width: 720px) { .nt-pill { padding: 0 12px; font-size: 12px; } .nt-pop { width: min(380px, calc(100vw - 32px)); right: auto; left: 0; } }
