/* Ahorrito V6: nuevo sistema visual; evita mutar ids y formularios existentes. */
body[data-mode="web"],body[data-mode="app"]{--v6-page:#f2f6f2;--v6-panel:#fffefa;--v6-dark:#173d37;--v6-contrast:#183c35;--v6-accent:#07836d;--v6-border:#dbe8df;--v6-secondary:#5a776d;--v6-highlight:#e0f4e9;background:var(--v6-page)!important;color:var(--v6-contrast)!important}
body[data-mode="web"] #appScreen .shell,body[data-mode="app"] #appScreen .shell{max-width:1560px;padding:18px clamp(16px,2.6vw,45px) 115px!important}
body[data-mode="web"] #appScreen .topbar.topbar-v5,body[data-mode="app"] #appScreen .topbar.topbar-v5{background:transparent!important;border:0!important;border-bottom:1px solid var(--v6-border)!important;padding:7px 0 20px!important;margin-bottom:26px!important;min-height:74px!important;box-shadow:none!important}
body[data-mode="web"] #appScreen .topbar-v5 .v5-icon-button,body[data-mode="app"] #appScreen .topbar-v5 .v5-icon-button{background:var(--v6-panel)!important;color:var(--v6-contrast)!important;border:1px solid var(--v6-border)!important;border-radius:14px!important;box-shadow:none!important;transition:background .18s,border-color .18s,transform .18s}
body[data-mode="web"] #appScreen .topbar-v5 .v5-icon-button:hover,body[data-mode="app"] #appScreen .topbar-v5 .v5-icon-button:hover{background:var(--v6-highlight)!important;transform:translateY(-1px)}
body[data-mode="web"] #appScreen .topbar-v5 .ah-language-control select,body[data-mode="app"] #appScreen .topbar-v5 .ah-language-control select{background:var(--v6-panel)!important;color:var(--v6-contrast)!important;border:1px solid var(--v6-border)!important}
body[data-mode="web"] #appScreen .layout,body[data-mode="app"] #appScreen .layout{grid-template-columns:240px minmax(0,1fr);gap:28px}
body[data-mode="web"] #appScreen .sidebar,body[data-mode="app"] #appScreen .sidebar{background:var(--v6-panel)!important;border:1px solid var(--v6-border)!important;border-radius:22px!important;padding:13px!important;box-shadow:none!important}
body[data-mode="web"] #appScreen .nav button,body[data-mode="app"] #appScreen .nav button{min-height:49px!important;border-radius:14px!important;font-size:14px;font-weight:740;color:var(--v6-secondary)!important}
body[data-mode="web"] #appScreen .nav button.active,body[data-mode="app"] #appScreen .nav button.active{background:var(--v6-highlight)!important;color:var(--v6-accent)!important}
body[data-mode="web"] #appScreen .home-heading-v5,body[data-mode="app"] #appScreen .home-heading-v5{background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:9px 0 23px!important;margin:0!important;display:flex;align-items:flex-end!important;gap:24px}
body[data-mode="web"] #appScreen .home-heading-v5 h1,body[data-mode="app"] #appScreen .home-heading-v5 h1{font-weight:900;font-size:clamp(34px,3.6vw,55px)!important;color:var(--v6-contrast)!important;letter-spacing:-.06em}
body[data-mode="web"] #appScreen .home-heading-v5 .muted,body[data-mode="app"] #appScreen .home-heading-v5 .muted{font-size:15px;color:var(--v6-secondary)!important}
body[data-mode="web"] #appScreen .sync-inline-badge,body[data-mode="app"] #appScreen .sync-inline-badge{background:var(--v6-highlight)!important;color:var(--v6-accent)!important;border-radius:100px;font-size:11px!important;padding:5px 10px!important}
body[data-mode="web"] #appScreen .filters,body[data-mode="app"] #appScreen .filters{gap:13px;margin-top:6px;margin-bottom:22px}
body[data-mode="web"] #appScreen .field input,body[data-mode="web"] #appScreen .field select,body[data-mode="web"] #appScreen .field textarea,body[data-mode="app"] #appScreen .field input,body[data-mode="app"] #appScreen .field select,body[data-mode="app"] #appScreen .field textarea{min-height:50px!important;background:var(--v6-panel)!important;border:1px solid var(--v6-border)!important;border-radius:14px!important;color:var(--v6-contrast)!important;box-shadow:none!important;font-size:16px!important}
body[data-mode="web"] #appScreen .field label,body[data-mode="app"] #appScreen .field label{color:var(--v6-secondary)!important;font-weight:700}
body[data-mode="web"] #appScreen .cards,body[data-mode="app"] #appScreen .cards{margin-top:0!important;display:grid!important;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) minmax(0,1fr)!important;gap:15px!important}
body[data-mode="web"] #appScreen .cards>.card,body[data-mode="app"] #appScreen .cards>.card{border:1px solid var(--v6-border)!important;border-radius:22px!important;background:var(--v6-panel)!important;box-shadow:none!important;min-height:155px!important;padding:25px!important;color:var(--v6-contrast)!important}
body[data-mode="web"] #appScreen #view-inicio .cards>.card:first-child,body[data-mode="app"] #appScreen #view-inicio .cards>.card:first-child{background:#0f564c!important;border:1px solid #176f5e!important;color:#fff!important;box-shadow:none!important}
body[data-mode="web"] #appScreen #view-inicio .cards>.card:first-child:after,body[data-mode="app"] #appScreen #view-inicio .cards>.card:first-child:after{width:210px!important;height:210px!important;right:-55px!important;top:-85px!important;border:30px solid #ffffff12!important}
body[data-mode="web"] #appScreen .cards>.card .k,body[data-mode="app"] #appScreen .cards>.card .k{color:var(--v6-secondary)!important;font-size:12px!important;font-weight:780!important}
body[data-mode="web"] #appScreen #view-inicio .cards>.card:first-child .k,body[data-mode="app"] #appScreen #view-inicio .cards>.card:first-child .k{color:#ccecdf!important}
body[data-mode="web"] #appScreen #view-inicio .cards>.card:first-child .v,body[data-mode="app"] #appScreen #view-inicio .cards>.card:first-child .v{color:#fff!important;font-size:clamp(27px,3.2vw,46px)!important}
body[data-mode="web"] #appScreen .cards>.card .v,body[data-mode="app"] #appScreen .cards>.card .v{font-size:clamp(25px,2.2vw,35px)!important;line-height:1.25!important;overflow-wrap:anywhere!important}
body[data-mode="web"] #appScreen .panel,body[data-mode="app"] #appScreen .panel{border:1px solid var(--v6-border)!important;border-radius:20px!important;background:var(--v6-panel)!important;box-shadow:none!important;padding:24px!important;color:var(--v6-contrast)!important}
body[data-mode="web"] #appScreen .panel h2,body[data-mode="app"] #appScreen .panel h2,body[data-mode="web"] #appScreen .panel h3,body[data-mode="app"] #appScreen .panel h3{color:var(--v6-contrast)!important}
body[data-mode="web"] #appScreen .btn.primary,body[data-mode="app"] #appScreen .btn.primary{background:#087e6a!important;color:white!important;border-radius:14px!important;box-shadow:none!important}
body[data-mode="web"] #appScreen th,body[data-mode="app"] #appScreen th{background:var(--v6-highlight)!important;color:var(--v6-secondary)!important}
body[data-mode="web"] #appScreen td,body[data-mode="app"] #appScreen td{border-color:var(--v6-border)!important;color:var(--v6-contrast)!important}
body[data-mode="web"] #appScreen .mobile-nav,body[data-mode="app"] #appScreen .mobile-nav{background:var(--v6-panel)!important;border-top:1px solid var(--v6-border)!important;box-shadow:0 -10px 30px rgba(20,63,52,.08)!important}
.quick-actions-v6{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;max-width:100%}
.privacy-toggle-v6{min-height:48px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:8px 14px;background:var(--v6-panel);color:var(--v6-accent);border:1px solid var(--v6-border);border-radius:14px;font-weight:800;white-space:nowrap}
.privacy-toggle-v6 svg{width:19px;height:19px}
.privacy-toggle-v6:focus-visible{outline:3px solid #55cdaa;outline-offset:3px}
.ah-privacy-hidden #appScreen :is(#totalBalance,#totalIncome,#totalExpenses,#reportIncome,#reportExpense,#reportDifference,#walletRows .num,#movementsRows .num,.sum,.currency,#recentList .num,#categoryBars .bar-row>:last-child,#reportRows td:not(:first-child),#reportCategoryRows td:nth-child(3)){filter:blur(9px);user-select:none}
.ah-privacy-hidden #appScreen :is(#totalBalance,#totalIncome,#totalExpenses,#reportIncome,#reportExpense,#reportDifference){pointer-events:none}
.privacy-toggle-v6[aria-pressed="true"]{background:var(--v6-highlight)}
/* Dark mode carefully overrules old web-specific white cards and fixed ink colors. */
html[data-theme="dark"] body[data-mode="web"],html[data-theme="dark"] body[data-mode="app"]{--v6-page:#0b1715;--v6-panel:#142723;--v6-dark:#122920;--v6-contrast:#f1faf5;--v6-accent:#8ae9bc;--v6-border:#345448;--v6-secondary:#b1cbbf;--v6-highlight:#1b3b30;background:var(--v6-page)!important;color:var(--v6-contrast)!important}
html[data-theme="dark"] body[data-mode="web"] #appScreen .home-heading-v5 h1,html[data-theme="dark"] body[data-mode="app"] #appScreen .home-heading-v5 h1{color:#f1faf5!important}
html[data-theme="dark"] body[data-mode="web"] #appScreen :is(.topbar,.sidebar,.card,.panel,.modal,.auth-card,.mobile-nav),html[data-theme="dark"] body[data-mode="app"] #appScreen :is(.topbar,.sidebar,.card,.panel,.modal,.auth-card,.mobile-nav){color:var(--v6-contrast)!important}
html[data-theme="dark"] body[data-mode="web"] #appScreen #view-inicio .cards>.card:first-child,html[data-theme="dark"] body[data-mode="app"] #appScreen #view-inicio .cards>.card:first-child{background:#145d4e!important}
html[data-theme="dark"] body[data-mode="web"] #appScreen :is(.muted,.home-greeting-subtitle,.field label,.card .k),html[data-theme="dark"] body[data-mode="app"] #appScreen :is(.muted,.home-greeting-subtitle,.field label,.card .k){color:var(--v6-secondary)!important}
html[data-theme="dark"] body[data-mode="web"] #appScreen :is(.nav button,.mobile-nav button),html[data-theme="dark"] body[data-mode="app"] #appScreen :is(.nav button,.mobile-nav button){color:#b1cbbf!important}
html[data-theme="dark"] body[data-mode="web"] #appScreen :is(.nav button.active,.mobile-nav button.active),html[data-theme="dark"] body[data-mode="app"] #appScreen :is(.nav button.active,.mobile-nav button.active){background:var(--v6-highlight)!important;color:#99f1ce!important}
html[data-theme="dark"] body[data-mode="web"] #appScreen :is(.report-donut-card,.empty),html[data-theme="dark"] body[data-mode="app"] #appScreen :is(.report-donut-card,.empty){background:var(--v6-panel)!important;color:var(--v6-contrast)!important;border-color:var(--v6-border)!important}
html[data-theme="dark"] body[data-mode="web"] #appScreen .report-donut:before,html[data-theme="dark"] body[data-mode="app"] #appScreen .report-donut:before{background:var(--v6-panel)!important}
html[data-theme="dark"] .privacy-toggle-v6{background:var(--v6-panel)!important;color:var(--v6-accent)!important;border-color:var(--v6-border)!important}
/* Subtle smooth progress feedback: percent comes from actual files verified. */
#updateProgressBar,#pwaBootBar,#offlineDownloadBar,#offlinePrepFill{transition:width .32s ease-out!important;will-change:width}
.pwa-boot-track,.offline-download-track,.offline-prep-track{height:10px!important;border-radius:99px;overflow:hidden}
@media(max-width:950px){body[data-mode="web"] #appScreen .layout,body[data-mode="app"] #appScreen .layout{display:block!important}body[data-mode="web"] #appScreen .cards,body[data-mode="app"] #appScreen .cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}body[data-mode="web"] #appScreen #view-inicio .cards>.card:first-child,body[data-mode="app"] #appScreen #view-inicio .cards>.card:first-child{grid-column:1/-1!important}}
@media(max-width:650px){body[data-mode="web"] #appScreen .home-heading-v5,body[data-mode="app"] #appScreen .home-heading-v5{display:block!important;padding:3px 0 20px!important}body[data-mode="web"] #appScreen .home-heading-v5 h1,body[data-mode="app"] #appScreen .home-heading-v5 h1{font-size:clamp(30px,9vw,43px)!important}body[data-mode="web"] #appScreen .cards,body[data-mode="app"] #appScreen .cards{gap:9px!important}body[data-mode="web"] #appScreen .cards>.card,body[data-mode="app"] #appScreen .cards>.card{padding:18px!important;min-height:128px!important}body[data-mode="web"] #appScreen #view-inicio .cards>.card:first-child,body[data-mode="app"] #appScreen #view-inicio .cards>.card:first-child{min-height:160px!important}body[data-mode="web"] #appScreen .panel,body[data-mode="app"] #appScreen .panel{padding:18px!important}.quick-actions-v6{justify-content:stretch;margin-top:19px}.quick-actions-v6>.btn{flex:1;min-width:0!important;width:auto!important}.privacy-toggle-v6 span{display:none}.privacy-toggle-v6{min-width:52px;padding:8px 12px}.mobile-nav button .nav-label{font-size:clamp(9px,2vw,11px)!important}}
@media(prefers-reduced-motion:reduce){#updateProgressBar,#pwaBootBar,#offlineDownloadBar,#offlinePrepFill{transition:none!important}}
