:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #050b14;
  --panel: rgba(15, 27, 45, 0.82);
  --panel-solid: #101c2e;
  --panel-soft: rgba(22, 39, 63, 0.66);
  --line: rgba(157, 181, 216, 0.12);
  --line-strong: rgba(157, 181, 216, 0.22);
  --text: #f3f7fc;
  --muted: #8fa2bd;
  --subtle: #667994;
  --accent: #6ee7d2;
  --accent-2: #4f7cff;
  --warm: #ffba69;
  --positive: #ff6f7d;
  --negative: #43d39e;
  --warning: #ffba69;
  --danger: #ff6f7d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar-width: 236px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 5%, rgba(79, 124, 255, 0.12), transparent 28%),
    radial-gradient(circle at 15% 90%, rgba(110, 231, 210, 0.08), transparent 24%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ambient { position: fixed; border-radius: 999px; filter: blur(110px); pointer-events: none; opacity: .14; z-index: -1; }
.ambient-one { width: 330px; height: 330px; right: 7%; top: -160px; background: #4f7cff; }
.ambient-two { width: 300px; height: 300px; left: 12%; bottom: -180px; background: #6ee7d2; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  padding: 28px 18px 24px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(6, 14, 25, .76);
  backdrop-filter: blur(24px);
  z-index: 20;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 32px; }
.sidebar-brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.sidebar-brand span { display: block; margin-top: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--subtle); }
.brand-mark { position: relative; width: 38px; height: 38px; flex: 0 0 auto; overflow: hidden; border-radius: 13px; background: linear-gradient(145deg, rgba(110,231,210,.18), rgba(79,124,255,.2)); border: 1px solid rgba(110,231,210,.24); box-shadow: inset 0 1px rgba(255,255,255,.12); }
.brand-peak { position: absolute; left: 7px; right: 6px; bottom: 8px; height: 17px; clip-path: polygon(0 100%, 35% 20%, 57% 68%, 78% 0, 100% 100%); background: linear-gradient(110deg, var(--accent), var(--accent-2)); }
.brand-dot { position: absolute; width: 5px; height: 5px; border-radius: 50%; right: 7px; top: 6px; background: var(--warm); box-shadow: 0 0 12px var(--warm); }
.brand-mark-large { width: 56px; height: 56px; border-radius: 18px; margin-bottom: 22px; }
.brand-mark-large .brand-peak { left: 10px; right: 9px; bottom: 12px; height: 25px; }
.brand-mark-large .brand-dot { width: 7px; height: 7px; right: 10px; top: 9px; }

.side-nav { display: grid; gap: 6px; }
.nav-item, .mobile-nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.nav-item { width: 100%; height: 48px; padding: 0 13px; border-radius: 13px; display: flex; align-items: center; gap: 13px; text-align: left; transition: .2s ease; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active { color: #eafffa; background: linear-gradient(100deg, rgba(110,231,210,.14), rgba(79,124,255,.08)); box-shadow: inset 3px 0 var(--accent); }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--subtle); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(110,231,210,.8); }
.text-button { margin-top: 14px; padding: 0; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 12px; }
.text-button svg { width: 16px; height: 16px; }
.text-button:hover { color: var(--text); }

.main-panel { min-height: 100vh; margin-left: var(--sidebar-width); padding: 0 44px 48px; }
.topbar { height: 106px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.2; letter-spacing: -.03em; }
.eyebrow { margin: 0; color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.date-control, .soft-button, .icon-button {
  border: 1px solid var(--line);
  background: rgba(15, 28, 46, .72);
  box-shadow: inset 0 1px rgba(255,255,255,.03);
}
.date-control { height: 42px; padding: 0 13px; display: inline-flex; align-items: center; gap: 9px; border-radius: 12px; color: var(--muted); }
.date-control svg { width: 17px; height: 17px; }
.date-control input { width: 126px; color: var(--text); background: transparent; border: 0; outline: none; }
.date-control input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .5; }
.soft-button { height: 42px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; color: var(--muted); cursor: pointer; }
.soft-button:hover, .icon-button:hover { border-color: var(--line-strong); color: var(--text); }
.soft-button svg { width: 17px; height: 17px; }
.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; cursor: pointer; }
.top-icon svg { width: 18px; height: 18px; }

.content { max-width: 1540px; margin: 0 auto; animation: fade-in .32s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.loading-state { min-height: 55vh; display: grid; place-items: center; align-content: center; gap: 18px; color: var(--muted); font-size: 13px; }
.loader-ring { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.glass-card, .card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(18, 32, 52, .9), rgba(10, 21, 36, .84)); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.card { border-radius: var(--radius-lg); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .8fr); gap: 18px; }
.hero-card { position: relative; min-height: 252px; padding: 30px; overflow: hidden; border-radius: var(--radius-xl); }
.hero-card::before { content: ""; position: absolute; width: 280px; height: 280px; right: -50px; top: -100px; border-radius: 50%; background: radial-gradient(circle, rgba(79,124,255,.2), transparent 66%); }
.hero-card::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(110,231,210,.55), transparent); }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.hero-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.hero-label svg { width: 17px; height: 17px; color: var(--accent); }
.quality-pill, .status-pill, .tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; }
.quality-pill { padding: 7px 10px; color: var(--accent); background: rgba(110,231,210,.08); border: 1px solid rgba(110,231,210,.16); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.quality-pill svg { width: 14px; height: 14px; }
.hero-value { margin: 22px 0 8px; font-size: clamp(38px, 4vw, 58px); font-weight: 650; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.hero-subline { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.hero-subline strong { font-size: 15px; }
.hero-bottom { position: absolute; left: 30px; right: 30px; bottom: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mini-stat { padding-left: 16px; border-left: 1px solid var(--line); }
.mini-stat:first-child { padding-left: 0; border-left: 0; }
.mini-stat span { display: block; color: var(--subtle); font-size: 10px; margin-bottom: 5px; }
.mini-stat strong { font-size: 15px; font-variant-numeric: tabular-nums; }

.side-summary { padding: 24px; border-radius: var(--radius-xl); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.section-head p { margin: 4px 0 0; font-size: 11px; color: var(--subtle); }
.allocation-wrap { min-height: 190px; display: grid; grid-template-columns: 145px 1fr; gap: 18px; align-items: center; }
.donut { position: relative; width: 138px; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 24px rgba(0,0,0,.28); }
.donut::after { content: ""; position: absolute; inset: 21px; border-radius: 50%; background: var(--panel-solid); border: 1px solid var(--line); }
.donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: 20px; }
.donut-center span { margin-top: 2px; font-size: 9px; color: var(--subtle); }
.allocation-list { display: grid; gap: 9px; min-width: 0; }
.allocation-item { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.allocation-dot { width: 7px; height: 7px; border-radius: 50%; }
.allocation-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.allocation-item strong { color: var(--text); font-size: 10px; font-variant-numeric: tabular-nums; }

.kpi-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.kpi-card { position: relative; min-height: 130px; padding: 20px; overflow: hidden; border-radius: var(--radius-lg); box-shadow: none; }
.kpi-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: rgba(110,231,210,.08); }
.kpi-icon.blue { color: #7ea0ff; background: rgba(79,124,255,.11); }
.kpi-icon.warm { color: var(--warm); background: rgba(255,186,105,.1); }
.kpi-icon.rose { color: var(--positive); background: rgba(255,111,125,.1); }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-label { position: absolute; left: 66px; top: 22px; color: var(--muted); font-size: 11px; }
.kpi-value { margin-top: 19px; font-size: 23px; font-weight: 620; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-note { margin-top: 6px; color: var(--subtle); font-size: 10px; }

.analytics-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.75fr); gap: 18px; }
.chart-card, .alert-card { min-height: 310px; padding: 23px; }
.chart-toolbar { display: flex; gap: 6px; }
.chart-chip { padding: 6px 9px; border: 0; border-radius: 8px; background: rgba(255,255,255,.04); color: var(--subtle); cursor: pointer; font-size: 10px; }
.chart-chip.active { color: var(--accent); background: rgba(110,231,210,.1); }
.line-chart { height: 226px; margin-top: 16px; position: relative; }
.line-chart svg, .detail-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-marker-legend { display: flex; gap: 16px; align-items: center; color: var(--subtle); font-size: 11px; margin-top: 12px; }
.chart-marker-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trade-marker { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #101c2e; }
.trade-marker.buy { background: #fb7185; }
.trade-marker.sell { background: #48d597; }
.cost-line-key { width: 16px; height: 0; border-top: 2px dashed #f6b84c; display: inline-block; }
.chart-trade-dot { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.chart-axis-label { fill: var(--subtle); stroke: none; font-size: 9px; }
.chart-grid { stroke: rgba(157,181,216,.09); stroke-width: 1; }
.chart-path { fill: none; stroke: var(--accent); stroke-width: 2.2; filter: drop-shadow(0 4px 7px rgba(110,231,210,.3)); }
.chart-area { fill: url(#areaGradient); stroke: none; }
.chart-dot { fill: var(--panel-solid); stroke: var(--accent); stroke-width: 2; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--subtle); font-size: 12px; }
.alert-list { margin-top: 18px; display: grid; gap: 10px; max-height: 225px; overflow: auto; padding-right: 3px; }
.alert-item { padding: 12px; display: grid; grid-template-columns: 28px 1fr; gap: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 12px; }
.alert-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--warning); background: rgba(255,186,105,.09); }
.alert-icon.info { color: var(--accent); background: rgba(110,231,210,.08); }
.alert-icon svg { width: 14px; height: 14px; }
.alert-item strong { display: block; margin-bottom: 3px; font-size: 11px; }
.alert-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.all-clear { min-height: 160px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.all-clear .kpi-icon { margin: 0 auto 10px; }

.table-card { margin-top: 18px; overflow: hidden; }
.table-card .section-head { padding: 21px 22px 16px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { height: 42px; padding: 0 14px; color: var(--subtle); font-size: 9px; font-weight: 600; letter-spacing: .04em; text-align: right; white-space: nowrap; background: rgba(255,255,255,.02); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-table th:first-child, .data-table th:nth-child(2) { text-align: left; }
.data-table td { padding: 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid rgba(157,181,216,.08); font-variant-numeric: tabular-nums; }
.data-table td:first-child, .data-table td:nth-child(2) { text-align: left; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: .16s ease; cursor: pointer; }
.data-table tbody tr:hover { background: rgba(110,231,210,.035); }
.fund-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.fund-avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--accent); background: linear-gradient(145deg, rgba(110,231,210,.12), rgba(79,124,255,.12)); font-size: 11px; font-weight: 700; }
.fund-cell strong { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.fund-cell span { display: block; margin-top: 3px; color: var(--subtle); font-size: 9px; }
.value-stack strong, .value-stack span { display: block; }
.value-stack span { margin-top: 3px; color: var(--subtle); font-size: 9px; }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.neutral { color: var(--muted) !important; }
.status-pill { padding: 5px 8px; color: var(--accent); background: rgba(110,231,210,.08); border: 1px solid rgba(110,231,210,.13); font-size: 9px; }
.status-pill.pending { color: var(--warning); background: rgba(255,186,105,.08); border-color: rgba(255,186,105,.14); }
.status-pill.excluded { color: var(--subtle); background: rgba(255,255,255,.04); border-color: var(--line); }

.view-hero { margin-bottom: 18px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-radius: var(--radius-xl); }
.view-hero h2 { margin: 0 0 7px; font-size: 18px; }
.view-hero p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.view-hero-metric { text-align: right; }
.view-hero-metric span { display: block; color: var(--subtle); font-size: 10px; }
.view-hero-metric strong { display: block; margin-top: 5px; font-size: 25px; }
.holdings-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.holding-card { padding: 20px; border-radius: var(--radius-lg); cursor: pointer; transition: .2s ease; box-shadow: none; }
.holding-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.holding-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.holding-card-name { min-width: 0; }
.holding-card-name strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.holding-card-name span { display: block; margin-top: 4px; color: var(--subtle); font-size: 9px; }
.holding-card-value { margin: 20px 0 5px; font-size: 23px; font-weight: 620; }
.holding-card-meta { display: flex; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.holding-card-meta span { display: block; color: var(--subtle); font-size: 9px; }
.holding-card-meta strong { display: block; margin-top: 4px; font-size: 11px; }
.weight-bar { height: 3px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.05); }
.weight-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.toolbar { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-field, .filter-select { height: 40px; border: 1px solid var(--line); border-radius: 11px; background: rgba(15,28,46,.72); color: var(--text); outline: none; }
.search-field { min-width: 240px; display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.search-field svg { width: 16px; height: 16px; color: var(--subtle); }
.search-field input { min-width: 0; flex: 1; border: 0; background: transparent; color: var(--text); outline: 0; font-size: 11px; }
.filter-select { padding: 0 30px 0 12px; font-size: 10px; }
.primary-button, .secondary-button { min-height: 42px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 650; }
.primary-button { border: 0; color: #07111f; background: linear-gradient(120deg, var(--accent), #7dbfff); box-shadow: 0 10px 24px rgba(92,199,210,.18); }
.secondary-button { border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.03); }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; }
.full-button { width: 100%; }

.data-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(300px,.8fr); gap: 18px; }
.upload-panel, .import-panel { padding: 25px; }
.drop-zone { margin-top: 18px; min-height: 260px; padding: 28px; display: grid; place-content: center; text-align: center; border: 1px dashed rgba(110,231,210,.26); border-radius: 18px; background: linear-gradient(145deg, rgba(110,231,210,.035), rgba(79,124,255,.025)); transition: .2s ease; cursor: pointer; }
.drop-zone.dragging { border-color: var(--accent); background: rgba(110,231,210,.075); transform: scale(.995); }
.upload-orb { width: 58px; height: 58px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 18px; color: var(--accent); background: rgba(110,231,210,.09); border: 1px solid rgba(110,231,210,.15); }
.upload-orb svg { width: 25px; height: 25px; }
.drop-zone h3 { margin: 0 0 8px; font-size: 14px; }
.drop-zone p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.drop-zone input { display: none; }
.import-stats { margin-top: 18px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.import-stat { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.import-stat span { display: block; color: var(--subtle); font-size: 9px; }
.import-stat strong { display: block; margin-top: 5px; font-size: 14px; }
.checklist { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.checklist li { display: flex; gap: 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.checklist svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--accent); }
.import-meta { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 10px; line-height: 1.7; }

.empty-state { min-height: 62vh; padding: 40px; display: grid; place-content: center; text-align: center; border-radius: var(--radius-xl); }
.empty-state .brand-mark { margin: 0 auto 20px; }
.empty-state h2 { margin: 0 0 9px; }
.empty-state p { max-width: 470px; margin: 0 auto 22px; color: var(--muted); font-size: 11px; line-height: 1.7; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; background: rgba(2,7,13,.72); backdrop-filter: blur(12px); animation: fade-in .18s ease; }
.modal { position: relative; width: min(900px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 28px; border-radius: var(--radius-xl); border: 1px solid var(--line-strong); background: #0c1829; box-shadow: 0 36px 100px rgba(0,0,0,.55); }
.modal-close { position: absolute; right: 18px; top: 18px; z-index: 2; }
.modal-head { padding-right: 50px; }
.modal-head h2 { margin: 5px 0 7px; font-size: 20px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; }
.detail-kpis { margin: 22px 0; display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.detail-kpi { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.detail-kpi span { display: block; color: var(--subtle); font-size: 9px; }
.detail-kpi strong { display: block; margin-top: 6px; font-size: 14px; }
.holding-review-card { margin: 22px 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.holding-review-card .section-head { margin-bottom: 12px; }
.holding-review-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.holding-review-grid div { min-width: 0; padding: 12px 8px; text-align: center; border-radius: 10px; background: rgba(101,151,255,.09); }
.holding-review-grid div:nth-child(4), .holding-review-grid div:nth-child(5) { grid-column: span 3; }
.holding-review-grid div:nth-child(-n+3) { grid-column: span 2; }
.holding-review-grid span { display: block; color: var(--subtle); font-size: 10px; white-space: nowrap; }
.holding-review-grid strong { display: block; margin-top: 6px; font-size: 17px; white-space: nowrap; }
.detail-chart { height: 220px; margin: 18px 0 24px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.02); }
.attribution-card { margin: 18px 0 22px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(101,151,255,.06); }
.attribution-card .section-head { margin-bottom: 12px; }
.attribution-equation { display: grid; grid-template-columns: minmax(0,1.15fr) auto minmax(0,1fr) auto minmax(0,1fr); gap: 10px; align-items: center; }
.attribution-equation div { min-width: 0; padding: 11px 9px; border-radius: 10px; background: rgba(255,255,255,.05); }
.attribution-equation span { display: block; color: var(--subtle); font-size: 10px; margin-bottom: 5px; }
.attribution-equation strong { display: block; font-size: 17px; white-space: nowrap; }
.attribution-equation b { color: var(--subtle); font-size: 18px; }
.attribution-note { margin: 12px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.6; }

.login-screen { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.login-card { width: min(430px,100%); padding: 38px; border-radius: 30px; }
.login-card h1 { margin: 7px 0 10px; font-size: 31px; letter-spacing: -.04em; }
.login-copy { margin: 0 0 28px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.login-form label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.password-field { display: flex; border: 1px solid var(--line); border-radius: 13px; background: rgba(5,12,22,.65); }
.password-field:focus-within { border-color: rgba(110,231,210,.42); box-shadow: 0 0 0 3px rgba(110,231,210,.06); }
.password-field input { min-width: 0; flex: 1; height: 48px; padding: 0 15px; border: 0; outline: 0; color: var(--text); background: transparent; }
.password-field .icon-button { border: 0; background: transparent; }
.form-error { min-height: 20px; margin: 7px 0; color: var(--danger); font-size: 10px; }
.security-note { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--subtle); font-size: 9px; }
.security-note svg { width: 13px; height: 13px; }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 150; display: grid; gap: 8px; }
.toast { min-width: 270px; max-width: 390px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line-strong); border-radius: 13px; background: #101e31; box-shadow: var(--shadow); color: var(--muted); font-size: 10px; line-height: 1.5; animation: toast-in .22s ease; }
.toast.success { border-color: rgba(110,231,210,.25); }
.toast.error { border-color: rgba(255,111,125,.28); }
@keyframes toast-in { from { opacity:0; transform: translateX(15px); } }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .main-panel { padding-inline: 28px; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .holdings-grid { grid-template-columns: repeat(2,1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
  .alert-card { min-height: 240px; }
}

@media (max-width: 820px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .main-panel { margin: 0; padding: 0 16px 92px; }
  .topbar { height: auto; min-height: 95px; padding: 18px 0; align-items: flex-start; }
  .topbar h1 { font-size: 20px; }
  .topbar-actions { justify-content: flex-end; flex-wrap: wrap; }
  .date-control { order: 3; height: 36px; }
  .date-control input { width: 112px; }
  .soft-button, .top-icon { height: 36px; }
  .top-icon { width: 36px; }
  .soft-button { padding: 0 10px; }
  .overview-grid, .data-layout { grid-template-columns: 1fr; }
  .hero-card { min-height: 276px; padding: 24px; }
  .hero-bottom { left: 24px; right: 24px; bottom: 22px; }
  .hero-value { font-size: 38px; }
  .kpi-grid { gap: 10px; }
  .holdings-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; flex: 1; }
  .mobile-nav { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 50; height: 66px; padding: 6px; display: grid; grid-template-columns: repeat(5,1fr); border: 1px solid var(--line-strong); border-radius: 20px; background: rgba(8,18,31,.92); backdrop-filter: blur(22px); box-shadow: 0 18px 45px rgba(0,0,0,.42); }
  .mobile-nav-item { display: grid; place-content: center; gap: 3px; border-radius: 14px; font-size: 8px; }
  .mobile-nav-item svg { width: 18px; height: 18px; margin: auto; }
  .mobile-nav-item.active { color: var(--accent); background: rgba(110,231,210,.08); }
  .detail-kpis { grid-template-columns: repeat(2,1fr); }
  .holding-review-grid { grid-template-columns: repeat(2,1fr); }
  .holding-review-grid div, .holding-review-grid div:nth-child(4), .holding-review-grid div:nth-child(5), .holding-review-grid div:nth-child(-n+3) { grid-column: auto; }
  .holding-review-grid div:last-child { grid-column: span 2; }
  .attribution-equation { grid-template-columns: 1fr; gap: 7px; }
  .attribution-equation b { display: none; }
}

@media (max-width: 520px) {
  .topbar-actions .soft-button span { display: none; }
  .overview-grid { gap: 12px; }
  .hero-top { align-items: center; }
  .quality-pill { max-width: 140px; overflow: hidden; white-space: nowrap; }
  .hero-bottom { grid-template-columns: repeat(2,1fr); }
  .hero-bottom .mini-stat:last-child { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 119px; padding: 16px; }
  .kpi-label { left: 57px; top: 19px; }
  .kpi-value { font-size: 18px; }
  .allocation-wrap { grid-template-columns: 125px 1fr; gap: 10px; }
  .donut { width: 118px; }
  .view-hero { align-items: flex-start; flex-direction: column; }
  .view-hero-metric { text-align: left; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 92vh; padding: 23px 18px; border-radius: 24px 24px 0 0; }
  .login-card { padding: 30px 24px; }
  .toast-container { left: 14px; right: 14px; top: 14px; }
  .toast { min-width: 0; width: 100%; }
}
