/* Gasto do dia — visual system. Mobile first, accessible touch targets. */
:root {
  color-scheme: light;
  --bg: #f3f5f3;
  --card: #ffffff;
  --text: #233731;
  --muted: #65776e;
  --line: #dfe7e1;
  --green: #287759;
  --orange: #ad6130;
  --blue: #497799;
  --red: #b33e49;
  --panel: #294c50;
  --soft: #eaf2ed;
  --warn: #faf2df;
  --shadow: 0 4px 24px #243b3305;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.6 'Plus Jakarta Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select { touch-action: manipulation; }
button { cursor: pointer; min-height: 54px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; background: var(--card); font-weight: 700; font-size: 16px; transition: background .18s, box-shadow .18s, transform .18s; }
button:hover { background: var(--soft); box-shadow: 0 3px 10px #143b2310; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; box-shadow: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
input, select { width: 100%; min-height: 56px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin: 8px 0 20px; transition: border-color .18s; }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { border-color: var(--green); }
input::placeholder { color: var(--muted); opacity: .8; font-size: 16px; }
label { display: block; font-size: 15px; font-weight: 600; }
h1,h2,h3,p { margin: 0 0 12px; }
h1 { font-size: 23px; letter-spacing: -.9px; font-weight: 800; }
h2 { font-size: 21px; line-height: 1.35; letter-spacing: -.6px; font-weight: 800; margin-bottom: 20px; }
h3 { font-size: 18px; }
small,.small { font-size: 14px; line-height: 1.65; }
.muted { color: var(--muted); }
.green { color: var(--green); }
.orange { color: var(--orange); }
.red { color: var(--red); }
.blue { color: var(--blue); }
.primary { background: #287759; color: #fff; border-color: transparent; box-shadow: 0 4px 12px #28775912; }
.primary:hover { background: #206449; box-shadow: 0 5px 16px #28775925; }
.full { width: 100%; }
.stack { display: grid; gap: 12px; }
.flex { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 11px; font-weight: 800; color: var(--muted); }
header, main { max-width: 520px; margin: auto; padding: 24px 20px 0; }
header { display: flex; align-items: center; justify-content: space-between; padding-top: calc(24px + env(safe-area-inset-top)); padding-bottom: 18px; }
header .logo { background: #287759; color: #fff; border-radius: 14px; width: 46px; height: 46px; display: grid; place-items: center; font-size: 28px; box-shadow: 0 4px 10px #28775915; }
header .small { font-size: 12px; letter-spacing: .15px; }
header>.eyebrow { border: 1px solid var(--line); border-radius: 20px; padding: 5px 9px; letter-spacing: 1px; font-size: 9px; }
main { padding-top: 16px; padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
main>* { min-width: 0; }
.intro { margin: 0 0 26px; }
.intro .eyebrow { color: var(--green); margin-bottom: 8px; }
.intro>p:last-child { font-size: 16px; margin: 0; }
.hero { background: var(--panel); color: #fff; border-color: transparent; padding: 28px; box-shadow: 0 10px 28px #14393b12; }
.hero .muted { color: #d0e0dc; }
.hero>div:first-child { font-size: 13px; }
.hero .amount { font-size: clamp(36px,9vw,48px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -2px; margin: 12px 0 16px; }
.hero .between>div>div:first-child { font-size: 15px; }
.hero details { border-top: 1px solid #ffffff25; margin-top: 24px; padding-top: 14px; font-size: 14px; }
.hero summary { font-size: 13px; font-weight: 500; color: #e5efeb; }
.hero p { margin-bottom: 0; }
.ring { width: 76px; flex-shrink: 0; transform: rotate(-90deg); }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.tile { position: relative; border: 1px solid var(--line); background: var(--card); border-radius: 17px; padding: 19px 15px; }
.tile span { font-size: 12px; line-height: 1.5; display: block; margin-bottom: 12px; color: var(--muted); }
.tile strong { font-size: clamp(19px,5vw,24px); letter-spacing: -.8px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tile .small { font-size: 11px; margin-top: 7px; color: var(--muted); }
.tile.green { background: color-mix(in srgb,var(--green) 4%,var(--card)); border-color: color-mix(in srgb,var(--green) 14%,var(--line)); }
.tile.orange { background: color-mix(in srgb,var(--orange) 4%,var(--card)); }
.tile.blue { background: color-mix(in srgb,var(--blue) 4%,var(--card)); }
.notice { padding: 18px 20px; border: 1px solid color-mix(in srgb,var(--orange) 18%,var(--line)); border-radius: 16px; background: var(--warn); margin-bottom: 20px; font-size: 14px; line-height: 1.7; }
.notice button { margin-top: 10px; font-size: 14px; min-height: 48px; }
.row { padding: 18px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .name { overflow-wrap: anywhere; font-weight: 600; font-size: 16px; }
.row .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.row strong { font-variant-numeric: tabular-nums; font-size: 16px; white-space: nowrap; }
.icon { min-width: 44px; min-height: 44px; padding: 7px; background: transparent; }
.empty { text-align: center; padding: 35px 15px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.nav { position: fixed; z-index: 5; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%,520px); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border: 1px solid var(--line); border-radius: 22px 22px 0 0; box-shadow: 0 -4px 24px #243b3308; }
.nav button { border: 0; background: transparent; padding: 8px 4px; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 12px; box-shadow: none; }
.nav button>span { display: flex; justify-content: center; margin-bottom: 6px; }
.nav-icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav button:hover { background: var(--bg); }
.nav button[aria-current=page] { background: var(--soft); color: var(--green); font-weight: 800; }
summary { cursor: pointer; padding: 10px 0; font-size: 14px; color: var(--muted); }
details p { margin-top: 12px; }
form>details { border-top: 1px solid var(--line); }
form>details[open] { padding-bottom: 4px; }
.progress { height: 12px; background: var(--soft); border-radius: 20px; overflow: hidden; margin: 16px 0; }
.progress i { display: block; height: 100%; border-radius: 20px; background: var(--green); }
.month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.month h2 { font-size: 19px; text-align: center; margin: 0; text-transform: capitalize; }
.day { transition: border-color .18s, box-shadow .18s; }
.day:hover { border-color: var(--green); box-shadow: 0 5px 22px #243b3308; }
.day summary { display: block; color: var(--text); padding: 0; }
.day summary strong { font-size: 15px; }
.day .small { font-size: 12px; margin-top: 5px; }
.day[open] summary { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.day details { margin-top: 12px; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; justify-content: space-between; font-size: 12px; gap: 12px; }
.legend strong { display: inline-block; margin-top: 5px; }
.onboard { position: fixed; inset: 0; z-index: 20; overflow: auto; background: var(--bg); padding: calc(45px + env(safe-area-inset-top)) 22px 40px; }
.onboard>div { max-width: 440px; margin: auto; }
.onboard h1 { font-size: 36px; line-height: 1.2; margin: 24px 0; letter-spacing: -1.8px; }
.onboard .mark { width: 62px; height: 62px; border-radius: 19px; display: grid; place-items: center; background: var(--green); font-size: 38px; color: var(--card); margin-bottom: 30px; }
.onboard .card { margin-top: 28px; }
#toast { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(108px + env(safe-area-inset-bottom)); width: min(92%,460px); background: var(--card); color: var(--text); padding: 20px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 44px #0e241f26; font-size: 15px; }
#toast:empty { display: none; }
#toast .toast-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
#toast .toast-actions button { margin: 0; min-height: 54px; background: var(--bg); color: var(--text); border: 1px solid var(--line); }
#toast .toast-actions button[data-a=undo] { background: #287759; color: #fff; border-color: transparent; flex: 1; }
dialog { width: min(94%,460px); border: 1px solid var(--line); border-radius: 22px; background: var(--card); color: var(--text); padding: 28px; box-shadow: 0 24px 80px #0e241f33; }
dialog::backdrop { background: #12262a99; backdrop-filter: blur(3px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.warning-text { color: #ffe2a0; font-size: 14px; }
svg text { font-family: inherit; fill: var(--muted); }
[data-style=presentation-1] { margin: 0; }
[data-style=presentation-2] { justify-content: flex-end; margin-top: 8px; }
[data-style=presentation-3] { margin-top: 22px; }
[data-style=presentation-4] { margin-top: 18px; }
[data-style=presentation-5] { margin-top: 14px; }
[data-style=presentation-6] { height: 20px; }
[data-style=presentation-7] { text-align: right; }
[data-style=presentation-8] { text-align: left; border-radius: 0; background: transparent; }
[data-style=presentation-9] { white-space: pre-wrap; font: inherit; font-size: 14px; }
[data-style=presentation-10] { padding-left: 22px; }
[data-style=presentation-11] { margin-top: 26px; }
@media(prefers-color-scheme:dark) {
  :root:not([data-theme=light]) { color-scheme:dark; --bg:#121d1b; --card:#1c2a26; --text:#e4ede7; --muted:#a3b6a9; --line:#30443a; --green:#8ad0a9; --orange:#e4a574; --blue:#9bbfd7; --red:#ff9ba6; --panel:#274c4e; --soft:#283e32; --warn:#342f22; --shadow:none; }
  .hero .red { color: #ffb2b8; }
}
@media(min-width:900px) {
  header,main { max-width: 1200px; padding-left: 32px; padding-right: 32px; }
  header { min-height: 120px; padding-top: 30px; padding-bottom: 30px; }
  header h1 { font-size: 25px; }
  header .logo { width: 48px; height: 48px; }
  header>.eyebrow { display: none; }
  main { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; align-items: start; padding-top: 26px; padding-bottom: 64px; }
  main>.intro,main>.notice,main>.month,main>.empty,main[data-view=history]>p { grid-column: 1/-1; margin-bottom: 0; }
  .intro { padding-bottom: 4px; }
  .intro .eyebrow { font-size: 11px; }
  .intro>p:last-child { font-size: 19px; letter-spacing: -.4px; }
  main>.card,main>.grid { margin-bottom: 0; }
  main>.grid { align-self: stretch; gap: 16px; }
  .tile { padding: 24px; display: flex; flex-direction: column; justify-content: center; }
  .tile span { font-size: 13px; max-width: 190px; }
  .tile strong { font-size: 28px; }
  .tile .small { font-size: 11px; }
  .card { padding: 30px; }
  .hero { padding: 34px; align-self: stretch; }
  .hero .amount { font-size: 54px; letter-spacing: -2.5px; }
  .hero .between>div>div:first-child { font-size: 16px; }
  .ring { width: 90px; }
  .nav { top: 28px; bottom: auto; left: calc(50% + 244px); width: 520px; padding: 6px; border-radius: 16px; box-shadow: var(--shadow); }
  .nav button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; font-size: 14px; padding: 10px; }
  .nav button>span { margin: 0; }
  .nav-icon { width: 20px; height: 20px; }
  .month { justify-content: center; gap: 26px; padding: 4px 0 14px; }
  .month h2 { font-size: 24px; min-width: 265px; }
  main[data-view=summary]>.card:nth-of-type(4) { grid-column: 1/-1; }
  .chart { max-height: 340px; }
  .legend { font-size: 14px; }
  main[data-view=history]>.day { margin-bottom: 0; }
  #toast { left: auto; right: 28px; bottom: 28px; transform: none; width: 430px; }
  .onboard { display: grid; place-items: center; padding: 48px; }
  .onboard>div { max-width: 520px; width: 100%; }
  .onboard h1 { font-size: 44px; }
}
@media(min-width:900px) and (max-width:1120px) {
  .nav { left: auto; right: 32px; transform: none; width: 470px; }
  header h1 { font-size: 23px; }
  .tile { padding: 20px; }
  .tile strong { font-size: 25px; }
}
@media(min-width:1200px) {
  main[data-view=history] { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
/* Wide-screen dashboard: a financial overview followed by the daily workspace. */
@media(min-width:1100px) {
  header,main { max-width: 1320px; padding-left: 40px; padding-right: 40px; }
  header { min-height: 108px; padding-top: 24px; padding-bottom: 24px; }
  .nav { top: 24px; left: calc(50% + 300px); width: 540px; }
  main { padding-top: 20px; gap: 24px; }
  main[data-view=today] { grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); }
  main[data-view=today]>.hero { grid-column: 1/-1; position: relative; padding: 32px 40px; overflow: hidden; background: radial-gradient(ellipse at 95% 10%,#ffffff09,transparent 65%),var(--panel); }
  main[data-view=today]>.hero .between { margin-top: 16px; }
  main[data-view=today]>.hero .amount { font-size: 60px; margin: 8px 0 12px; }
  main[data-view=today]>.hero .ring { position: absolute; right: 48px; top: 66px; width: 120px; }
  main[data-view=today]>.hero details { margin-top: 20px; padding-top: 12px; }
  main[data-view=today]>.hero details p { max-width: 820px; }
  main[data-view=today]>.grid { grid-column: 1/-1; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; }
  main[data-view=today]>.grid .tile { min-height: 144px; padding: 24px; justify-content: flex-start; }
  main[data-view=today]>.grid .tile span { max-width: none; min-height: 20px; }
  main[data-view=today]>.grid .tile strong { font-size: 27px; }
  main[data-view=today]>.card:not(.hero) { min-height: 360px; }
  main[data-view=today]>.card:not(.hero):last-child { position: sticky; top: 112px; }
  .intro>p:last-child { font-size: 20px; }
  main[data-view=settings] { gap: 28px; }
  main[data-view=summary]>.card { padding: 32px; }
  .month { justify-content: flex-start; }
}
@media(min-width:1100px) and (max-width:1320px) {
  .nav { left: auto; right: 40px; transform: none; }
  main[data-view=today]>.grid .tile { padding: 20px; }
  main[data-view=today]>.grid .tile strong { font-size: 24px; }
  main[data-view=today]>.grid .tile span { font-size: 12px; }
}
:root[data-theme=dark] { color-scheme:dark; --bg:#121d1b; --card:#1c2a26; --text:#e4ede7; --muted:#a3b6a9; --line:#30443a; --green:#8ad0a9; --orange:#e4a574; --blue:#9bbfd7; --red:#ff9ba6; --panel:#274c4e; --soft:#283e32; --warn:#342f22; --shadow:none; }
:root[data-theme=light] { color-scheme:light; }
.theme-toggle { display:flex; align-items:center; justify-content:center; gap:8px; font-size:12px; padding:10px 12px; flex-shrink:0; }
.theme-toggle .nav-icon { width:19px; height:19px; }
@media(max-width:420px) { header h1 { font-size:20px; } header .flex { gap:9px; } header .logo { width:40px; height:40px; } .theme-toggle { padding:8px 10px; font-size:11px; } }
@media(min-width:900px) { header>.theme-toggle { position:absolute; top:130px; right:max(32px,calc((100vw - 1136px)/2)); min-height:46px; font-size:13px; } }
@media(min-width:1100px) { header>.theme-toggle { top:120px; right:max(40px,calc((100vw - 1240px)/2)); } }
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { transition: none !important; scroll-behavior: auto !important; }
}

[hidden] { display:none !important; }
.history-search { grid-column:1/-1; }
.filter-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 16px; }
.search-hint { margin-top:16px; margin-bottom:0; }
.connection-status,.update-notice { max-width:1240px; margin:12px auto 0; padding:14px 20px; border:1px solid var(--line); border-radius:14px; font-size:14px; background:var(--warn); color:var(--text); }
.update-notice button { margin:8px; min-height:44px; font-size:14px; }
@media(max-width:899px) { .connection-status,.update-notice { margin:12px 20px 0; } }
@media(min-width:900px) { .history-search form>label { max-width:680px; } .history-search details .filter-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } .history-search details>label { max-width:360px; } }


