:root {
  --navy: #142e50;
  --teal: #55bba3;
  --teal-dark: #168d81;
  --gold: #efb241;
  --cream: #faf5f3;
  --ink: #182b3e;
  --muted: #526477;
  --line: #e5e9ec;
  --white: #fff;
  --green: #258453;
  --red: #a7473d;
  --amber: #8a610e;
  --shadow: 0 14px 38px rgba(20, 46, 80, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f7f9f8; color: var(--ink); font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr) 310px; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px; background: var(--white); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.brand { display: flex; align-items: center; padding: 4px 9px 24px; }
.brand img { display: block; width: 172px; height: auto; }
.nav-link { min-height: 44px; padding: 0 12px; border-radius: 12px; display: flex; align-items: center; gap: 11px; text-decoration: none; color: #4b5d70; font-weight: 600; }
.nav-link:hover, .nav-link.active { background: #e8f5f1; color: var(--navy); }
.nav-ico { width: 21px; text-align: center; color: var(--teal-dark); font-size: 17px; }
.house-mini { margin-top: auto; padding: 12px; border-radius: 14px; background: var(--cream); color: var(--navy); font-size: 13px; }
.house-mini small { display: block; color: var(--muted); margin-top: 3px; }
.workspace { min-width: 0; }
.fini-screen .shell { grid-template-columns: 232px minmax(0, 1fr); }
.fini-screen .chat-panel { display: none; }
.topbar { min-height: 72px; position: sticky; top: 0; z-index: 5; padding: 12px 30px; display: flex; align-items: center; gap: 16px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; flex: 1; color: var(--navy); font-size: 23px; letter-spacing: -.03em; }
.topbar .desktop-brand { display: none; }
.button { min-height: 46px; border: 0; border-radius: 999px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--navy); color: white; text-decoration: none; font-weight: 700; cursor: pointer; }
.button:hover { filter: brightness(1.08); }
.button.secondary { color: var(--navy); background: white; border: 1px solid #d8e1e5; }
.button.whatsapp { background: #168857; }
.button.small { min-height: 40px; padding: 0 14px; font-size: 13px; }
.content { width: min(100%, 1180px); margin: 0 auto; padding: 26px 30px 38px; }
.page-heading { display: flex; align-items: flex-end; gap: 18px; margin: 4px 0 22px; }
.page-heading h2 { margin: 0; color: var(--navy); font-size: 25px; letter-spacing: -.03em; }
.page-heading p { margin: 4px 0 0; color: var(--muted); }
.page-heading .button { margin-left: auto; }
.card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 12px rgba(20,46,80,.025); }
.card-pad { padding: 20px; }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--navy); font-size: 16px; }
.eyebrow { margin: 0 0 7px; color: var(--teal-dark); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.muted { color: var(--muted); }
.demo-note { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; background: #fff5dd; color: #72520c; font-size: 11px; font-weight: 700; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.metric-card { padding: 17px 18px; }
.metric-card span { display: block; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; color: var(--navy); margin: 6px 0 3px; font-size: 25px; letter-spacing: -.03em; }
.metric-card strong.positive { color: var(--green); }
.metric-card small { color: #7b8791; font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 14px; margin-top: 14px; }
.stack { display: grid; gap: 14px; align-content: start; }
.goal { padding: 19px 20px; background: linear-gradient(135deg, #fff 0%, #f0faf6 100%); }
.goal-head { display: flex; align-items: flex-start; gap: 12px; }
.goal-head h3 { flex: 1; margin: 0; color: var(--navy); font-size: 17px; }
.goal-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.goal-icon { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 14px; background: #fff2d1; display: grid; place-items: center; color: #9a690a; font-size: 19px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; margin: 17px 0 8px; color: var(--muted); font-size: 12px; }
.progress-copy strong { color: var(--navy); }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #e9efed; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.goal-foot { margin-top: 10px; color: var(--muted); font-size: 12px; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; text-align: center; }
.calendar .dow { padding-bottom: 5px; color: #89949e; font-size: 10px; font-weight: 700; }
.calendar .day { min-height: 31px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #697987; font-size: 11px; }
.calendar .ok { background: #e0f2e5; color: #23653a; }
.calendar .near { background: #fff0cc; color: #805b08; }
.calendar .over { background: #f9e1dc; color: #984638; }
.calendar .today { outline: 2px solid var(--navy); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.budget-list { display: grid; gap: 14px; }
.budget-row { display: grid; gap: 6px; }
.budget-head { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 12px; }
.budget-head strong { color: var(--navy); }
.budget-head span { color: var(--muted); white-space: nowrap; }
.budget-track { height: 7px; border-radius: 99px; background: #edf0ef; overflow: hidden; }
.budget-track span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.budget-track span.near { background: var(--gold); }
.budget-track span.over { background: #df806e; }
.text-link { color: var(--teal-dark); font-size: 12px; font-weight: 700; text-decoration: none; }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 15px; }
.filter { min-height: 40px; padding: 0 12px; border: 1px solid #dce4e7; border-radius: 12px; background: white; color: #465c70; font-size: 12px; }
.filter.active { border-color: var(--navy); background: var(--navy); color: white; }
.search { min-height: 42px; flex: 1 1 180px; padding: 0 14px; border: 1px solid #dce4e7; border-radius: 12px; background: white; color: var(--ink); }
.movement-list { display: grid; gap: 13px; }
.movement-group { padding: 18px; }
.group-heading { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; color: var(--navy); font-size: 13px; }
.group-heading span { color: var(--muted); font-size: 11px; font-weight: 500; }
.movement { min-height: 66px; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f0f2f3; }
.movement:first-of-type { border-top: 0; }
.move-icon { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; background: #edf7f4; color: var(--teal-dark); font-weight: 800; }
.move-details { min-width: 0; flex: 1; }
.move-details strong { display: block; overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.move-details small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.move-amount { color: var(--navy); font-size: 13px; font-weight: 800; white-space: nowrap; }
.move-amount.income { color: var(--green); }
.icon-button { min-width: 40px; min-height: 40px; border: 1px solid #dfe6e8; border-radius: 12px; background: white; color: var(--navy); cursor: pointer; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 740px; }
th { padding: 12px 13px; border-bottom: 1px solid var(--line); color: #73818d; font-size: 10px; text-align: left; }
td { padding: 13px; border-bottom: 1px solid #f0f2f3; color: #40566a; font-size: 12px; }
td strong { color: var(--navy); }
.table-action { border: 0; background: none; color: var(--teal-dark); font-size: 11px; font-weight: 700; cursor: pointer; }
.table-action.danger { color: var(--red); }
.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.account-card { padding: 18px; position: relative; overflow: hidden; }
.account-card:after { content: ""; position: absolute; top: -42px; right: -32px; width: 112px; height: 112px; border-radius: 50%; background: #eef8f5; }
.account-top { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 11px; }
.account-symbol { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: #e8f5f1; color: var(--navy); font-size: 19px; }
.account-name { flex: 1; min-width: 0; }
.account-name strong { display: block; color: var(--navy); font-size: 14px; }
.account-name small { display: block; color: var(--muted); font-size: 11px; }
.account-menu { position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.account-bottom { position: relative; z-index: 1; display: flex; align-items: end; justify-content: space-between; gap: 8px; margin-top: 24px; }
.account-bottom span { color: var(--muted); font-size: 10px; }
.account-bottom strong { color: var(--navy); font-size: 17px; }
.type-chip { display: inline-flex; margin-top: 14px; padding: 4px 8px; border-radius: 99px; background: #f4f7f7; color: #5c6d7d; font-size: 10px; }
.notice { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border: 1px solid #dcefe8; border-radius: 16px; background: #eff8f4; color: #315e53; font-size: 12px; }
.notice strong { color: var(--navy); }
.form-grid { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 10px; align-items: end; }
.field { display: grid; gap: 6px; color: #4d6072; font-size: 11px; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #d7e0e4; border-radius: 12px; background: white; color: var(--ink); }
.safe-note { display: flex; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.bottom-nav { display: none; }
.chat-panel { position: sticky; top: 0; height: 100vh; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px; border-left: 1px solid var(--line); background: #fff; }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow: auto; padding: 10px 2px; }
.chat-composer { display: grid; gap: 8px; margin-top: auto; }
.chat-composer input { min-height: 44px; min-width: 0; padding: 0 12px; border: 1px solid #dfe6e8; border-radius: 12px; color: var(--ink); }
.chat-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-tools button, .chat-tools a { min-height: 36px; padding: 0 9px; border: 1px solid #dfe6e8; border-radius: 10px; background: white; color: var(--navy); font-size: 10px; text-decoration: none; }
.chat-tools .button { min-height: 36px; border: 0; background: var(--navy); color: white; }
.desktop-whatsapp { font-size: 10px; }
.more-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.more-item { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; background: white; color: var(--navy); text-decoration: none; font-weight: 700; }
.more-item small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; }
.more-item.disabled { color: #778591; background: #f8faf9; }
.budget-input { width: 100px; min-height: 40px; padding: 0 10px; border: 1px solid #dce4e7; border-radius: 10px; text-align: right; }
.budget-edit { display: flex; align-items: center; gap: 8px; }
.fini-page { min-height: calc(100vh - 72px); display: flex; flex-direction: column; }
.fini-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 16px 0; }
.fini-bubble { max-width: 88%; padding: 12px 14px; border-radius: 16px; background: white; border: 1px solid var(--line); }
.fini-bubble.user { align-self: flex-end; background: #e1f5ee; border: 0; }
.fini-form { padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.fini-form .field input { min-height: 48px; }
.fini-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.fini-tools button { min-height: 42px; }
.chat-title { display: flex; align-items: center; gap: 9px; padding-bottom: 10px; border-bottom: 1px solid #edf0f1; }
.chat-title img { width: 35px; height: 35px; object-fit: contain; border-radius: 50%; }
.chat-title strong { display: block; color: var(--navy); font-size: 12px; }
.chat-title small { color: var(--muted); font-size: 10px; }
.chat-sample { margin: 12px 0; padding: 10px; border-radius: 12px 12px 12px 3px; background: #f2f7f5; color: #385267; font-size: 11px; }
.chat-input { min-height: 38px; padding: 8px 10px; border: 1px solid #dfe6e8; border-radius: 12px; color: #89949e; font-size: 10px; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, .9fr) minmax(340px, 1fr); align-items: center; gap: clamp(36px, 8vw, 110px); padding: clamp(26px, 6vw, 80px); background: radial-gradient(ellipse at 9% 12%, #e6f5f1 0, transparent 28%), var(--cream); }
.login-brand { max-width: 440px; margin: 0 auto; }
.login-brand img { width: min(100%, 300px); height: auto; margin-bottom: 42px; }
.login-brand h1 { margin: 0 0 16px; color: var(--navy); font-size: clamp(35px, 4vw, 52px); line-height: 1.06; letter-spacing: -.045em; }
.login-brand p { color: var(--muted); font-size: 17px; }
.login-points { display: grid; gap: 10px; margin-top: 26px; color: #3c5c67; font-size: 13px; }
.login-points span { display: flex; align-items: center; gap: 9px; }
.login-card { width: min(100%, 440px); margin: 0 auto; padding: clamp(23px,4vw,38px); background: white; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.login-card .mark { width: 54px; height: 54px; object-fit: cover; border-radius: 16px; margin-bottom: 21px; }
.login-card h2 { margin: 0 0 7px; color: var(--navy); font-size: 27px; line-height: 1.15; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.login-card .button { width: 100%; min-height: 52px; }
.login-help { margin: 15px 0 0 !important; text-align: center; font-size: 11px !important; }
.login-state { display: none; margin-top: 16px; padding: 12px; border: 1px solid #cfe8df; border-radius: 14px; background: #eff8f4; color: #325c50; font-size: 12px; }
.login-state.show { display: block; }
.state-switch { display: flex; gap: 8px; margin-top: 23px; padding-top: 18px; border-top: 1px solid #edf0f1; }
.state-switch button { min-height: 38px; flex: 1; padding: 0 7px; border: 1px solid #dfe6e8; border-radius: 11px; background: white; color: #53687a; font-size: 10px; font-weight: 700; cursor: pointer; }
.expired { display: none; margin: -8px 0 17px; padding: 11px 12px; border: 1px solid #f1d4cd; border-radius: 13px; background: #fff4f1; color: #88473a; font-size: 12px; }
.expired.show { display: block; }
.app-install { min-height: 100vh; padding: 32px 18px 48px; background: radial-gradient(ellipse at 50% 0%, #e4f5f0 0, transparent 35%), #f8faf9; }
.install-wrap { width: min(820px, 100%); margin: auto; }
.install-header { display: flex; justify-content: center; margin: 10px 0 28px; }
.install-header img { width: 176px; }
.install-hero { padding: 28px; text-align: center; }
.install-icon { width: 98px; height: 98px; object-fit: cover; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 9px 24px rgba(20,46,80,.1); }
.install-hero h1 { margin: 16px 0 7px; color: var(--navy); font-size: 29px; letter-spacing: -.035em; }
.install-hero p { max-width: 460px; margin: auto; color: var(--muted); }
.install-steps { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.step-card { padding: 20px; }
.step-card h2 { margin: 0 0 15px; color: var(--navy); font-size: 17px; }
.step-line { display: flex; gap: 12px; align-items: flex-start; margin: 13px 0; }
.step-number { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: #e7f5f1; color: var(--navy); font-size: 12px; font-weight: 800; }
.step-line p { margin: 2px 0 0; color: #4d6072; font-size: 13px; }
.step-line strong { color: var(--navy); }
.install-footer { margin-top: 14px; text-align: center; color: #778591; font-size: 11px; }
dialog { max-width: min(420px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 20px 70px rgba(15,34,56,.24); color: var(--ink); }
dialog::backdrop { background: rgba(16,34,53,.42); backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 8px; color: var(--navy); font-size: 19px; }
dialog p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.dialog-actions button { min-height: 42px; }
@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .chat-panel { display: none; }
}
@media (max-width: 760px) {
  body { background: #f7f9f8; font-size: 14px; }
  .shell { display: block; min-height: 100vh; }
  .sidebar { display: none; }
  .topbar { min-height: 62px; padding: 9px 15px; }
  .topbar h1 { font-size: 19px; }
  .topbar .button { min-height: 40px; padding: 0 12px; font-size: 11px; }
  .content { padding: 17px 14px 94px; }
  .page-heading { display: block; margin: 1px 0 16px; }
  .page-heading h2 { font-size: 21px; }
  .page-heading p { font-size: 12px; }
  .page-heading .button { width: 100%; margin: 13px 0 0; }
  .card { border-radius: 18px; }
  .card-pad { padding: 16px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .metric-card { padding: 13px; border-radius: 17px; }
  .metric-card span { font-size: 11px; }
  .metric-card strong { font-size: 20px; }
  .metric-card small { font-size: 10px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .stack { gap: 10px; }
  .goal { padding: 16px; }
  .card-title { margin-bottom: 12px; font-size: 14px; }
  .calendar { gap: 3px; }
  .calendar .day { min-height: 29px; font-size: 10px; }
  .calendar .dow { font-size: 9px; }
  .legend { gap: 7px 10px; font-size: 9px; }
  .list-toolbar { gap: 7px; margin-bottom: 11px; }
  .filter { min-height: 38px; padding: 0 10px; font-size: 11px; }
  .search { flex-basis: 100%; }
  .movement-group { padding: 15px; }
  .movement { min-height: 61px; gap: 9px; }
  .move-icon { width: 35px; height: 35px; }
  .move-details strong, .move-amount { font-size: 12px; }
  .move-details small { font-size: 9px; }
  .card-grid { grid-template-columns: 1fr; gap: 9px; }
  .account-card { padding: 15px; }
  .account-bottom { margin-top: 13px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .field:first-child { grid-column: 1 / -1; }
  .form-grid .button { grid-column: 1 / -1; width: 100%; }
  .more-grid { grid-template-columns: 1fr; gap: 8px; }
  .fini-page { min-height: calc(100svh - 130px); }
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; min-height: 68px; display: grid; grid-template-columns: repeat(4,1fr); padding: 5px 7px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid #e3e8e9; background: rgba(255,255,255,.97); backdrop-filter: blur(14px); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; color: #657687; text-decoration: none; font-size: 9px; font-weight: 700; }
  .bottom-nav a.active { color: var(--navy); }
  .bottom-nav .nav-ico { font-size: 18px; }
  .login-page { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 23px; padding: 24px 17px; }
  .login-brand { width: min(100%, 420px); text-align: center; }
  .login-brand img { width: 150px; margin: 0 auto 16px; }
  .login-brand h1 { max-width: 360px; margin: 0 auto 8px; font-size: 29px; }
  .login-brand p { max-width: 370px; margin: auto; font-size: 13px; }
  .login-points { display: none; }
  .login-card { width: min(100%, 420px); padding: 20px; border-radius: 22px; }
  .login-card .mark { display: none; }
  .login-card h2 { font-size: 22px; }
  .login-card > p { font-size: 12px; }
  .state-switch { margin-top: 16px; padding-top: 13px; }
  dialog.sheet { width: 100%; max-width: none; max-height: 88vh; margin: auto 0 0; border-radius: 22px 22px 0 0; padding: 22px 17px max(20px, env(safe-area-inset-bottom)); }
  .dialog-actions { flex-wrap: wrap; }
  .app-install { min-height: 100svh; padding: 15px 14px 30px; }
  .install-header { margin: 4px 0 15px; }
  .install-header img { width: 142px; }
  .install-hero { padding: 20px 15px; }
  .install-icon { width: 76px; height: 76px; border-radius: 19px; }
  .install-hero h1 { font-size: 23px; }
  .install-hero p { font-size: 12px; }
  .install-steps { grid-template-columns: 1fr; gap: 9px; margin-top: 9px; }
  .step-card { padding: 15px; }
  .step-card h2 { margin-bottom: 10px; font-size: 15px; }
  .step-line { margin: 9px 0; }
  .step-line p { font-size: 12px; }
}
