:root {
  color-scheme: light;
  --ink: #261d2c;
  --muted: #716978;
  --line: #e9e3eb;
  --paper: #fbfafc;
  --white: #fff;
  --purple: #421247;
  --purple-2: #6a2b70;
  --orange: #f28a28;
  --green: #18794e;
  --red: #aa3e48;
  --shadow: 0 14px 40px rgba(49, 23, 54, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--purple-2); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
:focus-visible { outline: 3px solid #f0a13e; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 99; top: -60px; left: 16px; background: var(--white); padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--purple); text-decoration: none; font-weight: 850; letter-spacing: -.04em; font-size: 1.25rem; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--purple); color: white; position: relative; overflow: hidden; }
.brand-mark::before { content: ""; width: 13px; height: 13px; border: 4px solid white; border-right-color: transparent; border-radius: 50%; transform: rotate(-25deg); }
.brand-mark::after { content: ""; position: absolute; top: 4px; right: 3px; width: 12px; height: 12px; border: 4px solid var(--orange); border-left-color: transparent; border-radius: 50%; transform: rotate(22deg); }
.brand small { display: block; color: var(--muted); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; line-height: 1.1; }
.button { border: 1px solid transparent; border-radius: 11px; padding: 11px 16px; font-weight: 700; background: var(--purple); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); background: #351039; }
.button.secondary { background: #fff; color: var(--purple); border-color: var(--line); }
.button.secondary:hover { background: #f8f2fa; }
.button.ghost { background: transparent; color: var(--purple); border-color: transparent; }
.button.danger { color: #fff; background: #a33343; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: .86rem; border-radius: 8px; }
.public-header { height: 74px; display: flex; align-items: center; justify-content: space-between; width: min(1160px, calc(100% - 40px)); margin: auto; }
.public-header nav { display: flex; gap: 22px; align-items: center; }
.public-header nav a { text-decoration: none; color: var(--ink); font-weight: 650; font-size: .95rem; }
.landing { overflow: hidden; }
.hero { width: min(1160px, calc(100% - 40px)); margin: 38px auto 0; min-height: 500px; display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 48px; }
.eyebrow { color: var(--purple-2); font-weight: 800; font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.65rem, 5vw, 4.75rem); letter-spacing: -.065em; line-height: 1.01; color: var(--purple); margin: 14px 0 20px; max-width: 700px; }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.045em; color: var(--purple); line-height: 1.12; margin: 0 0 12px; }
h3 { letter-spacing: -.025em; line-height: 1.2; }
.hero p { max-width: 560px; color: var(--muted); font-size: 1.12rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 18px; }
.microcopy { font-size: .87rem !important; color: #827b87 !important; }
.hero-art { min-height: 390px; border-radius: 32px; background: #f4edf5; border: 1px solid #ecdfef; position: relative; padding: 30px; display: flex; align-items: center; justify-content: center; }
.art-orbit { position: absolute; width: 310px; height: 310px; border: 1px solid #d8c3dc; border-radius: 50%; }
.art-orbit::before, .art-orbit::after { content: ""; position: absolute; border: 1px solid #e3d5e5; border-radius: 50%; inset: 26px; }
.art-orbit::after { inset: 56px; }
.art-card { width: min(100%, 330px); position: relative; z-index: 1; background: #fff; box-shadow: var(--shadow); border: 1px solid #eee7ef; border-radius: 18px; padding: 22px; }
.art-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .82rem; }
.art-amount { font-size: 2rem; font-weight: 800; color: var(--purple); letter-spacing: -.04em; margin: 6px 0 18px; }
.art-bars { height: 96px; display: flex; align-items: end; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 4px; }
.art-bars i { display: block; flex: 1; border-radius: 6px 6px 0 0; background: #b78cbd; }
.art-bars i:nth-child(1) { height: 34%; }.art-bars i:nth-child(2) { height: 56%; }.art-bars i:nth-child(3) { height: 43%; }.art-bars i:nth-child(4) { height: 75%; background: #e59a4d; }.art-bars i:nth-child(5) { height: 63%; }.art-bars i:nth-child(6) { height: 94%; background: var(--purple); }
.art-caption { display: flex; justify-content: space-between; margin-top: 12px; font-size: .76rem; color: var(--muted); }
.hero-note { position: absolute; bottom: 28px; right: 22px; background: var(--purple); color: white; border-radius: 13px; padding: 11px 14px; font-size: .82rem; box-shadow: var(--shadow); }
.section { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: 86px 0; }
.section-intro { max-width: 680px; margin-bottom: 28px; }
.section-intro p { color: var(--muted); font-size: 1.06rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card, .panel, .kpi, .form-card { border: 1px solid var(--line); background: var(--white); border-radius: 17px; padding: 22px; box-shadow: 0 4px 18px rgba(49, 23, 54, .03); }
.feature-card .number { width: 34px; height: 34px; display: grid; place-items: center; color: var(--purple); background: #f3e9f4; border-radius: 10px; font-weight: 800; margin-bottom: 18px; }
.feature-card p { margin: 0; color: var(--muted); }
.trust-band { background: #f4eff5; border-block: 1px solid #e9ddec; }
.trust-band .section { padding: 42px 0; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.trust-band strong { color: var(--purple); font-size: 1.2rem; }
.trust-band p { margin: 0; color: var(--muted); }
.consent-box { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: .91rem; color: #564e5a; }
.check-row input { margin-top: 4px; accent-color: var(--purple); }
.legal-copy { color: var(--muted); max-width: 820px; }
.legal-copy h2 { margin-top: 32px; font-size: 1.35rem; }
.public-footer { border-top: 1px solid var(--line); background: #fff; }
.public-footer-inner { width: min(1160px, calc(100% - 40px)); margin: auto; padding: 25px 0; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .9rem; }
.public-footer-inner p { margin: 7px 0 0; }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; height: 100vh; top: 0; background: #321039; color: #fff; padding: 23px 15px; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { color: #fff; padding: 0 9px 22px; border-bottom: 1px solid rgba(255,255,255,.13); }
.sidebar .brand small { color: #d5bed9; }
.sidebar .brand-mark { background: #fff; }
.sidebar .brand-mark::before { border-color: var(--purple); border-right-color: transparent; }
.sidebar .brand-mark::after { border-left-color: transparent; }
.nav-caption { margin: 22px 10px 8px; color: #c7aaca; font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; gap: 11px; align-items: center; border-radius: 10px; padding: 10px 11px; color: #e7dce9; text-decoration: none; font-weight: 650; font-size: .91rem; }
.side-nav a:hover, .side-nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-icon { width: 22px; text-align: center; color: #ffc276; font-size: 1.05rem; }
.sidebar-bottom { margin-top: auto; padding: 14px 9px 0; border-top: 1px solid rgba(255,255,255,.13); }
.sidebar-bottom .user-email { color: #cfb8d3; font-size: .78rem; overflow-wrap: anywhere; margin: 5px 0 11px; }
.sidebar-bottom button { width: 100%; }
.app-main { min-width: 0; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 clamp(18px, 4vw, 48px); background: #fff; border-bottom: 1px solid var(--line); }
.topbar-title { font-weight: 800; font-size: 1.08rem; color: var(--purple); }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.mobile-menu { display: none; border: 1px solid var(--line); background: #fff; color: var(--purple); border-radius: 9px; padding: 8px 10px; font-weight: 700; }
.page-content { width: min(1280px, 100%); margin: auto; padding: 34px clamp(18px, 4vw, 48px) 56px; }
.page-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin: 0 0 6px; letter-spacing: -.05em; }
.page-heading p { color: var(--muted); margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 19px; }
.kpi-label { color: var(--muted); font-size: .86rem; font-weight: 650; }
.kpi-value { color: var(--purple); font-weight: 850; font-size: clamp(1.3rem, 2.2vw, 1.8rem); letter-spacing: -.045em; margin: 4px 0 0; overflow-wrap: anywhere; }
.kpi-note { color: var(--muted); font-size: .78rem; margin: 4px 0 0; }
.content-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.span-12 { grid-column: span 12; }.span-8 { grid-column: span 8; }.span-7 { grid-column: span 7; }.span-6 { grid-column: span 6; }.span-5 { grid-column: span 5; }.span-4 { grid-column: span 4; }
.panel { padding: 20px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-heading h2, .panel-heading h3 { margin: 0; font-size: 1.12rem; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 28px 14px; border: 1px dashed #d8cbdc; border-radius: 13px; color: var(--muted); }
.empty strong { display: block; color: var(--purple); margin-bottom: 4px; }
.data-table-wrap { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 580px; }
th, td { padding: 11px 10px; border-bottom: 1px solid #f0edf1; text-align: left; vertical-align: middle; }
th { color: #79717d; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; }
td strong { color: #34283a; }
.amount-positive { color: var(--green); font-weight: 750; }.amount-negative { color: var(--red); font-weight: 750; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: .74rem; font-weight: 750; background: #f0eef1; color: #665c6a; }
.status-pill.good { background: #e7f5ec; color: #167046; }.status-pill.warn { background: #fff3dd; color: #8a5b05; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1/-1; }
.field label { font-size: .83rem; color: #514855; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; border: 1px solid #ded6e1; background: #fff; color: var(--ink); padding: 9px 11px; border-radius: 9px; }
.field textarea { min-height: 86px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #a098a4; }
.form-actions { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 4px; }
.form-note { color: var(--muted); font-size: .82rem; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.filters .field { min-width: 145px; }
.filters .field input, .filters .field select { min-height: 38px; }
.bar-chart { min-height: 210px; display: flex; align-items: end; gap: 10px; padding: 20px 6px 0; border-bottom: 1px solid var(--line); }
.bar-group { flex: 1; min-width: 0; height: 190px; display: flex; align-items: end; justify-content: center; gap: 4px; position: relative; }
.bar { min-width: 8px; width: 30%; border-radius: 5px 5px 0 0; background: #b38ab8; min-height: 2px; }
.bar.expense { background: #f0a04f; }
.bar-label { position: absolute; bottom: -23px; font-size: .68rem; color: var(--muted); white-space: nowrap; }
.chart-legend { display: flex; gap: 18px; padding-top: 31px; font-size: .8rem; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; background: #b38ab8; }.legend-dot.orange { background: #f0a04f; }
.progress-track { height: 8px; border-radius: 9px; background: #f0edf1; overflow: hidden; margin: 8px 0; }.progress-track span { display: block; height: 100%; background: var(--orange); border-radius: inherit; }
.list-stack { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0edf1; }.list-row:last-child { border-bottom: 0; }
.list-row p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.inline-form .field { flex: 1; min-width: 150px; }
.premium-banner { border: 1px solid #ecd9bc; background: #fff8ed; padding: 16px; border-radius: 13px; color: #674e2b; }
.premium-banner strong { color: #774813; }
.notice { border-left: 3px solid var(--orange); background: #fff9f1; color: #6e573d; padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: .88rem; }
.section-separator { border: 0; border-top: 1px solid var(--line); margin: 23px 0; }
.toast { position: fixed; z-index: 100; bottom: 20px; left: 50%; transform: translate(-50%, 140%); max-width: min(560px, calc(100% - 30px)); background: #2e1834; color: #fff; padding: 12px 16px; border-radius: 11px; box-shadow: var(--shadow); transition: transform .2s ease; }
.toast.show { transform: translate(-50%, 0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(31, 17, 34, .48); }
.modal { width: min(680px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 20px 80px rgba(0,0,0,.22); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }.modal-header h2 { font-size: 1.3rem; margin: 0; }
.mobile-overlay { display: none; }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .hero { gap: 24px; }
}
@media (max-width: 760px) {
  .public-header { height: 64px; width: calc(100% - 28px); }
  .public-header nav a:not(.button) { display: none; }
  .hero { width: calc(100% - 28px); margin-top: 20px; grid-template-columns: 1fr; gap: 22px; min-height: auto; }
  .hero-art { min-height: 325px; }
  .hero h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .section { width: calc(100% - 28px); padding: 58px 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .trust-band .section { display: grid; gap: 7px; padding: 28px 0; }
  .public-footer-inner { width: calc(100% - 28px); display: grid; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(290px, 86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 10px 0 40px rgba(21, 10, 25, .2); }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay.show { display: block; position: fixed; z-index: 19; inset: 0; background: rgba(27, 16, 31, .38); }
  .mobile-menu { display: inline-flex; }
  .topbar { height: 62px; padding: 0 14px; }
  .topbar-title { margin-right: auto; }
  .topbar-right .user-chip { display: none; }
  .page-content { padding: 24px 14px 42px; }
  .page-heading { display: grid; }
  .content-grid { grid-template-columns: repeat(6,1fr); gap: 12px; }
  .span-12,.span-8,.span-7,.span-6,.span-5,.span-4 { grid-column: span 6; }
  .kpi-grid { gap: 9px; }
  .kpi { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .form-actions { grid-column: auto; }
  .table-scroll-note { display: block; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-label { font-size: .77rem; }
  .kpi-value { font-size: 1.25rem; }
  .public-header .button { padding: 8px 11px; font-size: .86rem; }
  .hero-actions .button { flex: 1; }
  .button { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
