/* ═══════════════════════════════════════════════════════════
   AICEX Portfolio — Financial Dashboard Design System
═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:       #080B14;
  --bg-surface:    #0E1220;
  --bg-card:       #0F1623;
  --bg-elevated:   #131929;
  --bg-row-hover:  #111d2e;

  --border:        rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.04);
  --border-active: rgba(99,102,241,0.35);

  --accent:        #6366F1;
  --accent-dim:    rgba(99,102,241,0.12);
  --accent-bright: #818CF8;

  --green:         #10B981;
  --green-dim:     rgba(16,185,129,0.1);
  --green-bright:  #34D399;
  --amber:         #F59E0B;
  --amber-dim:     rgba(245,158,11,0.1);
  --red:           #EF4444;
  --red-dim:       rgba(239,68,68,0.1);
  --purple:        #A855F7;
  --cyan:          #06B6D4;
  --blue:          #3B82F6;
  --blue-dim:      rgba(59,130,246,0.1);

  /* Provider colors */
  --openai:    #10A37F;
  --anthropic: #D97706;
  --gemini:    #4285F4;
  --hf:        #FF9D00;

  --text-primary:  #E2E8F0;
  --text-secondary:#94A3B8;
  --text-muted:    #475569;

  --font-display:  'Syne', sans-serif;
  --font-body:     'Outfit', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --nav-h:      56px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── Background ─────────────────────────────────────────── */
.bg-atmosphere { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(100px); }
.bg-orb-1 { width: 600px; height: 600px; background: var(--accent); opacity: 0.04; top: -200px; left: -100px; }
.bg-orb-2 { width: 400px; height: 400px; background: var(--green); opacity: 0.03; bottom: 100px; right: -100px; }
.bg-orb-3 { width: 300px; height: 300px; background: var(--amber); opacity: 0.025; top: 40%; left: 50%; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ─── Navigation ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(8,11,20,0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 0 24px; height: 100%;
  display: flex; align-items: center; gap: 28px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-logo {
  width: 32px; height: 32px;
  background: var(--accent-dim); border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.nav-wordmark { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: 0.08em; }
.nav-divider { width: 1px; height: 16px; background: var(--border); }
.nav-page-label { font-family: var(--font-mono); font-size: 11px; color: var(--accent-bright); letter-spacing: 0.05em; }
.nav-tabs { display: flex; gap: 2px; flex: 1; }
.nav-tab {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; transition: all 0.15s; border: none; background: none; cursor: pointer;
}
.nav-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.nav-tab.active { color: var(--accent-bright); background: var(--accent-dim); border: 1px solid var(--border-active); }
.nav-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav-perf { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.perf-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.perf-value { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.perf-value.up { color: var(--green); }
.nav-acu { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.acu-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.acu-value { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--accent-bright); }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; cursor: pointer;
}

/* ─── Page Header ────────────────────────────────────────── */
.page-header {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, rgba(99,102,241,0.04) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 24px 0 0;
}
.page-header-inner {
  max-width: 1600px; margin: 0 auto; padding: 0 24px 20px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.header-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px;
  background: var(--accent-dim); border: 1px solid var(--border-active);
  border-radius: 20px; font-size: 12px; font-weight: 500; color: var(--accent-bright);
  margin-bottom: 10px;
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }
.page-title {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  letter-spacing: -0.03em; color: var(--text-primary); margin-bottom: 6px;
}
.page-subtitle { font-size: 14px; color: var(--text-secondary); }

/* Total Value Card */
.total-value-card {
  background: var(--bg-card); border: 1px solid var(--border-active);
  border-radius: var(--radius-lg); padding: 18px 24px;
  text-align: right; flex-shrink: 0;
  box-shadow: 0 0 40px rgba(99,102,241,0.08);
  animation: cardIn 0.4s ease forwards;
}
@keyframes cardIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.tv-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }
.tv-value {
  font-family: var(--font-mono); font-size: 36px; font-weight: 800;
  color: var(--text-primary); line-height: 1;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-bright));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tv-unit { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.tv-change {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.tv-change.up { color: var(--green); }

/* KPI Strip */
.kpi-strip {
  max-width: 1600px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}
.kpi-item { padding: 12px 20px; flex-shrink: 0; }
.kpi-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 3px; }
.kpi-value { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--text-primary); }
.kpi-value.green { color: var(--green); }
.kpi-value.amber { color: var(--amber); }
.kpi-sep { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }

/* ─── Main ───────────────────────────────────────────────── */
.portfolio-main {
  position: relative; z-index: 1;
  max-width: 1600px; margin: 0 auto;
  padding: 20px 24px 48px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ─── Charts Row ─────────────────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 380px 1fr; gap: 16px; }

.chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  animation: cardIn 0.4s ease forwards; opacity: 0;
}
.chart-card:nth-child(1) { animation-delay: 0.05s; }
.chart-card:nth-child(2) { animation-delay: 0.10s; }

.chart-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.chart-card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.chart-card-actions { display: flex; gap: 3px; }
.chart-btn, .time-btn {
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  border: none; background: none; cursor: pointer; transition: all 0.15s;
  font-family: var(--font-body);
}
.chart-btn:hover, .time-btn:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.chart-btn.active, .time-btn.active {
  color: var(--accent-bright); background: var(--accent-dim);
  border: 1px solid var(--border-active);
}

/* Donut */
.donut-body { display: flex; align-items: center; gap: 20px; padding: 20px; }
.donut-wrap { position: relative; flex-shrink: 0; }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.donut-center-val { font-family: var(--font-mono); font-size: 20px; font-weight: 800; color: var(--text-primary); }
.donut-center-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.legend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.12s;
}
.legend-item:hover { background: rgba(255,255,255,0.04); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-body { flex: 1; }
.legend-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.legend-pct { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.legend-val { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); text-align: right; }
.legend-change { font-family: var(--font-mono); font-size: 10px; text-align: right; }
.legend-change.up { color: var(--green); }
.legend-change.down { color: var(--red); }

/* Bar chart */
.bar-chart-wrap { padding: 16px 20px 20px; }

/* Performance Chart */
.perf-chart-area { padding: 16px 16px 8px; }
.perf-footer {
  display: flex; gap: 0;
  border-top: 1px solid var(--border);
}
.perf-stat {
  flex: 1; padding: 10px 14px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.perf-stat:last-child { border-right: none; }
.perf-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.perf-stat-val { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-primary); }
.perf-stat-val.green { color: var(--green); }
.perf-stat-val.red { color: var(--red); }

/* ─── Provider Cards ─────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.02em;
}
.section-actions { display: flex; gap: 4px; }
.view-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: none;
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.view-btn:hover { color: var(--text-secondary); border-color: rgba(255,255,255,0.1); }
.view-btn.active { color: var(--accent-bright); background: var(--accent-dim); border-color: var(--border-active); }

.provider-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.provider-grid.list-view { grid-template-columns: 1fr; }

/* Provider Card */
.provider-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  animation: cardIn 0.4s ease forwards; opacity: 0;
}
.provider-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.provider-card:nth-child(1) { animation-delay: 0.05s; }
.provider-card:nth-child(2) { animation-delay: 0.10s; }
.provider-card:nth-child(3) { animation-delay: 0.15s; }
.provider-card:nth-child(4) { animation-delay: 0.20s; }

.pc-top {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.pc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pc-provider { display: flex; align-items: center; gap: 9px; }
.pc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pc-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-primary); }
.pc-badge {
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 600; font-family: var(--font-mono);
}
.pc-balance {
  font-family: var(--font-mono); font-size: 22px; font-weight: 800;
  color: var(--text-primary); margin-bottom: 2px;
}
.pc-balance-unit { font-size: 11px; color: var(--text-muted); }
.pc-acu { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); }

.pc-bottom { padding: 12px 16px; }
.pc-stats { display: flex; justify-content: space-between; margin-bottom: 10px; }
.pc-stat { display: flex; flex-direction: column; gap: 2px; }
.pc-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pc-stat-val { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-primary); }
.pc-stat-val.green { color: var(--green); }
.pc-stat-val.red { color: var(--red); }
.pc-stat-val.amber { color: var(--amber); }

/* Allocation bar */
.pc-alloc-bar { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.pc-alloc-fill { height: 100%; border-radius: 2px; transition: width 1s cubic-bezier(0.34,1.56,0.64,1); }

/* List view card */
.provider-grid.list-view .provider-card { border-radius: var(--radius-md); }
.provider-grid.list-view .pc-top {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; border-bottom: none;
}
.provider-grid.list-view .pc-header { margin-bottom: 0; flex: 0 0 140px; }
.provider-grid.list-view .pc-balance { font-size: 16px; flex: 1; }
.provider-grid.list-view .pc-bottom { display: none; }

/* ─── Bottom Row ─────────────────────────────────────────── */
.bottom-row { display: grid; grid-template-columns: 1fr 1fr 280px; gap: 16px; }

/* Allocation Card */
.allocation-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  animation: cardIn 0.4s ease 0.1s forwards; opacity: 0;
}
.rebalance-hint {
  padding: 3px 9px; border-radius: 20px;
  background: var(--amber-dim); border: 1px solid rgba(245,158,11,0.25);
  font-size: 10px; font-weight: 600; color: var(--amber);
  cursor: pointer; font-family: var(--font-body);
  transition: all 0.15s;
}
.rebalance-hint:hover { background: rgba(245,158,11,0.18); }

.allocation-bars { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.alloc-row { display: flex; flex-direction: column; gap: 5px; }
.alloc-row-header { display: flex; align-items: center; justify-content: space-between; }
.alloc-provider { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.alloc-dot { width: 8px; height: 8px; border-radius: 50%; }
.alloc-pcts { display: flex; gap: 8px; }
.alloc-pct { font-family: var(--font-mono); font-size: 11px; }
.alloc-pct.actual { color: var(--text-primary); font-weight: 700; }
.alloc-pct.target { color: var(--text-muted); }
.alloc-track { height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: visible; position: relative; }
.alloc-actual-bar { height: 100%; border-radius: 4px; transition: width 1s cubic-bezier(0.34,1.56,0.64,1); }
.alloc-target-line {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: rgba(255,255,255,0.3); border-radius: 1px;
  transition: left 1s cubic-bezier(0.34,1.56,0.64,1);
}
.alloc-delta {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-align: right;
}
.alloc-delta.over { color: var(--amber); }
.alloc-delta.under { color: var(--accent-bright); }
.alloc-delta.ok { color: var(--green); }

/* Activity Card */
.activity-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  animation: cardIn 0.4s ease 0.15s forwards; opacity: 0;
}
.live-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600; color: var(--green);
  font-family: var(--font-mono); letter-spacing: 0.05em;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
.activity-list { padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.activity-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; border-radius: var(--radius-sm);
  transition: background 0.12s;
  animation: actIn 0.3s ease forwards; opacity: 0;
}
@keyframes actIn { from{opacity:0;transform:translateX(-6px)} to{opacity:1;transform:translateX(0)} }
.activity-item:hover { background: rgba(255,255,255,0.03); }
.act-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 11px;
}
.act-body { flex: 1; }
.act-title { font-size: 12px; color: var(--text-primary); font-weight: 500; }
.act-sub { font-size: 11px; color: var(--text-muted); }
.act-val { font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-align: right; }
.act-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

/* Risk Card */
.risk-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  animation: cardIn 0.4s ease 0.2s forwards; opacity: 0;
}
.risk-metrics { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.risk-metric { display: flex; flex-direction: column; gap: 5px; }
.risk-metric-header { display: flex; justify-content: space-between; align-items: center; }
.risk-metric-label { font-size: 11px; color: var(--text-secondary); }
.risk-metric-val { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.risk-bar-track { height: 5px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.risk-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.risk-score {
  display: flex; align-items: center; justify-content: center;
  padding: 12px; margin-top: 4px;
  background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.15);
  border-radius: var(--radius-md);
  flex-direction: column; gap: 3px;
}
.risk-score-val { font-family: var(--font-mono); font-size: 28px; font-weight: 800; color: var(--green); }
.risk-score-label { font-size: 11px; color: var(--text-muted); }

/* ─── Actions Section ────────────────────────────────────── */
.actions-section { }
.actions-header { margin-bottom: 14px; }
.actions-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.action-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer; transition: all 0.2s; text-align: left;
  position: relative; overflow: hidden;
  animation: cardIn 0.4s ease forwards; opacity: 0;
}
.action-card:nth-child(1) { animation-delay: 0.05s; }
.action-card:nth-child(2) { animation-delay: 0.10s; }
.action-card:nth-child(3) { animation-delay: 0.15s; }
.action-card:nth-child(4) { animation-delay: 0.20s; }
.action-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.3); }
.action-card::before {
  content: ''; position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.2s;
}
.action-card:hover::before { opacity: 1; }

.action-rebalance { border-color: rgba(245,158,11,0.2); }
.action-rebalance:hover { border-color: rgba(245,158,11,0.4); box-shadow: 0 8px 28px rgba(245,158,11,0.1); }
.action-rebalance::before { background: linear-gradient(135deg, rgba(245,158,11,0.04), transparent); }

.action-allocate { border-color: rgba(59,130,246,0.2); }
.action-allocate:hover { border-color: rgba(59,130,246,0.4); box-shadow: 0 8px 28px rgba(59,130,246,0.1); }
.action-allocate::before { background: linear-gradient(135deg, rgba(59,130,246,0.04), transparent); }

.action-export { border-color: rgba(16,185,129,0.2); }
.action-export:hover { border-color: rgba(16,185,129,0.4); box-shadow: 0 8px 28px rgba(16,185,129,0.1); }
.action-export::before { background: linear-gradient(135deg, rgba(16,185,129,0.04), transparent); }

.action-autopilot { border-color: rgba(168,85,247,0.2); }
.action-autopilot:hover { border-color: rgba(168,85,247,0.4); box-shadow: 0 8px 28px rgba(168,85,247,0.1); }
.action-autopilot::before { background: linear-gradient(135deg, rgba(168,85,247,0.04), transparent); }

.action-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.action-rebalance .action-icon { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.action-allocate  .action-icon { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(59,130,246,0.2); }
.action-export    .action-icon { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.action-autopilot .action-icon { background: rgba(168,85,247,0.1); color: var(--purple); border: 1px solid rgba(168,85,247,0.2); }

.action-body { flex: 1; }
.action-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.action-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

.action-badge {
  padding: 3px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 600; font-family: var(--font-mono);
  flex-shrink: 0;
}
.action-badge.amber  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.action-badge.blue   { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(59,130,246,0.2); }
.action-badge.green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.action-badge.purple { background: rgba(168,85,247,0.1); color: var(--purple); border: 1px solid rgba(168,85,247,0.2); }

.action-arrow { color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s; }
.action-card:hover .action-arrow { transform: translateX(3px); color: var(--text-secondary); }

/* ─── Modals ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(10px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease; padding: 20px;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-xl); width: 100%; max-width: 500px;
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp { from{transform:translateY(24px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.modal-header { padding: 24px 24px 16px; border-bottom: 1px solid var(--border); text-align: center; }
.modal-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.modal-icon.amber  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.modal-icon.blue   { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(59,130,246,0.25); }
.modal-icon.green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.25); }
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.modal-subtitle { font-size: 13px; color: var(--text-secondary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex; gap: 10px; padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}
.btn-modal-cancel {
  flex: 1; padding: 11px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; font-family: var(--font-body);
}
.btn-modal-cancel:hover { background: rgba(255,255,255,0.07); }
.btn-modal-confirm {
  flex: 2; padding: 11px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: white; cursor: pointer; transition: all 0.2s;
}
.btn-modal-confirm:hover { transform: translateY(-1px); }
.amber-btn { background: linear-gradient(135deg, var(--amber), #D97706); box-shadow: 0 4px 16px rgba(245,158,11,0.3); }
.amber-btn:hover { box-shadow: 0 8px 24px rgba(245,158,11,0.4); }
.blue-btn  { background: linear-gradient(135deg, var(--blue), #2563EB); box-shadow: 0 4px 16px rgba(59,130,246,0.3); }
.blue-btn:hover  { box-shadow: 0 8px 24px rgba(59,130,246,0.4); }
.green-btn { background: linear-gradient(135deg, var(--green), #059669); box-shadow: 0 4px 16px rgba(16,185,129,0.3); }
.green-btn:hover { box-shadow: 0 8px 24px rgba(16,185,129,0.4); }

/* Rebalance Table */
.rebalance-table { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rb-row {
  display: grid; grid-template-columns: 120px 1fr 80px 80px 80px;
  align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
}
.rb-provider { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.rb-dot { width: 8px; height: 8px; border-radius: 50%; }
.rb-bar-track { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.rb-bar-fill { height: 100%; border-radius: 3px; }
.rb-val { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); text-align: right; }
.rb-delta { font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-align: right; }
.rb-delta.buy  { color: var(--green); }
.rb-delta.sell { color: var(--red); }
.rb-delta.ok   { color: var(--text-muted); }
.rebalance-summary {
  background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 12px; color: var(--text-secondary); line-height: 1.6;
}

/* Allocate Form */
.allocate-form { display: flex; flex-direction: column; gap: 12px; }
.alloc-form-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
}
.alloc-form-provider { display: flex; align-items: center; gap: 8px; flex: 1; }
.alloc-form-dot { width: 8px; height: 8px; border-radius: 50%; }
.alloc-form-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.alloc-form-input {
  width: 90px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 10px; font-family: var(--font-mono); font-size: 13px;
  color: var(--text-primary); outline: none; text-align: right;
  transition: border-color 0.15s;
}
.alloc-form-input:focus { border-color: var(--border-active); }
.alloc-form-unit { font-size: 11px; color: var(--text-muted); width: 30px; }

/* Export Options */
.export-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.export-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border); cursor: pointer; transition: all 0.15s;
}
.export-option input { display: none; }
.export-option:hover { border-color: rgba(255,255,255,0.1); }
.export-option.selected { border-color: var(--border-active); background: var(--accent-dim); }
.export-option-icon { color: var(--text-secondary); flex-shrink: 0; }
.export-option-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.export-option-desc { font-size: 11px; color: var(--text-muted); }
.export-includes { background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 12px 14px; }
.export-includes-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.export-includes-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.export-include-item { font-size: 12px; color: var(--green); }

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  font-size: 13px; color: var(--text-primary); z-index: 1000;
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none; max-width: 300px;
}
.toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast.toast-success { border-color: rgba(16,185,129,0.3); }
.toast.toast-error   { border-color: rgba(239,68,68,0.3); }
.toast-icon { font-size: 15px; flex-shrink: 0; }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .charts-row { grid-template-columns: 1fr; }
  .provider-grid { grid-template-columns: repeat(2, 1fr); }
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-row { grid-template-columns: 1fr 1fr; }
  .risk-card { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .provider-grid { grid-template-columns: 1fr; }
  .actions-grid { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .nav-tabs { display: none; }
  .page-header-inner { flex-direction: column; }
  .kpi-strip { gap: 0; }
}