:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #080d18;
  --surface: #101827;
  --surface-high: #152033;
  --border: #26344c;
  --text: #eef3fb;
  --muted: #9aa9bf;
  --blue: #78aaff;
  --green: #58d692;
  --red: #ff7b86;
  --amber: #f1b764;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 78% -10%, #172746 0, transparent 34rem), var(--bg); color: var(--text); }
a { color: #a6c8ff; text-decoration: none; }
a:hover { color: #d5e5ff; }
.page-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(73, 91, 121, .42); background: rgba(8, 13, 24, .88); backdrop-filter: blur(16px); }
.site-nav { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-weight: 760; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #07101f; background: linear-gradient(135deg, #8fb9ff, #5be3a0); box-shadow: 0 8px 28px rgba(73, 142, 255, .24); }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.user-chip { padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: rgba(21, 32, 51, .7); }
.logout-form { margin: 0; }
.logout-form button { padding: 0; border: 0; color: #a6c8ff; background: transparent; font: inherit; cursor: pointer; }
.logout-form button:hover { color: #d5e5ff; }
.page-content { padding-block: 48px 72px; }
.hero { padding: 42px 0 12px; }
.eyebrow, .section-kicker { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1 { max-width: 900px; margin: 10px 0 12px; font-size: clamp(34px, 5vw, 58px); line-height: 1.04; letter-spacing: -.045em; }
h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.018em; }
.lead { max-width: 780px; margin: 0; color: #adbad0; font-size: 17px; line-height: 1.65; }
.lead.compact { max-width: 700px; font-size: 15px; }
.system-status, .freshness { display: inline-flex; align-items: center; gap: 9px; margin-top: 21px; padding: 9px 13px; border: 1px solid #29466e; border-radius: 999px; color: #c3d1e5; background: #0e192b; font-size: 13px; white-space: nowrap; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px rgba(88, 214, 146, .9); }
.freshness.stale { border-color: #654b29; background: #211a12; }
.freshness.stale .status-dot { background: var(--amber); box-shadow: 0 0 14px rgba(241, 183, 100, .8); }
.hero-actions { margin-top: 26px; }
.button { display: inline-flex; padding: 11px 16px; border-radius: 10px; font-weight: 700; }
.button.primary { color: #07101f; background: linear-gradient(135deg, #8fb9ff, #63d9a0); }
.surface { border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(145deg, rgba(20, 31, 50, .96), rgba(13, 21, 35, .96)); box-shadow: 0 18px 55px rgba(0, 0, 0, .16); }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 36px; }
.module-card { padding: 21px; }
.module-card p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.callout { margin-top: 28px; padding: 16px 18px; border-radius: 12px; line-height: 1.5; }
.callout.warning { border: 1px solid #5a4226; background: #211a13; color: #f0cea1; }
.callout.safe { border: 1px solid #24533f; background: #10231d; color: #a9dfc4; }
.page-footer { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; font-size: 14px; }
.page-heading { margin-bottom: 30px; }
.split-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.split-heading .freshness { margin-top: 4px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.metrics-grid.three { grid-template-columns: repeat(3, 1fr); }
.metric-card { min-height: 138px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-card.emphasis { border-color: #3c659c; background: linear-gradient(145deg, #162b49, #102238); }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin: 12px 0 3px; font-size: clamp(23px, 3vw, 32px); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric-card small, td small { display: block; margin-top: 5px; color: #7f8fa8; font-size: 12px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.neutral { color: var(--text); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 16px; margin: 16px 0; }
.panel { padding: 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.allocation-list { display: grid; gap: 17px; }
.allocation-meta { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; color: #cbd5e4; font-size: 13px; }
.allocation-meta span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.allocation-track { height: 8px; overflow: hidden; border-radius: 999px; background: #1d293d; }
.allocation-track span { display: block; min-width: 3px; height: 100%; border-radius: inherit; background: #78aaff; }
.allocation-track .asset-bonds { background: #5dd7a0; }
.allocation-track .asset-funds { background: #b492ff; }
.allocation-track .asset-currencies { background: #f2bd6f; }
.allocation-track .asset-futures { background: #ef7e91; }
.allocation-track .asset-options { background: #d88cf2; }
.allocation-track .asset-structured { background: #66ced8; }
.compact-facts { display: grid; gap: 11px; margin: 21px 0; }
.compact-facts div { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 10px; border-bottom: 1px solid rgba(59, 75, 101, .55); }
.compact-facts dt { color: var(--muted); }
.compact-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-link, .table-link { font-weight: 700; }
.table-panel { margin-top: 16px; padding-inline: 0; }
.table-panel .panel-heading, .table-panel > .empty-state { padding-inline: 22px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 18px; border-top: 1px solid rgba(52, 68, 94, .62); text-align: left; vertical-align: middle; }
th { color: #8595ad; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
td { color: #cbd5e4; }
td strong { color: var(--text); }
th.number, td.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-count { display: inline-grid; place-items: center; min-width: 25px; height: 25px; padding: 0 7px; border-radius: 999px; color: #cfe0ff; background: #203555; font-size: 12px; font-weight: 800; }
.empty-state { color: var(--muted); line-height: 1.55; }
.breadcrumbs { display: flex; gap: 9px; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.auth-shell { min-height: calc(100vh - 220px); display: grid; place-items: center; }
.auth-card { width: min(100%, 480px); padding: 30px; }
.auth-card h1 { margin-bottom: 12px; font-size: 38px; }
.auth-form { display: grid; gap: 10px; margin-top: 26px; }
.auth-form label { margin-top: 8px; color: #b5c2d4; font-size: 13px; font-weight: 700; }
.auth-form input { width: 100%; padding: 12px 13px; border: 1px solid #354663; border-radius: 10px; outline: none; color: var(--text); background: #0c1422; font: inherit; }
.auth-form input:focus { border-color: #6d9ce4; box-shadow: 0 0 0 3px rgba(109, 156, 228, .15); }
.auth-form .button { justify-content: center; margin-top: 14px; border: 0; cursor: pointer; }
.form-error { margin-top: 20px; padding: 12px 14px; border: 1px solid #6b3340; border-radius: 10px; color: #ffc0c6; background: #2a151c; }
.message-list { display: grid; gap: 10px; margin-bottom: 24px; }
.message-list__item { padding: 12px 14px; border: 1px solid #34527e; border-radius: 10px; color: #cfe0ff; background: #10203a; }
.message-list__item_success { border-color: #24533f; color: #a9dfc4; background: #10231d; }
.message-list__item_error { border-color: #6b3340; color: #ffc0c6; background: #2a151c; }
.watch-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-reasons__item { padding: 5px 8px; border: 1px solid #334a6c; border-radius: 999px; color: #bdd2f1; background: #17263d; font-size: 11px; white-space: nowrap; }
.data-state { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; font-weight: 700; white-space: nowrap; }
.data-state::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.data-state_stale { color: var(--amber); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions__form { margin: 0; }
.row-actions__button { padding: 7px 9px; border: 1px solid #405778; border-radius: 8px; color: #cfe0ff; background: #17253a; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.row-actions__button:hover { border-color: #6d94cb; background: #1d3150; }
.row-actions__button_danger { border-color: #633844; color: #ffc0c6; background: #2a1720; }
.watchlist-search { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 16px; margin-top: 16px; }
.watchlist-search__panel { min-width: 0; }
.inline-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 20px; }
.inline-search__label { grid-column: 1 / -1; color: #b5c2d4; font-size: 13px; font-weight: 700; }
.inline-search__input, .stacked-search__input { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #354663; border-radius: 10px; outline: none; color: var(--text); background: #0c1422; font: inherit; }
.inline-search__input:focus, .stacked-search__input:focus { border-color: #6d9ce4; box-shadow: 0 0 0 3px rgba(109, 156, 228, .15); }
.inline-search__button { border: 0; cursor: pointer; }
.catalog-results { display: grid; gap: 8px; margin-top: 18px; }
.catalog-results__item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; border: 1px solid rgba(52, 68, 94, .62); border-radius: 10px; background: rgba(10, 18, 31, .5); }
.catalog-results__item small { display: block; margin-top: 4px; color: var(--muted); }
.stacked-search { display: grid; gap: 10px; margin-top: 18px; }
.stacked-search__label { color: #b5c2d4; font-size: 13px; font-weight: 700; }
.stacked-search__button { justify-content: center; border: 0; cursor: pointer; }
.search-history { display: grid; gap: 7px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(52, 68, 94, .62); }
.search-history__item { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; }
.search-history__item small { color: var(--muted); }

@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .split-heading { display: block; }
  .watchlist-search { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-shell { width: min(100% - 24px, 1180px); }
  .page-content { padding-block: 32px 52px; }
  .site-nav { min-height: 58px; }
  .brand span:last-child { display: none; }
  .nav-links { gap: 13px; }
  .user-chip { display: none; }
  .metrics-grid, .metrics-grid.three { grid-template-columns: 1fr; }
  .metric-card { min-height: 118px; }
  .allocation-meta { align-items: flex-start; flex-direction: column; gap: 3px; }
  th, td { padding: 13px 14px; }
  .inline-search { grid-template-columns: 1fr; }
  .inline-search__label { grid-column: auto; }
}
