:root {
  color-scheme: dark;
  --bg: #090b0d;
  --surface: #111519;
  --surface-2: #171c21;
  --surface-3: #20262c;
  --line: rgba(224, 216, 199, .14);
  --line-strong: rgba(224, 216, 199, .26);
  --text: #f0ece4;
  --muted: #9f9b93;
  --muted-2: #6e706f;
  --gold: #d7a844;
  --gold-soft: #f0ce77;
  --amber: #e9813e;
  --jade: #55a98f;
  --teal: #67b9aa;
  --vermilion: #dd5746;
  --blue: #7797bd;
  --violet: #9b8ac5;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --shadow: 0 22px 80px rgba(0, 0, 0, .38);
  --rail: 124px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 62% 3%, rgba(215, 168, 68, .055), transparent 28rem),
    linear-gradient(140deg, #080a0c 0%, #0c0f12 52%, #090b0d 100%);
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--rail);
  padding: 24px 12px 16px; border-right: 1px solid var(--line);
  background: rgba(8, 10, 12, .92); backdrop-filter: blur(18px);
  display: flex; flex-direction: column; align-items: stretch;
}
.brand { color: var(--text); text-decoration: none; display: grid; justify-items: center; gap: 5px; font-weight: 650; margin-bottom: 28px; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 15px; font-size: 19px; letter-spacing: -.04em; background: linear-gradient(145deg, rgba(255,255,255,.08), transparent); }
.nav-list { display: grid; gap: 8px; }
.nav-item {
  min-height: 66px; border: 1px solid transparent; border-radius: 14px; background: transparent;
  color: var(--muted); text-decoration: none; cursor: pointer; display: grid; justify-items: center; align-content: center; gap: 6px;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.nav-item span { font-size: 12px; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); transform: translateY(-1px); }
.nav-item.is-active { color: var(--gold-soft); border-color: rgba(215,168,68,.18); background: linear-gradient(120deg, rgba(215,168,68,.16), rgba(215,168,68,.04)); box-shadow: inset 3px 0 0 var(--gold); }
.rail-foot { margin-top: auto; padding: 10px 0; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted-2); font-size: 11px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 4px rgba(85,169,143,.1); }

.main { grid-column: 2; min-width: 0; margin-left: 0; padding: 0 28px 36px; }
.topbar { min-height: 82px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 4px; color: var(--gold); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.topbar-date { margin: 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.register-trigger { min-height: 44px; border: 1px solid rgba(239,189,70,.42); border-radius: 13px; padding: 0 14px; color: #1a1305; background: linear-gradient(135deg, var(--gold-soft), #cf9130); box-shadow: 0 9px 24px rgba(215,168,68,.16); display: inline-flex; align-items: center; gap: 7px; font-weight: 760; cursor: pointer; }
.register-trigger svg { width: 17px; height: 17px; }
.search-trigger { min-width: 310px; height: 44px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 0 12px; cursor: pointer; }
.search-trigger span { flex: 1; text-align: left; }
kbd { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 2px 7px; color: var(--muted-2); font-size: 11px; }
.segment { display: flex; border: 1px solid var(--line); border-radius: 13px; padding: 3px; background: rgba(0,0,0,.2); }
.segment button { min-width: 52px; min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 650; }
.segment button[aria-pressed="true"] { color: #17120a; background: linear-gradient(145deg, var(--gold-soft), #a87923); box-shadow: 0 0 24px rgba(215,168,68,.2); }
.segment.compact button { min-width: auto; padding: 0 10px; display: flex; align-items: center; gap: 5px; font-size: 12px; }
.segment.compact svg { width: 15px; height: 15px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; position: relative; }
.icon-button .status-dot { position: absolute; right: 1px; top: 2px; }

.loading-panel, .error-panel { margin: 28px 0; min-height: 160px; border: 1px solid var(--line); border-radius: var(--radius-lg); display: grid; place-items: center; color: var(--muted); background: var(--surface); }
.loading-panel { animation: breathe 1.8s ease-in-out infinite; }
.error-panel { padding: 30px; justify-items: start; align-content: center; gap: 10px; }
.error-panel button { border: 1px solid var(--gold); background: transparent; color: var(--gold-soft); border-radius: 9px; padding: 9px 14px; cursor: pointer; }
@keyframes breathe { 50% { opacity: .55; } }
.dashboard { padding-top: 24px; }

.hero-grid { display: grid; grid-template-columns: minmax(330px, .82fr) minmax(600px, 1.8fr); gap: 18px; }
.wealth-overview, .map-panel, .trend-panel, .equation-band, .insight-panel { border: 1px solid var(--line); background: linear-gradient(150deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); box-shadow: var(--shadow); }
.wealth-overview { border-radius: var(--radius-lg); padding: 30px 28px; display: flex; flex-direction: column; min-height: 440px; position: relative; overflow: hidden; }
.wealth-overview::after { content: ""; position: absolute; inset: auto -80px -100px auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(215,168,68,.11), transparent 68%); pointer-events: none; }
.wealth-overview h1 { margin: 2px 0 10px; font-size: clamp(25px, 2vw, 38px); font-weight: 500; letter-spacing: -.03em; }
.hero-value { border: 0; background: transparent; padding: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; }
.hero-value span { font-size: clamp(38px, 3.15vw, 56px); line-height: .98; font-weight: 730; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-value svg { color: var(--gold); opacity: .6; }
.secondary-value { margin: 10px 0 16px; color: #c9c3b9; font-size: clamp(18px, 1.6vw, 27px); font-variant-numeric: tabular-nums; }
.freshness { color: var(--muted); display: flex; align-items: center; gap: 9px; font-size: 12px; margin: 0; }
.mini-equation { margin-top: auto; padding-top: 26px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; }
.mini-metric { border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.mini-metric span, .mini-metric strong { display: block; }
.mini-metric span { color: var(--muted); font-size: 12px; }
.mini-metric strong { margin-top: 4px; font-size: clamp(16px, 1.4vw, 22px); font-variant-numeric: tabular-nums; }
.mini-metric.is-debt strong { color: #ee8f82; }

.map-panel { min-width: 0; border-radius: var(--radius-lg); padding: 20px; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.panel-intro { margin: 4px 0 8px; color: var(--muted); font-size: 12px; }
.asset-map { position: relative; height: 338px; border-top: 1px solid var(--line); margin-top: 10px; perspective: 900px; overflow: hidden; background: radial-gradient(ellipse at 52% 55%, rgba(215,168,68,.06), transparent 45%); }
.asset-map::before { content: ""; position: absolute; inset: 18% 12% 4%; transform: rotateX(64deg); transform-origin: center; background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(ellipse, black 40%, transparent 78%); }
.map-connections { position: absolute; inset: 13% 8% 5%; width: 84%; height: 80%; overflow: visible; }
.map-connections path { stroke: rgba(224,216,199,.26); stroke-width: .38; fill: none; vector-effect: non-scaling-stroke; }
.map-connections path.danger { stroke: rgba(221,87,70,.62); }
.asset-node { --node: var(--gold); position: absolute; border: 0; background: transparent; padding: 0; cursor: pointer; width: 128px; min-height: 92px; color: var(--text); text-align: center; transition: transform .25s var(--ease), filter .25s var(--ease); }
.asset-node:hover, .asset-node:focus-visible { transform: translateY(-5px); filter: brightness(1.15); }
.asset-node.is-selected .volume { box-shadow: 0 0 0 1px var(--node), 0 0 28px color-mix(in srgb, var(--node) 34%, transparent); }
.volume { position: relative; display: block; margin: 0 auto 8px; width: 68px; height: 44px; border: 1px solid color-mix(in srgb, var(--node) 78%, white); border-radius: 7px; background: linear-gradient(145deg, color-mix(in srgb, var(--node) 38%, #111), color-mix(in srgb, var(--node) 7%, #0b0d0f)); transform: rotateX(56deg) rotateZ(-35deg); box-shadow: 10px 14px 30px rgba(0,0,0,.42); }
.volume::before, .volume::after { content: ""; position: absolute; inset: 7px -1px -7px 5px; border: 1px solid color-mix(in srgb, var(--node) 52%, transparent); border-radius: inherit; z-index: -1; }
.volume::after { inset: 14px -2px -14px 10px; opacity: .55; }
.layers-4 { width: 110px; height: 72px; }
.layers-1::before, .layers-1::after { display: none; }
.layers-2::after { display: none; }
.node-copy { display: grid; line-height: 1.2; text-shadow: 0 2px 9px #000; }
.node-copy strong { font-size: 11px; font-weight: 600; }
.node-copy span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.node-building { --node: var(--gold); left: 43%; top: 31%; width: 170px; }
.node-cash { --node: var(--teal); left: 11%; top: 15%; }
.node-investments { --node: var(--jade); left: 20%; top: 64%; }
.node-loans { --node: var(--violet); right: 11%; top: 13%; }
.node-rent { --node: var(--amber); right: 4%; top: 65%; }
.node-debt { --node: var(--vermilion); right: 6%; top: 37%; }
.map-inspector { position: absolute; left: 2%; bottom: 2%; width: min(230px, 31%); padding: 14px; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(10,12,14,.82); backdrop-filter: blur(16px); display: grid; gap: 3px; box-shadow: 0 16px 50px rgba(0,0,0,.4); }
.inspector-kicker { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: 9px; }
.map-inspector strong { font-size: 15px; }
.inspector-value { font-size: 20px; font-weight: 720; font-variant-numeric: tabular-nums; }
#inspector-share { color: var(--gold-soft); font-size: 11px; }
.map-inspector p { margin: 4px 0; color: var(--muted); font-size: 10px; }
.map-inspector button { border: 0; padding: 5px 0 0; background: transparent; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 4px; font-size: 11px; }
.map-inspector button svg { width: 14px; height: 14px; }
.map-summary { margin: 0; color: var(--muted-2); font-size: 10px; }
.asset-map.mode-2d { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 0 90px; overflow-y: auto; perspective: none; }
.asset-map.mode-2d::before, .asset-map.mode-2d .map-connections { display: none; }
.asset-map.mode-2d .asset-node { position: static; width: auto; min-height: 56px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; text-align: left; }
.asset-map.mode-2d .asset-node:hover, .asset-map.mode-2d .asset-node:focus-visible { transform: none; border-color: var(--node); }
.asset-map.mode-2d .volume { width: 28px; height: 22px; margin: 0; transform: none; flex: 0 0 auto; }
.asset-map.mode-2d .volume::before, .asset-map.mode-2d .volume::after { display: none; }

.trend-panel { margin-top: 18px; border-radius: var(--radius-lg); padding: 18px 20px 14px; }
.text-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.text-button:hover { color: var(--gold-soft); }
.text-button svg { width: 14px; height: 14px; }
.chart-summary { margin: 4px 0 8px; color: var(--muted); font-size: 11px; }
.chart-wrap { width: 100%; min-height: 160px; }
#trend-chart { display: block; width: 100%; height: 175px; overflow: visible; }
#trend-chart .grid-line { stroke: rgba(255,255,255,.065); stroke-width: 1; }
#trend-chart .area { fill: url(#chart-fill); }
#trend-chart .trend-line { fill: none; stroke: var(--gold-soft); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
#trend-chart .point { fill: var(--surface); stroke: var(--gold-soft); stroke-width: 2; cursor: pointer; }
#trend-chart .point:hover, #trend-chart .point:focus { fill: var(--gold-soft); outline: none; }
#trend-chart text { fill: var(--muted-2); font-size: 10px; font-family: inherit; }
.chart-event { min-height: 28px; border-top: 1px solid var(--line); padding-top: 9px; color: var(--muted); font-size: 11px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.chart-event strong { color: var(--text); }
.chart-event span:last-child { flex-basis: 100%; color: var(--muted-2); }

.equation-band { margin-top: 18px; border-radius: var(--radius-lg); padding: 15px 20px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr 1.1fr; align-items: center; gap: 12px; }
.equation-item { min-width: 0; min-height: 73px; border: 0; background: transparent; padding: 8px 14px; text-align: left; cursor: pointer; border-left: 2px solid currentColor; }
.equation-item span, .equation-item strong, .equation-item small { display: block; }
.equation-item span { color: var(--muted); font-size: 11px; }
.equation-item strong { color: var(--text); margin: 3px 0; font-size: clamp(17px, 1.45vw, 24px); font-variant-numeric: tabular-nums; }
.equation-item small { color: var(--muted-2); font-size: 9px; }
.equation-item.available { border-left: 1px solid var(--line-strong); padding-left: 22px; }
.operator { color: var(--muted-2); font-size: 25px; }
.tone-jade { color: var(--jade); }.tone-red { color: var(--vermilion); }.tone-gold { color: var(--gold); }.tone-blue { color: var(--blue); }

.insight-grid { display: grid; grid-template-columns: .9fr .9fr 1.1fr 1.05fr; gap: 12px; margin-top: 14px; }
.insight-panel { border-radius: var(--radius-md); padding: 16px; min-height: 200px; }
.insight-panel .panel-heading h2 { font-size: 14px; display: flex; align-items: center; gap: 7px; }
.insight-panel .panel-heading h2 svg { color: var(--vermilion); width: 18px; }
.panel-value { display: block; margin: 18px 0 12px; font-size: 26px; font-variant-numeric: tabular-nums; }
.metric-list { margin: 14px 0 0; display: grid; gap: 12px; }
.metric-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.metric-list dt { color: var(--muted); font-size: 11px; }
.metric-list dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 12px; }
.metric-list .total { margin-top: 3px; border-top: 1px solid var(--line); padding-top: 12px; }
.metric-list .total dd { font-size: 14px; }
.compact-list { gap: 9px; }
.positive { color: #7fcab0; }.negative { color: #ef7766; }
.count-badge { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 8px; background: rgba(221,87,70,.12); color: #f48777; font-size: 11px; }
.alert-list { margin-top: 10px; display: grid; }
.alert-item { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 10px 0; display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 9px; text-align: left; cursor: pointer; }
.alert-item:first-child { border-top: 0; }
.alert-marker { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--amber); }
.alert-item.is-critical .alert-marker { background: var(--vermilion); box-shadow: 0 0 0 4px rgba(221,87,70,.1); }
.alert-copy { display: grid; }
.alert-copy strong { font-size: 11px; }
.alert-copy span { color: var(--muted-2); font-size: 9px; }
.alert-amount { color: #ef7766; font-weight: 650; font-size: 11px; font-variant-numeric: tabular-nums; }

dialog { color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(6px); }
.sheet-dialog { width: min(520px, calc(100vw - 30px)); border: 1px solid var(--line-strong); border-radius: 20px; background: #111519; padding: 0; box-shadow: var(--shadow); }
.dialog-head { padding: 22px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; }
.dialog-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 20px; }
#detail-content { padding: 20px 22px 26px; }
.detail-list { display: grid; gap: 0; }
.detail-row { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-row span { color: var(--muted); }
.detail-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.detail-note { color: var(--muted); font-size: 12px; }
.register-content { padding: 20px 22px 22px; }
.register-intro { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.register-kind-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.register-kind { min-height: 72px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); color: var(--muted); padding: 10px; text-align: left; cursor: pointer; display: grid; gap: 3px; }
.register-kind strong { color: var(--text); font-size: 13px; }
.register-kind span { font-size: 11px; line-height: 1.25; }
.register-kind[aria-pressed="true"] { border-color: rgba(239,189,70,.55); background: linear-gradient(145deg, rgba(239,189,70,.16), rgba(239,189,70,.05)); box-shadow: inset 0 0 0 1px rgba(255,214,109,.12); }
.register-form { display: grid; gap: 14px; }
.register-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.register-fields .full { grid-column: 1 / -1; }
.register-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.register-field input, .register-field select { min-height: 43px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: rgba(0,0,0,.16); color: var(--text); font: inherit; }
.register-preview { border: 1px solid rgba(75,195,159,.22); border-radius: 12px; padding: 12px; background: rgba(75,195,159,.055); }
.register-preview strong { display: block; font-size: 13px; }
.register-preview p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.register-note { margin: 0; color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.register-actions { display: flex; justify-content: flex-end; gap: 9px; }
.register-drafts { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.register-drafts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.register-drafts-head strong { font-size: 12px; }
.register-drafts-head span { color: var(--muted-2); font-size: 11px; }
.register-draft { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.055); color: var(--muted); font-size: 12px; }
.register-draft:first-of-type { border-top: 0; }
.register-draft span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-remove { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.search-dialog { width: min(650px, calc(100vw - 30px)); max-height: min(620px, 80vh); border: 1px solid var(--line-strong); border-radius: 18px; padding: 0; background: #111519; box-shadow: var(--shadow); }
.search-box { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 15px; border-bottom: 1px solid var(--line); }
.search-box input { width: 100%; border: 0; background: transparent; color: var(--text); outline: 0; font-size: 17px; }
.search-results { padding: 8px; max-height: 480px; overflow-y: auto; }
.search-result { width: 100%; border: 0; border-radius: 10px; background: transparent; color: var(--text); padding: 12px; display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus-visible { background: var(--surface-3); }
.search-result small { color: var(--gold); }
.search-result span { color: var(--muted); }
.empty-result { color: var(--muted); padding: 30px; text-align: center; }
.toast { position: fixed; z-index: 60; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: #1b2024; box-shadow: var(--shadow); }
.context-help { position: fixed; z-index: 90; width: max-content; max-width: min(280px, calc(100vw - 24px)); padding: 9px 11px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: rgba(24,30,35,.94); color: #e9eeeb; box-shadow: 0 12px 34px rgba(0,0,0,.34); backdrop-filter: blur(16px) saturate(125%); font-size: 11px; line-height: 1.42; pointer-events: auto; animation: context-help-in .16s var(--ease) both; }
.context-help[hidden] { display: none; }
[data-help-visible="true"] { outline-offset: 3px; }
@keyframes context-help-in { from { opacity: 0; transform: translateY(3px) scale(.985); } to { opacity: 1; transform: none; } }

/* Cuentas base: preparación aislada hasta validar su procedencia. */
.account-setup-content { padding: 20px 22px 22px; }
.account-setup-intro { margin: 0 0 17px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.account-setup-form { display: grid; gap: 9px; }
.account-setup-labels, .account-setup-row { display: grid; grid-template-columns: minmax(0, 1.25fr) 82px minmax(0, .9fr) 36px; gap: 8px; align-items: center; }
.account-setup-labels { color: var(--muted-2); font-size: 10px; padding: 0 2px; }
.account-setup-rows { display: grid; gap: 8px; }
.account-setup-row { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: rgba(255,255,255,.025); }
.account-setup-row input, .account-setup-row select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: rgba(0,0,0,.15); color: var(--text); font: inherit; }
.account-row-remove { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.account-row-remove:hover, .account-row-remove:focus-visible { border-color: rgba(239,119,102,.7); color: #f28a7c; }
.account-setup-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 5px; }
.account-setup-status { margin: 16px 0 0; color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.account-setup-note { margin: 12px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.account-setup-mobile-label { display: none; }

/* Edificio: selector espacial y registro manual de alquileres */
.building-dashboard { padding-top: 22px; }
.building-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.building-heading h1 { margin: 0; font-size: clamp(30px, 3vw, 44px); letter-spacing: -.045em; }
.building-heading > div > p:last-child { margin: 3px 0 0; color: var(--muted); }
.manual-badge { margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 8px; }

.rent-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.032), rgba(255,255,255,.012)); box-shadow: var(--shadow); }
.rent-summary .metric-card { min-width: 0; min-height: 108px; border: 0; padding: 22px 24px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; gap: 3px 12px; align-items: center; position: relative; background: transparent; text-align: left; cursor: pointer; }
.rent-summary .metric-card + .metric-card::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 1px; background: var(--line); }
.rent-summary svg { grid-row: 1 / 3; color: var(--gold); width: 26px; height: 26px; }
.rent-summary span { color: var(--muted); font-size: 11px; }
.rent-summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(19px, 1.65vw, 28px); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.rent-summary .is-positive svg { color: var(--jade); }
.rent-summary .is-pending svg, .rent-summary .is-pending strong { color: #ef7766; }

.building-workspace { margin-top: 16px; display: grid; grid-template-columns: minmax(650px, 1.8fr) minmax(330px, .78fr); gap: 16px; }
.building-visual, .payment-inspector, .rent-history-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(150deg, rgba(255,255,255,.032), rgba(255,255,255,.009)); box-shadow: var(--shadow); }
.building-visual { min-width: 0; padding: 20px 22px; overflow: hidden; }
.visual-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.visual-heading h2 { margin: 0; font-size: 17px; }
.visual-hint { color: var(--muted-2); font-size: 10px; }
.apartment-system { min-height: 500px; display: grid; grid-template-columns: minmax(260px, .9fr) minmax(300px, 1.1fr); align-items: center; gap: 26px; position: relative; }
.apartment-system::before { content: ""; position: absolute; inset: 10% 4% 2%; background: radial-gradient(ellipse at 31% 76%, rgba(215,168,68,.11), transparent 39%); pointer-events: none; }

.apartment-stack { height: 430px; display: flex; flex-direction: column; justify-content: end; align-items: center; perspective: 1100px; transform-style: preserve-3d; position: relative; isolation: isolate; }
.apartment-stack::before { content: ""; position: absolute; bottom: 1px; width: 255px; height: 52px; border-radius: 50%; background: radial-gradient(ellipse, rgba(215,168,68,.2), rgba(0,0,0,.65) 58%, transparent 72%); filter: blur(7px); z-index: -1; }
.apartment-module { --module-edge: rgba(224,216,199,.22); width: min(270px, 90%); height: 65px; margin-top: -4px; border: 1px solid var(--module-edge); border-radius: 9px; background: linear-gradient(115deg, #101419 0 22%, #1d2329 22% 68%, #101419 68%); box-shadow: 0 16px 28px rgba(0,0,0,.4), inset 0 1px rgba(255,255,255,.06); transform: rotateX(54deg) rotateZ(-17deg); transform-origin: center; cursor: pointer; position: relative; display: grid; place-items: center; transition: transform .26s var(--ease), border-color .26s var(--ease), filter .26s var(--ease), box-shadow .26s var(--ease); }
.apartment-module::before { content: ""; position: absolute; inset: 8px 13px; border: 1px solid rgba(255,255,255,.065); border-radius: 5px; background: linear-gradient(90deg, rgba(255,255,255,.018), rgba(255,255,255,.055), rgba(255,255,255,.014)); }
.apartment-module::after { content: ""; position: absolute; width: 4px; height: 4px; right: 18px; top: 16px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px color-mix(in srgb, var(--amber) 72%, transparent); }
.apartment-module span { z-index: 1; color: #d8d4cc; font-size: 18px; font-weight: 720; text-shadow: 0 2px 10px #000; transform: rotateZ(17deg) rotateX(-30deg); }
.apartment-module:hover, .apartment-module:focus-visible { transform: rotateX(54deg) rotateZ(-17deg) translate3d(5px,-5px,8px); filter: brightness(1.18); }
.apartment-module.is-selected { --module-edge: var(--gold-soft); transform: rotateX(54deg) rotateZ(-17deg) translate3d(10px,-7px,14px); box-shadow: 0 0 0 1px rgba(215,168,68,.4), 0 0 36px rgba(215,168,68,.18), 0 18px 32px rgba(0,0,0,.48); }
.apartment-module.is-paid { --module-edge: rgba(85,169,143,.55); }
.apartment-module.is-paid::after { background: var(--jade); box-shadow: 0 0 12px rgba(85,169,143,.65); }
.apartment-module.is-unknown { opacity: .52; }
.apartment-module.is-unknown::after { background: var(--muted-2); box-shadow: none; }

.apartment-list { display: grid; gap: 8px; position: relative; z-index: 1; }
.apartment-row { min-height: 62px; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: rgba(8,10,12,.38); padding: 4px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px; transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease); }
.apartment-row:hover { background: rgba(255,255,255,.035); transform: translateX(2px); }
.apartment-row.is-selected { border-color: var(--gold); background: linear-gradient(90deg, rgba(215,168,68,.12), rgba(215,168,68,.025)); box-shadow: 0 0 22px rgba(215,168,68,.08); }
.apartment-row-main { min-width: 0; min-height: 52px; border: 0; border-radius: 9px; background: transparent; padding: 6px 8px; cursor: pointer; display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 10px; text-align: left; touch-action: pan-y; }
.apartment-state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(233,129,62,.08); }
.apartment-row.is-paid .apartment-state-dot { background: var(--jade); box-shadow: 0 0 0 4px rgba(85,169,143,.08); }
.apartment-row.is-unknown .apartment-state-dot { background: var(--muted-2); box-shadow: none; }
.apartment-row-copy { min-width: 0; display: grid; }
.apartment-row-copy strong { font-size: 12px; }
.apartment-row-copy small { color: var(--amber); font-size: 10px; }
.apartment-row.is-paid .apartment-row-copy small { color: var(--jade); }
.apartment-row.is-unknown .apartment-row-copy small { color: var(--muted-2); }
.apartment-row-main > strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.row-action { min-width: 98px; min-height: 44px; border: 1px solid rgba(215,168,68,.34); border-radius: 9px; background: rgba(215,168,68,.09); color: var(--gold-soft); padding: 0 10px; cursor: pointer; font-size: 10px; font-weight: 690; }
.row-action:hover, .row-action:focus-visible { border-color: var(--gold); background: rgba(215,168,68,.16); }
.row-action.is-quick-pay { min-width: 44px; width: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 27px; font-weight: 300; line-height: 1; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 24px rgba(215,168,68,.08); }
.row-action.is-quick-pay:hover, .row-action.is-quick-pay:focus-visible { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 28px rgba(215,168,68,.14); }
.row-action.is-edit { border-color: var(--line); background: rgba(255,255,255,.025); color: var(--muted); }

.payment-inspector { min-height: 540px; padding: 26px; display: flex; flex-direction: column; align-self: stretch; }
.inspector-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.payment-inspector h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.payment-inspector .apartment-name { margin: 3px 0 0; color: var(--muted); }
.state-pill { padding: 5px 10px; border: 1px solid rgba(233,129,62,.4); border-radius: 999px; color: #f0b277; background: rgba(233,129,62,.08); font-size: 10px; white-space: nowrap; }
.state-pill.is-paid { border-color: rgba(85,169,143,.4); color: #84cbb5; background: rgba(85,169,143,.08); }
.state-pill.is-unknown { border-color: var(--line); color: var(--muted); background: transparent; }
.inspector-month { margin: 22px 0 6px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.inspector-amount { margin: 8px 0 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: clamp(36px, 3.3vw, 54px); line-height: 1; font-weight: 740; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.inspector-field { display: grid; gap: 7px; margin-bottom: 16px; }
.inspector-field label, .payment-record dt, .rent-reversal-content label { color: var(--muted); font-size: 11px; }
.inspector-field input, .rent-reversal-content input { height: 45px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.2); color: var(--text); padding: 0 12px; color-scheme: dark; }
.primary-action, .secondary-action, .danger-action { min-height: 48px; border-radius: 11px; padding: 0 16px; cursor: pointer; font-weight: 680; }
.primary-action { border: 0; color: #17120a; background: linear-gradient(145deg, #f0ce77, #b98225); box-shadow: 0 8px 28px rgba(215,168,68,.17); }
.primary-action:disabled { cursor: not-allowed; opacity: .38; box-shadow: none; }
.secondary-action { border: 1px solid var(--line); color: var(--text); background: transparent; }
.compact-action { min-height: 40px; padding: 0 13px; font-size: 12px; }
.view-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.view-heading-actions .compact-action { display: inline-flex; align-items: center; gap: 7px; border-color: rgba(255,255,255,.17); background: rgba(255,255,255,.045); color: #edf2ee; }
.view-heading-actions [data-entity-draft-count] { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: rgba(101,208,179,.14); color: #79d9bf; font-size: 10px; line-height: 18px; text-align: center; }

.entity-draft-content { padding: 20px 22px 22px; }
.entity-draft-intro { margin: 0 0 17px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.entity-draft-form { display: grid; gap: 16px; }
.entity-draft-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.entity-draft-fields .full { grid-column: 1 / -1; }
.entity-draft-form .primary-action { justify-self: end; }
.entity-draft-note { margin: 13px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.entity-draft-list { margin-top: 18px; border-top: 1px solid var(--line); }
.entity-draft-list h3 { display: flex; justify-content: space-between; margin: 0; padding: 15px 0 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.entity-draft-list h3 span { color: var(--text); font-variant-numeric: tabular-nums; }
.entity-draft-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.entity-draft-row > div { min-width: 0; display: grid; gap: 3px; }
.entity-draft-row strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.entity-draft-row span { color: var(--muted); font-size: 11px; }
.danger-action { border: 1px solid rgba(221,87,70,.45); color: #f28a7c; background: rgba(221,87,70,.08); }
.inspector-note { margin: auto 0 0; padding-top: 18px; color: var(--muted-2); font-size: 10px; display: flex; gap: 8px; }
.payment-record { margin: 0 0 18px; display: grid; gap: 10px; }
.payment-record div { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.payment-record dd { margin: 0; font-size: 12px; text-align: right; }

.rent-history-panel { margin-top: 16px; padding: 20px 22px; }
.rent-history { min-height: 94px; margin-top: 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.history-unit { min-width: 0; border-top: 1px solid var(--line); padding: 13px 8px 5px; display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; }
.history-unit .apartment-state-dot { margin-top: 4px; }
.history-unit strong { font-size: 11px; }
.history-unit span:last-child { grid-column: 2; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.history-event { grid-column: 1 / -1; min-height: 48px; border-top: 1px solid var(--line); padding: 10px 4px; display: grid; grid-template-columns: 110px minmax(0,1fr) auto; align-items: center; gap: 12px; }
.history-event span { color: var(--muted); font-size: 10px; }
.history-event strong { font-size: 11px; }
.history-event b { font-size: 12px; font-variant-numeric: tabular-nums; }
.history-event.is-reversal b { color: #ef7766; }
.rent-history .empty-state { grid-column: 1 / -1; margin: 0; padding: 23px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.rent-reversal-content { padding: 22px; display: grid; gap: 12px; }
.rent-reversal-content p { margin: 0; }
.delete-payment-zone { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; }
.delete-payment-zone p { display: grid; gap: 3px; }
.delete-payment-zone p strong { font-size: 12px; }
.delete-payment-zone p span { color: var(--muted); font-size: 10px; }

@media (max-width: 1180px) {
  :root { --rail: 92px; }
  .hero-grid { grid-template-columns: 1fr; }
  .wealth-overview { min-height: 330px; }
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-item span { font-size: 11px; }
  .search-trigger { min-width: 240px; }
  .building-workspace { grid-template-columns: 1fr; }
  .payment-inspector { min-height: 420px; }
}

@media (max-width: 760px) {
  :root { --rail: 0px; }
  body { padding-bottom: 78px; }
  .app-shell { display: block; }
  .main { grid-column: auto; margin-left: 0; padding: 0 14px 24px; }
  .rail { inset: auto 8px 8px; width: auto; height: 66px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 18px; flex-direction: row; background: rgba(12,15,18,.94); }
  .brand, .rail-foot { display: none; }
  .nav-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; width: 100%; }
  .nav-item { min-width: 0; min-height: 54px; border-radius: 12px; gap: 2px; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .nav-item.is-active { box-shadow: inset 0 2px 0 var(--gold); }
  .topbar { min-height: 70px; position: sticky; top: 0; z-index: 12; background: rgba(9,11,13,.92); backdrop-filter: blur(16px); }
  .topbar > div:first-child { min-width: 0; }
  .topbar > div:first-child .eyebrow { display: none; }
  .topbar-date { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 6px; }
  .search-trigger { min-width: 42px; width: 42px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd, .icon-button { display: none; }
  .register-trigger { width: 42px; padding: 0; justify-content: center; }
  .register-trigger span { display: none; }
  .segment:not(.compact) button { min-width: 42px; }
  .dashboard { padding-top: 14px; }
  .wealth-overview { min-height: 310px; padding: 24px 20px; }
  .hero-value span { font-size: clamp(34px, 10vw, 44px); }
  .hero-value svg { display: none; }
  .mini-equation { gap: 8px; }
  .map-panel { padding: 16px; }
  .asset-map { height: 390px; }
  .asset-map.mode-3d { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 0 98px; overflow-y: auto; perspective: none; }
  .asset-map.mode-3d::before, .asset-map.mode-3d .map-connections { display: none; }
  .asset-map.mode-3d .asset-node { position: static; width: auto; min-height: 74px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; align-items: center; gap: 10px; text-align: left; }
  .asset-map.mode-3d .node-copy { min-width: 0; }
  .asset-map.mode-3d .node-copy strong, .asset-map.mode-3d .node-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .asset-map.mode-3d .volume { width: 38px; height: 28px; margin: 0; transform: rotateX(50deg) rotateZ(-34deg); flex: 0 0 auto; }
  .map-inspector { left: 0; right: 0; width: auto; bottom: 2px; }
  .trend-panel { padding: 16px 12px; }
  .chart-wrap { overflow-x: auto; }
  #trend-chart { width: 800px; }
  .equation-band { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .operator { display: none; }
  .equation-item { border-left-width: 1px; }
  .equation-item.available { padding-left: 14px; }
  .insight-grid { grid-template-columns: 1fr; }
  .insight-panel { min-height: auto; }
  .building-heading { align-items: start; }
  .manual-badge { display: none; }
  .rent-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rent-summary .metric-card { min-height: 88px; padding: 16px; }
  .rent-summary .metric-card:nth-child(3)::before { display: none; }
  .rent-summary .metric-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rent-summary strong { font-size: 19px; }
  .building-workspace { display: block; }
  .building-visual { padding: 16px 12px; }
  .visual-hint { display: none; }
  .apartment-system { min-height: auto; grid-template-columns: 1fr; gap: 10px; }
  .apartment-stack { height: 380px; }
  .apartment-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apartment-row { min-height: 66px; }
  .row-action { min-width: 92px; }
  .row-action.is-quick-pay { min-width: 44px; }
  .delete-payment-zone { grid-template-columns: 1fr; }
  .payment-inspector { margin-top: 12px; min-height: 400px; padding: 22px 18px; }
  .rent-history { grid-template-columns: 1fr; }
  .history-event { grid-template-columns: 80px minmax(0,1fr); }
  .history-event b { grid-column: 2; }
}

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

@media (forced-colors: active) {
  .status-dot, .alert-marker { forced-color-adjust: none; }
  .volume { background: Canvas; border-color: CanvasText; }
  .apartment-module { background: Canvas; border-color: CanvasText; }
}

/* Dirección visual aprobada: centro patrimonial espacial, luminoso y sobrio. */
body.spatial-light {
  --bg: #e8ebe7;
  --surface: rgba(250, 250, 247, .78);
  --surface-2: rgba(239, 242, 238, .84);
  --surface-3: #dfe4df;
  --line: rgba(29, 34, 33, .12);
  --line-strong: rgba(29, 34, 33, .2);
  --text: #141716;
  --muted: #5c6461;
  --muted-2: #737b77;
  --gold: #9a6919;
  --gold-soft: #d8ae55;
  --amber: #a95426;
  --jade: #347863;
  --teal: #367a70;
  --vermilion: #b54335;
  --blue: #496d92;
  --violet: #6e5f8f;
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --shadow: 0 30px 80px rgba(61, 70, 66, .13), 0 2px 8px rgba(61, 70, 66, .05);
  --rail: 110px;
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.98) 0 8%, transparent 31%),
    radial-gradient(circle at 83% 2%, rgba(255,255,255,.94) 0 10%, transparent 34%),
    linear-gradient(135deg, #e4e8e5 0%, #f4f3ee 46%, #dfe6e3 100%);
  color: var(--text);
  color-scheme: light;
}

body.spatial-light::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(255,255,255,.72) 7% 7.4%, transparent 7.4% 91%, rgba(255,255,255,.6) 91% 91.4%, transparent 91.4%),
    linear-gradient(112deg, transparent 0 20%, rgba(255,255,255,.42) 20% 21%, transparent 21% 72%, rgba(255,255,255,.35) 72% 73%, transparent 73%),
    linear-gradient(180deg, rgba(255,255,255,.32), transparent 55%);
}

body.spatial-light::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  width: 54vw;
  height: 54vw;
  right: -17vw;
  bottom: -24vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160, 180, 167, .2), rgba(255,255,255,.07) 42%, transparent 68%);
  filter: blur(16px);
  animation: ambient-drift 18s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
  to { transform: translate3d(-2.5vw, -1.5vw, 0) scale(1.04); }
}

.spatial-light :focus-visible { outline-color: #171a19; outline-width: 2px; }
.spatial-light .app-shell { position: relative; }
.spatial-light .main { padding: 0 34px 56px; }

.spatial-light .rail {
  inset: 20px auto 20px 18px;
  width: 82px;
  padding: 16px 8px 12px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 28px;
  background: rgba(247, 248, 244, .58);
  box-shadow: 0 24px 70px rgba(51, 60, 56, .14), inset 0 1px 0 rgba(255,255,255,.88);
  backdrop-filter: blur(28px) saturate(118%);
}
.spatial-light .brand { margin-bottom: 20px; color: var(--text); font-size: 11px; }
.spatial-light .brand-mark { width: 48px; height: 48px; border-color: rgba(22,25,24,.14); border-radius: 17px; background: rgba(255,255,255,.5); box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.spatial-light .nav-list { gap: 5px; }
.spatial-light .nav-item { min-height: 58px; border-radius: 18px; color: #626a67; }
.spatial-light .nav-item:hover { color: #151817; background: rgba(255,255,255,.58); }
.spatial-light .nav-item.is-active { color: #f5f5f1; border-color: rgba(20,23,22,.9); background: #1b1e1d; box-shadow: 0 12px 28px rgba(27,30,29,.18); }
.spatial-light .nav-item.is-active svg { color: #e7c36c; }
.spatial-light .rail-foot { color: #68706d; }

.spatial-light .topbar {
  min-height: 66px;
  margin-top: 16px;
  padding: 9px 12px 9px 16px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: rgba(248, 249, 246, .54);
  box-shadow: 0 16px 44px rgba(60, 69, 65, .09), inset 0 1px 0 rgba(255,255,255,.86);
  backdrop-filter: blur(26px) saturate(120%);
}
.spatial-light .eyebrow { color: #8b621e; }
.spatial-light .topbar-date { color: #626a67; }
.spatial-light .search-trigger { border-color: rgba(27,31,30,.12); background: rgba(255,255,255,.55); color: #606865; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.spatial-light kbd { border-color: rgba(27,31,30,.12); background: rgba(238,240,236,.8); color: #666d6a; }
.spatial-light .segment { border-color: rgba(27,31,30,.13); background: rgba(255,255,255,.44); }
.spatial-light .segment button { color: #69706d; }
.spatial-light .segment button[aria-pressed="true"] { color: #f8f7f2; background: #1c1f1e; box-shadow: 0 8px 18px rgba(25,28,27,.16); }
.spatial-light .icon-button { border-color: rgba(27,31,30,.13); background: rgba(255,255,255,.52); }

.spatial-light .loading-panel,
.spatial-light .error-panel,
.spatial-light .wealth-overview,
.spatial-light .map-panel,
.spatial-light .trend-panel,
.spatial-light .equation-band,
.spatial-light .insight-panel {
  border-color: rgba(255,255,255,.72);
  background: rgba(249, 250, 247, .53);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(24px) saturate(112%);
}
.spatial-light .node-copy { text-shadow: none; }
.spatial-light .node-copy span { color: #606865; }
.spatial-light .asset-map { background: radial-gradient(ellipse at 52% 55%, rgba(154,105,25,.1), transparent 45%); }
.spatial-light .asset-map::before { background-image: linear-gradient(rgba(28,32,31,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(28,32,31,.07) 1px, transparent 1px); }
.spatial-light .map-connections path { stroke: rgba(34,39,37,.3); }
.spatial-light .map-inspector { color: #f5f5f1; border-color: rgba(255,255,255,.14); background: rgba(27,30,29,.9); box-shadow: 0 20px 50px rgba(30,34,32,.18); }
.spatial-light .map-inspector p { color: #c1c6c3; }
.spatial-light #trend-chart .grid-line { stroke: rgba(26,30,29,.08); }
.spatial-light #trend-chart .point { fill: #f7f7f3; }
.spatial-light .positive { color: #2f745d; }
.spatial-light .negative,
.spatial-light .alert-amount { color: #a83f32; }

.spatial-light .building-dashboard {
  position: relative;
  isolation: isolate;
  padding-top: 34px;
  animation: spatial-reveal .7s var(--ease) both;
}
@keyframes spatial-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.spatial-light .building-heading { min-height: 142px; align-items: end; margin-bottom: 18px; padding: 4px 6px; }
.spatial-light .building-heading h1 { font-size: clamp(58px, 7vw, 104px); font-weight: 390; line-height: .86; letter-spacing: -.04em; }
.spatial-light .building-heading > div > p:last-child { margin-top: 14px; color: #5d6562; font-size: 15px; }
.spatial-light .manual-badge { border-color: rgba(27,31,30,.12); background: rgba(255,255,255,.48); color: #59615e; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); backdrop-filter: blur(18px); }

.spatial-light .rent-summary {
  border-color: rgba(255,255,255,.76);
  border-radius: 28px;
  background: rgba(249,250,247,.55);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.92);
  backdrop-filter: blur(26px) saturate(115%);
  overflow: hidden;
}
.spatial-light .rent-summary .metric-card { min-height: 118px; padding: 24px 26px; }
.spatial-light .rent-summary .metric-card + .metric-card::before { background: rgba(29,34,33,.1); }
.spatial-light .rent-summary svg { color: #1b1e1d; }
.spatial-light .rent-summary span { color: #626966; }
.spatial-light .rent-summary strong { font-weight: 550; color: #171a19; }
.spatial-light .rent-summary .is-positive svg { color: var(--jade); }
.spatial-light .rent-summary .is-pending svg,
.spatial-light .rent-summary .is-pending strong { color: #a84135; }

.spatial-light .building-workspace { margin-top: 18px; grid-template-columns: minmax(650px, 1.72fr) minmax(330px, .72fr); gap: 18px; }
.spatial-light .building-visual,
.spatial-light .rent-history-panel {
  border-color: rgba(255,255,255,.76);
  border-radius: 32px;
  background: rgba(249,250,247,.45);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.92);
  backdrop-filter: blur(28px) saturate(114%);
}
.spatial-light .building-visual { padding: 26px 28px; }
.spatial-light .visual-heading h2 { font-size: 19px; font-weight: 560; }
.spatial-light .visual-hint { color: #626a67; }
.spatial-light .apartment-system::before { background: radial-gradient(ellipse at 30% 74%, rgba(147,117,58,.17), transparent 42%); }

.spatial-light .apartment-stack::before { background: radial-gradient(ellipse, rgba(68,80,74,.22), rgba(255,255,255,.08) 56%, transparent 74%); filter: blur(11px); }
.spatial-light .apartment-module {
  --module-edge: rgba(57,66,62,.21);
  border-color: var(--module-edge);
  background: linear-gradient(115deg, rgba(213,220,216,.94) 0 22%, rgba(249,250,247,.92) 22% 68%, rgba(205,214,209,.88) 68%);
  box-shadow: 0 20px 34px rgba(56,66,61,.18), inset 0 1px rgba(255,255,255,.95);
}
.spatial-light .apartment-module::before { border-color: rgba(43,49,46,.09); background: linear-gradient(90deg, rgba(255,255,255,.2), rgba(255,255,255,.7), rgba(255,255,255,.16)); }
.spatial-light .apartment-module span { color: #1d211f; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.spatial-light .apartment-module:hover,
.spatial-light .apartment-module:focus-visible { filter: brightness(1.03); }
.spatial-light .apartment-module.is-selected { --module-edge: #9c6c1f; box-shadow: 0 0 0 1px rgba(156,108,31,.3), 0 17px 40px rgba(91,70,29,.2), inset 0 1px rgba(255,255,255,.95); }
.spatial-light .apartment-module.is-paid { --module-edge: rgba(52,120,99,.58); }

.spatial-light .apartment-list { gap: 9px; }
.spatial-light .apartment-row { border-color: rgba(35,40,38,.1); border-radius: 17px; background: rgba(255,255,255,.48); box-shadow: inset 0 1px 0 rgba(255,255,255,.88); }
.spatial-light .apartment-row:hover { background: rgba(255,255,255,.72); }
.spatial-light .apartment-row.is-selected { border-color: rgba(27,31,30,.65); background: rgba(255,255,255,.74); box-shadow: 0 12px 28px rgba(55,64,60,.09); }
.spatial-light .apartment-row-copy small { color: #9b4c26; }
.spatial-light .apartment-row.is-paid .apartment-row-copy small { color: #2f745d; }
.spatial-light .row-action { color: #202422; }
.spatial-light .row-action.is-quick-pay { border-color: #1c201e; background: #1c201e; color: #f7f6f1; box-shadow: 0 9px 22px rgba(28,32,30,.16); }
.spatial-light .row-action.is-quick-pay:hover,
.spatial-light .row-action.is-quick-pay:focus-visible { border-color: #8e641f; background: #8e641f; color: white; box-shadow: 0 12px 28px rgba(99,75,31,.2); }
.spatial-light .row-action.is-edit { border-color: rgba(27,31,30,.13); background: rgba(255,255,255,.56); color: #454b48; }

.spatial-light .payment-inspector {
  min-height: 570px;
  border-color: rgba(255,255,255,.14);
  border-radius: 32px;
  color: #f5f5f1;
  background: linear-gradient(145deg, rgba(33,37,35,.96), rgba(20,23,22,.98));
  box-shadow: 0 30px 75px rgba(35,41,38,.2), inset 0 1px 0 rgba(255,255,255,.08);
}
.spatial-light .payment-inspector .apartment-name,
.spatial-light .payment-inspector .inspector-month,
.spatial-light .payment-inspector .inspector-field label,
.spatial-light .payment-inspector .payment-record dt { color: #b9c0bc; }
.spatial-light .payment-inspector .inspector-amount,
.spatial-light .payment-inspector .payment-record div { border-color: rgba(255,255,255,.12); }
.spatial-light .payment-inspector .state-pill { border-color: rgba(216,174,85,.4); color: #e9c979; background: rgba(216,174,85,.1); }
.spatial-light .payment-inspector .state-pill.is-paid { border-color: rgba(103,179,151,.38); color: #91d1b8; background: rgba(74,143,117,.12); }
.spatial-light .payment-inspector .inspector-field input { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #f6f5f0; color-scheme: dark; }
.spatial-light .payment-inspector .primary-action { color: #17130b; background: linear-gradient(145deg, #efd88f, #c79435); box-shadow: 0 12px 34px rgba(198,151,54,.19); }
.spatial-light .payment-inspector .secondary-action { border-color: rgba(255,255,255,.18); color: #f4f3ef; background: rgba(255,255,255,.05); }
.spatial-light .payment-inspector .inspector-note { color: #9da6a1; }

.spatial-light .rent-history-panel { margin-top: 18px; padding: 24px 28px; }
.spatial-light .history-unit,
.spatial-light .history-event { border-color: rgba(29,34,33,.11); }
.spatial-light .history-unit span:last-child,
.spatial-light .history-event span { color: #606865; }

.spatial-light dialog { color: #171a19; }
.spatial-light dialog::backdrop { background: rgba(38,45,41,.36); backdrop-filter: blur(12px); }
.spatial-light .sheet-dialog,
.spatial-light .search-dialog { border-color: rgba(255,255,255,.76); background: rgba(248,249,246,.92); box-shadow: 0 30px 90px rgba(44,53,49,.22); backdrop-filter: blur(30px); }
.spatial-light .dialog-close { border-color: rgba(25,29,27,.14); background: rgba(255,255,255,.55); }
.spatial-light .search-box input,
.spatial-light .search-result { color: #171a19; }
.spatial-light .search-result:hover,
.spatial-light .search-result:focus-visible { background: rgba(37,43,40,.07); }
.spatial-light .rent-reversal-content input { border-color: rgba(25,29,27,.14); background: rgba(255,255,255,.65); color: #171a19; color-scheme: light; }
.spatial-light .toast { color: #f5f5f1; border-color: rgba(255,255,255,.16); background: rgba(29,33,31,.94); box-shadow: 0 20px 55px rgba(32,38,35,.24); }

@supports not (backdrop-filter: blur(1px)) {
  .spatial-light .rail,
  .spatial-light .topbar,
  .spatial-light .rent-summary,
  .spatial-light .building-visual,
  .spatial-light .rent-history-panel { background: #f4f5f1; }
}

@media (max-width: 1180px) {
  body.spatial-light { --rail: 94px; }
  .spatial-light .rail { width: 72px; left: 12px; }
  .spatial-light .main { padding-inline: 24px; }
  .spatial-light .building-heading h1 { font-size: clamp(58px, 9vw, 88px); }
  .spatial-light .building-workspace { grid-template-columns: 1fr; }
  .spatial-light .payment-inspector { min-height: 430px; }
}

@media (max-width: 760px) {
  body.spatial-light { --rail: 0px; padding-bottom: 80px; }
  body.spatial-light::before { opacity: .48; }
  .spatial-light .main { padding: 0 12px 24px; }
  .spatial-light .rail {
    inset: auto 8px 8px;
    width: auto;
    height: 68px;
    padding: 5px;
    border-radius: 22px;
    background: rgba(247,248,244,.84);
  }
  .spatial-light .nav-item { min-height: 56px; border-radius: 17px; }
  .spatial-light .nav-item.is-active { box-shadow: 0 7px 18px rgba(27,30,29,.15); }
  .spatial-light .topbar { top: 8px; min-height: 62px; margin-top: 8px; border-radius: 19px; background: rgba(248,249,246,.84); }
  .spatial-light .topbar > div:first-child { display: none; }
  .spatial-light .topbar-actions { width: 100%; justify-content: space-between; }
  .spatial-light .building-dashboard { padding-top: 24px; }
  .spatial-light .building-heading { min-height: 112px; margin-bottom: 12px; }
  .spatial-light .building-heading h1 { font-size: clamp(50px, 17vw, 68px); }
  .spatial-light .building-heading > div > p:last-child { margin-top: 9px; }
  .spatial-light .rent-summary { border-radius: 24px; }
  .spatial-light .rent-summary .metric-card { min-height: 92px; padding: 16px; }
  .spatial-light .rent-summary strong { font-size: 18px; }
  .spatial-light .building-workspace { display: block; min-width: 0; }
  .spatial-light .building-visual { padding: 20px 14px; border-radius: 26px; }
  .spatial-light .apartment-stack { height: 350px; }
  .spatial-light .apartment-list { grid-template-columns: 1fr; }
  .spatial-light .apartment-row { min-height: 64px; }
  .spatial-light .payment-inspector { margin-top: 12px; min-height: 420px; border-radius: 26px; }
  .spatial-light .rent-history-panel { padding: 20px 16px; border-radius: 26px; }
  .spatial-light .sheet-dialog,
  .spatial-light .search-dialog { border-radius: 24px; }
  .spatial-light .register-content { padding: 18px 16px 20px; }
  .spatial-light .register-kind-picker { gap: 6px; }
  .spatial-light .register-kind { min-height: 68px; padding: 8px; }
  .spatial-light .register-fields { grid-template-columns: 1fr; }
  .spatial-light .register-fields .full { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  body.spatial-light::after { animation: none; }
  .spatial-light .building-dashboard { animation: none; }
}

/* Refinamiento aprobado: grafito profundo, vidrio visible y métricas cromáticas. */
body.spatial-light {
  --bg: #080d12;
  --surface: rgba(20, 27, 33, .68);
  --surface-2: rgba(27, 35, 42, .76);
  --surface-3: #222c34;
  --line: rgba(231, 238, 236, .12);
  --line-strong: rgba(231, 238, 236, .22);
  --text: #f3f5f2;
  --muted: #aab3b0;
  --muted-2: #747f7c;
  --gold: #efbd46;
  --gold-soft: #ffd66d;
  --amber: #ff7a3d;
  --jade: #4bc39f;
  --teal: #49b8ae;
  --vermilion: #ff5f4b;
  --blue: #65a2d8;
  --violet: #9b85d0;
  --shadow: 0 28px 85px rgba(0, 5, 10, .42), 0 2px 12px rgba(0,0,0,.22);
  background:
    radial-gradient(circle at 11% 16%, rgba(240, 170, 56, .18), transparent 28%),
    radial-gradient(circle at 76% 8%, rgba(255, 110, 54, .16), transparent 26%),
    radial-gradient(circle at 88% 76%, rgba(62, 178, 153, .12), transparent 27%),
    radial-gradient(circle at 35% 88%, rgba(220, 74, 58, .08), transparent 25%),
    linear-gradient(138deg, #070c11 0%, #101820 44%, #091018 100%);
  color: var(--text);
  color-scheme: dark;
}

body.spatial-light::before {
  opacity: .92;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(255,255,255,.055) 8% 8.1%, transparent 8.1% 91%, rgba(255,255,255,.045) 91% 91.1%, transparent 91.1%),
    linear-gradient(114deg, transparent 0 24%, rgba(255,188,73,.06) 24% 24.2%, transparent 24.2% 73%, rgba(73,184,174,.045) 73% 73.2%, transparent 73.2%),
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(255,255,255,.018) 43px 44px),
    repeating-linear-gradient(90deg, transparent 0 43px, rgba(255,255,255,.018) 43px 44px);
  mask-image: linear-gradient(to bottom, black, rgba(0,0,0,.75) 72%, transparent 100%);
}

body.spatial-light::after {
  width: 62vw;
  height: 62vw;
  right: -20vw;
  bottom: -30vw;
  background: radial-gradient(circle, rgba(255,116,51,.15), rgba(239,189,70,.07) 35%, transparent 67%);
  filter: blur(30px);
}

.spatial-light :focus-visible { outline-color: #ffd66d; }

.spatial-light .rail {
  border-color: rgba(255,255,255,.13);
  background: linear-gradient(165deg, rgba(34,42,48,.68), rgba(12,18,23,.58));
  box-shadow: 0 28px 75px rgba(0,5,10,.42), inset 1px 1px 0 rgba(255,255,255,.12), inset -1px -1px 0 rgba(0,0,0,.18);
  backdrop-filter: blur(30px) saturate(145%);
}
.spatial-light .brand { color: #f2f4f1; }
.spatial-light .brand-mark { border-color: rgba(255,255,255,.16); background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.025)); box-shadow: inset 0 1px 0 rgba(255,255,255,.16); }
.spatial-light .nav-item { color: #9ca7a3; }
.spatial-light .nav-item:hover { color: #f3f5f2; background: rgba(255,255,255,.07); }
.spatial-light .nav-item.is-active { color: #11161a; border-color: rgba(255,211,105,.86); background: linear-gradient(145deg, #ffd972, #d6972f); box-shadow: 0 12px 30px rgba(219,151,42,.22), inset 0 1px 0 rgba(255,255,255,.38); }
.spatial-light .nav-item.is-active svg { color: #17130b; }
.spatial-light .rail-foot { color: #7e8985; }

.spatial-light .topbar {
  border-color: rgba(255,255,255,.13);
  background: linear-gradient(135deg, rgba(36,44,51,.62), rgba(11,17,22,.52));
  box-shadow: 0 18px 55px rgba(0,5,10,.3), inset 0 1px 0 rgba(255,255,255,.13);
  backdrop-filter: blur(30px) saturate(150%);
}
.spatial-light .eyebrow { color: #efbd46; }
.spatial-light .topbar-date { color: #a8b1ae; }
.spatial-light .search-trigger { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.055); color: #aeb7b4; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.spatial-light kbd { border-color: rgba(255,255,255,.12); background: rgba(0,0,0,.18); color: #8d9894; }
.spatial-light .segment { border-color: rgba(255,255,255,.12); background: rgba(0,0,0,.16); }
.spatial-light .segment button { color: #9fa9a5; }
.spatial-light .segment:not(.compact) { min-width: 112px; }
.spatial-light .segment:not(.compact) button { min-width: 52px; padding-inline: 10px; }
.spatial-light .segment button[aria-pressed="true"] { color: #17130a; background: linear-gradient(145deg, #ffda72, #d89831); box-shadow: 0 8px 22px rgba(225,157,48,.22); }
.spatial-light .icon-button { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.05); }

.spatial-light .loading-panel,
.spatial-light .error-panel,
.spatial-light .wealth-overview,
.spatial-light .map-panel,
.spatial-light .trend-panel,
.spatial-light .equation-band,
.spatial-light .insight-panel {
  border-color: rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035) 46%, rgba(3,8,12,.32));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.13), inset 0 -1px 0 rgba(0,0,0,.18);
  backdrop-filter: blur(28px) saturate(145%);
}
.spatial-light .node-copy span { color: #9ca7a3; }
.spatial-light .asset-map { background: radial-gradient(ellipse at 52% 55%, rgba(239,189,70,.1), transparent 45%); }
.spatial-light .asset-map::before { background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px); }
.spatial-light .map-connections path { stroke: rgba(226,234,231,.26); }
.spatial-light .map-inspector { background: rgba(7,12,16,.72); backdrop-filter: blur(22px) saturate(150%); }
.spatial-light #trend-chart .grid-line { stroke: rgba(255,255,255,.07); }
.spatial-light #trend-chart .point { fill: #131b21; }
.spatial-light .positive { color: #6bd3b0; }
.spatial-light .negative,
.spatial-light .alert-amount { color: #ff7866; }

.spatial-light .building-heading h1 { color: #f4f5f2; text-shadow: 0 12px 45px rgba(0,0,0,.28); }
.spatial-light .building-heading > div > p:last-child { color: #a9b2af; }
.spatial-light .manual-badge { border-color: rgba(255,255,255,.13); background: rgba(18,25,30,.54); color: #aeb7b4; box-shadow: inset 0 1px 0 rgba(255,255,255,.09); backdrop-filter: blur(22px) saturate(145%); }

.spatial-light .rent-summary {
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.spatial-light .rent-summary .metric-card {
  --metric-accent: #efbd46;
  --metric-glow: rgba(239,189,70,.16);
  min-height: 132px;
  padding: 22px 22px 18px;
  grid-template-rows: auto auto 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 14%, var(--metric-glow), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035) 52%, rgba(3,8,12,.34));
  box-shadow: 0 22px 55px rgba(0,5,10,.28), inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.18);
  backdrop-filter: blur(26px) saturate(150%);
}
.spatial-light .rent-summary .metric-card + .metric-card::before { display: none; }
.spatial-light .rent-summary .metric-card:hover { border-color: rgba(255,255,255,.22); transform: translateY(-2px); }
.spatial-light .rent-summary .metric-expected { --metric-accent: #f4c84f; --metric-glow: rgba(244,200,79,.17); }
.spatial-light .rent-summary .metric-confirmed { --metric-accent: #4cc6a2; --metric-glow: rgba(76,198,162,.15); }
.spatial-light .rent-summary .metric-paid { --metric-accent: #55c9b2; --metric-glow: rgba(85,201,178,.15); }
.spatial-light .rent-summary .metric-pending { --metric-accent: #ff6a43; --metric-glow: rgba(255,106,67,.18); }
.spatial-light .rent-summary svg,
.spatial-light .rent-summary .is-positive svg,
.spatial-light .rent-summary .is-pending svg { color: var(--metric-accent); filter: drop-shadow(0 0 10px var(--metric-glow)); }
.spatial-light .rent-summary span { color: #a8b2ae; }
.spatial-light .rent-summary strong,
.spatial-light .rent-summary .is-pending strong { color: #f4f5f2; font-weight: 620; }
.spatial-light .metric-track { grid-column: 2; align-self: end; display: block; height: 3px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.spatial-light .metric-track i { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--metric-accent), color-mix(in srgb, var(--metric-accent) 48%, white)); box-shadow: 0 0 13px var(--metric-accent); transform: scaleX(var(--metric-scale, 0)); transform-origin: left center; transition: transform .45s var(--ease); }

.spatial-light .building-visual,
.spatial-light .rent-history-panel {
  border-color: rgba(255,255,255,.13);
  background:
    linear-gradient(120deg, rgba(255,255,255,.09), transparent 28%),
    linear-gradient(145deg, rgba(37,46,53,.56), rgba(10,16,21,.48));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.2);
  backdrop-filter: blur(30px) saturate(150%);
}
.spatial-light .visual-heading h2 { color: #f1f3f0; }
.spatial-light .visual-hint { color: #8d9894; }
.spatial-light .apartment-system::before { background: radial-gradient(ellipse at 30% 74%, rgba(239,189,70,.14), transparent 42%); }
.spatial-light .apartment-stack::before { background: radial-gradient(ellipse, rgba(239,189,70,.18), rgba(0,0,0,.55) 58%, transparent 74%); }
.spatial-light .apartment-module {
  --module-edge: rgba(230,238,235,.2);
  border-color: var(--module-edge);
  background:
    linear-gradient(115deg, rgba(31,41,48,.78) 0 22%, rgba(67,79,87,.56) 22% 68%, rgba(16,24,30,.76) 68%),
    linear-gradient(180deg, rgba(255,255,255,.08), transparent);
  box-shadow: 0 22px 38px rgba(0,4,8,.42), inset 0 1px rgba(255,255,255,.12);
  backdrop-filter: blur(18px) saturate(140%);
}
.spatial-light .apartment-module::before { border-color: rgba(255,255,255,.08); background: linear-gradient(90deg, rgba(255,255,255,.02), rgba(255,255,255,.09), rgba(255,255,255,.018)); }
.spatial-light .apartment-module span { color: #f2f4f1; text-shadow: 0 2px 12px rgba(0,0,0,.65); }
.spatial-light .apartment-module.is-selected { --module-edge: #efbd46; box-shadow: 0 0 0 1px rgba(239,189,70,.36), 0 0 34px rgba(239,160,49,.15), 0 22px 38px rgba(0,4,8,.48), inset 0 1px rgba(255,255,255,.14); }
.spatial-light .apartment-module.is-paid { --module-edge: rgba(75,195,159,.62); }

.spatial-light .apartment-row { border-color: rgba(255,255,255,.1); background: rgba(8,14,18,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.055); backdrop-filter: blur(14px); }
.spatial-light .apartment-row:hover { background: rgba(255,255,255,.065); }
.spatial-light .apartment-row.is-selected { border-color: rgba(239,189,70,.72); background: linear-gradient(90deg, rgba(239,189,70,.13), rgba(255,255,255,.035)); box-shadow: 0 12px 30px rgba(0,4,8,.2), inset 0 1px 0 rgba(255,255,255,.07); }
.spatial-light .apartment-row-copy small { color: #ff9b67; }
.spatial-light .apartment-row.is-paid .apartment-row-copy small { color: #6bd3b0; }
.spatial-light .row-action { color: #edf1ee; }
.spatial-light .row-action.is-quick-pay { border-color: rgba(255,211,105,.86); background: linear-gradient(145deg, #ffce5f, #d98e2d); color: #16120a; box-shadow: 0 10px 25px rgba(217,142,45,.22), inset 0 1px 0 rgba(255,255,255,.35); }
.spatial-light .row-action.is-quick-pay:hover,
.spatial-light .row-action.is-quick-pay:focus-visible { border-color: #ffd66d; background: linear-gradient(145deg, #ffe084, #ed9f35); color: #151109; }
.spatial-light .row-action.is-edit { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #adb7b3; }

.spatial-light .payment-inspector {
  border-color: rgba(255,255,255,.14);
  background:
    radial-gradient(circle at 84% 8%, rgba(255,110,54,.13), transparent 32%),
    linear-gradient(145deg, rgba(39,48,55,.78), rgba(9,15,20,.72));
  box-shadow: 0 30px 80px rgba(0,4,9,.45), inset 0 1px 0 rgba(255,255,255,.15), inset 0 -1px 0 rgba(0,0,0,.22);
  backdrop-filter: blur(32px) saturate(155%);
}
.spatial-light .payment-inspector .primary-action { background: linear-gradient(100deg, #ffd66d, #ff963c); box-shadow: 0 12px 34px rgba(239,143,48,.22); }

.spatial-light .history-unit,
.spatial-light .history-event { border-color: rgba(255,255,255,.1); }
.spatial-light .history-unit span:last-child,
.spatial-light .history-event span { color: #9da7a3; }

.spatial-light dialog { color: #f2f4f1; }
.spatial-light dialog::backdrop { background: rgba(1,5,8,.72); backdrop-filter: blur(14px); }
.spatial-light .sheet-dialog,
.spatial-light .search-dialog {
  border-color: rgba(255,255,255,.14);
  background: linear-gradient(145deg, rgba(38,47,54,.92), rgba(8,14,19,.94));
  box-shadow: 0 34px 95px rgba(0,4,8,.55), inset 0 1px 0 rgba(255,255,255,.14);
  backdrop-filter: blur(32px) saturate(145%);
}
.spatial-light .dialog-close { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); }
.spatial-light .search-box input,
.spatial-light .search-result { color: #f2f4f1; }
.spatial-light .search-result:hover,
.spatial-light .search-result:focus-visible { background: rgba(255,255,255,.07); }
.spatial-light .rent-reversal-content input { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #f2f4f1; color-scheme: dark; }

@supports not (backdrop-filter: blur(1px)) {
  .spatial-light .rail,
  .spatial-light .topbar,
  .spatial-light .rent-summary .metric-card,
  .spatial-light .building-visual,
  .spatial-light .payment-inspector,
  .spatial-light .rent-history-panel { background: #182128; }
}

@media (max-width: 760px) {
  .spatial-light .rail { background: rgba(18,25,30,.88); }
  .spatial-light .topbar { background: rgba(20,28,34,.82); }
  .spatial-light .rent-summary { gap: 9px; }
  .spatial-light .rent-summary .metric-card { min-height: 108px; padding: 16px 15px 14px; border-radius: 19px; }
  .spatial-light .rent-summary strong { font-size: 18px; }
  .spatial-light .metric-track { height: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .spatial-light .metric-track i { transition: none; }
}

/* Inicio: composición de control patrimonial, no cuadrícula de tarjetas genéricas. */
.spatial-light .dashboard {
  position: relative;
  isolation: isolate;
}
.spatial-light .dashboard::before {
  content: "PATRIMONIO";
  position: absolute;
  z-index: -1;
  top: 20px;
  right: 1%;
  color: rgba(239,244,241,.035);
  font-size: clamp(82px, 12vw, 196px);
  font-weight: 570;
  line-height: .8;
  letter-spacing: -.08em;
  pointer-events: none;
}
.spatial-light .wealth-overview {
  min-height: 472px;
  background:
    radial-gradient(circle at 76% 10%, rgba(239,189,70,.16), transparent 36%),
    linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.035) 46%, rgba(3,8,12,.44));
}
.spatial-light .wealth-overview h1 { color: #f3f5f2; font-weight: 480; }
.spatial-light .hero-value span { text-shadow: 0 12px 36px rgba(0,0,0,.35); }
.spatial-light .secondary-value { color: #c2cbc7; }
.spatial-light .mini-equation { border-color: rgba(255,255,255,.12); }
.spatial-light .mini-metric span { color: #a9b3af; }
.spatial-light .mini-metric strong { color: #f3f5f2; }
.spatial-light .map-panel { min-height: 472px; background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025) 46%, rgba(3,8,12,.38)); }
.spatial-light .map-panel .panel-intro { color: #a7b1ad; }
.spatial-light .asset-map { height: 338px; border-top-color: rgba(255,255,255,.11); }
.spatial-light .asset-node .volume { filter: drop-shadow(0 12px 18px rgba(0,0,0,.28)); }
.spatial-light .node-copy strong { color: #edf1ee; }
.spatial-light .trend-panel { position: relative; overflow: hidden; background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025) 48%, rgba(3,8,12,.4)); }
.spatial-light .trend-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--gold), var(--amber), var(--teal), transparent 78%); opacity: .8; }
.spatial-light .chart-summary { color: #aeb8b4; }
.spatial-light #trend-chart .trend-line { stroke: #ffd66d; filter: drop-shadow(0 0 6px rgba(255,214,109,.44)); }
.spatial-light #trend-chart .area { opacity: .72; }
.spatial-light .chart-event { border-color: rgba(255,255,255,.1); color: #aab4b0; }
.spatial-light .chart-event strong { color: #f0f3f0; }
.spatial-light .equation-band { gap: 7px; padding: 10px; background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025) 50%, rgba(3,8,12,.36)); }
.spatial-light .equation-item { border-left: 2px solid currentColor; border-radius: 14px; background: rgba(255,255,255,.035); transition: background .2s var(--ease), transform .2s var(--ease); }
.spatial-light .equation-item:hover, .spatial-light .equation-item:focus-visible { background: rgba(255,255,255,.08); transform: translateY(-2px); }
.spatial-light .equation-item span { color: #aab4b0; }
.spatial-light .equation-item strong { color: #f1f4f1; }
.spatial-light .equation-item small { color: #7e8985; }
.spatial-light .equation-item.available { border-left-color: var(--blue); }
.spatial-light .insight-grid { gap: 14px; }
.spatial-light .insight-panel { min-height: 210px; background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025) 48%, rgba(3,8,12,.35)); }
.spatial-light .insight-panel .panel-heading h2 { color: #edf1ee; }
.spatial-light .metric-list dt { color: #a5afab; }

@media (max-width: 760px) {
  .spatial-light .dashboard::before { display: none; }
  .spatial-light .wealth-overview,
  .spatial-light .map-panel { min-height: auto; }
  .spatial-light .segment:not(.compact) { min-width: 88px; }
  .spatial-light .segment:not(.compact) button { min-width: 42px; padding-inline: 5px; }
  .spatial-light .equation-band { gap: 7px; }
  .spatial-light .equation-item { padding: 8px 10px; }
}

/* Dinero: lectura de liquidez y compromisos, sin simular una conexión bancaria. */
.spatial-light .cash-dashboard { padding-top: 28px; }
.spatial-light .cash-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.spatial-light .cash-heading h1 { margin: 0; color: #f3f5f2; font-size: clamp(32px, 3vw, 46px); font-weight: 480; letter-spacing: -.04em; }
.spatial-light .cash-heading > div > p:last-child { margin: 3px 0 0; color: #a9b2af; }
.spatial-light .cash-heading-actions { display: flex; align-items: center; gap: 9px; }
.spatial-light .cash-heading .compact-action { border-color: rgba(255,255,255,.17); background: rgba(255,255,255,.045); color: #edf2ee; }
.spatial-light .cash-hero { display: block; }
.spatial-light .liquidity-focus,
.spatial-light .cash-accounts-panel,
.spatial-light .cash-reserves-panel {
  border: 1px solid rgba(255,255,255,.13);
  background: linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.025) 47%, rgba(3,8,12,.4));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.18);
  backdrop-filter: blur(28px) saturate(145%);
}
.spatial-light .liquidity-focus { min-height: 386px; padding: 30px 28px; border-radius: 24px; position: relative; overflow: hidden; }
.spatial-light .liquidity-focus::after { content: ""; position: absolute; inset: auto -80px -108px auto; width: 295px; height: 295px; border-radius: 50%; background: radial-gradient(circle, rgba(79,201,178,.17), transparent 67%); pointer-events: none; }
.spatial-light .liquidity-value { position: relative; z-index: 1; border: 0; background: transparent; color: #f5f7f3; display: flex; align-items: center; gap: 12px; padding: 0; cursor: pointer; text-align: left; }
.spatial-light .liquidity-value span { font-size: clamp(39px, 3.2vw, 58px); font-weight: 730; letter-spacing: -.04em; line-height: .95; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 12px 36px rgba(0,0,0,.35); }
.spatial-light .liquidity-value svg { color: #69d4bc; }
.spatial-light .liquidity-focus .secondary-value { margin-bottom: 17px; }
.spatial-light .liquidity-equation { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); }
.spatial-light .liquidity-equation button { border: 0; padding: 0; background: transparent; text-align: left; cursor: pointer; }
.spatial-light .liquidity-equation button span,
.spatial-light .liquidity-equation button strong { display: block; }
.spatial-light .liquidity-equation button span { color: #a9b3af; font-size: 11px; }
.spatial-light .liquidity-equation button strong { margin-top: 5px; color: #f0f3f0; font-size: 18px; font-variant-numeric: tabular-nums; }
.spatial-light .liquidity-equation > span { color: #8d9894; }
.spatial-light .cash-workspace { display: grid; grid-template-columns: minmax(500px, 1.35fr) minmax(360px, .9fr); gap: 16px; margin-top: 16px; }
.spatial-light .cash-accounts-panel,
.spatial-light .cash-reserves-panel { min-width: 0; min-height: 322px; padding: 22px; border-radius: 22px; }
.spatial-light .cash-accounts { display: grid; gap: 9px; margin-top: 17px; }
.spatial-light .cash-account { min-height: 72px; width: 100%; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; background: rgba(6,12,16,.27); color: #eef3ef; padding: 11px 13px; display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 13px; align-items: center; text-align: left; cursor: pointer; transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease); }
.spatial-light .cash-account:hover,
.spatial-light .cash-account:focus-visible { transform: translateX(3px); border-color: rgba(105,212,188,.56); background: rgba(255,255,255,.06); }
.spatial-light .account-signal { align-self: stretch; border-radius: 999px; background: linear-gradient(180deg, #71d8c0 var(--account-share), rgba(255,255,255,.11) var(--account-share)); box-shadow: 0 0 12px rgba(105,212,188,.24); }
.spatial-light .account-copy { min-width: 0; display: grid; gap: 2px; }
.spatial-light .account-copy small { color: #8d9894; font-size: 10px; }
.spatial-light .account-copy strong { overflow: hidden; color: #eff3f0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.spatial-light .account-copy em { overflow: hidden; color: #aeb8b4; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.spatial-light .cash-account > b { color: #f3f6f3; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.025em; text-align: right; }
.spatial-light .cash-reserves { display: grid; margin-top: 13px; }
.spatial-light .reserve-row { width: 100%; min-height: 70px; border: 0; border-top: 1px solid rgba(255,255,255,.1); background: transparent; color: #e9efeb; padding: 12px 0; display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 12px; text-align: left; cursor: pointer; transition: background .2s var(--ease), transform .2s var(--ease); }
.spatial-light .reserve-row:hover,
.spatial-light .reserve-row:focus-visible { transform: translateX(4px); background: rgba(255,255,255,.05); }
.spatial-light .reserve-row time { color: #efbd46; font-size: 11px; font-variant-numeric: tabular-nums; text-transform: capitalize; }
.spatial-light .reserve-row span { min-width: 0; display: grid; gap: 3px; }
.spatial-light .reserve-row strong { overflow: hidden; color: #edf2ee; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.spatial-light .reserve-row small { color: #8f9a96; font-size: 10px; }
.spatial-light .reserve-row b { color: #f3f5f2; font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.spatial-light .reserve-row b em { color: #9ca7a2; font-size: 10px; font-style: normal; font-weight: 500; }

@media (max-width: 1180px) {
  .spatial-light .cash-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .spatial-light .cash-dashboard { padding-top: 15px; }
  .spatial-light .cash-heading { align-items: start; margin-bottom: 14px; }
  .spatial-light .cash-heading .manual-badge { display: none; }
  .spatial-light .cash-heading .compact-action { min-height: 38px; }
  .spatial-light .liquidity-focus { min-height: 310px; padding: 24px 20px; }
  .spatial-light .liquidity-value span { font-size: clamp(34px, 10vw, 44px); }
  .spatial-light .liquidity-value svg { display: none; }
  .spatial-light .liquidity-equation { gap: 8px; margin-top: 22px; padding-top: 17px; }
  .spatial-light .liquidity-equation button strong { font-size: 15px; }
  .spatial-light .cash-accounts-panel,
  .spatial-light .cash-reserves-panel { min-height: auto; padding: 17px; }
  .spatial-light .cash-account { grid-template-columns: 5px minmax(0, 1fr); min-height: 78px; }
  .spatial-light .cash-account > b { grid-column: 2; text-align: left; font-size: 16px; }
  .spatial-light .reserve-row { grid-template-columns: 50px minmax(0, 1fr); }
  .spatial-light .reserve-row b { grid-column: 2; text-align: left; }
}

@media (max-width: 560px) {
  .account-setup-content { padding: 18px 16px 20px; }
  .account-setup-labels { display: none; }
  .account-setup-row { grid-template-columns: minmax(0, 1fr) 76px 36px; }
  .account-setup-row label:first-child { grid-column: 1 / -1; }
  .account-setup-row label:last-of-type { grid-column: 1 / 3; }
  .account-setup-actions { align-items: stretch; flex-direction: column; }
  .account-setup-actions .text-button { align-self: flex-start; }
  .account-setup-actions .primary-action { width: 100%; }
  .spatial-light .cash-heading-actions { margin-left: auto; }
  #account-setup-trigger-label { display: none; }
  .account-setup-mobile-label { display: inline; font-size: 12px; }
}

/* Préstamos: cartera seleccionable, riesgo y procedencia del capital. */
.spatial-light .loans-dashboard { padding-top: 28px; }
.spatial-light .loans-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.spatial-light .loans-heading h1 { margin: 0; color: #f3f5f2; font-size: clamp(32px, 3vw, 46px); font-weight: 480; letter-spacing: -.04em; }
.spatial-light .loans-heading > div > p:last-child { margin: 3px 0 0; color: #a9b2af; }
.spatial-light .loans-hero { display: grid; grid-template-columns: minmax(350px, .88fr) minmax(590px, 1.52fr); gap: 16px; }
.spatial-light .loan-total-focus,
.spatial-light .loan-field-panel,
.spatial-light .loan-inspector,
.spatial-light .loan-schedule-panel {
  border: 1px solid rgba(255,255,255,.13);
  background: linear-gradient(145deg, rgba(255,255,255,.095), rgba(255,255,255,.025) 47%, rgba(3,8,12,.4));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.18);
  backdrop-filter: blur(28px) saturate(145%);
}
.spatial-light .loan-total-focus { min-height: 430px; padding: 30px 28px 24px; border-radius: 24px; position: relative; overflow: hidden; }
.spatial-light .loan-total-focus::after { content: ""; position: absolute; inset: auto -95px -125px auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(163,135,238,.18), transparent 68%); pointer-events: none; }
.spatial-light .loan-total-value { position: relative; z-index: 1; border: 0; padding: 0; background: transparent; color: #f5f7f3; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; }
.spatial-light .loan-total-value span { font-size: clamp(39px, 3.1vw, 56px); font-weight: 730; letter-spacing: -.04em; line-height: .95; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 12px 36px rgba(0,0,0,.35); }
.spatial-light .loan-total-value svg { color: #ab90f3; }
.spatial-light .loan-health { position: relative; z-index: 1; display: grid; grid-template-columns: .72fr .72fr 1.25fr; gap: 8px; margin-top: 25px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.spatial-light .loan-health div { min-width: 0; padding: 11px 10px; border-radius: 12px; background: rgba(255,255,255,.035); }
.spatial-light .loan-health span,
.spatial-light .loan-health strong { display: block; }
.spatial-light .loan-health span { color: #9ca6a2; font-size: 10px; }
.spatial-light .loan-health strong { margin-top: 5px; color: #f0f3f0; font-size: 16px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.spatial-light .loan-health .is-critical strong { color: #ff7968; }
.spatial-light .loan-field-panel { min-width: 0; min-height: 430px; padding: 22px; border-radius: 24px; overflow: hidden; position: relative; }
.spatial-light .loan-field-hint { color: #9ca7a2; font-size: 10px; }
.spatial-light .loan-portfolio { position: relative; z-index: 1; display: grid; gap: 10px; margin-top: 22px; padding-left: 8px; }
.spatial-light .loan-portfolio::before { content: ""; position: absolute; left: 34px; top: 20px; bottom: 20px; width: 1px; background: linear-gradient(#ae94f2, rgba(255,255,255,.1), #ff7866); }
.spatial-light .loan-position { --loan-tone: #ae94f2; position: relative; min-height: 94px; width: 100%; border: 1px solid rgba(255,255,255,.11); border-radius: 17px; background: linear-gradient(100deg, rgba(11,17,22,.82), rgba(255,255,255,.035)); color: #edf2ee; padding: 13px 15px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 13px; align-items: center; text-align: left; cursor: pointer; overflow: hidden; transition: transform .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease); }
.spatial-light .loan-position:nth-child(2) { transform: translateX(22px); width: calc(100% - 22px); }
.spatial-light .loan-position:nth-child(3) { transform: translateX(8px); width: calc(100% - 8px); }
.spatial-light .loan-position.is-overdue { --loan-tone: #ff7866; }
.spatial-light .loan-position:hover,
.spatial-light .loan-position:focus-visible { transform: translateX(5px); border-color: color-mix(in srgb, var(--loan-tone) 72%, white); background: linear-gradient(100deg, color-mix(in srgb, var(--loan-tone) 12%, rgba(11,17,22,.82)), rgba(255,255,255,.055)); }
.spatial-light .loan-position:nth-child(2):hover,
.spatial-light .loan-position:nth-child(2):focus-visible { transform: translateX(27px); }
.spatial-light .loan-position.is-selected { border-color: color-mix(in srgb, var(--loan-tone) 82%, white); box-shadow: 0 0 0 1px color-mix(in srgb, var(--loan-tone) 28%, transparent), 0 14px 34px rgba(0,4,8,.28); }
.spatial-light .loan-position-index { position: relative; z-index: 1; width: 40px; height: 40px; border: 1px solid color-mix(in srgb, var(--loan-tone) 62%, white); border-radius: 50%; background: #111920; color: var(--loan-tone); display: grid; place-items: center; font-size: 12px; font-weight: 720; box-shadow: 0 0 18px color-mix(in srgb, var(--loan-tone) 18%, transparent); }
.spatial-light .loan-position-copy { min-width: 0; display: grid; gap: 2px; }
.spatial-light .loan-position-copy small { color: var(--loan-tone); font-size: 10px; }
.spatial-light .loan-position-copy strong { color: #f0f3f0; font-size: 14px; }
.spatial-light .loan-position-copy em { overflow: hidden; color: #98a39f; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.spatial-light .loan-position-value { min-width: 130px; display: grid; gap: 4px; text-align: right; }
.spatial-light .loan-position-value strong { color: #f3f6f3; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.spatial-light .loan-position-value small { color: #8f9a96; font-size: 9px; }
.spatial-light .loan-position > i { position: absolute; left: 68px; right: 15px; bottom: 8px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--loan-tone) var(--loan-share), rgba(255,255,255,.08) var(--loan-share)); box-shadow: 0 0 10px color-mix(in srgb, var(--loan-tone) 38%, transparent); }
.spatial-light .loan-workspace { display: grid; grid-template-columns: minmax(380px, .84fr) minmax(560px, 1.35fr); gap: 16px; margin-top: 16px; }
.spatial-light .loan-inspector,
.spatial-light .loan-schedule-panel { min-width: 0; min-height: 420px; padding: 22px; border-radius: 22px; }
.spatial-light .loan-inspector { display: flex; flex-direction: column; }
.spatial-light .loan-inspector-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.spatial-light .loan-inspector-head h2 { margin: 0; color: #f1f4f1; font-size: 25px; letter-spacing: -.035em; }
.spatial-light .loan-inspector-head p:last-child { margin: 3px 0 0; color: #9da7a3; font-size: 10px; }
.spatial-light .loan-status { padding: 5px 9px; border: 1px solid rgba(101,208,179,.45); border-radius: 999px; background: rgba(101,208,179,.09); color: #72d6bb; font-size: 10px; white-space: nowrap; }
.spatial-light .loan-status.is-overdue { border-color: rgba(255,120,102,.5); background: rgba(255,120,102,.09); color: #ff8879; }
.spatial-light .loan-inspector-balance { margin: 22px 0 2px; color: #f4f6f3; font-size: clamp(34px, 3vw, 48px); line-height: 1; font-weight: 730; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.spatial-light .loan-native-balance { margin: 6px 0 0; color: #ad99e8; font-size: 12px; }
.spatial-light .loan-component-list { display: grid; gap: 8px; margin-top: 21px; }
.spatial-light .loan-component-list div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.09); }
.spatial-light .loan-component-list span { color: #9fa9a5; font-size: 10px; }
.spatial-light .loan-component-list strong { color: #eef2ef; font-size: 12px; font-variant-numeric: tabular-nums; }
.spatial-light .loan-component-list small { grid-column: 2; color: #9e8ed2; font-size: 9px; text-align: right; }
.spatial-light .loan-due-callout { margin-top: 14px; padding: 12px 13px; border-left: 1px solid #65d0b3; border-radius: 0 11px 11px 0; background: rgba(101,208,179,.055); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; }
.spatial-light .loan-due-callout.is-overdue { border-left-color: #ff7866; background: rgba(255,120,102,.06); }
.spatial-light .loan-due-callout span { color: #bcc5c1; font-size: 10px; }
.spatial-light .loan-due-callout strong { color: #f0f3f0; font-size: 13px; font-variant-numeric: tabular-nums; }
.spatial-light .loan-due-callout small { grid-column: 1 / -1; color: #89948f; font-size: 9px; }
.spatial-light .loan-audit-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 14px; }
.spatial-light .loan-audit-strip div { padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.03); }
.spatial-light .loan-audit-strip dt { color: #87928d; font-size: 9px; }
.spatial-light .loan-audit-strip dd { margin: 4px 0 0; color: #e9eeea; font-size: 11px; font-variant-numeric: tabular-nums; }
.spatial-light .loan-detail-action { min-height: 42px; }
.spatial-light .loan-inspector .inspector-note { margin-top: auto; }
.spatial-light .loan-schedule { display: grid; margin-top: 15px; }
.spatial-light .loan-schedule-row { --schedule-tone: #65d0b3; width: 100%; min-height: 84px; border: 0; border-top: 1px solid rgba(255,255,255,.1); background: transparent; color: #edf2ee; padding: 12px 7px; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; text-align: left; cursor: pointer; transition: background .2s var(--ease), transform .2s var(--ease); }
.spatial-light .loan-schedule-row.is-overdue { --schedule-tone: #ff7866; }
.spatial-light .loan-schedule-row:hover,
.spatial-light .loan-schedule-row:focus-visible,
.spatial-light .loan-schedule-row.is-selected { transform: translateX(4px); background: color-mix(in srgb, var(--schedule-tone) 8%, transparent); }
.spatial-light .loan-schedule-row time { color: var(--schedule-tone); font-size: 11px; text-transform: capitalize; }
.spatial-light .loan-schedule-row span { min-width: 0; display: grid; gap: 3px; }
.spatial-light .loan-schedule-row span strong { color: #eff3f0; font-size: 12px; }
.spatial-light .loan-schedule-row span small { overflow: hidden; color: #909b96; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.spatial-light .loan-schedule-row > b { color: #f3f6f3; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.spatial-light .loan-schedule-row > b em { display: block; margin-top: 3px; color: #a28edb; font-size: 9px; font-style: normal; font-weight: 500; }

@media (max-width: 1180px) {
  .spatial-light .loans-hero,
  .spatial-light .loan-workspace { grid-template-columns: 1fr; }
  .spatial-light .loan-total-focus { min-height: 350px; }
  .spatial-light .loan-field-panel { min-height: 420px; }
}

@media (max-width: 760px) {
  .spatial-light .loans-dashboard { padding-top: 15px; }
  .spatial-light .loans-heading { align-items: start; margin-bottom: 14px; }
  .spatial-light .loans-heading .manual-badge { display: none; }
  .spatial-light .view-heading-actions { margin-left: auto; }
  .spatial-light .loan-total-focus { min-height: 360px; padding: 24px 20px; }
  .spatial-light .loan-total-value span { font-size: clamp(33px, 9.4vw, 42px); }
  .spatial-light .loan-total-value svg { display: none; }
  .spatial-light .loan-health { grid-template-columns: 1fr 1fr; }
  .spatial-light .loan-health div:last-child { grid-column: 1 / -1; }
  .spatial-light .loan-field-panel { min-height: auto; padding: 17px; }
  .spatial-light .loan-portfolio { padding-left: 0; }
  .spatial-light .loan-portfolio::before { display: none; }
  .spatial-light .loan-position,
  .spatial-light .loan-position:nth-child(2),
  .spatial-light .loan-position:nth-child(3) { width: 100%; min-height: 112px; transform: none; grid-template-columns: 38px minmax(0, 1fr); }
  .spatial-light .loan-position:nth-child(2):hover,
  .spatial-light .loan-position:nth-child(2):focus-visible,
  .spatial-light .loan-position:hover,
  .spatial-light .loan-position:focus-visible { transform: translateY(-2px); }
  .spatial-light .loan-position-value { grid-column: 2; min-width: 0; text-align: left; }
  .spatial-light .loan-position > i { left: 66px; }
  .spatial-light .loan-inspector,
  .spatial-light .loan-schedule-panel { min-height: auto; padding: 17px; }
  .spatial-light .loan-schedule-row { grid-template-columns: 58px minmax(0, 1fr); }
  .spatial-light .loan-schedule-row > b { grid-column: 2; text-align: left; }
}

/* Deudas: reutiliza la gramática de cartera y cambia únicamente el significado. */
.spatial-light .debt-total-focus::after { background: radial-gradient(circle, rgba(215,168,68,.16), transparent 68%); }
.spatial-light .debts-dashboard .loan-total-value svg { color: #efbd46; }
.spatial-light .debt-field-panel::before { display: none; }
.spatial-light .debts-dashboard .loan-portfolio::before { background: linear-gradient(#65d0b3, rgba(255,255,255,.1), #d7a844); }
.spatial-light .debt-position { --loan-tone: #d7a844; }
.spatial-light .debt-position.is-reserved { --loan-tone: #65d0b3; }
.spatial-light .debt-position.is-unplanned { --loan-tone: #d7a844; }
.spatial-light .loan-status.is-unplanned { border-color: rgba(215,168,68,.44); background: rgba(215,168,68,.08); color: #efbd46; }
.spatial-light .source-personal-dop { --source-tone: #d7a844; }
.spatial-light .source-personal-usd { --source-tone: #ae94f2; }
.spatial-light .source-building { --source-tone: #7fa7c7; }
.spatial-light .manual-badge-short { display: none; }
.spatial-light .debt-audit-strip { grid-template-columns: 1fr 1fr; }
.spatial-light .debt-audit-strip .debt-destination { grid-column: 1 / -1; }
.spatial-light .debt-destination dd { line-height: 1.45; }

/* Inversiones: la valoración se presenta como estado verificable, no como rendimiento. */
.spatial-light .investment-total-focus::after { background: radial-gradient(circle, rgba(101,208,179,.15), transparent 68%); }
.spatial-light .investments-dashboard .loan-total-value svg { color: #65d0b3; }
.spatial-light .investment-field-panel::before { display: none; }
.spatial-light .investments-dashboard .loan-portfolio::before { background: linear-gradient(#65d0b3, rgba(255,255,255,.1), #7fa7c7); }
.spatial-light .investment-position { --loan-tone: #65d0b3; }
.spatial-light .investment-status { border-color: rgba(101,208,179,.45); background: rgba(101,208,179,.09); color: #72d6bb; }
.spatial-light .source-investment-dop { --source-tone: #65d0b3; }
.spatial-light .source-investment-usd { --source-tone: #ae94f2; }
.spatial-light .investment-audit-strip { grid-template-columns: 1fr 1fr; }
.spatial-light .investment-audit-strip .investment-finance { grid-column: 1 / -1; }
.spatial-light .investment-finance dd { line-height: 1.45; }
.spatial-light .investment-unknown { margin: 2px 0 14px; padding: 12px 13px; border-left: 1px solid #7fa7c7; border-radius: 0 11px 11px 0; background: rgba(127,167,199,.055); display: grid; gap: 3px; }
.spatial-light .investment-unknown span { color: #a8b5bd; font-size: 11px; }
.spatial-light .investment-unknown strong { color: #eef3f0; font-size: 13px; }
.spatial-light .investment-unknown small { color: #9aa6ad; font-size: 11px; }
.spatial-light .investment-context-list { display: grid; gap: 0; margin: 22px 0 0; }
.spatial-light .investment-context-list div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,.1); }
.spatial-light .investment-context-list dt { color: #9ea9a4; font-size: 12px; }
.spatial-light .investment-context-list dd { margin: 0; color: #d3ddd7; font-size: 12px; }

@media (max-width: 760px) {
  .spatial-light .investments-dashboard .loan-total-focus { min-height: auto; padding-bottom: 20px; }
  .spatial-light .investments-dashboard .loans-heading { display: grid; gap: 10px; }
  .spatial-light .investments-dashboard .view-heading-actions { margin-left: 0; justify-content: flex-start; }
  .spatial-light .investments-dashboard .loans-heading .manual-badge { display: flex; justify-self: start; padding: 6px 9px; }
  .spatial-light .investments-dashboard .manual-badge-full { display: none; }
  .spatial-light .investments-dashboard .manual-badge-short { display: inline; }
  .spatial-light .investment-audit-strip { grid-template-columns: 1fr; }
  .spatial-light .investment-audit-strip .investment-finance { grid-column: auto; }
}

@media (max-width: 760px) {
  .spatial-light .debts-dashboard .loans-heading { display: grid; gap: 10px; }
  .spatial-light .debts-dashboard .view-heading-actions { margin-left: 0; justify-content: flex-start; }
  .spatial-light .debts-dashboard .loans-heading .manual-badge { display: flex; justify-self: start; padding: 6px 9px; }
  .spatial-light .debts-dashboard .manual-badge-full { display: none; }
  .spatial-light .debts-dashboard .manual-badge-short { display: inline; }
  .spatial-light .debts-dashboard .loan-total-focus { min-height: auto; padding-bottom: 20px; }
  .spatial-light .debts-dashboard .loan-health { margin-top: 18px; padding-top: 14px; }
  .spatial-light .debt-audit-strip { grid-template-columns: 1fr; }
  .spatial-light .debt-audit-strip .debt-destination { grid-column: auto; }
}

/* Legibilidad operativa: los estados y controles no dependen de microtexto. */
.spatial-light .dialog-close { width: 44px; height: 44px; }
.spatial-light .cash-account small,
.spatial-light .cash-account em,
.spatial-light .reserve-row small,
.spatial-light .reserve-row b em,
.spatial-light .loan-health span,
.spatial-light .loan-field-hint,
.spatial-light .loan-position-copy small,
.spatial-light .loan-position-copy em,
.spatial-light .loan-position-value small,
.spatial-light .loan-inspector-head p:last-child,
.spatial-light .loan-status,
.spatial-light .loan-component-list span,
.spatial-light .loan-component-list small,
.spatial-light .loan-due-callout span,
.spatial-light .loan-due-callout small,
.spatial-light .loan-audit-strip dt,
.spatial-light .loan-schedule-row span small,
.spatial-light .loan-schedule-row > b em { font-size: 11px; }

@media (max-width: 760px) {
  .spatial-light .nav-item span { font-size: 11px; line-height: 1.1; }
  .entity-draft-content { padding: 18px 16px 20px; }
  .entity-draft-fields { grid-template-columns: 1fr; }
  .entity-draft-fields .full { grid-column: auto; }
  .entity-draft-form .primary-action { width: 100%; justify-self: stretch; }
  .context-help { max-width: min(250px, calc(100vw - 24px)); padding: 10px 12px; font-size: 12px; }
}

/* Cierre de auditoría: lectura, alcance táctil y flujo móvil sin desplazamiento anidado. */
::selection { background: rgba(255, 206, 95, .28); color: #fff; }
html { scrollbar-color: #46515a #10161b; }
.spatial-light .text-button,
.spatial-light .map-inspector button { min-height: 32px; padding: 6px 4px; }
.spatial-light .equation-item small,
.spatial-light .alert-copy span,
.spatial-light .inspector-kicker,
.spatial-light .map-inspector p,
.spatial-light .map-summary,
.spatial-light .node-copy span,
.spatial-light .apartment-row-copy small { font-size: 11px; }
.spatial-light .loan-due-callout { border-left-width: 1px; }
.spatial-light .search-result {
  min-height: 52px;
  grid-template-columns: 88px minmax(0, 1fr) auto auto;
  align-items: center;
}
.spatial-light .search-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spatial-light .search-result svg { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .spatial-light .asset-map,
  .spatial-light .asset-map.mode-2d,
  .spatial-light .asset-map.mode-3d {
    height: auto;
    min-height: 0;
    padding: 12px 0;
    overflow: visible;
  }
  .spatial-light .map-inspector {
    position: static;
    grid-column: 1 / -1;
    width: auto;
    margin-top: 3px;
  }
  .spatial-light .search-result { grid-template-columns: 66px minmax(0, 1fr) auto; }
  .spatial-light .search-result small { display: none; }
}
