:root {
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --paper: #ffffff;
  --surface: #f6f8fb;
  --navy: #14213d;
  --blue: #2d5ce6;
  --blue-soft: #eef3ff;
  --green: #039855;
  --red: #d92d20;
  --amber: #f79009;
  --violet: #7a5af8;
  --cyan: #06aed4;
  --shadow: 0 12px 36px rgba(16, 24, 40, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, rgba(45, 92, 230, .12), transparent 30rem),
    var(--surface);
  font-family: "DM Sans", system-ui, sans-serif;
}

.shell { max-width: 1280px; margin: 0 auto; padding: 42px 28px 28px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { font-family: Manrope, system-ui, sans-serif; margin: 0; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -.04em; }
h2 { font-size: 20px; letter-spacing: -.025em; }
.subtitle { margin: 10px 0 0; color: var(--muted); }
.status-wrap { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.8); color: var(--muted); font-size: 13px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(3,152,85,.12); }
.status-wrap.fallback .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(247,144,9,.12); }

.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; padding: 18px; background: var(--navy); border-radius: 18px; box-shadow: var(--shadow); }
.filters label { display: grid; gap: 7px; color: #c7d0e3; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
select { width: 100%; min-height: 46px; padding: 0 42px 0 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; color: #fff; background: #24314d; font: 600 14px "DM Sans"; cursor: pointer; }
select:focus { outline: 3px solid rgba(74, 117, 255, .35); border-color: #7fa0ff; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 148px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.metric-card.primary { color: #fff; border-color: transparent; background: linear-gradient(145deg, #2d5ce6, #183a9e); }
.metric-card > span { display: block; min-height: 38px; color: var(--muted); font-size: 13px; font-weight: 600; }
.metric-card.primary > span, .metric-card.primary small { color: #dfe7ff; }
.metric-card strong { display: block; margin: 8px 0 2px; font: 800 clamp(25px, 2.5vw, 34px) Manrope; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-size: 12px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.grid-two { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .8fr); gap: 18px; margin-bottom: 18px; }
.grid-two.lower-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-note { color: var(--muted); font-size: 12px; }
.chart-wrap { position: relative; min-height: 280px; }
#history-chart { display: block; width: 100%; height: 280px; overflow: visible; }
.axis-label { fill: #98a2b3; font: 11px "DM Sans"; }
.grid-line { stroke: #eaecf0; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#area-gradient); }
.chart-dot { fill: #fff; stroke: var(--blue); stroke-width: 3; }
.empty-state { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }

.allocation-layout { display: grid; grid-template-columns: 190px 1fr; gap: 24px; align-items: center; min-height: 280px; }
.donut { width: 190px; height: 190px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--blue) 0 100%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 28px; border-radius: 50%; background: var(--paper); }
.donut > div { position: relative; z-index: 1; text-align: center; }
.donut strong { display: block; font: 800 18px Manrope; letter-spacing: -.03em; }
.donut span { color: var(--muted); font-size: 11px; }
.legend { display: grid; gap: 11px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-row span:nth-child(2) { color: var(--muted); }
.legend-row strong { font-weight: 700; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 0 12px 11px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: right; text-transform: uppercase; letter-spacing: .05em; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td { padding: 13px 12px; border-top: 1px solid #f0f2f5; font-size: 13px; text-align: right; }
td:first-child { font-weight: 600; }
.asset-chip { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; color: #344054; background: #f2f4f7; font-size: 11px; font-weight: 700; }
.holdings-panel { margin-bottom: 18px; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 10px 4px 0; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-two, .grid-two.lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shell { padding: 26px 16px 20px; }
  .topbar { display: grid; }
  .status-wrap { width: fit-content; }
  .filters, .metrics { grid-template-columns: 1fr; }
  .allocation-layout { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  footer { display: grid; }
}


