:root{font-family:Inter,system-ui,Arial,sans-serif;color:#152b29;background:#f3f7f5}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;background:#126b53;color:white;border:0;border-radius:10px;padding:11px 15px}button.secondary{background:#e8f1ee;color:#175844}button.danger{background:#a33c3c}button:disabled{opacity:.5}header{background:#104c3d;color:white;padding:18px 22px;display:flex;justify-content:space-between;gap:12px;align-items:center}header h1{font-size:20px;margin:0}nav{display:flex;flex-wrap:wrap;gap:7px;background:white;padding:10px 16px;border-bottom:1px solid #dce7e2}nav button{background:transparent;color:#22584a}nav button.active{background:#d9ede4}main{max-width:1200px;margin:auto;padding:18px}.card{background:white;border:1px solid #dfebe6;border-radius:16px;padding:18px;margin-bottom:14px;box-shadow:0 3px 14px #173b3010}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}.kpi{font-size:24px;font-weight:750;margin-top:9px}.muted{color:#6b807a;font-size:13px}h2{margin:0 0 16px}label{display:flex;flex-direction:column;gap:5px;font-size:13px;font-weight:600}input,select,textarea{border:1px solid #cbdad4;border-radius:9px;padding:10px;background:white;width:100%;color:#203d34}form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;align-items:end}.wide{grid-column:1/-1}.actions{display:flex;gap:8px;flex-wrap:wrap}.scroll{overflow:auto}table{width:100%;border-collapse:collapse;min-width:650px}th,td{padding:10px;text-align:left;border-bottom:1px solid #e5efea;font-size:13px}th{background:#f3f8f5}#login{max-width:420px;margin:12vh auto;padding:24px}#app{display:none}#notice{position:fixed;bottom:15px;right:15px;max-width:360px;background:#163f35;color:white;padding:13px 18px;border-radius:12px;display:none;z-index:5}.right{text-align:right}.negative{color:#ac3c40}.positive{color:#127655}.pill{padding:4px 9px;background:#e6f1eb;border-radius:30px;font-size:12px}@media(max-width:600px){header{padding:14px}main{padding:10px}.card{padding:14px}nav{flex-wrap:nowrap;overflow-x:auto}nav button{white-space:nowrap}form{grid-template-columns:1fr 1fr}.wide{grid-column:1/-1}}

#busy[hidden]{display:none!important}#busy{position:fixed;inset:0;background:#0c241e70;display:grid;place-content:center;z-index:100;color:white;text-align:center;font-weight:700;gap:14px}.spinner{width:48px;height:48px;border:5px solid #ffffff66;border-top-color:white;border-radius:50%;animation:spin .7s linear infinite;margin:auto}@keyframes spin{to{transform:rotate(360deg)}}.is-busy button{pointer-events:none}.icon-btn{padding:6px 10px;font-size:17px;min-width:36px}.annual{min-width:1350px}.annual th:first-child,.annual td:first-child{position:sticky;left:0;background:#fff;min-width:180px}.annual thead th{background:#e8f1ee}.annual .summary th,.annual .summary td{font-weight:800;background:#eaf3ef}.annual .summary th:first-child{background:#eaf3ef}
/* Visual v3 */
:root{--brand:#176e62;--brand-dark:#104c47;--line:#dfeae7;--ink:#203a37;--muted:#657d78;font-family:Inter,ui-sans-serif,system-ui,Arial,sans-serif;background:#f4f7fa;color:var(--ink)}
header{background:linear-gradient(115deg,#103d46,#176d62 68%,#237c76);box-shadow:0 10px 24px #092c2b20}nav{box-shadow:0 3px 14px #173b3010;position:sticky;top:0;z-index:4}nav button{border-radius:9px;transition:background .18s,transform .18s}nav button:hover{background:#e6f5ef;transform:translateY(-1px)}nav button.active{background:#d2ece3;color:#0d5947;font-weight:750}.card{border-color:var(--line);box-shadow:0 5px 20px #1b45400d;transition:box-shadow .2s,transform .2s}.cards>.card:hover{transform:translateY(-3px);box-shadow:0 12px 30px #1b45401b}tbody tr{transition:background .15s}tbody tr:hover{background:#edf7f4}tbody tr:hover td{background:transparent}button{transition:filter .15s,transform .15s,box-shadow .15s}button:hover:not(:disabled){filter:brightness(1.07);box-shadow:0 4px 12px #144e4025}button:active:not(:disabled){transform:scale(.98)}input:focus,select:focus,textarea:focus{outline:2px solid #69bba6;outline-offset:1px;border-color:#4eac95}.actions{white-space:nowrap}.icon-btn{display:inline-flex;align-items:center;justify-content:center;border-radius:9px}.card h2{letter-spacing:-.02em}.kpi{letter-spacing:-.035em}label[hidden]{display:none!important}th{color:#496760;font-weight:750}table{font-variant-numeric:tabular-nums}

/* Situação financeira nas tabelas */
.scroll tbody tr.row-paid{background:rgba(20,155,100,.095)}
.scroll tbody tr.row-partial{background:rgba(234,164,40,.12)}
.scroll tbody tr.row-open{background:rgba(224,72,72,.055)}
.scroll tbody tr:hover{filter:brightness(.975);box-shadow:inset 3px 0 0 #378e78;transition:background .18s,box-shadow .18s}

/* V5: aproveitamento de telas grandes e leitura de tabelas */
@media(min-width:900px){main{max-width:none;width:calc(100% - 44px);margin:0 auto;padding:20px 0}.annual{width:100%;min-width:1350px;table-layout:auto}.annual th,.annual td{padding:11px 9px}.card{padding:22px}}
.scroll{border:1px solid #e5ecea;border-radius:12px;max-width:100%}
.scroll table tbody td:nth-child(even){background-color:rgba(30,100,90,.025)}
.annual tbody td:nth-child(even){background-color:rgba(35,100,95,.065)}
.annual tbody td:nth-child(odd){background-color:rgba(255,255,255,.45)}
.annual td.amount-negative{color:#b22b3b!important;font-weight:750}
.annual tr.summary-income td,.annual tr.summary-income th{background:#e4f5e9!important}
.annual tr.summary-expense td,.annual tr.summary-expense th{background:#fff0e6!important}
.annual tr.summary-balance td,.annual tr.summary-balance th{background:#e7eefc!important}
.annual tr.summary td.amount-negative{color:#b22b3b!important}
.annual tbody tr:hover td{filter:brightness(.97)}
.split-line{display:grid;grid-template-columns:2fr 2fr 1fr auto;gap:10px;align-items:end;padding:10px;border-bottom:1px solid #e5ecea}
.import-errors{color:#b22b3b;font-size:13px}
@media(max-width:720px){.split-line{grid-template-columns:1fr 1fr}.split-line label:nth-child(3){grid-column:1/-1}}

/* V8: controles compactos e tabelas anuais com situação financeira */
label:has(>input[type="checkbox"]),label.switch{display:inline-flex;flex-direction:row;align-items:center;gap:10px;cursor:pointer}
input[type="checkbox"]{appearance:none;width:43px;min-width:43px;height:24px;border-radius:999px;background:#cbd8d5;border:1px solid #b5cbc3;position:relative;cursor:pointer;transition:background .2s;padding:0}
input[type="checkbox"]:before{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;background:white;border-radius:50%;box-shadow:0 1px 4px #0002;transition:transform .2s}
input[type="checkbox"]:checked{background:#17866d;border-color:#17866d}input[type="checkbox"]:checked:before{transform:translateX(19px)}
input[type="month"],.compact-month select{max-width:180px;min-width:130px}
.annual td.annual-paid{background:#e0f4e9!important}.annual td.annual-partial{background:#fff0cf!important}.annual td.annual-open{background:#fff0f0!important}
.annual-link{background:transparent;color:#174e45;padding:5px;border-radius:6px;font-weight:650;white-space:nowrap}.annual-link:hover{background:#d5eae4;box-shadow:none!important;text-decoration:underline}
.annual tbody tr:not(.summary) td.amount-negative{color:inherit!important;font-weight:inherit!important}
.annual tr.summary td.amount-negative{color:#b22b3b!important}
#annualDetail{margin-top:20px}#launchSplitLines[hidden],#launchSplitActions[hidden]{display:none!important}

/* Anual: superfície plana e indicadores discretos por valor. */
.annual-panel{border:0;border-radius:0;box-shadow:none;transition:none}
.annual-scroll{border:0;border-radius:0}
.annual-scroll .annual th,.annual-scroll .annual td{padding:9px 8px;border-bottom:1px solid #e8eceb;background:#fff!important}
.annual-scroll .annual thead th{color:#65736f;font-size:12px;font-weight:600;border-bottom:1px solid #cbd5d1}
.annual-scroll .annual tbody th{font-weight:500;color:#203a37}
.annual-scroll .annual tbody tr:hover{filter:none;box-shadow:none;background:#f7f9f8}
.annual-scroll .annual tbody tr:hover th,.annual-scroll .annual tbody tr:hover td{background:#f7f9f8!important;filter:none}
.annual-scroll .annual .summary th,.annual-scroll .annual .summary td{font-weight:650;background:#fff!important}
.annual-scroll .annual .summary-income th,.annual-scroll .annual .summary-expense th,.annual-scroll .annual .summary-balance th{color:#435b54}
.annual-scroll .annual .summary-income th,.annual-scroll .annual .summary-income td{border-top:1px solid #b9c8c2}
.annual-scroll .annual .summary-balance th,.annual-scroll .annual .summary-balance td{border-top:1px solid #b9c8c2;border-bottom:0}
.annual-scroll .annual-link{display:inline-flex;align-items:center;gap:6px;padding:2px 0;border-radius:0;font-weight:500;color:#203a37;background:transparent}
.annual-scroll .annual-link::before{content:"";width:5px;height:5px;border-radius:50%;flex-shrink:0}
.annual-scroll .annual-paid .annual-link::before{background:#238060}
.annual-scroll .annual-partial .annual-link::before{background:#ad7718}
.annual-scroll .annual-open .annual-link::before{background:#b35d5d}
.annual-scroll .annual-link:hover,.annual-scroll .annual-link:active{background:transparent;box-shadow:none;filter:none;transform:none;text-decoration:underline}
.annual-scroll .annual-link:focus-visible{outline:2px solid #176e62;outline-offset:3px}

.annual-scroll .annual.annual-monthly{min-width:0;table-layout:auto}.annual-monthly thead th:last-child{text-align:right}.annual-monthly th:first-child{width:65%}

.annual-scroll .annual .annual-center th{padding:18px 8px 7px;background:#f4f7f5!important;border-bottom:1px solid #cbd5d1;font-size:12px;font-weight:700;color:#49645b;position:static}
.annual-scroll .annual.annual-monthly{width:560px;max-width:100%;min-width:0;table-layout:fixed}
.annual-scroll .annual-monthly th:first-child{width:65%;min-width:0;white-space:normal}
.annual-scroll .annual-monthly td{white-space:nowrap}

.annual-scroll .annual .annual-center th{background:#dce8e1!important;border-top:2px solid #849e90;border-bottom:2px solid #849e90;text-align:center;font-weight:800;font-size:13px;padding:12px 8px}.annual-scroll .annual tbody tr.annual-center:hover th{background:#dce8e1!important}

.mobile-menu-toggle{display:none}.menu-backdrop[hidden],.menu-close[hidden]{display:none!important}
@media(max-width:720px){
 .mobile-menu-toggle{display:inline-flex;align-items:center;justify-content:center;font-size:22px;padding:7px 11px}
 #app header{gap:10px}#app header>div{flex:1;min-width:0}#identity{display:block;overflow:hidden;text-overflow:ellipsis;max-width:100%;font-size:12px}
 #nav{position:fixed;inset:0 auto 0 0;width:min(290px,85vw);height:100dvh;padding:64px 12px 24px;display:flex;flex-direction:column;flex-wrap:nowrap;gap:4px;overflow-y:auto;background:#fff;z-index:51;transform:translateX(-100%);visibility:hidden;transition:transform .2s,visibility .2s;box-shadow:none;border-right:1px solid #dfeae7}
 #nav button{width:100%;text-align:left;flex-shrink:0;padding:12px 14px;white-space:normal}
 .menu-open #nav{transform:translateX(0);visibility:visible}
 .menu-open{overflow:hidden}
 .menu-backdrop{position:fixed;inset:0;z-index:50;background:#10292180;border-radius:0;padding:0}
 .menu-close{position:fixed;top:12px;left:14px;z-index:52;background:#e8f1ee;color:#175844;padding:8px 12px}
 .menu-backdrop:hover,.menu-close:hover{box-shadow:none;filter:none}
}
@media(prefers-reduced-motion:reduce){#nav{transition:none}}

.launch-detail-link{background:transparent;color:#176e62;text-align:left;padding:0;border-radius:0;text-decoration:underline;text-underline-offset:3px;white-space:normal}
.launch-detail-link:hover{box-shadow:none!important;filter:none}
#launchDetails{width:min(960px,94vw);max-height:90dvh;overflow:auto;border:1px solid #dfeae7;border-radius:12px;padding:22px;color:#203a37}
#launchDetails::backdrop{background:#10292180}.detail-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}
.launch-details-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}
.launch-details-fields dt{font-size:12px;color:#657d78;font-weight:600}.launch-details-fields dd{margin:5px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}

/* Tabelas compactas e planas em todas as telas. */
.scroll{border:0;border-radius:0}
.scroll table th,.scroll table td{padding:6px 8px;font-size:12px;line-height:1.35;border-bottom:1px solid #e7ece9}
.scroll table th{font-weight:600;background:#f5f7f6}
.scroll table tbody td:nth-child(even){background:transparent}
.scroll table tbody tr:hover{filter:none;box-shadow:none}
.scroll table .icon-btn{font-size:12px;min-width:0;padding:4px 7px;border-radius:3px}
.scroll table button{padding:4px 7px;border-radius:3px;font-size:12px;box-shadow:none}
.scroll table .actions{gap:4px}
.scroll table .launch-detail-link{padding:0;border-radius:0}
.annual-scroll .annual th,.annual-scroll .annual td{padding:6px 8px;font-size:12px}
.annual-scroll .annual-link{padding:1px 0}
.annual-scroll .annual .annual-center th{padding:10px 8px;font-size:13px}

#importMessage{width:min(640px,94vw);max-height:85dvh;overflow:auto;border:1px solid #dfeae7;border-radius:10px;padding:24px;color:#203a37}#importMessage::backdrop{background:#10292180}.import-message-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;user-select:text}

.category-tree{border-top:1px solid #e7ece9}
.category-row{display:flex;align-items:center;gap:12px;min-height:36px;padding:5px 4px 5px calc(var(--depth)*18px + 4px);border-bottom:1px solid #e7ece9;font-size:13px;background:transparent}
.category-name{display:flex;align-items:center;gap:6px;flex:1;min-width:0;overflow-wrap:anywhere;font-weight:500}
.category-marker{color:#789087;flex-shrink:0}.category-meta{font-size:11px;color:#657d78;white-space:nowrap}
.category-row .actions{gap:4px;flex-shrink:0}.category-row .icon-btn{padding:3px 7px;min-width:26px;font-size:14px;border-radius:2px;background:transparent;color:#49645b}
.category-row .danger{color:#a33c3c}.category-row .icon-btn:hover{background:#f1f5f3;box-shadow:none;filter:none}
@media(max-width:600px){.category-row{flex-wrap:wrap;gap:4px 8px}.category-name{flex-basis:calc(100% - 70px)}.category-meta{order:3;flex-basis:100%;padding-left:15px}.category-row .actions{margin-left:auto}}

.annual-scroll .annual tr.totals-start th,.annual-scroll .annual tr.totals-start td{border-top:3px solid #849e90;padding-top:14px;background:#edf3ef!important}.annual-scroll .annual tr.totals-start:hover th,.annual-scroll .annual tr.totals-start:hover td{background:#edf3ef!important}

#content .card{scroll-margin-top:85px}#content :focus-visible{outline:2px solid #176e62;outline-offset:3px}

.category-charts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:30px}.category-chart-row{margin-bottom:14px}.category-chart-row>div:first-child{display:flex;justify-content:space-between;gap:12px;font-size:12px;margin-bottom:5px}.category-chart-track{height:9px;background:#edf1ef}.category-chart-bar{height:100%;min-width:2px}.category-chart-bar.income{background:#36896a}.category-chart-bar.expense{background:#bc7660}

/* Ações uniformes e linhas sem quebra no mobile. */
.scroll table .actions,.category-row .actions{display:inline-flex;flex-wrap:nowrap;align-items:center;gap:5px;white-space:nowrap}
.scroll table button:not(.annual-link):not(.launch-detail-link),.category-row .icon-btn{display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;line-height:1.2;min-height:30px;padding:6px 9px;border-radius:3px;white-space:nowrap;box-shadow:none}
@media(max-width:720px){
 .scroll{overflow-x:auto;overscroll-behavior-x:contain}
 .scroll table th,.scroll table td{white-space:nowrap;vertical-align:middle;padding:6px 8px}
 .scroll .launch-detail-link{white-space:nowrap;max-width:250px;overflow:hidden;text-overflow:ellipsis;display:inline-block;vertical-align:middle}
 .annual-scroll .annual-monthly th:first-child{white-space:nowrap;width:auto}
 .annual-scroll .annual.annual-monthly{table-layout:auto;width:560px;max-width:none}
 .scroll table button:not(.annual-link):not(.launch-detail-link){min-height:34px}
}

/* Larguras determinadas pelo conteúdo e pelos cabeçalhos, em todas as tabelas. */
.scroll table,.annual-scroll .annual,.annual-scroll .annual.annual-monthly{width:max-content;min-width:0;max-width:none;table-layout:auto}
.scroll table th,.scroll table td{white-space:nowrap;width:auto;min-width:0}
.annual-scroll .annual th:first-child,.annual-scroll .annual td:first-child,.annual-scroll .annual-monthly th:first-child{width:auto;min-width:0;white-space:nowrap}
.scroll .launch-detail-link{max-width:none;overflow:visible;text-overflow:clip;white-space:nowrap}
.financial-type{display:inline-flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;line-height:1;min-width:22px;vertical-align:middle}

/* Visão financeira: faixas por coluna para acompanhar os meses. */
.annual-scroll .annual:not(.annual-monthly) thead th:nth-child(n+2):nth-child(-n+13):nth-child(even),
.annual-scroll .annual:not(.annual-monthly) tbody tr:not(.annual-center):not(.summary) td:nth-child(n+2):nth-child(-n+13):nth-child(even){background:#f1f6f3!important}
.annual-scroll .annual:not(.annual-monthly) thead th:nth-child(n+2):nth-child(-n+13):nth-child(odd),
.annual-scroll .annual:not(.annual-monthly) tbody tr:not(.annual-center):not(.summary) td:nth-child(n+2):nth-child(-n+13):nth-child(odd){background:#e6eee9!important}
.annual-scroll .annual:not(.annual-monthly) thead th:first-child,
.annual-scroll .annual:not(.annual-monthly) thead th:last-child,
.annual-scroll .annual:not(.annual-monthly) tbody tr:not(.annual-center):not(.summary) th:first-child,
.annual-scroll .annual:not(.annual-monthly) tbody tr:not(.annual-center):not(.summary) td:last-child{background:#d4e2d9!important}

.annual-scroll .annual:not(.annual-monthly) thead th:last-child,.annual-scroll .annual:not(.annual-monthly) tbody tr:not(.annual-center) td:last-child{font-weight:700}

.search-select{position:relative;min-width:0}.search-select-options{position:absolute;top:calc(100% + 3px);left:0;right:0;z-index:20;background:#fff;border:1px solid #cbdad4;max-height:240px;overflow:auto;box-shadow:0 5px 14px #12352b20;font-size:13px;font-weight:400}.search-select-options [role="option"]{padding:10px;cursor:pointer;white-space:normal;overflow-wrap:anywhere}.search-select-options [role="option"]:hover,.search-select-options [aria-selected="true"]{background:#e0eee7}.search-select-empty{padding:10px;color:#657d78}select[data-searchable][hidden]{display:none!important}

.scroll table tfoot .table-total td{font-weight:700;background:#e6eee9;border-top:2px solid #849e90;padding-top:9px;padding-bottom:9px;white-space:nowrap}

.session-loading #login{display:none}.session-loading::before{content:"Carregando seu financeiro…";position:fixed;inset:0;display:grid;place-items:center;color:#175844;background:#f4f7fa}

.funding-details{margin:18px 0;padding:16px;background:#edf3ef;border-left:3px solid #849e90}.funding-details p{line-height:1.6}.funding-details h3{margin-top:0}
