/* ═══ INVESTOR PORTAL · BASE CSS ═══ */

/* ── Tokens ── */
:root {
  --bg0: #06080d;
  --bg1: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --line: #30363d;
  --line-soft: #21262d;

  --fg: #e6edf3;
  --fg-mut: #8b949e;
  --fg-dim: #484f58;

  --accent: #9f7aea;
  --blue: #4ea8f5;
  --green: #38c9a0;
  --amber: #f0a828;
  --red: #ff4d4d;
  --gold: #d4af37;

  --radius: 12px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  --font-head: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --font-data: 'DM Mono', ui-monospace, monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg0);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.ip-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 41px;
  background: var(--bg1);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-mut);
  position: sticky;
  top: 0;
  z-index: 100;
}
.ip-topbar .brand {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 13px;
  color: var(--fg);
  text-transform: uppercase;
}
.ip-topbar a {
  color: var(--fg-mut);
  text-decoration: none;
  margin-left: 16px;
  transition: color .15s;
}
.ip-topbar a:hover { color: var(--fg); }
.ip-topbar .user-chip {
  margin-left: 24px;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  background: rgba(159, 122, 234, 0.08);
}

/* ── Nav ── */
.ip-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--bg0);
  border-bottom: 1px solid var(--line);
  padding: 0;
  position: sticky;
  top: 41px;
  z-index: 99;
}
.ip-nav .nav-item {
  padding: 16px 20px;
  color: var(--fg-mut);
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: 0.16em;
  font-size: 11px;
  text-transform: uppercase;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.ip-nav .nav-item:hover { color: var(--fg); }
.ip-nav .nav-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── View container ── */
.ip-view {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  min-height: calc(100vh - 120px);
  width: 100%;
}

/* ── Typography ── */
.ip-h1 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 26px;
  color: var(--fg);
  margin: 0 0 24px 0;
}
.ip-h2 {
  font-family: var(--font-head);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--fg-mut);
  margin: 0 0 12px 0;
}

/* ── Cards ── */
.ip-card {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.ip-card-hover {
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ip-card-hover:hover {
  border-color: var(--accent);
  background: var(--bg2);
}

/* ── KPI Cards ── */
.ip-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.ip-kpi {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.ip-kpi-label {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--fg-mut);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ip-kpi-val {
  font-family: var(--font-data);
  font-size: 32px;
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.ip-kpi-val.green { color: var(--green); }
.ip-kpi-val.blue  { color: var(--blue); }
.ip-kpi-val.gold  { color: var(--gold); }
.ip-kpi-val.amber { color: var(--amber); }
.ip-trend-up   { color: var(--green); font-size: 12px; }
.ip-trend-down { color: var(--red); font-size: 12px; }

/* ── Buttons ── */
.ip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--fg);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  transition: border-color .15s, color .15s;
}
.ip-pill:hover { border-color: var(--accent); color: var(--accent); }
.ip-pill.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}
.ip-pill.primary:hover { background: #b89fef; border-color: #b89fef; }

.ip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
  font-family: var(--font-body);
  border: none;
}
.ip-btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.ip-btn-primary:hover { background: #b89fef; }
.ip-btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
}
.ip-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.ip-btn-danger {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
}
.ip-btn-danger:hover { background: #e03a3a; }

/* ── Excel export button ── */
.ip-xlsx-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.ip-xlsx-btn:hover { border-color: var(--green); }

/* ── Tables ── */
.ip-table-wrap { overflow-x: auto; width: 100%; }
.ip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-family: var(--font-data);
}
.ip-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--fg-mut);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}
.ip-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--fg);
}
.ip-table tr:last-child td { border-bottom: none; }
.ip-table td.num, .ip-table th.num { text-align: right; font-family: var(--font-data); }
.ip-table td.pos { color: var(--green); }
.ip-table td.neg { color: var(--red); }
.ip-table td.muted { color: var(--fg-mut); }
.ip-table tr:hover td { background: var(--bg2); }

/* ── Badges ── */
.ip-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ip-badge-green  { background: rgba(56, 201, 160, 0.12); color: var(--green); border: 1px solid rgba(56, 201, 160, 0.25); }
.ip-badge-amber  { background: rgba(240, 168, 40, 0.12);  color: var(--amber); border: 1px solid rgba(240, 168, 40, 0.25); }
.ip-badge-red    { background: rgba(255, 77, 77, 0.12);   color: var(--red);   border: 1px solid rgba(255, 77, 77, 0.25); }
.ip-badge-blue   { background: rgba(78, 168, 245, 0.12);  color: var(--blue);  border: 1px solid rgba(78, 168, 245, 0.25); }
.ip-badge-purple { background: rgba(159, 122, 234, 0.12); color: var(--accent); border: 1px solid rgba(159, 122, 234, 0.25); }
/* legacy category variants */
.ip-badge.vc    { background: rgba(159, 122, 234, 0.12); color: var(--accent); border: 1px solid rgba(159, 122, 234, 0.25); }
.ip-badge.pe    { background: rgba(78, 168, 245, 0.12);  color: var(--blue);  border: 1px solid rgba(78, 168, 245, 0.25); }
.ip-badge.multi { background: rgba(240, 168, 40, 0.12);  color: var(--amber); border: 1px solid rgba(240, 168, 40, 0.25); }
.ip-badge.credit { background: rgba(160, 196, 255, 0.12); color: #a0c4ff; border: 1px solid rgba(160, 196, 255, 0.25); }
.ip-badge.infra  { background: rgba(56, 201, 160, 0.12);  color: var(--green); border: 1px solid rgba(56, 201, 160, 0.25); }
.ip-badge.re     { background: rgba(255, 77, 77, 0.12);   color: var(--red);   border: 1px solid rgba(255, 77, 77, 0.25); }

/* ── Status colors ── */
.ip-positive { color: var(--green); }
.ip-negative { color: var(--red); }
.ip-neutral  { color: var(--fg-mut); }

/* ── Form inputs ── */
.ip-label {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--fg-mut);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  display: block;
}
.ip-input {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.ip-input::placeholder { color: var(--fg-dim); }
.ip-input:focus { border-color: var(--accent); }
.ip-select {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color .15s;
}
.ip-select:focus { border-color: var(--accent); }

/* ── Empty state ── */
.ip-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--fg-mut);
}
.ip-empty .ip-empty-icon {
  font-size: 48px;
  color: var(--fg-dim);
  margin-bottom: 16px;
}
.ip-empty h3 {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.ip-empty p {
  font-size: 14px;
  color: var(--fg-mut);
  margin: 0;
}

/* ── Banners ── */
.ip-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: rgba(159, 122, 234, 0.07);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-body);
  margin-bottom: 16px;
}
.ip-banner-success {
  border-left-color: var(--green);
  background: rgba(56, 201, 160, 0.07);
  color: var(--green);
}
.ip-banner-error {
  border-left-color: var(--red);
  background: rgba(255, 77, 77, 0.07);
  color: var(--red);
}
.ip-banner-info {
  border-left-color: var(--blue);
  background: rgba(78, 168, 245, 0.07);
  color: var(--blue);
}

/* ── Loading spinner ── */
.ip-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ip-spin .65s linear infinite;
  display: inline-block;
}
@keyframes ip-spin {
  to { transform: rotate(360deg); }
}

/* ── Chart container ── */
.ip-chart-wrap {
  padding: 20px 0;
  position: relative;
}
.ip-chart-wrap canvas { max-height: 280px; }

/* ── Number/mono helpers ── */
.ip-num  { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.ip-mono { font-family: var(--font-mono); }

/* ── Layout helpers ── */
.ip-row    { display: flex; gap: 16px; flex-wrap: wrap; }
.ip-grid   { display: grid; gap: 16px; }
.ip-spacer { flex: 1; }

/* ── Demo banner ── */
.ip-demo-banner {
  background: rgba(240, 168, 40, 0.07);
  border: 1px solid rgba(240, 168, 40, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

/* ── Search input ── */
.ip-search {
  flex: 1;
  max-width: 340px;
  padding: 9px 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color .15s;
}
.ip-search::placeholder { color: var(--fg-dim); }
.ip-search:focus { border-color: var(--accent); }

/* ── Accounts view (IP-02) ── */
.ip-acc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ip-acc-toolbar .right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ip-acc-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.ip-acc-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.ip-acc-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.ip-acc-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.ip-acc-card h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 14px;
  color: var(--blue);
  text-transform: uppercase;
}
.ip-acc-check {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.ip-acc-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}
.ip-acc-row span {
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.ip-acc-row strong {
  font-size: 20px;
  color: var(--fg);
  margin-top: 2px;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}
.ip-acc-bar {
  height: 5px;
  background: var(--bg3);
  border-radius: 3px;
  margin: 14px 0;
  overflow: hidden;
}
.ip-acc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #c4aaf5);
  border-radius: 3px;
  transition: width .4s;
}
.ip-acc-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.ip-acc-stats li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fg-mut);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}
.ip-acc-stats li b {
  margin-left: auto;
  color: var(--fg);
  font-family: var(--font-data);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.d-d { background: var(--blue); }
.d-p { background: #3b6ea5; }
.d-x { background: var(--green); }

.ip-pager {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mut);
  letter-spacing: 0.1em;
  flex-wrap: wrap;
}
.ip-pager .num {
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg2);
  color: var(--accent);
  border: 1px solid var(--line);
}

/* ── Integrated position (IP-03) ── */
.ip-int-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.ip-int-selects  { display: flex; gap: 12px; flex-wrap: wrap; }
.ip-select-wrap  {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ip-select-wrap select,
.ip-select-wrap input {
  margin-top: 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 220px;
  outline: none;
  transition: border-color .15s;
}
.ip-select-wrap select:focus,
.ip-select-wrap input:focus { border-color: var(--accent); }

.ip-int-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.ip-int-kpi { display: flex; flex-direction: column; }
.ip-int-kpi .label {
  font-size: 11px;
  color: var(--fg-mut);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.ip-int-kpi .val {
  font-family: var(--font-data);
  font-size: 34px;
  color: var(--accent);
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.ip-int-tabs {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-top: 6px;
}
.ip-int-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--fg-mut);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  transition: color .15s, border-color .15s;
}
.ip-int-tab:hover { color: var(--fg); }
.ip-int-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.ip-int-body {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1.4fr;
  align-items: center;
  margin-top: 20px;
}
@media (max-width: 880px) { .ip-int-body { grid-template-columns: 1fr; } }

/* NUEVO 2026-05-20: ajustar tamaño donut posición integrada */
.ip-int-canvas-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 300px;
  justify-self: center;
}
@media (max-width: 768px) {
  .ip-int-canvas-wrap { max-width: 100%; max-height: 280px; }
}
/* /NUEVO */
.ip-int-leg-row  {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mut);
}
.ip-int-leg-row .swatch { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.ip-int-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.ip-int-table th {
  font-weight: 400;
  color: var(--fg-mut);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
}
.ip-int-table th.left { text-align: left; }
.ip-int-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  color: var(--fg);
}
.ip-int-table td.left { text-align: left; }
.ip-int-table tr.total td {
  font-weight: 700;
  color: var(--fg);
  border-top: 2px solid var(--line);
  border-bottom: none;
  padding-top: 12px;
}
.ip-int-table tr:hover td { background: var(--bg2); }

/* ── Investments (IP-04) ── */
.ip-inv-filters {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 18px 0 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-mut);
  align-items: center;
}
.ip-inv-filters label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.ip-inv-filters label:hover { color: var(--fg); }
.ip-inv-filters .swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ip-inv-filters input[type="checkbox"] { accent-color: var(--accent); width: 13px; height: 13px; cursor: pointer; }

.ip-fund-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.ip-fund-card { background: var(--bg1); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ff-head { padding: 14px 16px; background: var(--bg2); display: flex; flex-direction: column; gap: 2px; }
.ff-head h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
}
.ff-meta { font-family: var(--font-mono); font-size: 10px; color: var(--fg-mut); letter-spacing: 0.1em; text-transform: uppercase; }

.ff-block { padding: 14px 16px; border-top: 1px solid var(--line); }
.ff-block h4 {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--fg-mut);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.ff-block h4 em { font-style: normal; color: var(--fg-dim); font-family: var(--font-mono); font-size: 10px; }

.ff-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ff-3col span { display: block; font-size: 9px; color: var(--fg-mut); letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--font-mono); }
.ff-3col b    { display: block; font-size: 16px; color: var(--fg); margin-top: 2px; font-family: var(--font-data); }

.ff-flow > span { font-size: 9px; color: var(--fg-mut); letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--font-mono); }
.ff-flow > b    { display: block; font-size: 16px; color: var(--fg); margin-bottom: 4px; font-family: var(--font-data); }
.ff-bar      { height: 5px; background: var(--bg3); border-radius: 3px; margin: 8px 0; overflow: hidden; }
.ff-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #c4aaf5); border-radius: 3px; }
.ff-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mut);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 0;
}
.ff-row b { margin-left: auto; color: var(--fg); font-family: var(--font-data); }
.ff-row i { font-style: normal; width: 56px; text-align: right; color: var(--fg-dim); font-family: var(--font-data); font-size: 10px; }

.ff-docs h4  { margin-bottom: 8px; }
.ff-doc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ff-doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg-mut);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, color .15s;
}
.ff-doc:hover { border-color: var(--accent); color: var(--accent); }
.ff-doc .ico  { font-size: 14px; }

/* ── Documents (IP-05) ── */
.ip-doc-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}
@media (max-width: 720px) { .ip-doc-cats { grid-template-columns: repeat(2, 1fr); } }

.ip-doc-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 10px;
  border-radius: var(--radius);
  text-align: center;
  background: linear-gradient(180deg, rgba(159, 122, 234, 0.1), var(--bg2));
  border: 1px solid var(--line);
  color: var(--fg);
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color .15s, transform .15s;
}
.ip-doc-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.ip-doc-tile svg   { width: 32px; height: 32px; color: var(--accent); opacity: .85; }

.ip-doc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 16px;
  flex-wrap: wrap;
}
.ip-doc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: border-color .15s;
}
.ip-doc-row.selected { border-color: var(--accent); }
.ip-doc-main    { flex: 1; min-width: 0; }
.ip-doc-main h4 {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--blue);
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ip-doc-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ip-doc-dl {
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--fg-mut);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s;
}
.ip-doc-dl:hover { border-color: var(--accent); color: var(--accent); }

.ip-doc-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 8px;
}
.ip-doc-cat:hover { border-color: var(--accent); background: var(--bg3); }
.ip-doc-cat .cat-label { font-family: var(--font-body); font-weight: 500; color: var(--fg); }
.ip-doc-cat .cat-count { font-family: var(--font-mono); font-size: 11px; color: var(--fg-mut); }

/* ── Document card (generic) ── */
.ip-doc-card {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color .15s;
}
.ip-doc-card:hover { border-color: var(--accent); }
.ip-doc-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  background: rgba(159, 122, 234, 0.12);
  color: var(--accent);
}
.ip-doc-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: border-color .15s, color .15s;
}
.ip-doc-download:hover { border-color: var(--accent); color: var(--accent); }
.ip-doc-date {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--fg-mut);
}

/* ── Manage accounts (IP-08) ── */
.ip-manage-form  { display: flex; flex-direction: column; gap: 14px; }
.ip-manage-row   { display: flex; gap: 14px; flex-wrap: wrap; }
.ip-manage-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 180px; }
.ip-manage-field label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ip-manage-field input {
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.ip-manage-field input:focus { border-color: var(--accent); }
.ip-manage-field input::placeholder { color: var(--fg-dim); }

.ip-manage-acc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: border-color .15s;
}
.ip-manage-acc-row:hover { border-color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ip-nav {
    overflow-x: auto;
    justify-content: flex-start;
    gap: 0;
  }
  .ip-view { padding: 16px; }
  .ip-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .ip-table-wrap { overflow-x: auto; }
  .ip-acc-grid { grid-template-columns: 1fr; }
  .ip-fund-grid { grid-template-columns: 1fr; }
  .ip-doc-cats  { grid-template-columns: repeat(2, 1fr); }
  .ip-int-selects { flex-direction: column; }
}

/* ═══ AI SUMMARY CARD ═══ */
.ip-ai-card { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); border-radius: 10px; overflow: hidden; }
.ip-ai-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: rgba(255,255,255,.02); font-family: 'DM Mono', monospace; font-size: 11px; color: #d4af37; border-bottom: 1px solid rgba(255,255,255,.05); }
.ip-ai-date { color: #555; font-size: 10px; }
.ip-ai-body { padding: 14px 16px; font-size: 13px; color: #ccc; line-height: 1.6; }
.ip-ai-body p { margin: 0 0 8px; }
.ip-ai-body p:last-child { margin-bottom: 0; }
.ip-ai-body strong { color: #eee; }
.ip-ai-insight { font-size: 12px; color: #888; border-left: 2px solid rgba(212,175,55,.3); padding-left: 10px; }

/* ── LP Welcome Banner ── */
.ip-lp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(77,166,255,.08) 0%, rgba(184,138,255,.06) 100%);
  border: 1px solid rgba(77,166,255,.22);
  border-radius: 10px;
}
.ip-lp-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ip-lp-banner-greeting {
  font-family: var(--font-head);
  font-size: 15px;
  color: var(--fg);
  font-weight: 600;
}
.ip-lp-banner-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mut);
  letter-spacing: .06em;
}

/* ═══ NUEVO: KPI cards ═══ */
.ip-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.ip-kpi-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.ip-kpi-card .kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ip-kpi-card .kpi-value {
  font-family: var(--font-data);
  font-size: 22px;
  color: var(--fg);
  margin-top: 6px;
  line-height: 1.2;
}
.ip-kpi-card .kpi-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mut);
  margin-top: 4px;
}
.ip-kpi-card.green .kpi-value { color: var(--green); }

/* ═══ Period selector ═══ */
.ip-period-row {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ip-period-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: none;
  color: var(--fg-mut);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: all .15s;
}
.ip-period-btn:hover { border-color: var(--accent); color: var(--fg); }
.ip-period-btn.active { background: rgba(159,122,234,.12); border-color: var(--accent); color: var(--accent); }

/* ═══ Donut grid ═══ */
.ip-donut-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.ip-donut-cell {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ip-donut-cell .donut-title {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: .1em;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.ip-donut-cell canvas { max-width: 140px; max-height: 140px; }
.ip-donut-legend {
  margin-top: 12px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ip-donut-leg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
}
.ip-donut-leg-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ═══ Sub-tabs (Inversiones / Documentos / Gestionar) ═══ */
.ip-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}
.ip-subtab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mut);
  cursor: pointer;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .15s;
}
.ip-subtab:hover { color: var(--fg); }
.ip-subtab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ═══ User chip dropdown ═══ */
.ip-topbar .user-chip-wrap {
  position: relative;
  display: inline-block;
}
.ip-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 300;
  overflow: hidden;
  display: none;
}
.ip-user-dropdown.open { display: block; }
.ip-user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--fg);
  text-decoration: none;
  transition: background .1s;
  cursor: pointer;
}
.ip-user-dropdown a:hover { background: var(--bg3); }
.ip-user-dropdown a.danger { color: var(--red); }

/* ═══ Lang dropdown ═══ */
.ip-lang-wrap {
  position: relative;
  display: inline-block;
}
.ip-lang-btn {
  background: none;
  border: none;
  color: var(--fg-mut);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  transition: color .15s;
}
.ip-lang-btn:hover { color: var(--fg); }
.ip-lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 300;
  overflow: hidden;
  display: none;
  min-width: 80px;
}
.ip-lang-dropdown.open { display: block; }
.ip-lang-dropdown button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: background .1s;
}
.ip-lang-dropdown button:hover { background: var(--bg3); }
.ip-lang-dropdown button.active { color: var(--accent); }

/* ═══ Investments summary table ═══ */
.ip-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 12px;
  margin-top: 24px;
}
.ip-summary-table th {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: .06em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ip-summary-table th:first-child { text-align: left; }
.ip-summary-table td {
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--fg);
}
.ip-summary-table td:first-child { text-align: left; color: var(--fg-mut); }
.ip-summary-table tr.total td {
  border-top: 1px solid var(--line);
  font-weight: 700;
  color: var(--fg);
}

/* ═══ Cash Flow table ═══ */
.ip-cashflow-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 12px;
  margin-top: 16px;
}
.ip-cashflow-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: .06em;
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ip-cashflow-table th:first-child { text-align: left; }
.ip-cashflow-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line-soft);
}
.ip-cashflow-table td:first-child { text-align: left; font-family: var(--font-mono); color: var(--fg-mut); }
.ip-cashflow-table .neg { color: var(--red); }
.ip-cashflow-table .pos { color: var(--green); }

/* ═══ Documents filter pills ═══ */
.ip-doc-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ip-doc-filter-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: none;
  color: var(--fg-mut);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.ip-doc-filter-btn:hover { border-color: var(--accent); color: var(--fg); }
.ip-doc-filter-btn.active { background: rgba(159,122,234,.12); border-color: var(--accent); color: var(--accent); }

/* ═══ Documents table ═══ */
.ip-docs-table {
  width: 100%;
  border-collapse: collapse;
}
.ip-docs-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mut);
  letter-spacing: .06em;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.ip-docs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--fg);
}
.ip-docs-table td.date-col { font-family: var(--font-data); font-size: 11px; color: var(--fg-mut); white-space: nowrap; }
.ip-docs-table td.type-col { font-family: var(--font-mono); font-size: 10px; color: var(--fg-mut); white-space: nowrap; }
.ip-docs-view-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg-mut);
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.ip-docs-view-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ═══ TOTP offer modal ═══ */
.ip-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ip-modal {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
}
.ip-modal h3 { font-family: var(--font-head); font-size: 16px; margin: 0 0 8px; }
.ip-modal p { font-size: 13px; color: var(--fg-mut); margin: 0 0 24px; line-height: 1.5; }
.ip-modal-btns { display: flex; gap: 10px; }
.ip-modal-btns button { flex: 1; padding: 10px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all .15s; }
.ip-modal-btns .primary { background: var(--accent); border: none; color: #fff; font-weight: 600; }
.ip-modal-btns .secondary { background: none; border: 1px solid var(--line); color: var(--fg-mut); }
.ip-modal-btns .primary:hover { filter: brightness(1.1); }
.ip-modal-btns .secondary:hover { border-color: var(--fg-mut); color: var(--fg); }

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
  .ip-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .ip-donut-grid { grid-template-columns: 1fr; }
  .ip-subtabs { overflow-x: auto; }
}

/* ═══ NUEVO: mobile-responsive ═══ */

/* ── Hamburguesa toggle: visible solo bajo 768px ── */
.ip-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  padding: 0;
  cursor: pointer;
  color: var(--fg);
  font-size: 18px;
}
.ip-nav-toggle:hover { border-color: var(--blue); }
.ip-nav-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Backdrop del nav slide-in ── */
.ip-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ip-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Media queries globales bajo 768px ── */
@media (max-width: 768px) {
  /* Mostrar toggle, ocultar nav inline */
  .ip-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  /* Topbar más compacto */
  .ip-topbar {
    padding: 12px 14px;
    height: auto;
    flex-wrap: wrap;
  }
  .ip-topbar .brand {
    font-size: 12px;
    letter-spacing: .12em;
    flex: 1 1 auto;
  }

  /* Nav slide-in desde la derecha */
  .ip-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(82vw, 320px);
    background: var(--bg1, #0d1117);
    border-left: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 64px 16px 16px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 9001;
    gap: 4px;
    overflow-y: auto;
    overflow-x: visible;
    justify-content: flex-start;
  }
  .ip-nav.open { transform: translateX(0); }
  .ip-nav .nav-item {
    padding: 12px 14px;
    text-align: left;
    border-radius: 8px;
    width: 100%;
    border-bottom: none;
    white-space: normal;
  }
  .ip-nav .nav-item:hover { background: var(--bg2, #161b22); }
  .ip-nav .nav-item.active {
    border-bottom: none;
    background: rgba(159, 122, 234, 0.08);
  }

  /* Vistas: padding interior más compacto */
  #ip-view { padding: 16px 14px; }

  /* User chip: truncar en pantallas pequeñas */
  .user-chip {
    font-size: 11px;
    padding: 4px 8px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── Container queries para componentes complejos ── */

/* Card de cuenta/fondo */
.ip-card {
  container-type: inline-size;
  container-name: ipcard;
}
@container ipcard (max-width: 480px) {
  .ip-card .ip-card-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .ip-card .ip-card-row > * { width: 100%; }
}

/* Tabla genérica → card-view bajo 600px de container */
.ip-table-wrap {
  container-type: inline-size;
  container-name: iptable;
  overflow-x: auto;
}
@container iptable (max-width: 600px) {
  .ip-table thead { display: none; }
  .ip-table tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg2);
  }
  .ip-table td {
    display: flex;
    justify-content: space-between;
    border: none;
    padding: 6px 0;
    font-size: 12px;
  }
  .ip-table td::before {
    content: attr(data-label) ": ";
    font-family: var(--font-mono, monospace);
    color: var(--fg-mut);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 8px;
  }
}

/* Doc row: stack vertical bajo 400px */
.ip-doc-row { container-type: inline-size; container-name: ipdocrow; }
@container ipdocrow (max-width: 400px) {
  .ip-doc-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ip-doc-row .ip-doc-main { width: 100%; }
}

/* Charts wrapper: max-height responsive */
.ip-chart-wrap { container-type: inline-size; }
@container (max-width: 500px) {
  .ip-chart-wrap canvas { max-height: 240px !important; }
}

/* ═══ /NUEVO: mobile-responsive ═══ */

/* NUEVO: notif-dropdown */
.ip-notif-dropdown.open { display: block !important; }
/* /NUEVO */

/* ═══ NUEVO: calendar ═══ */
.ip-cal-body { container-type: inline-size; }
.ip-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: var(--bg2);
  padding: 4px;
  border-radius: 8px;
}
.ip-cal-dow {
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--fg-mut);
  padding: 6px 0;
}
.ip-cal-cell {
  aspect-ratio: 1 / 1;
  background: var(--bg1);
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--fg);
  transition: background 0.15s;
}
.ip-cal-cell.empty { background: transparent; }
.ip-cal-cell.today { outline: 1px solid var(--accent, #4da6ff); }
.ip-cal-cell.has-events { cursor: pointer; }
.ip-cal-cell.has-events:hover { background: var(--bg2); }
.ip-cal-num { font-size: 13px; color: var(--fg); }
.ip-cal-dots { display: flex; gap: 2px; flex-wrap: wrap; }
.ip-cal-dot { width: 6px; height: 6px; border-radius: 999px; }
.ip-cal-dot.type-capital_call   { background: #ffaa00; }
.ip-cal-dot.type-distribution   { background: #38c9a0; }
.ip-cal-dot.type-document       { background: #4ea8f5; }
.ip-cal-dot.type-fund_closing   { background: #9f7aea; }
.ip-cal-dot.type-fund_valuation { background: #c9a227; }
.ip-cal-dot.type-fund_meeting   { background: #4ea8f5; }
.ip-cal-dot.type-fund_other     { background: var(--fg-mut); }

/* Container query: grid colapsa bajo 480px del propio container */
@container (max-width: 480px) {
  .ip-cal-grid { gap: 2px; padding: 2px; }
  .ip-cal-cell { aspect-ratio: auto; min-height: 44px; padding: 4px; }
  .ip-cal-num { font-size: 11px; }
}
/* ═══ /NUEVO: calendar ═══ */
