:root {
  --ink: #092b28;
  --ink-2: #24423f;
  --muted: #72817f;
  --green-950: #032924;
  --green-900: #073d36;
  --green-800: #075447;
  --green-600: #0fa88e;
  --green-500: #14c979;
  --green-200: #a7efcf;
  --green-100: #dff9ed;
  --surface: #fbfdfb;
  --surface-2: #f3f6f2;
  --on-dark: #f2f7f4;
  --line: #e7ece9;
  --orange: #ff9f43;
  --red: #ee5b66;
  --purple: #7557d3;
  --blue: #278fe8;
  --shadow-sm: 0 1px 2px rgba(8, 43, 39, .04), 0 5px 18px rgba(8, 43, 39, .05);
  --shadow-md: 0 16px 50px rgba(4, 42, 36, .13);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --sidebar: 264px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface-2); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--surface-2); font-family: "DM Sans", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg { width: 1.2em; height: 1.2em; display: block; stroke-width: 1.9; }

.splash-screen { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 28px; z-index: 1000; background: radial-gradient(circle at 50% 38%, #ecfff5, #f6f8f5 42%, #edf3ef); transition: opacity .35s ease; }
.splash-logo { display: flex; align-items: center; gap: 15px; font: 800 34px/1 "Manrope", sans-serif; letter-spacing: -.04em; }
.splash-logo img { width: 62px; border-radius: 18px; box-shadow: var(--shadow-md); }
.splash-screen p { color: var(--muted); margin: -13px 0 0; font-size: 14px; }
.loading-bar { width: 184px; height: 4px; overflow: hidden; background: #d9e7df; border-radius: 9px; }
.loading-bar span { display: block; height: 100%; width: 45%; background: linear-gradient(90deg, var(--green-600), var(--green-500)); border-radius: inherit; animation: loading 1.1s ease-in-out infinite alternate; }
@keyframes loading { from { transform: translateX(-20%); } to { transform: translateX(145%); } }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(500px, 1.15fr) minmax(430px, .85fr); background: white; }
.login-showcase { position: relative; min-height: 100vh; overflow: hidden; padding: 48px clamp(48px, 7vw, 112px); color: white; background: radial-gradient(circle at 30% 25%, rgba(25, 199, 123, .16), transparent 32%), radial-gradient(circle at 88% 80%, rgba(15, 168, 142, .18), transparent 29%), linear-gradient(145deg, #073d36, #042d28 57%, #021d1a); display: flex; flex-direction: column; justify-content: space-between; }
.login-showcase::before, .login-showcase::after { content: ""; position: absolute; width: 460px; aspect-ratio: 1; border: 1px solid rgba(151, 239, 198, .11); border-radius: 50%; }
.login-showcase::before { right: -160px; top: -230px; box-shadow: 0 0 0 80px rgba(151, 239, 198, .025), 0 0 0 160px rgba(151, 239, 198, .018); }
.login-showcase::after { left: -300px; bottom: -310px; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand img { width: 54px; border-radius: 15px; }
.login-brand strong { display: block; font: 800 27px/1.1 "Manrope"; letter-spacing: -.04em; }
.login-brand span { display: block; margin-top: 4px; color: #a8c8bf; font-size: 10px; text-transform: uppercase; letter-spacing: .19em; }
.showcase-copy { position: relative; z-index: 1; margin-top: 9vh; max-width: 610px; }
.eyebrow { display: block; color: var(--green-600); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.light { color: #88e0b6; }
.showcase-copy h1 { margin: 18px 0; font: 700 clamp(40px, 4.6vw, 68px)/1.06 "Manrope"; letter-spacing: -.055em; }
.showcase-copy h1 em { color: var(--green-500); font-style: normal; }
.showcase-copy p { max-width: 535px; margin: 0; color: #b7ccc7; font-size: 17px; line-height: 1.7; }
.showcase-card { position: relative; z-index: 1; align-self: flex-end; width: min(480px, 84%); padding: 24px 26px 18px; margin: 18px 0 0; border: 1px solid rgba(164, 242, 202, .18); border-radius: 24px; background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.045)); box-shadow: 0 25px 60px rgba(0,0,0,.23); backdrop-filter: blur(15px); transform: rotate(-1.5deg); }
.mock-card-top { display: flex; justify-content: space-between; color: #b9d1cb; font-size: 12px; }
.mock-card-top i { color: #8becb7; font-style: normal; }
.showcase-card > strong { display: block; margin-top: 7px; font: 700 28px "Manrope"; }
.mock-chart { display: flex; align-items: flex-end; gap: 10px; height: 70px; margin-top: 16px; }
.mock-chart span { flex: 1; min-height: 10px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #51dfa1, #0fa88e); opacity: .72; }
.mock-chart span:last-child { opacity: 1; }
.showcase-footer { position: relative; z-index: 1; display: flex; gap: 28px; color: #8eb2aa; font-size: 11px; text-transform: uppercase; letter-spacing: .11em; }
.showcase-footer span::first-letter { color: var(--green-500); }
.login-panel { display: grid; place-items: center; padding: 50px clamp(40px, 6vw, 95px); }
.login-form { width: min(100%, 430px); }
.mobile-login-brand { display: none; }
.login-form h2 { margin: 9px 0 6px; font: 700 34px "Manrope"; letter-spacing: -.04em; }
.login-form > p { margin: 0 0 34px; color: var(--muted); }
.field-label { display: block; margin: 18px 0 7px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.password-row { display: flex; align-items: flex-end; justify-content: space-between; }
.password-row .field-label { margin-bottom: 7px; }
.text-button { border: 0; background: none; padding: 5px 0; color: var(--green-600); font-size: 12px; font-weight: 700; cursor: pointer; }
.field-with-icon { position: relative; display: flex; align-items: center; }
.field-with-icon > span { position: absolute; left: 15px; color: #8ca09b; display: grid; pointer-events: none; }
.field-with-icon input { width: 100%; height: 52px; border: 1px solid #dfe7e3; border-radius: 13px; padding: 0 46px; color: var(--ink); background: #fbfcfb; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.field-with-icon input:focus { background: white; border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(15,168,142,.1); }
.password-toggle { position: absolute; right: 9px; }
.check-line { display: flex; align-items: center; gap: 9px; margin: 18px 0 24px; color: var(--muted); font-size: 12px; }
.check-line input { accent-color: var(--green-600); width: 16px; height: 16px; }
.primary-button { min-height: 48px; border: 0; border-radius: 13px; padding: 0 20px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; color: white; background: linear-gradient(135deg, var(--green-600), #0c8d78); font-weight: 700; box-shadow: 0 8px 22px rgba(15,168,142,.2); cursor: pointer; transition: transform .18s, box-shadow .18s, opacity .18s; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 11px 26px rgba(15,168,142,.27); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.login-submit { width: 100%; height: 53px; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 27px 0 0; color: #93a29f; font-size: 11px; }
.form-error { margin-top: 15px; padding: 11px 13px; color: #a73540; border: 1px solid #ffd3d7; border-radius: 10px; background: #fff4f5; font-size: 13px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar); display: flex; flex-direction: column; padding: 27px 18px 13px; color: white; background: radial-gradient(circle at 5% 4%, rgba(23,198,124,.15), transparent 27%), linear-gradient(180deg, #073d36, #042e29 64%, #032620); box-shadow: inset -1px 0 rgba(255,255,255,.05); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.sidebar-brand img { width: 43px; border-radius: 12px; }
.sidebar-brand strong { display: block; font: 800 23px/1 "Manrope"; letter-spacing: -.04em; }
.sidebar-brand span { display: block; margin-top: 4px; color: #7ca79e; font-size: 7px; letter-spacing: .17em; text-transform: uppercase; }
.sidebar-close { display: none; margin-left: auto; color: white; }
.sidebar-nav { flex: 1; overflow-y: auto; scrollbar-width: none; }
.nav-section { display: block; padding: 17px 12px 8px; color: #608d84; font-size: 8px; font-weight: 800; letter-spacing: .17em; }
.nav-item { position: relative; width: 100%; min-height: 45px; display: flex; align-items: center; gap: 12px; margin: 2px 0; padding: 0 12px; border: 0; border-radius: 11px; color: #9bbab3; background: transparent; font-size: 13px; text-align: left; cursor: pointer; transition: .18s ease; }
.nav-item i { display: grid; font-style: normal; font-size: 17px; }
.nav-item span { flex: 1; }
.nav-item b { min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; color: #b8e8d1; background: rgba(20,201,121,.14); border-radius: 10px; font-size: 9px; }
.nav-item:hover { color: #d9ebe7; background: rgba(255,255,255,.055); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(20,201,121,.2), rgba(20,201,121,.08)); box-shadow: inset 3px 0 var(--green-500); }
.nav-item.active i { color: #5ee0a0; }
.sidebar-insight { display: flex; gap: 10px; margin: 12px 3px 13px; padding: 13px; border: 1px solid rgba(122,231,176,.13); border-radius: 14px; background: rgba(255,255,255,.045); }
.insight-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; color: #5de09e; border-radius: 9px; background: rgba(20,201,121,.13); }
.sidebar-insight strong { font-size: 10px; }
.sidebar-insight p { margin: 3px 0 0; color: #80a59d; font-size: 9px; line-height: 1.45; }
.sidebar-user { display: grid; grid-template-columns: 35px 1fr 32px; align-items: center; gap: 9px; padding: 12px 7px 9px; border-top: 1px solid rgba(255,255,255,.07); }
.avatar, .top-avatar span { display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--green-200), var(--green-500)); color: #064137; font-size: 11px; font-weight: 800; }
.sidebar-user .avatar { width: 35px; height: 35px; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 11px; }
.sidebar-user div span { margin-top: 2px; color: #719a92; font-size: 9px; }
.sidebar-user .icon-button { color: #719a92; }
.app-version { display: block; color: #4d746c; font-size: 8px; text-align: center; letter-spacing: .08em; }

.main-area { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 30; height: 70px; display: flex; align-items: center; gap: 9px; padding: 0 clamp(22px, 4vw, 52px); border-bottom: 1px solid rgba(218,228,222,.8); background: rgba(246,248,245,.88); backdrop-filter: blur(16px); }
.topbar-spacer { flex: 1; }
.menu-button, .mobile-brand { display: none; }
.top-icon, .top-avatar { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 11px; display: grid; place-items: center; color: #60736f; background: rgba(255,255,255,.75); cursor: pointer; }
.top-avatar { border: 0; border-radius: 50%; padding: 0; }
.top-avatar span { width: 39px; height: 39px; }
.notification-button { position: relative; }
.notification-button > span { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: var(--red); }
.install-button { min-height: 37px; display: flex; align-items: center; gap: 7px; padding: 0 13px; border: 1px solid #cfe6dc; border-radius: 10px; color: var(--green-800); background: #edfaf4; font-size: 11px; font-weight: 700; cursor: pointer; }
.page-content { width: min(100%, 1540px); margin: 0 auto; padding: 29px clamp(22px, 4vw, 52px) 60px; animation: pageIn .28s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 23px; }
.page-head h1 { margin: 2px 0 4px; font: 700 clamp(24px, 2.3vw, 34px) "Manrope"; letter-spacing: -.045em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; align-items: center; gap: 9px; }
.date-pill, .filter-select { min-height: 39px; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; display: flex; align-items: center; gap: 8px; color: var(--ink-2); background: white; font-size: 11px; font-weight: 600; box-shadow: var(--shadow-sm); }
.secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid #dfe8e4; border-radius: 11px; color: var(--ink-2); background: white; font-size: 12px; font-weight: 700; cursor: pointer; }
.secondary-button:hover { border-color: #b8d7ca; background: #f9fcfa; }
.small-button { min-height: 34px; padding: 0 11px; font-size: 10px; }

.metrics-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 15px; margin-bottom: 17px; }
.metric-card { position: relative; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); overflow: hidden; }
.metric-card.primary { color: white; border-color: transparent; background: radial-gradient(circle at 90% 20%, rgba(41,222,141,.25), transparent 34%), linear-gradient(135deg, #085347, #073d36 58%, #052f2a); box-shadow: 0 13px 28px rgba(5,61,53,.16); }
.metric-card .metric-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 600; }
.primary .metric-label { color: #b9d3cc; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--green-600); background: var(--green-100); }
.metric-icon.red { color: var(--red); background: #fff0f1; }
.metric-icon.purple { color: var(--purple); background: #f2effd; }
.metric-card h2 { margin: 14px 0 5px; font: 700 23px "Manrope"; letter-spacing: -.04em; white-space: nowrap; }
.metric-card.primary h2 { font-size: 28px; }
.metric-foot { display: flex; align-items: center; gap: 5px; color: #7e8e8b; font-size: 9px; }
.metric-foot.up { color: var(--green-600); }
.primary .metric-foot { color: #86ddb3; }
.metric-card .mini-line { position: absolute; right: 18px; bottom: 16px; width: 55px; height: 25px; opacity: .65; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(280px, .72fr); gap: 17px; }
.stack { display: grid; align-content: start; gap: 17px; min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.panel.pad { padding: 20px; }
.panel-head { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 15px 19px; border-bottom: 1px solid #edf1ef; }
.panel-head h3 { margin: 0; font: 700 14px "Manrope"; letter-spacing: -.02em; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.link-button { border: 0; padding: 5px; color: var(--green-600); background: none; font-size: 10px; font-weight: 700; cursor: pointer; }
.cashflow-body { padding: 12px 18px 15px; }
.cashflow-legend { display: flex; gap: 18px; justify-content: flex-end; color: var(--muted); font-size: 9px; }
.cashflow-legend span::before { content: ""; width: 7px; height: 7px; display: inline-block; margin-right: 5px; border-radius: 2px; background: var(--green-500); }
.cashflow-legend span:last-child::before { background: #c6d2ce; }
.bar-chart { height: 157px; display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; padding: 19px 4px 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 37px, #f1f4f2 38px); }
.bar-group { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; color: #8b9996; font-size: 8px; }
.bar-pair { height: calc(100% - 17px); display: flex; align-items: flex-end; gap: 4px; }
.bar { width: clamp(7px, 1vw, 13px); min-height: 3px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #24d68b, #0fa88e); animation: growBar .55s ease both; transform-origin: bottom; }
.bar.expense { background: #d5dedb; }
@keyframes growBar { from { transform: scaleY(.08); } }

.transaction-list { padding: 0 8px 8px; }
.transaction-row { display: grid; grid-template-columns: 38px minmax(120px, 1.45fr) minmax(90px, .8fr) minmax(90px, .8fr) auto; align-items: center; gap: 11px; min-height: 63px; padding: 8px 11px; border-bottom: 1px solid #f0f3f1; cursor: pointer; border-radius: 10px; transition: background .15s; }
.transaction-row:last-child { border-bottom: 0; }
.transaction-row:hover { background: #f8fbf9; }
.transaction-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--green-600); background: var(--green-100); }
.transaction-main { min-width: 0; }
.transaction-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.transaction-main span, .transaction-meta { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.person-tags { display: flex; align-items: center; gap: 3px; }
.person-tag { display: inline-flex; align-items: center; gap: 4px; max-width: 100px; padding: 4px 7px; border-radius: 8px; color: #465b57; background: #f0f5f2; font-size: 8px; white-space: nowrap; }
.person-tag i { width: 6px; height: 6px; border-radius: 50%; }
.transaction-value { text-align: right; white-space: nowrap; font-size: 11px; font-weight: 700; }
.transaction-value.expense { color: #d94856; }
.transaction-value.income { color: var(--green-600); }

.spending-body { display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 12px; padding: 19px; }
.donut { position: relative; width: 118px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green-600) 0 34%, var(--orange) 34% 59%, var(--purple) 59% 77%, var(--blue) 77% 91%, #d8dedc 91%); }
.donut::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: white; }
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center span { display: block; color: var(--muted); font-size: 8px; }
.donut-center strong { display: block; margin-top: 2px; font: 700 13px "Manrope"; }
.category-list { display: grid; gap: 9px; }
.category-row { display: grid; grid-template-columns: 7px 1fr auto; align-items: center; gap: 7px; font-size: 9px; }
.category-row i { width: 7px; height: 7px; border-radius: 3px; }
.category-row span { color: #596c68; }
.category-row strong { font-size: 9px; }

.goal-mini { padding: 17px 19px; }
.goal-mini-top { display: flex; align-items: center; gap: 10px; }
.goal-icon, .entity-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: var(--green-600); background: var(--green-100); }
.goal-mini-top div { min-width: 0; flex: 1; }
.goal-mini-top strong { display: block; font-size: 11px; }
.goal-mini-top span { color: var(--muted); font-size: 9px; }
.goal-mini-top > b { color: var(--green-600); font: 700 11px "Manrope"; }
.progress { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 8px; background: #e9efec; }
.progress span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--green-600), var(--green-500)); }
.budget-alert { display: flex; gap: 11px; margin: 0 19px 17px; padding: 12px; border-radius: 12px; color: #89561f; background: #fff5e8; }
.budget-alert i { flex: 0 0 auto; }
.budget-alert strong { display: block; font-size: 10px; }
.budget-alert p { margin: 3px 0 0; font-size: 8px; line-height: 1.4; }

.entity-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 15px; }
.entity-card { position: relative; min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
.entity-card-top { display: flex; align-items: center; gap: 11px; }
.entity-card-top > div:nth-child(2) { min-width: 0; flex: 1; }
.entity-card-top h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 13px; }
.entity-card-top p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.more-button { width: 30px; height: 30px; border: 0; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: #f7f9f8; cursor: pointer; }
.entity-value { margin: 22px 0 3px; font: 700 23px "Manrope"; letter-spacing: -.04em; }
.entity-foot { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; }
.entity-actions { display: flex; gap: 7px; margin-top: 16px; }
.entity-actions button { flex: 1; }
.account-balance-positive { color: var(--green-800); }
.credit-visual { min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; color: white; border-radius: 22px; background: radial-gradient(circle at 88% 15%, rgba(53,224,148,.28), transparent 33%), linear-gradient(145deg, var(--card-color, #073d36), #042d28); box-shadow: 0 16px 35px color-mix(in srgb, var(--card-color, #073d36) 25%, transparent); overflow: hidden; }
.credit-visual::after { content: ""; position: absolute; right: -25px; bottom: -65px; width: 150px; height: 150px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 25px rgba(255,255,255,.025); }
.credit-top, .credit-bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; }
.credit-top span { color: #c4d8d3; font-size: 10px; }
.credit-top b { font-size: 11px; }
.credit-chip { width: 36px; height: 27px; margin: 15px 0; border-radius: 6px; background: linear-gradient(135deg, #f8d785, #b9963d); }
.credit-visual h3 { position: relative; z-index: 1; margin: 0 0 4px; color: white; font: 700 17px "Manrope"; }
.credit-bottom span { font-size: 12px; letter-spacing: .15em; }
.credit-bottom strong { font-size: 10px; text-transform: uppercase; }
.invoice-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.summary-box { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.summary-box span { display: block; color: var(--muted); font-size: 9px; }
.summary-box strong { display: block; margin-top: 7px; font: 700 17px "Manrope"; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.search-field { position: relative; flex: 1; max-width: 420px; }
.search-field i { position: absolute; left: 13px; top: 50%; color: var(--muted); transform: translateY(-50%); }
.search-field input { width: 100%; height: 42px; padding: 0 15px 0 40px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: white; }
.filter-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { min-height: 35px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: white; font-size: 10px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip.active { color: var(--green-800); border-color: #bde3d2; background: #edfaf4; }
.data-panel { overflow: hidden; }
.data-head { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 90px; gap: 12px; padding: 12px 19px; color: #879591; background: #f8faf9; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.data-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 90px; gap: 12px; align-items: center; min-height: 64px; padding: 9px 19px; border-top: 1px solid #edf1ef; font-size: 10px; }
.data-row:hover { background: #fbfcfb; }
.row-title { display: flex; align-items: center; min-width: 0; gap: 10px; }
.row-title div { min-width: 0; }
.row-title strong, .row-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.status-pill { width: fit-content; padding: 4px 8px; border-radius: 8px; color: #267457; background: #e8f8f0; font-size: 8px; font-weight: 700; }
.status-pill.pending { color: #a86c27; background: #fff3e4; }
.status-pill.duplicate { color: #637083; background: #eef1f2; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions button { width: 28px; height: 28px; border: 0; border-radius: 8px; display: grid; place-items: center; color: var(--muted); background: #f4f7f5; cursor: pointer; }
.row-actions button.danger { color: var(--red); }

.people-summary { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 15px; margin-bottom: 16px; }
.debt-hero { color: white; padding: 22px; background: radial-gradient(circle at 90% 20%, rgba(44,220,142,.24), transparent 35%), linear-gradient(135deg, var(--green-800), var(--green-900)); }
.debt-hero span { color: #b5d0c9; font-size: 10px; }
.debt-hero h2 { margin: 8px 0 15px; font: 700 28px "Manrope"; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack i { width: 29px; height: 29px; margin-right: -6px; border: 2px solid var(--green-800); display: grid; place-items: center; border-radius: 50%; color: white; font-size: 8px; font-style: normal; }
.avatar-stack small { margin-left: 12px; color: #9dc2b9; font-size: 8px; }
.person-card .person-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: white; font-weight: 800; }
.person-debt { margin: 18px 0 4px; color: var(--red); font: 700 21px "Manrope"; }
.split-list { display: grid; gap: 7px; margin-top: 14px; }
.split-line { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 10px; background: #f7f9f8; font-size: 9px; }
.split-line button { border: 0; color: var(--green-600); background: none; font-size: 8px; font-weight: 700; cursor: pointer; }

.planning-layout { display: grid; grid-template-columns: 1.35fr .8fr; gap: 17px; }
.goals-list { display: grid; gap: 12px; padding: 16px; }
.goal-card { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 14px; }
.goal-card .goal-icon { width: 46px; height: 46px; }
.goal-info strong { display: block; font-size: 11px; }
.goal-info p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.goal-info .progress { margin-top: 10px; }
.goal-number { text-align: right; }
.goal-number strong { display: block; font: 700 14px "Manrope"; }
.goal-number span { color: var(--muted); font-size: 8px; }
.budget-list { display: grid; gap: 12px; padding: 16px; }
.budget-item { padding: 14px; border: 1px solid var(--line); border-radius: 13px; }
.budget-item-top { display: flex; justify-content: space-between; gap: 9px; font-size: 10px; }
.budget-item-top strong:last-child { color: var(--green-800); }
.budget-item small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }

.import-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; padding: 25px 28px; margin-bottom: 17px; color: white; border-radius: var(--radius-lg); background: radial-gradient(circle at 85% 30%, rgba(52,224,146,.27), transparent 34%), linear-gradient(135deg, #075347, #073d36); }
.import-hero::after { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; bottom: -180px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.025); }
.import-hero h2 { margin: 5px 0 7px; font: 700 22px "Manrope"; }
.import-hero p { max-width: 640px; margin: 0; color: #a8cac1; font-size: 11px; line-height: 1.55; }
.ai-orb { position: relative; z-index: 1; width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid rgba(140,237,185,.3); border-radius: 20px; color: #7bf0b5; background: rgba(255,255,255,.09); box-shadow: 0 0 40px rgba(20,201,121,.18); font-size: 28px; }
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 17px; }
.upload-panel { padding: 22px; }
.segmented { display: flex; padding: 4px; border-radius: 11px; background: #f0f4f2; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { height: 36px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.segmented input:checked + span { color: var(--green-800); background: white; box-shadow: var(--shadow-sm); }
.drop-zone { min-height: 235px; display: grid; place-items: center; align-content: center; gap: 9px; margin-top: 15px; padding: 25px; border: 1.5px dashed #bcd7cb; border-radius: 16px; color: var(--muted); background: #f8fcfa; text-align: center; cursor: pointer; transition: .18s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--green-600); background: #effaf5; }
.drop-zone > i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--green-600); background: var(--green-100); font-size: 22px; }
.drop-zone strong { color: var(--ink); font-size: 12px; }
.drop-zone span, .drop-zone small { font-size: 9px; }
.drop-zone small { color: #9caaa7; }
.drop-zone input { display: none; }
.form-select { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; color: var(--ink-2); background: white; outline: none; }
.import-form-actions { display: flex; align-items: end; gap: 10px; margin-top: 14px; }
.import-form-actions > label { flex: 1; }
.import-form-actions .field-label { margin-top: 0; }
.support-list { display: grid; gap: 9px; padding: 16px; }
.support-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; background: #f7f9f8; }
.support-item i { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--green-600); background: var(--green-100); }
.support-item strong { display: block; font-size: 9px; }
.support-item span { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.learning-note { margin: 0 16px 16px; padding: 12px; color: #526864; border: 1px solid #dcece5; border-radius: 12px; background: #f4fbf7; font-size: 9px; line-height: 1.5; }
.import-preview { margin-top: 17px; overflow: hidden; }
.import-preview-head { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.import-preview-head h3 { margin: 0; font-size: 13px; }
.import-preview-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.detected-bank { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 9px; color: var(--green-800); background: var(--green-100); font-size: 9px; font-weight: 700; }
.import-table-wrap { overflow-x: auto; }
.import-table { min-width: 870px; }
.import-table .data-head, .import-table .data-row { grid-template-columns: 28px 90px minmax(175px, 1.8fr) 100px 145px 165px; }
.import-table input[type="text"], .import-table select { width: 100%; height: 32px; padding: 0 8px; border: 1px solid #e2e9e5; border-radius: 8px; background: #fbfcfb; font-size: 9px; }
.import-table input[type="checkbox"] { accent-color: var(--green-600); }
.memory-badge { width: fit-content; display: flex; align-items: center; gap: 4px; margin-top: 4px; padding: 3px 6px; border-radius: 7px; color: #5e4a9e; background: #f1edff; font-size: 7px; font-weight: 700; }
.split-button { min-height: 31px; width: 100%; padding: 0 8px; border: 1px solid #dbe7e2; border-radius: 8px; color: var(--green-800); background: #f6fbf8; font-size: 8px; font-weight: 700; cursor: pointer; }
.import-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.import-footer span { color: var(--muted); font-size: 9px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.setting-card { padding: 20px; }
.setting-card h3 { margin: 0 0 4px; font-size: 13px; }
.setting-card > p { margin: 0 0 16px; color: var(--muted); font-size: 9px; }
.setting-line { display: flex; justify-content: space-between; align-items: center; gap: 15px; min-height: 54px; border-top: 1px solid #edf1ef; }
.setting-line strong { display: block; font-size: 10px; }
.setting-line span { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border: 0; border-radius: 20px; background: #d8dfdc; cursor: pointer; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: .18s; }
.switch.on { background: var(--green-500); }
.switch.on::after { transform: translateX(16px); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3, 29, 26, .55); backdrop-filter: blur(5px); animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(100%, 620px); max-height: min(88vh, 820px); display: flex; flex-direction: column; border-radius: 22px; background: white; box-shadow: 0 30px 80px rgba(2,30,27,.28); animation: modalIn .24s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.modal.modal-small { max-width: 430px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 21px 23px 16px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 4px 0 0; font: 700 20px "Manrope"; letter-spacing: -.035em; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; display: grid; place-items: center; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(120,140,135,.09); }
.modal-body { overflow-y: auto; padding: 20px 23px 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field { min-width: 0; }
.form-field label { display: block; margin-bottom: 6px; color: #546764; font-size: 10px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 43px; border: 1px solid #dfe7e3; border-radius: 11px; padding: 0 12px; color: var(--ink); background: #fbfcfb; outline: none; }
.form-field textarea { min-height: 78px; resize: vertical; padding-top: 10px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(15,168,142,.09); background: white; }
.form-help { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.color-options { display: flex; gap: 8px; }
.color-options input { position: absolute; opacity: 0; }
.color-options span { width: 27px; height: 27px; display: block; border: 3px solid white; border-radius: 9px; background: var(--color); box-shadow: 0 0 0 1px #dbe3df; cursor: pointer; }
.color-options input:checked + span { box-shadow: 0 0 0 2px var(--color); }
.split-editor { margin-top: 3px; padding: 14px; border: 1px solid #dce9e3; border-radius: 13px; background: #f8fbf9; }
.split-editor-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.split-editor-head strong { font-size: 10px; }
.split-editor-head span { color: var(--muted); font-size: 8px; }
.split-row { display: grid; grid-template-columns: minmax(130px, 1fr) 115px 30px; gap: 7px; margin-top: 7px; }
.split-row select, .split-row input { width: 100%; height: 37px; border: 1px solid #dde6e1; border-radius: 9px; padding: 0 9px; background: white; font-size: 9px; }
.split-row button { width: 30px; height: 37px; display: grid; place-items: center; border: 0; color: var(--red); background: transparent; cursor: pointer; }
.split-summary { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px solid #e0e8e4; color: var(--muted); font-size: 8px; }
.split-summary strong { color: var(--ink); }
.modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 15px; border-top: 1px solid var(--line); }
.danger-button { min-height: 42px; padding: 0 15px; border: 1px solid #ffd7da; border-radius: 11px; color: var(--red); background: #fff7f7; font-size: 11px; font-weight: 700; cursor: pointer; }
.confirm-copy { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.toast-region { position: fixed; z-index: 200; right: 20px; bottom: 22px; display: grid; gap: 9px; pointer-events: none; }
.toast { min-width: 260px; max-width: 360px; display: flex; align-items: center; gap: 10px; padding: 13px 15px; color: white; border-radius: 12px; background: #073d36; box-shadow: var(--shadow-md); font-size: 11px; animation: toastIn .3s ease both; }
.toast.error { background: #9e3541; }
.toast i { color: #77e6ac; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
.empty-state { padding: 45px 20px; display: grid; justify-items: center; color: var(--muted); text-align: center; }
.empty-state > i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--green-600); background: var(--green-100); font-size: 23px; }
.empty-state h3 { margin: 11px 0 3px; color: var(--ink); font-size: 12px; }
.empty-state p { margin: 0; font-size: 9px; }
.sidebar-overlay, .mobile-nav { display: none; }
.menu-button.icon-button, .sidebar-close.icon-button { display: none; }
.sidebar-user > .avatar { display: grid; }

/* Os dois temas evitam preto e branco puros para reduzir contraste agressivo. */
html[data-theme="light"] :is(.login-panel, .metric-card:not(.primary), .panel, .date-pill, .filter-select, .secondary-button, .top-icon, .summary-box, .entity-card:not(.credit-visual), .chip, .form-select, .modal, .setting-card) { background-color: var(--surface); }
html[data-theme="light"] :is(.field-with-icon input, .search-field input, .form-field input, .form-field select, .form-field textarea, .split-row input, .split-row select, .import-table input[type="text"], .import-table select) { background-color: #f8fbf8; }
html[data-theme="light"] .donut::after,
html[data-theme="light"] .segmented input:checked + span,
html[data-theme="light"] .modal-actions,
html[data-theme="light"] .mobile-nav { background: var(--surface); }

html[data-theme="dark"] {
  --ink: #e1eee8;
  --ink-2: #bdd0c8;
  --muted: #78958c;
  --green-950: #051d1a;
  --green-900: #082f2a;
  --green-800: #0b5547;
  --green-600: #19b99b;
  --green-500: #24d383;
  --green-200: #83dcb0;
  --green-100: #143d34;
  --surface: #102a26;
  --surface-2: #091f1c;
  --line: #1d3a34;
  --shadow-sm: 0 1px 2px rgba(2, 14, 13, .14), 0 8px 22px rgba(2, 14, 13, .17);
  --shadow-md: 0 18px 55px rgba(2, 14, 13, .34);
  background: #091f1c;
}
html[data-theme="dark"] body { color: var(--ink); background: radial-gradient(circle at 82% 8%, rgba(20, 150, 113, .055), transparent 30%), var(--surface-2); }
html[data-theme="dark"] .splash-screen { background: radial-gradient(circle at 50% 38%, #123a31, #0a211e 48%, #071a18); }
html[data-theme="dark"] .loading-bar { background: #173a33; }
html[data-theme="dark"] .login-panel { background: radial-gradient(circle at 60% 0, rgba(33,194,127,.09), transparent 38%), #0b211e; }
html[data-theme="dark"] .login-form h2 { color: #e4f0eb; }
html[data-theme="dark"] .field-with-icon input,
html[data-theme="dark"] .search-field input,
html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .split-row input,
html[data-theme="dark"] .split-row select,
html[data-theme="dark"] .import-table input[type="text"],
html[data-theme="dark"] .import-table select,
html[data-theme="dark"] .form-select { color: var(--ink); border-color: #25453e; background: #0c2521; }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #57736b; }
html[data-theme="dark"] :is(.metric-card:not(.primary), .panel, .date-pill, .filter-select, .secondary-button, .top-icon, .summary-box, .entity-card:not(.credit-visual), .chip, .modal, .setting-card) { color: var(--ink); border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] .sidebar { background: radial-gradient(circle at 5% 4%, rgba(33,198,127,.12), transparent 27%), linear-gradient(180deg, #082f2a, #071f1c 64%, #051a17); }
html[data-theme="dark"] .topbar { border-color: rgba(31,62,55,.86); background: rgba(9,31,28,.87); }
html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .transaction-row,
html[data-theme="dark"] .data-row,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-actions,
html[data-theme="dark"] .setting-line,
html[data-theme="dark"] .import-footer,
html[data-theme="dark"] .import-preview-head { border-color: #1c3933; }
html[data-theme="dark"] .transaction-row:hover,
html[data-theme="dark"] .data-row:hover { background: #122f2a; }
html[data-theme="dark"] .data-head { color: #6f8d84; background: #0d2723; }
html[data-theme="dark"] .transaction-icon,
html[data-theme="dark"] .goal-icon,
html[data-theme="dark"] .entity-icon,
html[data-theme="dark"] .metric-icon { background: #153f35; }
html[data-theme="dark"] .person-tag,
html[data-theme="dark"] .split-line,
html[data-theme="dark"] .support-item,
html[data-theme="dark"] .row-actions button,
html[data-theme="dark"] .more-button { color: #a8bdb7; background: #16322d; }
html[data-theme="dark"] .cashflow-body { background: #102a26; }
html[data-theme="dark"] .bar-chart { background: repeating-linear-gradient(to bottom, transparent 0, transparent 37px, #1a3630 38px); }
html[data-theme="dark"] .bar.expense { background: #36534d; }
html[data-theme="dark"] .donut::after { background: var(--surface); }
html[data-theme="dark"] .progress { background: #203d37; }
html[data-theme="dark"] .split-editor,
html[data-theme="dark"] .drop-zone { color: var(--muted); border-color: #315149; background: #0d2723; }
html[data-theme="dark"] .drop-zone:hover,
html[data-theme="dark"] .drop-zone.dragging { border-color: var(--green-600); background: #10342c; }
html[data-theme="dark"] .segmented { background: #0b211e; }
html[data-theme="dark"] .segmented input:checked + span { color: #bce6d3; background: #173b33; }
html[data-theme="dark"] .learning-note { color: #9bb5ad; border-color: #24473e; background: #102f29; }
html[data-theme="dark"] .status-pill { color: #8ed9b4; background: #123a2f; }
html[data-theme="dark"] .status-pill.pending { color: #e4b576; background: #3d2e1d; }
html[data-theme="dark"] .status-pill.duplicate { color: #9aaba7; background: #243a35; }
html[data-theme="dark"] .budget-alert { color: #e3bb86; background: #382a1b; }
html[data-theme="dark"] .modal-backdrop { background: rgba(3, 20, 18, .72); }
html[data-theme="dark"] .mobile-nav { border-color: var(--line); background: rgba(14,42,37,.96); }
html[data-theme="dark"] .mobile-nav .mobile-add { border-color: var(--surface-2); }
html[data-theme="dark"] .toast { background: #125044; }
html[data-theme="dark"] .primary-button { color: #eef8f3; }
html[data-theme="dark"] .credit-visual { color: #eff7f3; }

@media (max-width: 1180px) {
  :root { --sidebar: 236px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .entity-grid { grid-template-columns: repeat(2, 1fr); }
  .login-showcase { padding: 42px 54px; }
}

@media (max-width: 900px) {
  body { padding-bottom: 70px; }
  .login-view { grid-template-columns: 1fr; }
  .login-showcase { display: none; }
  .login-panel { min-height: 100vh; padding: 38px 24px; background: radial-gradient(circle at 50% 0, #e8fff3, transparent 38%), white; }
  .mobile-login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 55px; font: 800 26px "Manrope"; }
  .mobile-login-brand img { width: 48px; border-radius: 14px; }
  .sidebar { width: min(86vw, 310px); transform: translateX(-105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close.icon-button { display: grid; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 35; background: rgba(2,31,27,.48); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; display: block; transition: opacity .25s; }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .main-area { margin-left: 0; }
  .topbar { height: 61px; padding: max(5px, env(safe-area-inset-top)) 16px 0; }
  .menu-button.icon-button { display: grid; }
  .mobile-brand { display: flex; align-items: center; gap: 7px; font: 800 17px "Manrope"; }
  .mobile-brand img { width: 29px; border-radius: 9px; }
  .top-icon[data-action="open-search"], .install-button span { display: none; }
  .install-button { width: 38px; justify-content: center; padding: 0; }
  .top-avatar { display: none; }
  .page-content { padding: 21px 15px 30px; }
  .mobile-nav { position: fixed; z-index: 32; left: 0; right: 0; bottom: 0; height: calc(66px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(16px); box-shadow: 0 -6px 24px rgba(5,47,41,.06); }
  .mobile-nav button { position: relative; border: 0; display: grid; place-content: center; justify-items: center; gap: 3px; color: #85938f; background: transparent; font-size: 8px; }
  .mobile-nav button i { font-size: 18px; }
  .mobile-nav button.active { color: var(--green-600); }
  .mobile-nav .mobile-add { width: 47px; height: 47px; align-self: start; justify-self: center; margin-top: -24px; color: white; border: 5px solid var(--surface-2); border-radius: 50%; background: linear-gradient(135deg, #1cd884, #0fa88e); box-shadow: 0 7px 18px rgba(15,168,142,.28); }
  .mobile-nav .mobile-add i { font-size: 21px; }
  .dashboard-grid, .planning-layout, .import-grid { grid-template-columns: 1fr; }
  .people-summary { grid-template-columns: 1fr 1fr; }
  .debt-hero { grid-column: 1 / -1; }
  .transaction-row { grid-template-columns: 38px minmax(120px, 1fr) auto; }
  .transaction-row .transaction-meta, .transaction-row .person-tags { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .page-head { align-items: center; margin-bottom: 17px; }
  .page-head h1 { font-size: 23px; }
  .page-head p { display: none; }
  .head-actions .date-pill, .head-actions .secondary-button span.hide-mobile { display: none; }
  .primary-button, .secondary-button { min-height: 40px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 15px; border-radius: 15px; }
  .metric-card.primary { grid-column: 1 / -1; }
  .metric-card h2 { margin-top: 11px; font-size: 17px; }
  .metric-card.primary h2 { font-size: 27px; }
  .metric-card:nth-child(4) { grid-column: 1 / -1; }
  .dashboard-grid, .stack { gap: 12px; }
  .panel { border-radius: 15px; }
  .bar-chart { height: 135px; }
  .spending-body { grid-template-columns: 110px 1fr; padding: 15px; }
  .donut { width: 104px; }
  .entity-grid { grid-template-columns: 1fr; gap: 11px; }
  .invoice-summary { grid-template-columns: 1fr 1fr; }
  .invoice-summary .summary-box:last-child { grid-column: 1 / -1; }
  .people-summary { grid-template-columns: 1fr; }
  .debt-hero { grid-column: auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field { max-width: none; }
  .data-head { display: none; }
  .data-row { grid-template-columns: 1fr auto; gap: 7px; padding: 13px 14px; }
  .data-row > *:not(.row-title):not(.row-actions):not(.mobile-value) { display: none; }
  .data-row .row-actions { grid-column: 2; grid-row: 1; }
  .data-row .mobile-value { display: block; grid-column: 1; font-weight: 700; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full, .modal-actions { grid-column: auto; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 23px 23px 0 0; }
  .modal-header, .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal-actions { position: sticky; bottom: -23px; margin: 9px -18px -23px; padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); background: white; }
  .split-row { grid-template-columns: 1fr 100px 28px; }
  .import-hero { padding: 21px; }
  .import-hero h2 { font-size: 18px; }
  .import-hero .ai-orb { width: 49px; height: 49px; font-size: 22px; }
  .import-form-actions { align-items: stretch; flex-direction: column; }
  .import-form-actions .primary-button { width: 100%; }
  .goal-card { grid-template-columns: 42px 1fr; }
  .goal-number { grid-column: 2; text-align: left; }
  .toast-region { left: 12px; right: 12px; bottom: 78px; }
  .toast { min-width: 0; width: 100%; }
}

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