:root {
  color-scheme: dark;
  --bg: #131a29;
  --surface: #1e273b;
  --surface-raised: #263149;
  --surface-soft: #192235;
  --line: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --faint: #718096;
  --accent: #639bf7;
  --accent-strong: #80adff;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5fb;
  --surface: #ffffff;
  --surface-raised: #f5f7fb;
  --surface-soft: #edf2fa;
  --line: #d7dfeb;
  --text: #18243a;
  --muted: #64748b;
  --faint: #8290a4;
  --accent: #3478e5;
  --accent-strong: #2464cd;
  --green: #059669;
  --red: #dc5656;
  --amber: #b7791f;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); }
body, button, input, select { font-family: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.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; }
.muted { color: var(--muted); line-height: 1.6; }
.eyebrow { margin: 0 0 6px; color: var(--faint); font-size: 9px; font-weight: 760; letter-spacing: .15em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 18px; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 17px; letter-spacing: -.035em; }
h3 { margin: 0; font-size: 14px; font-weight: 680; letter-spacing: -.02em; }

.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 70% 20%, #263c64 0, transparent 42%), var(--bg); }
.login-card { width: min(100%, 430px); padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 30px 90px #0005; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; letter-spacing: -.07em; }
.login-card .brand { margin-bottom: 30px; }
.brand-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: var(--accent); color: white; font-size: 17px; }
.brand-accent { color: var(--accent); }
.login-card h1 { margin: 12px 0; font-size: 37px; line-height: 1.05; }
.login-card > .muted { margin-bottom: 20px; font-size: 12px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.auth-tab { min-height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.auth-tab.active { background: var(--surface-raised); color: var(--text); box-shadow: 0 2px 8px #0002; }
.login-form { display: grid; gap: 9px; margin-top: 18px; }
.login-form label, .dialog-card label, .export-panel > label { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 650; }
.login-form input { min-height: 44px !important; }
.login-form .button { margin-top: 5px; }
.login-card > .form-error { margin-top: 9px; }
.oauth-providers { display: grid; gap: 9px; margin-top: 20px; }
.oauth-divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 10px; }
.oauth-divider::before, .oauth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.oauth-button { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--text); font-size: 12px; font-weight: 650; transition: border-color .18s, background .18s; }
.oauth-button:hover { border-color: var(--accent); background: var(--surface-raised); }
.oauth-button.inactive { opacity: .58; }
.oauth-button.inactive:hover { border-color: var(--line); background: var(--surface-soft); }
.oauth-button svg { width: 18px; height: 18px; flex: 0 0 auto; }
.oauth-provider-error { margin-top: 10px; text-align: center; }
.admin-token-access { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 13px; }
.admin-token-access summary { color: var(--muted); cursor: pointer; font-size: 10px; text-align: center; }
.admin-token-access[open] summary { margin-bottom: 12px; }
.admin-token-access .login-form { margin-top: 0; }
.login-footnote { margin: 15px 0 0; color: var(--faint); font-size: 10px; text-align: center; }

.app-shell { min-height: 100vh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.app-container { width: min(100%, 540px); min-height: 100vh; margin: 0 auto; padding: 24px 20px 24px; }
.welcome-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 21px; }
.header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.whatsapp-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; border: 1px solid #25d366; border-radius: 12px; background: #25d366; color: #062b19; font-size: 10px; font-weight: 750; white-space: nowrap; }
.whatsapp-button:hover { border-color: #51e184; background: #51e184; }
.whatsapp-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.welcome-copy { display: flex; min-width: 0; align-items: center; gap: 12px; }
.welcome-copy .eyebrow { margin-bottom: 4px; }
.welcome-copy h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid #639bf755; border-radius: 15px; background: linear-gradient(145deg, #639bf7, #4564b7); color: #fff; font-size: 19px; font-weight: 800; }
.icon-button { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); font-size: 20px; }
.icon-button:hover { border-color: var(--accent); color: var(--accent); }
.status-message { min-height: 0; color: var(--muted); font-size: 12px; }
.status-message:not(:empty) { margin: -8px 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.status-message.error { border-color: #8c4145; color: var(--red); }

.app-view { display: none; animation: view-in .2s ease both; }
.app-view.active { display: block; }
@keyframes view-in { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.segment-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.segment-button { min-height: 35px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 640; }
.segment-button.active { background: var(--surface-raised); color: var(--text); box-shadow: 0 1px 5px #0002; }
.segment-button:disabled { cursor: not-allowed; opacity: .45; }
.quick-filters, .transaction-filter-row { display: flex; gap: 8px; margin: 14px 0 22px; }
.filter-chip { width: auto; min-height: 35px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; }
.filter-chip:focus, input:focus, select:focus { outline: 2px solid #639bf766; outline-offset: 1px; }

.content-section { margin: 0 0 24px; scroll-margin-top: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.section-heading .eyebrow { margin-bottom: 4px; }
.text-link { padding: 5px 0 5px 8px; border: 0; background: transparent; color: var(--accent); font-size: 11px; font-weight: 680; white-space: nowrap; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.account-card { display: flex; min-width: 0; min-height: 104px; flex-direction: column; justify-content: space-between; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.account-card-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.account-icon, .summary-icon, .movement-icon, .profile-row-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: #639bf71b; color: var(--accent); font-size: 15px; }
.currency-badge { padding: 4px 7px; border-radius: 7px; background: var(--surface-raised); color: var(--muted); font-size: 9px; font-weight: 700; }
.account-name { overflow: hidden; margin-top: 8px; font-size: 11px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.account-amount { margin-top: 3px; font-size: 14px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.empty-create { display: grid; min-height: 88px; grid-column: 1 / -1; place-items: center; padding: 13px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 11px; text-align: center; }
.empty-create span { display: grid; width: 28px; height: 28px; margin-bottom: 5px; place-items: center; border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 19px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 10px 0; }
.balance-slot { display: contents; }
.currency-balance.default-balance { order: 1; }
.outflow-summary { order: 2; }
.currency-balance:not(.default-balance) { order: 3; }
.summary-card { display: flex; min-width: 0; min-height: 112px; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.summary-card .eyebrow { margin-bottom: 5px; }
.summary-amount { display: block; overflow: hidden; font-size: 16px; font-weight: 770; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-caption { margin-top: 5px; color: var(--muted); font-size: 9px; }
.summary-icon { width: 34px; height: 34px; }
.summary-icon.eye-button { padding: 0; border: 1px solid var(--line); background: var(--surface-raised); cursor: pointer; }
.outflow-summary { min-height: 84px; margin: 0; }
.outflow-summary .summary-amount { margin-top: 5px; }
.expense-icon { background: #f871711a; color: var(--red); }
.amount-income { color: var(--green) !important; }
.amount-expense { color: var(--red) !important; }
.home-section { padding-top: 4px; }
.progress-list, .activity-list { display: grid; gap: 9px; }
.progress-item, .activity-item { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.progress-list:not(.show-extra) .extra-list-item, .activity-list:not(.show-extra) .extra-list-item { display: none; }
.progress-top, .progress-foot { display: flex; align-items: center; justify-content: space-between; gap: 9px; font-size: 10px; }
.progress-top { color: var(--text); font-weight: 620; }
.progress-top small { color: var(--muted); font-size: 9px; font-weight: 500; }
.progress-foot { color: var(--muted); font-size: 9px; }
.progress-track { height: 5px; margin: 10px 0 8px; overflow: hidden; border-radius: 99px; background: var(--surface-raised); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.progress-fill.warning { background: var(--amber); }
.progress-fill.danger { background: var(--red); }
.budget-alert { color: var(--amber) !important; }
.activity-item { display: flex; min-width: 0; align-items: center; gap: 10px; }
.activity-item .movement-icon { width: 35px; height: 35px; }
.activity-copy { min-width: 0; flex: 1; }
.activity-title { overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.activity-subtitle { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.activity-amount { flex: 0 0 auto; font-size: 11px; font-weight: 720; font-variant-numeric: tabular-nums; }
.activity-actions { display: flex; gap: 4px; margin-left: 4px; }
.debt-card { display: grid; min-width: 0; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.debt-card-head, .debt-card-topline, .debt-card-stat-row, .debt-calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.debt-card-head { min-width: 0; }
.debt-card-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.debt-details-toggle { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; padding: 0; border: 0; border-radius: 8px; background: var(--surface-raised); color: var(--muted); font-size: 13px; cursor: pointer; }
.debt-details-toggle:hover, .debt-details-toggle:focus-visible { background: #639bf71b; color: var(--accent); }
.debt-card-details { display: grid; min-width: 0; gap: 10px; }
.debt-card-details[hidden] { display: none; }
.debt-card-name { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.debt-card-subtitle { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.debt-badges { display: flex; flex: 0 0 auto; gap: 5px; }
.debt-badge { padding: 2px 8px; border-radius: 8px; background: var(--surface-raised); color: var(--muted); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.debt-badge.active { background: #fbbf241a; color: var(--amber); }
.debt-badge.paid { background: #34d3991b; color: var(--green); }
.debt-installment-highlight { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface-soft); }
.debt-installment-highlight small, .debt-installment-highlight strong { display: block; }
.debt-installment-highlight small { color: var(--muted); font-size: 0.72rem; }
.debt-installment-highlight strong { overflow: hidden; margin-top: 3px; font-size: 1.05rem; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.debt-installment-highlight > div { min-width: 0; }
.debt-card-topline { min-width: 0; color: var(--muted); font-size: 0.78rem; }
.debt-card-topline span, .debt-card-topline strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debt-card-topline strong { color: var(--text); font-size: inherit; font-weight: 600; }
.debt-progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: var(--surface-raised); }
.debt-progress-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.debt-calendar-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 0.78rem; font-weight: 650; text-align: left; }
.debt-calendar { display: grid; gap: 8px; }
.debt-calendar-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; }
.debt-calendar-number { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: var(--surface-raised); color: var(--muted); font-size: 9px; }
.debt-calendar-copy strong, .debt-calendar-copy small { display: block; }
.debt-calendar-copy strong { font-size: 9px; font-weight: 650; }
.debt-calendar-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.debt-calendar-status { color: var(--muted); font-size: 8px; white-space: nowrap; }
.debt-calendar-status.paid { color: var(--green); }
.debt-pay-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto 34px; gap: 6px; }
.debt-pay-row select, .debt-pay-row .button, .debt-pay-row .table-action { box-sizing: border-box; height: 34px; min-height: 34px; padding: 0 10px; font-size: 0.8rem; }
.debt-pay-row select:not(.filter-chip) { width: 100%; min-height: 34px; padding: 0 10px; overflow: hidden; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.debt-pay-row .table-action { width: 34px; padding: 0; font-size: 1rem; }
.debt-pay-row .button:disabled { cursor: not-allowed; opacity: .5; }
#homeDebts { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.debt-preview { margin: 0; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.table-action { min-height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 9px; }
.table-action:hover { border-color: var(--accent); color: var(--accent); }
.empty-state { margin: 0; padding: 18px 12px; color: var(--faint); font-size: 11px; text-align: center; }
.empty-state.dashed { border: 1.5px dashed var(--line); border-radius: var(--radius); }

.view-title { margin: 4px 0 16px; }
.view-title h2 { font-size: 23px; }
.transactions-balance { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #233454, var(--surface)); }
:root[data-theme="light"] .transactions-balance { background: linear-gradient(135deg, #e1ecff, var(--surface)); }
.transactions-balance span { display: block; color: var(--muted); font-size: 10px; }
.transactions-balance strong { display: block; margin-top: 5px; font-size: 19px; letter-spacing: -.04em; }
.transactions-balance small { color: var(--muted); font-size: 9px; }
.transaction-search { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.transaction-search input { min-width: 0; min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 11px; outline: none; }
.transaction-filter-row { margin: 0 0 13px; }
.transaction-filter-row .filter-chip { flex: 1; min-width: 0; }
.transaction-filter-row .transaction-export-button { min-height: 35px; flex: 0 0 auto; padding: 0 10px; font-size: 10px; white-space: nowrap; }
.inner-tabs { margin-bottom: 12px; }
.inner-tabs .segment-button { min-height: 32px; }
.quick-group-grid { display: flex; gap: 8px; margin: 0 -2px 18px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.quick-group-grid::-webkit-scrollbar { display: none; }
.quick-group-card { display: flex; min-width: 105px; min-height: 88px; flex-direction: column; justify-content: space-between; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); text-align: left; }
.quick-group-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.quick-group-card .group-emoji { font-size: 18px; }
.quick-group-card strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.quick-group-card small { color: var(--muted); font-size: 9px; }
.transaction-heading { margin-top: 2px; }
.transaction-heading h3 { font-size: 13px; }
.transaction-day { margin: 16px 0 7px; color: var(--muted); font-size: 10px; font-weight: 650; }
.transaction-day:first-child { margin-top: 0; }

.report-tabs { margin-bottom: 16px; }
.report-panel { display: grid; gap: 12px; }
.insight-banner { display: flex; align-items: flex-start; gap: 11px; padding: 15px; border: 1px solid #639bf74d; border-radius: var(--radius); background: linear-gradient(120deg, #243d67, #1d2b45); }
:root[data-theme="light"] .insight-banner { background: linear-gradient(120deg, #e0ebff, #f3f7ff); }
.insight-spark { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #639bf72b; color: var(--accent); }
.insight-banner .eyebrow { color: var(--accent-strong); }
.insight-banner p:last-child { margin: 0; color: var(--text); font-size: 11px; line-height: 1.55; }
.report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.metric-card { min-width: 0; padding: 11px 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.metric-card span, .metric-card small { display: block; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.metric-card strong { display: block; overflow: hidden; margin: 8px 0 5px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { color: var(--faint); font-size: 8px; }
.panel { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.report-chart .section-heading { margin-bottom: 17px; }
.report-bars { display: grid; gap: 13px; }
.report-bar-row { display: grid; grid-template-columns: minmax(68px, .7fr) minmax(80px, 1.5fr) auto; align-items: center; gap: 9px; }
.report-bar-label { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-raised); }
.report-bar-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.report-bar-value { color: var(--text); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.export-panel { display: grid; gap: 12px; }
.export-panel > h3 { margin-top: -6px; font-size: 18px; }
.export-panel select { margin-top: -7px; }
.choice-group { display: grid; gap: 10px; margin: 2px 0 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; }
.choice-group legend { padding: 0 5px; color: var(--muted); font-size: 10px; font-weight: 650; }
.choice-group label { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 10px; }
.choice-group input { width: 15px; height: 15px; min-height: auto; margin: 0; accent-color: var(--accent); }

.profile-card { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.profile-avatar { width: 48px; height: 48px; border-radius: 16px; }
.profile-card h3 { margin-bottom: 4px; }
.profile-card p { margin: 0; font-size: 10px; }
.profile-section { display: grid; gap: 2px; margin-bottom: 19px; }
.profile-section > .eyebrow { margin-bottom: 7px; }
.profile-row { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 11px 9px; border-bottom: 1px solid var(--line); }
.profile-row:last-child { border-bottom: 0; }
.profile-row-icon { width: 31px; height: 31px; }
.whatsapp-profile-row { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.whatsapp-profile-icon { background: #25d36624; color: #25d366; }
.whatsapp-profile-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.whatsapp-channel-actions { display: grid; gap: 8px; padding: 8px 0 0 50px; }
.whatsapp-code-box { display: grid; gap: 7px; padding: 17px; border: 1px dashed #25d36688; border-radius: 14px; background: #25d36610; text-align: center; }
.whatsapp-code-box strong { color: var(--green); font-size: 24px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.whatsapp-code-box small { color: var(--muted); font-size: 10px; }
.whatsapp-code-box small span { color: var(--text); font-weight: 650; }
.whatsapp-link-dialog-card > .muted { margin: 0; font-size: 11px; }
.whatsapp-link-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.profile-row-copy { min-width: 0; flex: 1; }
.profile-row-copy strong, .profile-row-copy small { display: block; }
.profile-row-copy strong { font-size: 10px; font-weight: 650; }
.profile-row-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.connection-status { flex: 0 0 auto; color: var(--faint); font-size: 9px; }
.connection-status.connected { color: var(--green); }
.profile-action { width: 100%; border-top: 0; border-right: 0; border-left: 0; background: transparent; text-align: left; }
.profile-action > span:last-child, .profile-row > span:last-child { color: var(--muted); }
.theme-row { cursor: pointer; }
.theme-toggle { width: 35px; height: 20px; min-height: auto; margin: 0; appearance: none; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-raised); transition: .2s; }
.theme-toggle::before { display: block; width: 14px; height: 14px; margin: 2px; border-radius: 50%; background: var(--muted); content: ""; transition: .2s; }
.theme-toggle:checked { border-color: var(--accent); background: var(--accent); }
.theme-toggle:checked::before { transform: translateX(15px); background: white; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 12px; font-size: 12px; font-weight: 700; transition: background .18s ease, transform .18s ease; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-strong); }
.button-outline { border-color: var(--line); background: transparent; color: var(--text); }
.button-outline:hover { background: var(--surface-raised); }
.button-wide { width: 100%; }
.logout-button { margin: 3px 0 12px; }
.page-footer { display: flex; justify-content: space-between; gap: 10px; padding: 15px 0 0; border-top: 1px solid var(--line); color: var(--faint); font-size: 9px; }

.bottom-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: grid; width: min(100%, 540px); height: calc(68px + env(safe-area-inset-bottom)); grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: center; margin: 0 auto; padding: 4px 10px env(safe-area-inset-bottom); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; background: color-mix(in srgb, var(--bg) 94%, transparent); box-shadow: 0 -10px 30px #0002; backdrop-filter: blur(18px); }
.bottom-nav-item { display: grid; min-width: 0; justify-items: center; gap: 3px; padding: 5px 2px; border: 0; background: transparent; color: var(--faint); }
.bottom-nav-item > span { font-size: 20px; line-height: 1; }
.bottom-nav-item small { font-size: 8px; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item.active small { color: var(--text); font-weight: 650; }
.quick-create-button { display: grid; width: 53px; height: 53px; justify-self: center; place-items: center; margin-top: -28px; border: 5px solid var(--bg); border-radius: 50%; background: var(--accent); box-shadow: 0 8px 24px #639bf755; color: white; }
.quick-create-button span { margin-top: -3px; font-size: 31px; font-weight: 350; line-height: 1; }

select:not(.filter-chip), input:not([type="checkbox"]):not([type="radio"]):not([type="search"]) { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: var(--surface-soft); color: var(--text); }
input[type="search"] { width: 100%; min-height: 40px; }
.transaction-dialog, .quick-dialog { width: min(calc(100% - 24px), 510px); max-height: min(92dvh, 760px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); }
.quick-dialog { align-self: end; margin: 0 auto 78px; }
.transaction-dialog::backdrop, .quick-dialog::backdrop { background: #080d18bb; backdrop-filter: blur(5px); }
.dialog-card, .quick-dialog-card { display: grid; gap: 10px; padding: 21px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.dialog-heading h2 { font-size: 21px; }
.dialog-card label { display: block; }
.dialog-card input, .dialog-card select { min-height: 41px; }
.form-row { display: grid; grid-template-columns: 1fr 100px; gap: 10px; }
.form-row > div { display: grid; gap: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.form-error { min-height: 15px; margin: 0; color: var(--red); font-size: 10px; }
.quick-action { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); text-align: left; }
.quick-action > span:first-child { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: #639bf71b; color: var(--accent); font-size: 17px; }
.quick-action > span:nth-child(2) { flex: 1; }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: 11px; }
.quick-action small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.quick-action b { color: var(--muted); }

@media (min-width: 700px) {
  body { display: flex; justify-content: center; background: #0c1220; }
  :root[data-theme="light"] body { background: #e6ebf3; }
  .app-shell { width: min(100%, 540px); min-height: 100vh; background: var(--bg); box-shadow: 0 0 80px #0003; }
  .app-container { padding-top: 30px; }
}
@media (max-width: 390px) {
  .login-shell { padding: 14px; }
  .login-card { padding: 25px 22px; }
  .login-card .brand { margin-bottom: 23px; }
  .login-card h1 { font-size: 33px; }
  .welcome-header { gap: 7px; }
  .header-actions { gap: 6px; }
  .whatsapp-button { width: 38px; padding: 0; }
  .whatsapp-button > span { display: none; }
  .app-container { padding-right: 14px; padding-left: 14px; }
  .account-card { padding: 11px; }
  .summary-card { padding: 11px; }
  .summary-amount { font-size: 14px; }
  .metric-card { padding-right: 6px; padding-left: 6px; }
  .metric-card strong { font-size: 10px; }
  .page-footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
