/*
 * PLÁTANO v1.2 · Fintech / Banking visual refresh
 * Presentational overrides only. Existing workflows remain in app.js.
 * The light theme is the default, and data-theme="dark" switches palettes.
 */
:root,html[data-theme="light"]{
  color-scheme:light;
  --bg:#f6f7f5;--sidebar:#ffffff;--card:#ffffff;--card2:#f7f8f8;--card3:#eef1f0;
  --stroke:#e6eae8;--stroke-soft:#eff1ef;--text:#192722;--muted:#7c8984;--dim:#9aa6a0;
  --green:#f9c62d;--green2:#ffe27c;--green-ink:#29230d;--red:#da685c;--blue:#638bda;--purple:#ab87cc;
  --surface:#fff;--canvas:#f6f7f5;--soft:#f6f7f4;--soft-border:#e8ece9;
  --secondary:#4e6158;--field:#fafbf9;--text-strong:#192722;--muted-strong:#637269;
  --shadow:0 9px 35px rgba(18,38,28,.055);
  --hero-start:#ffdf74;--hero-end:#f8bc26;--hero-text:#3c300b;
  --gold-soft:#fff4c6;--gold-border:#f9e59d;--nav-active:#fff3c5;
  --money-positive:#258974;--money-negative:#d46655;
  --chart-grid:#e5eae6;--chart-label:#7d9185;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0e161b;--sidebar:#131e24;--card:#19252c;--card2:#202e36;--card3:#26363e;
  --stroke:#2d3e44;--stroke-soft:#26353c;--text:#f2f6f4;--muted:#a3b1ad;--dim:#7f9892;
  --green:#f9c62d;--green2:#ffe27c;--green-ink:#352800;--red:#ff9483;--blue:#99b6f7;--purple:#c9a7e8;
  --surface:#19252c;--canvas:#0e161b;--soft:#223038;--soft-border:#32454b;
  --secondary:#b9c9c3;--field:#1b2b31;--text-strong:#f4f6f1;--muted-strong:#9fb4ab;
  --shadow:0 10px 38px rgba(0,0,0,.17);
  --hero-start:#ecc34b;--hero-end:#e4a824;--hero-text:#372a06;
  --gold-soft:#4b3d1a;--gold-border:#645222;--nav-active:#3c3623;
  --money-positive:#77c9b3;--money-negative:#ff998e;
  --chart-grid:#36474d;--chart-label:#aabeb7;
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{background:var(--canvas);color:var(--text);line-height:1.48}
button,input,select,textarea{font:inherit}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #edb820;outline-offset:3px}
.app-shell{grid-template-columns:250px minmax(0,1fr);min-height:100vh}
.sidebar{background:var(--sidebar);border-color:var(--stroke-soft);padding:30px 16px 22px}
.brand{padding:3px 11px;gap:12px}
.brand-mark{background:#ffedab;color:#3c310d;border-radius:17px;width:49px;height:49px;box-shadow:inset 0 0 0 1px #f8de8c}
.brand-title{font-size:26px;font-weight:850;letter-spacing:-1.3px;color:var(--text-strong)}
.brand-title span,.cloud-brand span{color:#efb51a}
.brand-sub{font-size:8px;letter-spacing:2px;color:var(--muted);font-weight:850}
.sidebar-label{color:var(--dim);margin:63px 14px 14px;font-size:10px}
.nav-links{gap:7px}
.nav-link{border:1px solid transparent;color:var(--muted-strong);padding:0 16px;min-height:49px;border-radius:15px;font-weight:690;font-size:13px}
.nav-link:hover{color:var(--text);background:var(--soft)}
.nav-link.active{color:var(--text-strong);background:var(--nav-active);border-color:var(--gold-border);font-weight:800}
.nav-link.active svg{stroke:#d29a0c}
.privacy-panel{background:var(--soft);border-color:var(--soft-border);border-radius:18px;padding:17px}
.privacy-panel strong{color:var(--text);font-size:12px}
.privacy-panel p{color:var(--muted);font-size:11px}
.privacy-panel .privacy-icon{color:#daa013}
.side-foot{color:var(--dim);font-size:9px;letter-spacing:1.25px}
.online-indicator{background:#f2bd2b;box-shadow:0 0 0 4px #f7c52a22}
.version{color:var(--muted)}
.topbar{background:var(--surface);border-color:var(--stroke-soft);min-height:83px;padding:14px clamp(20px,3.15vw,50px);gap:18px}
.topbar-location{color:var(--text);font-size:13px}
.topbar-small{color:var(--dim)}.topbar-slash{color:var(--dim)}
.topbar-date{color:var(--muted);font-size:12px}
.topbar-right{gap:12px}
.mobile-brand{display:none;align-items:center;gap:9px;font-size:20px;font-weight:850;letter-spacing:-.8px;color:var(--text)}
.mobile-brand img{width:33px;height:33px;border-radius:11px}
.btn{border-radius:14px;min-height:43px;font-weight:780}
.btn:hover{filter:brightness(.97)}
.btn-primary{background:var(--green);color:var(--green-ink);border:1px solid #eab523;box-shadow:0 3px 7px #dcad2222}
.btn-secondary{background:var(--soft);border-color:var(--soft-border);color:var(--text-strong)}
.btn-ghost{background:var(--surface);border-color:var(--stroke);color:var(--muted-strong)}
.btn-red{background:color-mix(in srgb,var(--red) 10%,var(--surface));border-color:color-mix(in srgb,var(--red) 35%,var(--stroke));color:var(--red)}
.btn-top{min-height:42px;border-radius:13px}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none;min-width:43px;height:43px;border-radius:14px;border:1px solid var(--stroke);background:var(--soft);color:var(--text);padding:0 12px;font-size:12px;font-weight:760;transition:background .2s,color .2s}
.theme-toggle:hover{background:var(--gold-soft);border-color:var(--gold-border)}
.theme-toggle svg{width:19px;height:19px;stroke-width:1.9}
.theme-toggle .theme-label{display:none}
.main-content{padding-top:32px;max-width:1480px}
.page-head{margin-bottom:24px}
.eyebrow{color:#d39a11;font-weight:830;font-size:10px;letter-spacing:1.75px}
.page-title{color:var(--text-strong);font-weight:820;letter-spacing:-1.45px}
.page-subtitle{color:var(--muted);font-size:13px}
.segment{border:1px solid var(--stroke);background:var(--surface);padding:4px;border-radius:14px;box-shadow:var(--shadow)}
.segment button{color:var(--muted-strong);border-radius:10px;font-weight:710}
.segment button.active{background:var(--green);color:var(--green-ink)}
.period-nav{background:var(--surface);border-color:var(--stroke);border-radius:13px}
.period-nav button{color:var(--muted-strong)}
.period-nav button:hover{background:var(--soft)}
.period-name{color:var(--text);font-weight:760}
.hero-grid{gap:17px;margin-bottom:17px}
.hero{border:0;background:linear-gradient(120deg,var(--hero-start),var(--hero-end));box-shadow:0 16px 35px rgba(212,160,26,.19);min-height:227px;border-radius:25px;padding:28px 31px;color:var(--hero-text);isolation:isolate}
.hero:before{content:"";position:absolute;width:230px;height:230px;border:1px solid #fff8d157;border-radius:50%;right:38px;top:-120px;z-index:0}
.hero:after{content:"";position:absolute;right:-94px;top:-100px;width:380px;height:380px;border:1px solid #fff8d188;border-radius:50%;box-shadow:0 0 0 38px #fff5ca18,0 0 0 80px #fff9df0c;z-index:0}
.hero-caption{color:#715617;font-size:11px;letter-spacing:1.5px}
.hero-balance{font-weight:850;letter-spacing:-1.9px;font-size:clamp(33px,3.35vw,49px)}
.hero-hint{color:#715817;font-size:12px}
.hero-icon{background:#ffffff44;color:#44330a;border:1px solid #ffffff66;width:44px;height:44px;border-radius:14px}
.saving-overview,.stat-card,.panel,.records-card,.goal-card,.settings-panel{background:var(--surface);border:1px solid var(--stroke);border-radius:24px;box-shadow:var(--shadow)}
.saving-overview{min-height:227px;padding:28px}
.small-heading{color:var(--muted-strong);font-weight:800}
.saving-amount{color:var(--text-strong);font-weight:850}
.subtle{color:var(--muted)}
.small-link{color:#ba8610;font-weight:770}
html[data-theme="dark"] .small-link{color:#f9ce5a}
.ring{background:conic-gradient(var(--green) var(--percent),var(--card3) 0)}
.ring:after{background:var(--surface)}
.ring-content strong{color:var(--text-strong)}.ring-content span{color:var(--muted)}
.stats-grid{gap:14px;margin-bottom:19px}
.stat-card{padding:21px 20px;border-radius:19px}
.stat-top{color:var(--muted-strong);font-size:12px}
.stat-icon{border-radius:12px;background:var(--soft);color:var(--muted-strong)}
.stat-icon.income{color:var(--money-positive);background:color-mix(in srgb,var(--money-positive) 13%,var(--surface))}
.stat-icon.outcome{color:var(--red);background:color-mix(in srgb,var(--red) 13%,var(--surface))}
.stat-icon.balance{color:#bb8511;background:var(--gold-soft)}
.stat-icon.daily{color:#9c84b3;background:color-mix(in srgb,#9c84b3 13%,var(--surface))}
.stat-value{color:var(--text-strong);font-weight:850;letter-spacing:-.9px}
.stat-footer{color:var(--muted)}
.panels-grid{gap:17px;margin-bottom:22px}
.panel{padding:25px}
.panel-title,.section-title{color:var(--text-strong);font-weight:830}
.panel-sub,.section-detail{color:var(--muted)}
.chart-legend{color:var(--muted-strong)}.legend-dot{background:var(--green)}
.trend-grid{stroke:var(--chart-grid)}.trend-label{fill:var(--chart-label)}.trend-value{fill:var(--muted-strong)}
.donut:after{background:var(--surface)}.donut-center span{color:var(--muted)}.donut-center strong{color:var(--text)}
.cat-row{color:var(--muted-strong)}
.records-card{overflow:hidden}
.record-row{background:transparent;border-color:var(--stroke-soft);color:var(--text)}
.record-row:hover{background:var(--soft)}
.record-symbol{background:var(--gold-soft);color:#c48e15;border-radius:15px}
.record-symbol.income{color:var(--money-positive);background:color-mix(in srgb,var(--money-positive) 13%,var(--surface))}
.record-name{color:var(--text-strong);font-weight:780}
.record-description,.record-category{color:var(--muted)}
.record-amount{color:var(--money-negative);font-weight:820}
.record-amount.income{color:var(--money-positive)}
.record-amount.expense{color:var(--text-strong)}
.mini-more{background:var(--soft);color:var(--muted-strong);border-color:var(--soft-border);border-radius:10px}
.mini-more:hover{background:var(--gold-soft)}
.blank-art{background:var(--gold-soft);color:#c48e15}
.blank h3{color:var(--text-strong)}.blank p{color:var(--muted)}
.hint-box{background:var(--gold-soft);border-color:var(--gold-border);color:var(--secondary)}
.hint-box svg{color:#cc9a20}
.toolbar,.records-topline,.pagination{color:var(--text)}
.field-search{border-color:var(--stroke);background:var(--surface);color:var(--muted-strong);border-radius:13px}
.field-search svg{color:var(--muted)}
.field-search input{background:transparent;color:var(--text)}
.field-search input::placeholder{color:var(--dim)}
.select-compact{border-color:var(--stroke);background:var(--surface);color:var(--text);border-radius:12px}
.record-count{color:var(--muted)}
.goal-card{padding:24px}
.goal-emoji{background:var(--gold-soft);color:#bc8c1d;border-radius:17px}
.goal-title{color:var(--text-strong)}.goal-date{color:var(--muted)}
.goal-amount{color:var(--text)}.goal-target{color:var(--muted)}
.progress-track{background:var(--soft-border)}
.progress-fill{background:linear-gradient(90deg,#f0ae14,#ffdc68)}
.goal-progress-caption{color:var(--muted)}
.goal-history{border-color:var(--stroke)}
.goal-history summary,.history-row{color:var(--muted-strong)}
.history-row strong{color:var(--text)}
.goal-new{background:var(--surface);border-color:#ebd385;color:var(--text);border-radius:24px}
.goal-new:hover{background:var(--gold-soft)}
.goal-new .plus-circle{background:var(--gold-soft);color:#b88b18}
.goal-new p{color:var(--muted)}
.settings-panel p{color:var(--muted)}
.form-field label{color:var(--text);font-weight:760}
.form-field input,.form-field select,.form-field textarea{border-color:var(--stroke);background:var(--field);color:var(--text);border-radius:13px}
.form-field textarea::placeholder,.form-field input::placeholder{color:var(--dim)}
.form-field input[type="date"]{color-scheme:light}
html[data-theme="dark"] .form-field input[type="date"]{color-scheme:dark}
.form-help,.muted-note{color:var(--muted)}
.modal-overlay{background:rgba(10,21,24,.6);backdrop-filter:blur(6px)}
.modal{background:var(--surface);border:1px solid var(--stroke);border-radius:25px;box-shadow:0 24px 80px #0004}
.modal-heading{border-color:var(--stroke)}.modal-heading h2{color:var(--text)}.modal-heading p{color:var(--muted)}
.modal-footer{border-color:var(--stroke)}
.modal-close{background:var(--soft);border-color:var(--stroke);color:var(--text)}
.type-toggle label{background:var(--soft);border-color:var(--stroke);color:var(--secondary);border-radius:14px}
.type-toggle label:has(input:checked){background:var(--gold-soft);border-color:var(--gold-border);color:var(--text)}
.type-toggle input{accent-color:#eab51f}
.separator{background:var(--stroke)}
.toast{background:var(--surface);border-color:var(--gold-border);color:var(--text);box-shadow:var(--shadow)}
.toast.error{background:var(--surface);border-color:var(--red);color:var(--red)}
.detail-stat{color:var(--text)}.alert-title{color:var(--red)}
.mini-pill{background:var(--soft);color:var(--muted-strong)}
.yearly-note{background:var(--soft);border-color:var(--stroke);color:var(--muted-strong)}
.goal-plan{background:var(--gold-soft);border-color:var(--gold-border);color:var(--secondary)}
.goal-plan svg{color:#d1a122}
.cloud-gate{background:var(--canvas);color:var(--text)}
.cloud-gate:before{content:"";pointer-events:none;position:fixed;left:0;right:0;top:0;height:230px;background:linear-gradient(115deg,#fff0b4,#ffe08c 60%,#ffebb3);z-index:-1}
html[data-theme="dark"] .cloud-gate:before{background:linear-gradient(115deg,#423513,#66501b 60%,#3e331a)}
.cloud-auth{background:var(--surface);border-color:var(--stroke);box-shadow:0 16px 70px #0b241526;border-radius:28px;padding:clamp(25px,5vw,39px)}
.cloud-brand{color:var(--text);font-weight:850}
.cloud-auth h1{color:var(--text);font-weight:840}
.cloud-auth p{color:var(--muted)}
.cloud-auth label{color:var(--text)}
.cloud-auth input{background:var(--field);border-color:var(--stroke);color:var(--text);border-radius:13px}
.cloud-auth input:focus{outline-color:#f5c530}
.auth-submit{background:var(--green);color:var(--green-ink);border-radius:14px;min-height:48px}
.auth-link{color:#b4800b;font-weight:700}
html[data-theme="dark"] .auth-link{color:#ffda77}
#cloudStatus{background:var(--surface);color:var(--text);border-color:var(--stroke);box-shadow:var(--shadow)}
#cloudSignout{background:var(--surface);color:var(--text);border-color:var(--stroke);border-radius:13px}
.auth-theme{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:25px}
.auth-theme .cloud-brand{margin-bottom:0}
@media(max-width:850px){
  .sidebar{display:none}
  .topbar{min-height:75px;padding:13px 20px}
  .topbar-location{display:none}
  .mobile-brand{display:inline-flex}
  .mobile-nav{background:var(--surface);border-color:var(--stroke);box-shadow:0 -5px 20px #182f210e;height:73px}
  .mobile-link{color:var(--muted);gap:4px}
  .mobile-link.active{color:#bb8810}
  html[data-theme="dark"] .mobile-link.active{color:#ffd464}
  .mobile-link small{font-size:10px}
  .main-content{padding-bottom:115px}
  .topbar-date{display:none}
}
@media(max-width:620px){
  .topbar{padding:12px 16px}
  .topbar-right{gap:8px}
  .main-content{padding-top:24px}
  .hero-grid{gap:14px}
  .hero{min-height:203px;padding:25px 24px;border-radius:26px}
  .hero:after{right:-160px;top:-110px}
  .saving-overview{min-height:168px;border-radius:23px;padding:23px}
  .stats-grid{gap:11px}
  .stat-card{border-radius:17px;padding:16px 14px}
  .panel{border-radius:22px}
  .goal-card,.settings-panel{border-radius:21px}
  .modal-overlay{padding:15px 10px 90px}
  .modal{border-radius:23px}
  .record-row{padding:14px 11px}
  .cloud-gate{padding:16px}
  .cloud-auth{border-radius:24px}
}
@media(max-width:365px){.theme-toggle{min-width:40px;width:40px;height:40px}.btn-top{min-height:40px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* Header-level logout replaces a floating button that could obscure content. */
.topbar #cloudSignout{position:static;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:43px;padding:0 12px;border-radius:13px;background:var(--soft);color:var(--muted-strong);border:1px solid var(--stroke);font-weight:760;cursor:pointer;font-size:12px}
.topbar #cloudSignout[hidden]{display:none}
.topbar #cloudSignout:hover{background:var(--gold-soft);color:var(--text)}
.topbar #cloudSignout svg{width:17px;height:17px}
@media(max-width:850px){
  .app-shell{grid-template-columns:minmax(0,1fr)}
  .topbar #cloudSignout{height:43px;min-width:43px;padding:0;flex:none}
  .topbar #cloudSignout span{display:none}
  .btn-top{position:fixed;bottom:91px;right:20px;z-index:55;width:57px;height:57px;min-height:57px;border-radius:50%;padding:0;box-shadow:0 7px 24px #d3a02655}
  .btn-top svg{width:25px;height:25px}
}
@media(max-width:420px){
  .topbar-right{gap:7px}
  .theme-toggle,.topbar #cloudSignout{width:41px;height:41px;min-width:41px;min-height:41px}
}
.topbar #cloudSignout{z-index:auto}

.mobile-brand-logo{width:35px;height:35px;display:inline-grid;place-items:center;border-radius:11px;background:#ffeda8;color:#3b300c;border:1px solid #f9df8e;flex:none}
.mobile-brand-logo svg{display:block}
@media(max-width:620px){
  .hero-grid{grid-template-columns:minmax(0,1fr)}
  .hero,.saving-overview{min-width:0}
  .saving-overview-row{min-width:0;gap:10px}
  .saving-overview-row > div:first-child{min-width:0}
  .saving-amount{overflow-wrap:anywhere}
}
