:root {
  --bg: #07111f;
  --bg-2: #0a1728;
  --panel: rgba(13, 28, 46, .82);
  --panel-solid: #0f2034;
  --panel-2: rgba(20, 40, 63, .74);
  --line: rgba(155, 190, 224, .14);
  --line-strong: rgba(155, 190, 224, .26);
  --text: #edf7ff;
  --muted: #8fa7bd;
  --faint: #668097;
  --brand: #63e6be;
  --brand-2: #6c8cff;
  --accent: #ffd166;
  --good: #62d9a8;
  --bad: #ff7f8f;
  --warn: #ffca6b;
  --info: #71b7ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, .18);
  --radius-xl: 26px;
  --radius-lg: 19px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar: 262px;
  --topbar: 82px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="light"] {
  --bg: #eef4f8;
  --bg-2: #f8fbfd;
  --panel: rgba(255,255,255,.84);
  --panel-solid: #ffffff;
  --panel-2: rgba(246,250,252,.9);
  --line: rgba(38, 69, 94, .12);
  --line-strong: rgba(38, 69, 94, .22);
  --text: #10243a;
  --muted: #5d7286;
  --faint: #7d91a3;
  --shadow: 0 24px 70px rgba(37, 65, 87, .13);
  --shadow-soft: 0 14px 34px rgba(37, 65, 87, .09);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
          radial-gradient(circle at 12% 8%, rgba(99,230,190,.09), transparent 33%),
          radial-gradient(circle at 85% 18%, rgba(108,140,255,.12), transparent 36%),
          linear-gradient(145deg, var(--bg), var(--bg-2));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
::selection { background: rgba(99,230,190,.25); }
:focus-visible { outline: 3px solid rgba(99,230,190,.45); outline-offset: 2px; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 999; transform: translateY(-150%); padding: 10px 14px; background: var(--panel-solid); border-radius: 10px; }
.skip-link:focus { transform: translateY(0); }

/* 性能修复 1：fixed -> absolute */
#ambient { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }

/* 性能修复 2：取消动态 blur / 无限动画 */
.orb { position: absolute; border-radius: 999px; filter: none; opacity: .28; animation: none; }

.orb-one { width: 290px; height: 290px; background: rgba(99,230,190,.22); left: -90px; top: 18%; }
.orb-two { width: 380px; height: 380px; background: rgba(108,140,255,.18); right: -140px; top: 5%; animation-delay: -7s; }
.grid-glow { position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(to bottom, black, transparent 82%); }
@keyframes drift { to { transform: translate3d(30px, 24px, 0) scale(1.08); } }

.icon { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 25px; height: 25px; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr); }
.auth-showcase { padding: clamp(34px, 6vw, 86px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand { display: flex; align-items: center; gap: 13px; font-weight: 800; letter-spacing: -.03em; font-size: 1.22rem; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #061420; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 28px rgba(99,230,190,.2); font-weight: 900; }
.auth-copy { max-width: 700px; margin: 10vh 0 8vh; }
.eyebrow { color: var(--brand); font-size: .77rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-copy h1 { margin: 18px 0; font-size: clamp(2.5rem, 5.6vw, 5.7rem); line-height: .98; letter-spacing: -.065em; max-width: 850px; }
.auth-copy h1 span { background: linear-gradient(110deg, var(--brand), #b8ffe8 40%, var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { color: var(--muted); font-size: clamp(1rem, 1.45vw, 1.22rem); line-height: 1.75; max-width: 610px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* 性能修复 3：取消小面积玻璃模糊 */
.trust-pill { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 999px; color: var(--muted); font-size: .82rem; backdrop-filter: none; }

.market-strip { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; max-width: 720px; }

/* 性能修复 4：取消三张市场卡片的背景模糊 */
.market-chip { padding: 17px; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-soft); backdrop-filter: none; }

.market-chip small { color: var(--muted); display: block; margin-bottom: 8px; }
.market-chip strong { font-size: 1.08rem; }
.market-chip .live-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--good); margin-right: 7px; box-shadow: 0 0 0 5px rgba(98,217,168,.08); }

/* 性能修复 5：取消占据约半屏的 blur(25px) */
.auth-panel { margin: 20px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: none; border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: clamp(28px, 4vw, 58px); display: flex; flex-direction: column; justify-content: center; position: relative; }

.auth-tools { position: absolute; top: 22px; right: 22px; display: flex; gap: 8px; }
.auth-form-wrap { width: min(100%, 460px); margin: auto; }
.auth-form-wrap h2 { font-size: 2rem; letter-spacing: -.045em; margin: 0 0 8px; }
.auth-form-wrap > p { color: var(--muted); line-height: 1.6; margin: 0 0 30px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border: 1px solid var(--line); background: rgba(0,0,0,.08); border-radius: 14px; margin-bottom: 26px; }
.auth-tab { border: 0; background: transparent; padding: 11px; color: var(--muted); border-radius: 10px; cursor: pointer; font-weight: 700; }
.auth-tab.active { color: var(--text); background: var(--panel-solid); box-shadow: var(--shadow-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1/-1; }
.form-label { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.field { position: relative; }
.input, .select, .textarea { width: 100%; color: var(--text); background: rgba(255,255,255,.035); border: 1px solid var(--line-strong); border-radius: 12px; min-height: 48px; padding: 0 14px; outline: none; transition: .2s ease; }
.textarea { padding-top: 12px; min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(99,230,190,.32); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99,230,190,.09); }
.input.has-icon { padding-left: 43px; }
.field-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.field-action { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.password-meter { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.password-meter span { display: block; height: 100%; width: 0; background: var(--bad); transition: .25s; }
.password-hint { margin-top: 7px; color: var(--faint); font-size: .75rem; }
.auth-note { color: var(--faint); font-size: .76rem; line-height: 1.55; margin-top: 16px; display: flex; gap: 8px; }

.btn { min-height: 42px; border: 1px solid transparent; border-radius: 11px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; cursor: pointer; transition: transform .18s var(--ease), border-color .18s, background .18s, opacity .18s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), #57cbb9); color: #061923; box-shadow: 0 10px 24px rgba(99,230,190,.18); }
.btn-secondary { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-danger { background: rgba(255,127,143,.11); border-color: rgba(255,127,143,.28); color: var(--bad); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: .79rem; border-radius: 9px; }
.btn-lg { min-height: 52px; width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; padding: 0; background: var(--panel-2); border: 1px solid var(--line); display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); position: relative; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.language-switch { width: auto; min-width: 66px; padding: 0 12px; grid-auto-flow: column; gap: 7px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.language-switch svg { width: 16px; height: 16px; }
.badge-count { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; background: var(--bad); color: white; font-size: .62rem; font-weight: 800; border: 2px solid var(--bg); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 21px 16px; border-right: 1px solid var(--line); background: rgba(7,17,31,.78); backdrop-filter: blur(22px); z-index: 50; display: flex; flex-direction: column; transition: transform .28s var(--ease); }
html[data-theme="light"] .sidebar { background: rgba(248,251,253,.82); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 3px 8px 24px; font-size: 1.1rem; font-weight: 850; letter-spacing: -.035em; }
.sidebar-brand small { display: block; color: var(--muted); font-size: .63rem; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.nav-label { color: var(--faint); font-size: .67rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; padding: 12px 12px 8px; }
.nav-list { display: grid; gap: 5px; }
.nav-link { min-height: 45px; padding: 0 12px; border-radius: 12px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .89rem; font-weight: 700; border: 1px solid transparent; cursor: pointer; transition: .18s ease; }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-link.active { color: var(--text); background: linear-gradient(90deg, rgba(99,230,190,.13), rgba(108,140,255,.07)); border-color: rgba(99,230,190,.18); }
.nav-link.active .icon { color: var(--brand); }
.sidebar-spacer { flex: 1; }
.security-card { padding: 15px; border: 1px solid rgba(99,230,190,.16); border-radius: 15px; background: linear-gradient(145deg, rgba(99,230,190,.07), rgba(108,140,255,.04)); }
.security-card strong { font-size: .82rem; display: flex; align-items: center; gap: 7px; }
.security-card p { font-size: .7rem; line-height: 1.55; color: var(--muted); margin: 8px 0 0; }

.main-wrap { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { height: var(--topbar); position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(18px, 3.2vw, 46px); border-bottom: 1px solid var(--line); background: rgba(7,17,31,.68); backdrop-filter: blur(20px); }
html[data-theme="light"] .topbar { background: rgba(248,251,253,.7); }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mobile-menu { display: none; }
.page-heading { min-width: 0; }
.page-heading h1 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.55rem); letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: .76rem; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.privacy-active { color: var(--brand); border-color: rgba(99,230,190,.32); }
.user-chip { height: 44px; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); cursor: pointer; max-width: 220px; }
.user-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(99,230,190,.25), rgba(108,140,255,.24)); color: var(--brand); font-size: .78rem; font-weight: 850; }
.user-meta { min-width: 0; text-align: left; }
.user-meta strong { display: block; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { display: block; color: var(--muted); font-size: .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { padding: clamp(20px, 3.2vw, 46px); max-width: 1800px; margin: 0 auto; }
.page-enter { animation: pageIn .42s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(9px); } }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-actions-left, .page-actions-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.hero-card { border: 1px solid var(--line); border-radius: var(--radius-xl); background: linear-gradient(135deg, rgba(99,230,190,.10), rgba(108,140,255,.08) 52%, var(--panel)); padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow-soft); overflow: hidden; position: relative; }
.hero-card:after { content: ""; position: absolute; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(99,230,190,.16), transparent 66%); right: -65px; top: -80px; }
.hero-card h2 { margin: 0 0 9px; font-size: clamp(1.4rem, 2.5vw, 2.2rem); letter-spacing: -.045em; }
.hero-card p { color: var(--muted); max-width: 700px; line-height: 1.65; margin: 0; }
.hero-meta { display: flex; gap: 18px; margin-top: 23px; flex-wrap: wrap; }
.hero-stat { min-width: 130px; }
.hero-stat small { color: var(--muted); display: block; margin-bottom: 5px; }
.hero-stat strong { font-size: 1.2rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.kpi-card { position: relative; min-height: 145px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); backdrop-filter: blur(16px); box-shadow: var(--shadow-soft); overflow: hidden; transition: transform .2s var(--ease), border-color .2s; }
.kpi-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.kpi-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.kpi-label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(99,230,190,.09); color: var(--brand); }
.kpi-value { margin: 15px 0 8px; font-size: clamp(1.45rem, 2.2vw, 2rem); font-weight: 840; letter-spacing: -.05em; }
.kpi-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; }
.delta { padding: 4px 7px; border-radius: 999px; font-size: .67rem; font-weight: 800; }
.delta.up { color: var(--good); background: rgba(98,217,168,.10); }
.delta.down { color: var(--bad); background: rgba(255,127,143,.10); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); backdrop-filter: blur(16px); box-shadow: var(--shadow-soft); min-width: 0; }
.card-pad { padding: 21px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title { margin: 0; font-size: 1rem; letter-spacing: -.025em; }
.card-subtitle { color: var(--muted); font-size: .72rem; margin-top: 5px; }
.card-tools { display: flex; gap: 7px; }
.chart-wrap { height: 250px; position: relative; }
.chart-svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid line { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 5px 10px rgba(99,230,190,.2)); }
.chart-area { fill: url(#areaGradient); opacity: .32; }
.chart-label { fill: var(--muted); font-size: 10px; }
.chart-dot { fill: var(--panel-solid); stroke: var(--brand); stroke-width: 3; }

.allocation-layout { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 22px; align-items: center; }
.donut { width: 170px; aspect-ratio: 1; border-radius: 50%; position: relative; display: grid; place-items: center; background: conic-gradient(var(--brand) 0 40%, var(--brand-2) 40% 73%, var(--accent) 73% 100%); box-shadow: inset 0 0 30px rgba(0,0,0,.12); }
.donut:after { content: ""; width: 105px; aspect-ratio: 1; border-radius: 50%; background: var(--panel-solid); box-shadow: 0 0 0 1px var(--line); }
.donut-center { position: absolute; z-index: 1; text-align: center; }
.donut-center strong { display: block; font-size: 1.35rem; }
.donut-center small { color: var(--muted); }
.legend { display: grid; gap: 12px; }
.legend-row { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; font-size: .78rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-row span:nth-child(2) { color: var(--muted); }

.progress-list { display: grid; gap: 15px; }
.progress-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .76rem; margin-bottom: 8px; }
.progress-item-head span { color: var(--muted); }
.progress-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; width: var(--value,0%); background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; transition: width .8s var(--ease); }

.insight-list { display: grid; gap: 10px; }
.insight { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); display: flex; gap: 11px; align-items: flex-start; }
.insight-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: rgba(113,183,255,.1); color: var(--info); }
.insight strong { font-size: .77rem; display: block; margin: 1px 0 5px; }
.insight p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.insight.warn .insight-icon { background: rgba(255,202,107,.1); color: var(--warn); }
.insight.good .insight-icon { background: rgba(98,217,168,.1); color: var(--good); }

.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.segmented button { border: 0; background: transparent; color: var(--muted); min-height: 34px; padding: 0 12px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: .76rem; }
.segmented button.active { color: var(--text); background: var(--panel-solid); box-shadow: var(--shadow-soft); }
.search-box { min-width: min(310px, 100%); position: relative; }
.search-box .input { padding-left: 40px; min-height: 42px; }
.search-box .icon { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: var(--faint); }

.table-card { overflow: hidden; }
.table-scroll { overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th { position: sticky; top: 0; z-index: 2; color: var(--muted); background: var(--panel-solid); text-align: left; padding: 13px 15px; white-space: nowrap; font-size: .69rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
td { padding: 14px 15px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody tr:last-child td { border-bottom: 0; }
.cell-title { font-weight: 750; color: var(--text); }
.cell-sub { display: block; color: var(--muted); font-size: .67rem; margin-top: 4px; }
.amount-positive { color: var(--good); font-weight: 800; }
.amount-negative { color: var(--bad); font-weight: 800; }
.row-actions { display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--muted); font-size: .66rem; font-weight: 750; }
.chip.good { color: var(--good); border-color: rgba(98,217,168,.2); background: rgba(98,217,168,.06); }
.chip.warn { color: var(--warn); border-color: rgba(255,202,107,.2); background: rgba(255,202,107,.06); }
.chip.bad { color: var(--bad); border-color: rgba(255,127,143,.2); background: rgba(255,127,143,.06); }
.empty-state { min-height: 260px; padding: 38px; display: grid; place-items: center; text-align: center; }
.empty-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 15px; color: var(--brand); background: rgba(99,230,190,.08); border: 1px solid rgba(99,230,190,.14); }
.empty-state h3 { margin: 0 0 8px; }
.empty-state p { color: var(--muted); margin: 0 0 17px; max-width: 460px; line-height: 1.6; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-select { min-height: 42px; width: auto; min-width: 150px; }
.summary-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.summary-item { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.summary-item small { color: var(--muted); display: block; margin-bottom: 8px; }
.summary-item strong { font-size: 1.15rem; }

.report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.report-grid .wide { grid-column: 1/-1; }
.metric-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.metric-tile { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.metric-tile small { color: var(--muted); display: block; margin-bottom: 7px; line-height: 1.35; }
.metric-tile strong { font-size: 1.08rem; }
.risk-range { display: grid; gap: 14px; }
.risk-range-row { padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.risk-range-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: .75rem; }
.range-track { height: 10px; border-radius: 999px; background: var(--line); position: relative; }
.range-target { position: absolute; top: 0; bottom: 0; left: var(--min); width: calc(var(--max) - var(--min)); border-radius: inherit; background: rgba(108,140,255,.32); }
.range-actual { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: var(--brand); top: 50%; left: var(--actual); transform: translate(-50%,-50%); box-shadow: 0 0 0 5px rgba(99,230,190,.12); }

.goal-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.goal-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); position: relative; overflow: hidden; }
.goal-card:after { content:""; position:absolute; width:90px; height:90px; border-radius:50%; background:rgba(99,230,190,.07); right:-28px; top:-28px; }
.goal-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.goal-card h3 { margin: 0; font-size: .95rem; }
.goal-card p { color: var(--muted); font-size: .7rem; margin: 5px 0 19px; }
.goal-amount { font-size: 1.45rem; font-weight: 850; letter-spacing: -.04em; margin-bottom: 10px; }
.goal-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .68rem; margin-top: 9px; }
.local-only { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: .68rem; }

.settings-grid { display: grid; grid-template-columns: minmax(240px,.65fr) minmax(0,1.35fr); gap: 18px; }
.settings-nav { padding: 8px; height: fit-content; }
.settings-nav button { width: 100%; text-align: left; min-height: 44px; border: 0; border-radius: 10px; padding: 0 12px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.settings-nav button.active { color: var(--text); background: var(--panel-2); }
.setting-section { padding: 22px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy strong { font-size: .84rem; display: block; margin-bottom: 5px; }
.setting-copy p { color: var(--muted); font-size: .71rem; margin: 0; line-height: 1.5; max-width: 580px; }
.switch { width: 46px; height: 26px; border-radius: 99px; background: var(--line-strong); border: 0; position: relative; cursor: pointer; transition: .2s; flex: 0 0 auto; }
.switch:after { content:""; position:absolute; width:20px; height:20px; border-radius:50%; background:white; top:3px; left:3px; transition:.22s var(--ease); box-shadow:0 2px 8px rgba(0,0,0,.22); }
.switch.on { background: var(--brand); }
.switch.on:after { left:23px; }
.privacy-panel { padding: 18px; border-radius: 15px; border: 1px solid rgba(99,230,190,.18); background: rgba(99,230,190,.05); margin-bottom: 17px; }
.privacy-panel strong { display: flex; align-items: center; gap: 8px; color: var(--brand); }
.privacy-panel p { color: var(--muted); font-size: .73rem; line-height: 1.65; margin: 10px 0 0; }

.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.54); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 18px; animation: fadeIn .18s ease both; }
.modal { width: min(720px,100%); max-height: min(88vh,900px); overflow: auto; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--panel-solid); box-shadow: var(--shadow); animation: modalIn .28s var(--ease) both; }
.modal-sm { width: min(470px,100%); }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.12rem; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: .72rem; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
@keyframes fadeIn { from { opacity:0; } }
@keyframes modalIn { from { opacity:0; transform:translateY(14px) scale(.985); } }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 400; display: grid; gap: 10px; width: min(390px, calc(100vw - 40px)); }
.toast { padding: 14px 15px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel-solid); box-shadow: var(--shadow); display: flex; gap: 11px; align-items: flex-start; animation: toastIn .3s var(--ease) both; }
.toast.good { border-color: rgba(98,217,168,.28); }
.toast.bad { border-color: rgba(255,127,143,.28); }
.toast .icon { margin-top: 1px; }
.toast.good .icon { color: var(--good); }
.toast.bad .icon { color: var(--bad); }
.toast strong { font-size: .77rem; display: block; margin-bottom: 4px; }
.toast p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
@keyframes toastIn { from { opacity:0; transform:translateX(18px); } }

.loading-shell { min-height: 50vh; display: grid; place-items: center; text-align: center; }
.loader { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 0 auto 13px; }
@keyframes spin { to { transform:rotate(360deg); } }
.skeleton { color: transparent !important; border-radius: 7px; background: linear-gradient(90deg, var(--line), rgba(255,255,255,.08), var(--line)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.dropdown { position: fixed; z-index: 120; width: 270px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--panel-solid); box-shadow: var(--shadow); animation: modalIn .2s var(--ease) both; }
.dropdown-head { padding: 10px 11px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.dropdown-head strong { font-size: .82rem; }
.dropdown-head p { margin: 4px 0 0; color: var(--muted); font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown button, .dropdown a { width: 100%; min-height: 39px; border: 0; background: transparent; color: var(--muted); padding: 0 10px; border-radius: 9px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .76rem; font-weight: 700; }
.dropdown button:hover, .dropdown a:hover { background: var(--panel-2); color: var(--text); }
.dropdown .danger { color: var(--bad); }

.privacy-mask .money, .privacy-mask [data-sensitive="true"] { filter: blur(8px); user-select: none; }
.privacy-mask .money:hover, .privacy-mask [data-sensitive="true"]:hover { filter: blur(5px); }

.offline-banner { padding: 8px 14px; text-align: center; background: rgba(255,202,107,.12); color: var(--warn); font-size: .72rem; border-bottom: 1px solid rgba(255,202,107,.18); }
.noscript { margin: 10vh auto; max-width: 600px; padding: 30px; text-align: center; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .goal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 940px) {
  :root { --sidebar: 246px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-showcase { min-height: 520px; }
  .auth-panel { min-height: 700px; }
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .report-grid, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --topbar: 70px; }
  .auth-showcase { padding: 28px 22px; min-height: 560px; }
  .auth-copy { margin: 55px 0; }
  .auth-panel { margin: 10px; padding: 26px 20px; min-height: 640px; }
  .market-strip { grid-template-columns: 1fr; }
  .market-chip:nth-child(n+2) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .page-heading p, .user-meta, .topbar-actions .desktop-only { display: none; }
  .content { padding: 18px 14px 32px; }
  .kpi-grid, .summary-strip, .goal-grid, .metric-list { grid-template-columns: 1fr; }
  .allocation-layout { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .page-actions-left, .page-actions-right { width: 100%; }
  .search-box { width: 100%; min-width: 0; }
  .filter-select { flex: 1; min-width: 130px; }
  .modal-backdrop { padding: 8px; align-items: end; }
  .modal { max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-foot { position: sticky; bottom: 0; background: var(--panel-solid); }
  .toast-region { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .report-grid .wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
  #ambient, .sidebar, .topbar, .page-actions, .btn, .icon-btn { display:none !important; }
  .main-wrap { margin:0; }
  body { background:white; color:#111; }
  .card, .kpi-card, .hero-card { box-shadow:none; border:1px solid #ddd; background:white; break-inside:avoid; }
  .content { padding:0; max-width:none; }
}

/* Restricted-access notice and privacy-policy links */
.auth-registration-notice { margin-top: 18px; padding: 15px 16px; border: 1px solid rgba(255,202,107,.24); border-radius: 13px; background: rgba(255,202,107,.065); }
.auth-registration-notice strong { display: flex; align-items: center; gap: 8px; color: var(--warn); font-size: .82rem; }
.auth-registration-notice p { margin: 8px 0 10px; color: var(--muted); font-size: .74rem; line-height: 1.55; }
.registration-contacts { display: flex; flex-wrap: wrap; gap: 7px 10px; }
.registration-contacts a, .auth-note a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.registration-contacts a { font-size: .71rem; }
