:root{font-family:Inter,system-ui,sans-serif;color:#182b23;background:#f4f6f1;line-height:1.5;--green:#195743;--line:#dce5dc;--muted:#54685e}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0}
header{background:#12372e;color:#fff;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px max(20px,calc((100% - 1100px)/2))}
.brand,.identity,.heading,.actions,.fields,.row,.row-actions,.legend{display:flex;align-items:center;gap:12px}
.brand strong{display:block;line-height:1.2}
.brand small{color:#c2dbcb}
.mark{display:grid;place-items:center;background:#cef0bc;color:#12372e;border-radius:12px;width:42px;height:42px;font-size:25px;font-weight:800}
main{max-width:1140px;margin:auto;padding:30px 20px 60px}
.heading,.row{justify-content:space-between}
.heading{margin-bottom:14px}
h1,h2,p{margin:0}
h1{font-size:clamp(1.75rem,5vw,2.7rem);letter-spacing:-.045em;line-height:1.1}
h2{font-size:1.25rem;letter-spacing:-.02em}
.eyebrow{color:var(--green);font-weight:750;letter-spacing:.12em;font-size:.72rem;margin-bottom:8px}
.panel,.metric,dialog{background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px}
.panel{margin-top:18px}
.login{max-width:440px;margin:6vh auto}
.login p{margin:12px 0 18px;color:var(--muted)}
.login>button{margin-top:12px}
form{display:grid;gap:13px}
label{display:grid;gap:5px;font-weight:650;font-size:.86rem}
.check{display:flex;align-items:center}
.fields>*{flex:1;min-width:0}
button,input,select,.button{font:inherit;border:1px solid #b9ccbf;border-radius:8px;padding:9px 11px;background:white;color:#20392e;min-width:0}
.button{text-decoration:none}
.actions{flex-wrap:wrap}
.muted{color:var(--muted);font-size:.88rem}
.monthly-note{margin-top:8px}
.catalog-form,.catalog-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:12px}
.catalog-form{align-items:end}
.catalog-list section{padding:12px;background:#f5f8f4;border-radius:8px}
.catalog-list ul{margin:6px 0;padding-left:20px;overflow-wrap:anywhere}
@media(max-width:680px){.catalog-form,.catalog-list{grid-template-columns:1fr}}
button,summary{cursor:pointer}
button:hover{background:#eaf2eb}
button:disabled{opacity:.5;cursor:wait}
.primary{background:var(--green);border-color:var(--green);color:white;font-weight:700}
.primary:hover{background:#124534}
:focus-visible{outline:3px solid #498e6d;outline-offset:2px}
.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.metric span,.row small,#shortfall{display:block;color:var(--muted);font-size:.88rem}
.metric strong{font-size:clamp(1.1rem,2.4vw,1.6rem)}
.negative,#form-error,#payment-error{color:#a02c32}
#chart svg{display:block;width:100%;height:150px;background:#f5f8f4;border-radius:8px}
polyline{fill:none;vector-effect:non-scaling-stroke;stroke-width:2.5}
.zero{stroke:#b9c7bb;stroke-width:1}
.confirmed{stroke:#17624a}
.possible{stroke:#856211;stroke-dasharray:6 5}
.legend{flex-wrap:wrap;font-size:.82rem;margin:10px 0}
.legend span::before{content:'';display:inline-block;width:16px;border-top:3px solid #17624a;margin-right:6px;vertical-align:middle}
.legend span+span::before{border-top:3px dashed #856211}
.table-wrap{overflow:auto;max-height:300px}
table{width:100%;border-collapse:collapse;text-align:left;font-size:.9rem}
td,th,.row{border-bottom:1px solid var(--line);padding:10px 4px}
.row:last-child{border:0}
.row-actions{flex-wrap:wrap;justify-content:flex-end}
.row-actions button{font-size:.78rem}
.empty{padding:18px 0;color:var(--muted)}
#status{padding:10px 14px;background:#e8f2e5;border-radius:10px;margin-bottom:14px}
dialog{width:min(94vw,490px);max-height:90dvh;color:inherit}
dialog::backdrop{background:#11251dc2}
@media(max-width:680px){.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.row{align-items:flex-start;flex-direction:column}.row-actions{justify-content:flex-start}.heading{flex-wrap:wrap}.panel,.metric{padding:14px}main{padding-top:20px}}
@media(max-width:360px){.fields{display:grid}.metric{padding:10px}}

body{background:radial-gradient(ellipse at top right,#e3eee3,transparent 38rem),#f2f5f1}
header{background:linear-gradient(115deg,#102e26,#1b4c3d)}
.panel,.metric{box-shadow:0 6px 24px #122e2410}
.metric{border-top:3px solid #8cb5a0}
.metric:first-child{background:#153e32;color:#fff;border-color:#a7d7b0}
.metric:first-child span{color:#d3e9dd}
.metric:first-child .negative{color:#ffd4d4}
.metric:nth-child(3){border-top-color:#d4aa69}
.metric .metric-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;margin-bottom:10px;background:#e7f3eb;color:#195743;font-size:1.15rem;font-weight:800}
.metric:first-child .metric-icon{background:#28614e}
.metric:nth-child(3) .metric-icon{background:#f8ecd8;color:#805118}
.bank-name{display:flex;align-items:center;gap:10px;min-width:0;overflow-wrap:anywhere}
.bank-badge{display:inline-grid;place-items:center;min-width:44px;height:34px;padding:0 6px;flex-shrink:0;border-radius:9px;background:#e0ece5;color:#174636;font-weight:850;font-size:.72rem;letter-spacing:-.025em}
.bank-nubank{background:#820ad1;color:#fff;font-size:1.05rem}
.bank-c6{background:#202124;color:#fff;font-size:.95rem}
.bank-itau{background:#ec7000;color:#142460;font-size:.92rem}
.bank-inter{background:#f16d00;color:#241800;font-size:.8rem}
.bank-bb{background:#fff200;color:#123b86}
.bank-caixa{background:#0069ae;color:#fff}
.bank-bradesco{background:#b8003d;color:#fff}
.bank-santander{background:#c90000;color:#fff}
.catalog-items{display:grid;gap:8px;margin-top:10px}
.catalog-tile{display:grid;gap:8px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}
.catalog-tile button{justify-self:start;font-size:.78rem;padding:4px 8px}
#card-preview{background:#e9f4ec;padding:8px 10px;border-radius:8px}

:root{font-family:"DM Sans",Inter,system-ui,sans-serif;color:#19171d;background:#f5f4f7;--green:#211b2a;--line:#e6e2eb;--muted:#625d6b}
body{background:#f5f4f7}
header{min-height:76px;background:#f5f4f7;color:#19171d;border-bottom:1px solid var(--line)}
.brand{gap:10px;white-space:nowrap;letter-spacing:-.035em;font-size:1.08rem}
.mark{width:36px;height:36px;background:#e9ddff;color:#663f96;border-radius:12px;font-size:.78rem;letter-spacing:.03em}
nav{display:flex;gap:clamp(12px,3vw,34px);align-items:center}
nav a{color:#4b4455;text-decoration:none;font-size:.86rem}
nav a:hover{text-decoration:underline}
main{padding-top:44px}
h1{font-size:clamp(2.25rem,6vw,4.1rem);font-weight:620;letter-spacing:-.075em}
h2{font-size:1.32rem;font-weight:650;letter-spacing:-.035em}
.dashboard-heading{margin-bottom:24px}
.eyebrow{color:#634b81;letter-spacing:.075em}
.panel,.metric,dialog{border-radius:22px;box-shadow:none}
.panel{padding:24px}
.login{padding:clamp(22px,5vw,38px);margin-top:8vh}
.login h1{font-size:clamp(2.15rem,5vw,3.25rem)}
.metric,.metric:first-child,.metric:nth-child(3){border:1px solid var(--line);color:#19171d;background:#fff}
.metric:first-child{background:linear-gradient(132deg,#e9ddff,#fbe5f6);border-color:#e7d8f5}
.metric:first-child span{color:#4f3a67}
.metric:first-child .negative{color:#a02c32}
.metric strong{font-variant-numeric:tabular-nums;letter-spacing:-.04em;overflow-wrap:anywhere}
.metric .metric-icon,.metric:first-child .metric-icon,.metric:nth-child(3) .metric-icon{background:#f1ebfb;color:#5f457d}
.metric:first-child .metric-icon{background:#fff8}
button,input,select,.button{border-color:#dcd6e4;color:#211b2a;border-radius:11px}
button,.button{border-radius:999px;padding-inline:15px}
.primary{background:#19171d;border-color:#19171d}
.primary:hover{background:#342841}
button:hover{background:#f2edf8}
:focus-visible{outline-color:#8957b8}
.projection{background:linear-gradient(155deg,#fff 50%,#f5edff)}
#chart svg{background:#f2ecf8}
.confirmed{stroke:#593885}
.legend span::before{border-top-color:#593885}
.zero{stroke:#c9bdd6}
.catalog-list section{background:#f7f4fa}
.bank-picker{display:flex;align-items:center;gap:8px;margin-top:6px}
.bank-picker select{flex:1;min-width:0;width:100%}
.bank-badge{background:#f3eef8;color:#604779;min-width:40px;height:40px;padding:4px;border:1px solid #e9e0f1}
.bank-badge img{display:block;width:30px;height:30px;object-fit:contain}
#card-preview,#status{background:#f0e8fa}
dialog::backdrop{background:#21192b99}
@media(max-width:680px){
  header{flex-wrap:wrap;padding-block:12px}
  nav{order:3;width:100%;padding:4px 0}
  main{padding-top:24px}
  .panel{padding:16px}
  .metric{border-radius:16px}
}

nav a{padding:7px 12px;border-radius:999px;white-space:nowrap}
nav a[aria-current=page]{background:#ebe3f7;color:#3d2658;font-weight:700}
nav a:hover{text-decoration:none;background:#f0eaf6}
#invoices,.card-details{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,215px),1fr));gap:12px}
.invoice-preview{display:grid;gap:7px;padding:15px;background:#f8f4fc;border:1px solid #e8e0ef;border-radius:16px;color:inherit;text-decoration:none}
.invoice-preview:hover{background:#f0e7fa;border-color:#cdb9e1}
.invoice-amount,.card-total strong{font-size:1.45rem;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.card-details{grid-template-columns:repeat(auto-fit,minmax(min(100%,390px),1fr));align-items:start}
.card-period{background:linear-gradient(120deg,#fbf8ff,#f4eafa)}
.card-period .actions{align-items:end}
.entry-filters h2{margin-bottom:12px}
.entry-filters .actions{flex-wrap:wrap}
.projection-plot{position:relative}
.projection-frame{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:10px}
.projection-frame .projection-dates{grid-column:2}
.projection-scale{position:relative;min-width:3.5rem;color:var(--muted);font-size:.75rem;font-variant-numeric:tabular-nums}
.projection-scale span{position:absolute;right:0;transform:translateY(-50%);white-space:nowrap}
.projection-plot .projection-gridline{stroke:#ded1eb;stroke-width:1;stroke-dasharray:2 4}
.amounts-private .projection-scale{visibility:hidden}
#chart .projection-plot svg{height:clamp(155px,23vw,245px);background:#f8f3fc}
.projection-plot path{fill:none;vector-effect:non-scaling-stroke;stroke-width:2;stroke-linecap:round}
.projection-plot .projection-area{fill:url(#projection-fill);stroke:none}
.projection-plot .confirmed{stroke:#70419f;stroke-width:2.5}
.projection-plot .zero{stroke-width:1;stroke-dasharray:3 4}
.projection-marker{position:absolute;left:0;width:10px;height:10px;border-radius:50%;background:#70419f;border:2px solid white;transform:translate(-50%,-50%)}
.projection-dates{display:flex;justify-content:space-between;color:var(--muted);font-size:.76rem;margin-top:6px}
.profile-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.profile-access #password-form{border-top:1px solid var(--line);padding-top:16px}
.profile-access .row{overflow-wrap:anywhere}
#catalog .catalog-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr));align-items:start;gap:14px}
#catalog .catalog-list section{background:white;border:1px solid var(--line);border-radius:18px;padding:16px}
.catalog-editor h2{margin-bottom:8px}
@media(max-width:760px){.profile-layout{grid-template-columns:1fr}}
.projection-guide{position:absolute;inset-block:0;border-left:1px dashed #623e88;pointer-events:none}
.projection-scrubber{position:absolute;inset:0;width:100%;height:100%;opacity:0;margin:0;cursor:crosshair;touch-action:pan-y}
.projection-plot:focus-within{outline:2px solid #8053aa;outline-offset:3px;border-radius:8px}
.projection-readout{display:flex;flex-wrap:wrap;gap:6px 18px;padding:10px 0;font-size:.85rem;color:#51475b}
.card-totals{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.card-total{display:grid;gap:3px}
.credit-detail .bank-name{margin-bottom:12px}
.invoice-detail{padding:12px 0;border-top:1px solid var(--line)}
.invoice-detail summary{font-weight:650}
.category-line{padding:8px 0}
.category-line .heading{margin-bottom:4px}
progress{display:block;width:100%;height:7px;accent-color:#8053aa;border:0;border-radius:10px;overflow:hidden;background:#eae1f2}
progress::-webkit-progress-bar{background:#eae1f2}
progress::-webkit-progress-value{background:#8053aa}
progress::-moz-progress-bar{background:#8053aa}
.credit-detail progress{margin:8px 0 12px}
@media(max-width:680px){nav{overflow:auto;gap:3px}nav a{padding:6px 9px}.card-totals{grid-template-columns:repeat(2,1fr)}}
.positive{color:#14613d}
.amount-zero{color:#19171d}
.primary{background:#623e88;border-color:#623e88}
.primary:hover{background:#503070}
.category-icon-picker,.category-symbol{display:inline-flex;align-items:center;gap:8px}
.category-icon-picker select{flex:1}
.category-symbol img{display:block;width:18px;height:18px}
.icon-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,135px),1fr));gap:6px;max-height:240px;overflow:auto;margin-top:8px;padding:4px}
.icon-options button{display:flex;align-items:center;gap:6px;border-radius:9px;text-align:left;padding:6px 8px}
.icon-options{grid-template-columns:repeat(auto-fill,44px)}
.icon-options button{justify-content:center;width:44px;height:44px;padding:0}
.icon-options button[aria-pressed=true]{background:#eee5fa;border-color:#8053aa}
#tag-year{width:7rem}
.entry-tag .category-symbol img{width:13px;height:13px;margin-right:4px}
.statement-row{display:grid;grid-template-columns:auto minmax(120px,1fr) auto minmax(135px,1fr) auto auto;align-items:center;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}
#statement-status{margin:10px 0;color:var(--muted)}
@media(max-width:860px){.statement-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
.metric .negative{color:#a02c32}
.brand .mark{overflow:hidden;flex-shrink:0}
.brand .mark img{width:100%;height:100%;object-fit:cover}
.brand strong{white-space:normal;overflow-wrap:anywhere}
#profile form{max-width:500px;margin-top:16px}
#profile form button{justify-self:start}
#profile form p:empty{display:none}
.entry-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.entry-tag{display:inline-block;border-radius:999px;padding:2px 8px;background:#f0eef2;color:#524b5b;font-size:.73rem;line-height:1.5}
.tag-type{background:#efe5fa;color:#593e78}
.tag-method{background:#eaf0fa;color:#3b5477}
.tag-repeat,.tag-paid{background:#e5f3eb;color:#2e6248}
.tag-date{background:#f4edf8;color:#624d74}
.tag-category{background:#f8efe2;color:#725129}
.tag-overdue{background:#fbe9e9;color:#8a373b}
#edit-scope{border:1px solid var(--line);border-radius:14px;padding:8px 12px 12px;display:grid;gap:7px}
#edit-scope legend{padding:0 4px;font-weight:650}
#edit-entry-error{color:#a02c32}
#edit-entry-error:empty{display:none}
.overview-heading{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px 22px}
.period-controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px}
.period-controls input{width:clamp(138px,17vw,190px)}
.period-controls button{white-space:nowrap;padding-inline:11px}
@media(max-width:860px){
  .overview-heading{grid-template-columns:minmax(0,1fr) auto}
  .overview-heading .period-controls{grid-row:2;grid-column:1/-1;justify-content:flex-start}
  .overview-heading .actions{grid-row:1;grid-column:2}
}
@media(max-width:560px){
  .overview-heading{grid-template-columns:minmax(0,1fr)}
  .overview-heading .actions{grid-row:3;grid-column:1}
  .period-controls input{width:min(180px,60vw)}
}
.due-legend{display:flex;flex-wrap:wrap;gap:8px 16px;margin:12px 0 4px}
.due-legend span,.entry-title{display:flex;align-items:center;gap:8px}
.due-dot{display:inline-block;width:9px;height:9px;border-radius:50%;flex:none}
.due-late{background:#be404c}
.due-today{background:#cb680d}
.due-future{background:#8c8796}
.investment-summary{display:grid;gap:6px;background:linear-gradient(125deg,#ede2fc,#f8eafa)}
.investment-summary strong,.investment-value{display:block;font-size:clamp(1.5rem,4vw,2rem);letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.investment-tile progress{margin:8px 0 12px}
.investment-actions{margin:14px 0}
.invoice-action{margin:8px 6px 4px 0}
#cash-review{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));margin-top:14px}
.overview-details>summary{font-weight:650}
details>summary{display:flex;align-items:center;gap:10px;list-style:none}
details>summary::-webkit-details-marker{display:none}
details>summary::before{content:'';width:7px;height:7px;flex:none;border-right:2px solid #8053aa;border-bottom:2px solid #8053aa;transform:rotate(-45deg);transition:transform .16s ease}
details[open]>summary::before{transform:rotate(45deg)}
@media(prefers-reduced-motion:reduce){details>summary::before{transition:none}}
.overview-details>h2,.overview-details .category-heading{margin-top:20px}
.overview-details #cash-review{grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr))}
#shortfall-causes{margin:10px 0}
.pending-tabs{margin-bottom:8px}
.pending-tabs button[aria-pressed=true]{background:#eee5fa;color:#513371;border-color:#e1d2ef;font-weight:700}
#pending-total{margin-left:auto}
.tag-picker{min-width:0;border:0;padding:0;margin:0}
.tag-picker legend{padding:0;margin-bottom:7px;font-size:.86rem;font-weight:650}
.tag-picker>div{display:flex;flex-wrap:wrap;gap:6px}
.tag-choice{position:relative;display:inline-flex;max-width:100%;cursor:pointer}
.tag-choice input{position:absolute;opacity:0;width:1px;height:1px}
.tag-choice-name{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:4px 11px;border:1px solid #e5ddec;border-radius:999px;background:#fff;color:#51475b;overflow-wrap:anywhere}
.tag-choice-name::before{content:'+';color:#766584;font-weight:500}
.tag-choice:hover .tag-choice-name{background:#faf6fe}
.tag-choice input:checked+.tag-choice-name{background:#eee4fa;border-color:#d6c2ed;color:#533478}
.tag-choice input:checked+.tag-choice-name::before{content:'✓';color:inherit}
.tag-choice input:focus-visible+.tag-choice-name{outline:2px solid #8957b8;outline-offset:2px}
#tag-totals{padding-top:12px}
#installment-preview{margin-top:-6px;color:#593e78;font-weight:650}
#card-installment-position,#default-installment-position{display:none}
#loan-fields{display:grid;gap:12px}
.loan-credit{display:grid;gap:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#f8f5fc}
.loan-credit input[type=checkbox]{margin:0;accent-color:#623e88}
.metric-amount{display:flex;align-items:baseline;flex-wrap:wrap;gap:0 6px}
.metric-amount span,.metric .metric-expected{font-size:.75rem}
.metric .metric-expected{margin-top:4px}
#investment-error{color:#a02c32}
#investment-error:empty{display:none}
.overview-privacy{display:inline-grid;place-items:center;width:44px;height:44px;padding:0}.overview-privacy[aria-pressed=true]{background:#eee4fa;color:#533478}
.overview-privacy svg [hidden]{display:none!important}
.amounts-private :is(.projection-plot svg,.projection-guide,.projection-scrubber,progress){visibility:hidden}
.amounts-private :is(.positive,.negative){color:inherit}

.goal-card{display:grid;gap:12px}
#until-income{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 14px;margin-bottom:16px}
.entry-filters .actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:12px}
.entry-filters input,.entry-filters select{width:100%;background:#ffffffdc}
#nav a{border-radius:999px}
button,.button,select{transition:background-color .15s,border-color .15s}
@media(max-width:680px){#nav{overflow-x:auto;scrollbar-width:thin}.entry-filters .actions{grid-template-columns:repeat(auto-fit,minmax(min(100%,125px),1fr))}}
@media(prefers-reduced-motion:reduce){button,.button,select{transition:none}}

.brand{flex:0 0 auto}.brand strong{white-space:nowrap}
#nav{gap:clamp(0px,1vw,14px)}
#nav a{padding-inline:clamp(6px,1vw,12px)}
.entry-filters>.heading:has(#entry-search){display:block}
#card-details{align-items:stretch}
#card-details .credit-detail{display:flex;flex-direction:column;align-items:stretch}
#card-details .invoice-action{margin-top:auto;text-align:left}
#selected-invoice{scroll-margin-top:20px}
#catalog .catalog-group{padding:15px;background:#fff;border:1px solid var(--line);border-radius:16px}
.catalog-group>summary{font-weight:650}
.catalog-tile[open]>:not(summary){margin-top:8px}
@media(max-width:900px){header{flex-wrap:wrap}#nav{order:3;width:100%;overflow-x:auto}}


#create-report{border-color:#a785c2;color:#593588}
#report-form details label{margin-top:12px}
#report-result h3{margin:18px 0 8px}
.report-month{margin:16px 0;padding:12px 16px;border:1px solid #eae1f2;border-radius:14px}
.report-month summary{cursor:pointer}
.report-month progress,.report-metrics progress{margin:6px 0 10px}
.report-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:16px;margin:14px 0}
.report-metrics strong{display:block;margin-bottom:6px}
.report-rows{padding-inline-start:20px;overflow-wrap:anywhere}
.report-rows li{margin:5px 0}
@media print{
  body:has(#report-result:not([hidden])) > header,
  body:has(#report-result:not([hidden])) #transactions > .dashboard-heading,
  #report-result > .heading .actions{display:none!important}
  #report-result{border:0;box-shadow:none}
  #report-result details::details-content{content-visibility:visible}
  .report-month{break-inside:avoid}
  #report-result progress{print-color-adjust:exact}
}
#until-income .daily-due-note{flex-basis:100%;margin:0;font-size:.9rem;color:#593588}
