/* Structural layout and official print templates. Visual UI: budget-ui.css. */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0}
.sidebar{width:240px;position:fixed;inset:0 auto 0 0;padding:28px 18px;display:flex;flex-direction:column}
.brand{display:flex;gap:10px;align-items:center}
.brand img{width:46px;height:58px;object-fit:contain}
.brand small{display:block;margin-top:8px}
nav{display:grid;gap:10px;margin-top:46px}
nav a{padding:15px 12px}
.sidebar-note{margin-top:auto;padding:16px;line-height:1.9}
main{margin-left:240px;padding:32px;max-width:1800px}
header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}
h1{margin:10px 0}
header p,footer,.table-help{line-height:1.8}
header p{margin:0}
.year,.badge{padding:12px 16px;white-space:nowrap}
.notice{padding:14px 18px;line-height:1.9;margin-bottom:20px}
.notice strong{margin-right:12px}
.filters{display:flex;gap:16px;margin-bottom:22px}
.filters label{display:grid;gap:8px;flex:1;min-width:0}
select,input{padding:13px;width:100%}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}
.stat{padding:22px;min-width:0}
.stat span{opacity:.9}
.stat strong{display:block;margin:16px 0 10px}
.stat small{opacity:.8}
.charts{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin-bottom:22px}
.panel{padding:24px;min-width:0}
.panel-title{display:flex;justify-content:space-between;gap:12px;align-items:center}
h2{margin:0}
.distribution{display:flex;gap:28px;align-items:center;justify-content:center;padding:26px 0 10px}
.donut{height:190px;width:190px;flex-shrink:0;display:grid;place-items:center}
.donut>div{height:142px;width:142px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px}
.legend-row{display:flex;align-items:center;gap:9px;margin:17px 0}
.dot{width:9px;height:9px;flex-shrink:0}
.legend-row strong{margin-left:auto}
.bar-row{margin:22px 0}
.bar-label{display:flex;justify-content:space-between;margin-bottom:10px;gap:10px}
.track{height:10px;overflow:hidden}
.track div{height:100%}
.badge{padding:7px 14px}
.table-wrap{overflow-x:auto}
table{width:100%;text-align:left}
th{white-space:nowrap}
td,th{padding:16px 12px}
td{line-height:1.7}
td small{display:block}
td.amount{text-align:right;white-space:nowrap}
button.project-name{text-align:left;padding:0;cursor:pointer}
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #b88be1;outline-offset:3px}
.details td{padding:20px}
.activity{display:flex;justify-content:space-between;gap:20px;padding:9px 0}
.activity span:last-child{white-space:nowrap}
footer{margin-top:22px}
@media(max-width:1100px){.sidebar{width:200px}
main{margin-left:200px;padding:24px}
.charts{grid-template-columns:1fr}
.stats{grid-template-columns:repeat(2,1fr)}
.filters{flex-wrap:wrap}
.filters .search{flex-basis:100%}}
@media(max-width:650px){.sidebar{position:static;width:auto;padding:16px}
.brand img{height:40px;width:34px}
nav{margin-top:18px;display:flex;overflow:auto;gap:5px}
nav a{white-space:nowrap;padding:10px}
.sidebar-note{display:none}
main{margin:0;padding:18px}
header{align-items:flex-start}
.year{padding:9px}
.filters{gap:10px}
.filters label{flex-basis:100%}
.stat{padding:16px}
.panel{padding:18px}
.distribution{flex-direction:column;gap:10px}
#legend{width:100%}
.stats{gap:10px}}
.document-panel{margin-top:22px;scroll-margin-top:20px}
.primary-action{display:inline-flex;align-items:center;padding:13px 18px;white-space:nowrap}
.document-tools{display:flex;align-items:flex-end;gap:14px;margin-top:20px}
.document-tools label{display:grid;gap:8px;flex:1}
.document-tools button,.history-actions button{padding:12px 14px;cursor:pointer}
.history-actions{display:flex;gap:8px}
.history-actions button{white-space:nowrap;padding:9px 12px}
button:disabled{opacity:.5;cursor:wait}
@media(max-width:650px){.document-panel .panel-title{align-items:flex-start;flex-direction:column}
.document-tools{align-items:stretch;flex-direction:column}
.document-panel table{min-width:610px}}
#balanceSummary table{width:100%}
#balanceSummary .source-register{margin-top:18px}
#balanceSummary .table-wrap{overflow:auto}
.stat .stat-income{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
.stat .stat-unit{opacity:.9}
.stat-remaining{line-height:1.8}
.stat>span{line-height:1.6}
.dept-chart-legend{display:flex;flex-wrap:wrap;gap:12px 22px;margin:20px 0 10px}
.dept-chart-legend>span{display:flex;align-items:center;gap:7px}
.dept-chart-legend i{width:10px;height:10px}
.dept-chart-scale{line-height:1.7}
.dept-fund-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.dept-fund-card{padding:20px;min-width:0}
.dept-fund-card h4{margin:0 0 20px}
.dept-chart-item{margin:16px 0}
.dept-chart-label{display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px 12px}
.dept-chart-track{position:relative;height:12px;margin-top:8px;overflow:hidden}
.dept-chart-bar{position:absolute;top:2px;height:8px}
.dept-chart-zero{position:absolute;top:0;bottom:0;width:1px;z-index:1}
.dept-chart-axis{display:flex;justify-content:space-between;gap:8px}
@media(max-width:750px){.dept-fund-grid{grid-template-columns:1fr}
.dept-fund-card{padding:16px}
.dept-chart-legend{gap:10px}}
.stat .stat-income{gap:5px 8px}
.stat .stat-value{line-height:1.2}
.number-counting{will-change:contents}
@media(prefers-reduced-motion:reduce){.number-counting{will-change:auto}}
.year-picker select{width:auto;min-width:240px;min-height:64px;padding:16px 42px 16px 22px;cursor:pointer}
.year-picker select:focus-visible{outline:3px solid #c8a9e7;outline-offset:3px}
.year-empty{padding:20px 24px;line-height:1.8;margin-bottom:22px}
.year-empty strong{display:block}
.year-empty p{margin:6px 0 0}
.charts[hidden]{display:none}
@media(max-width:650px){#overview>header{flex-wrap:wrap}
.year-picker select{min-width:225px;min-height:58px}}
.stat .stat-income .stat-value{opacity:1}
#overview #balanceSummary>h2{line-height:1.5;margin:0 0 26px;padding:4px 0 4px 16px}
#overview #balanceSummary .balance-detail>h3{line-height:1.6;margin:0 0 12px;padding:14px 18px}
#overview #balanceSummary .balance-detail+.balance-detail{margin-top:30px;padding-top:26px}
@media(max-width:650px){#overview #balanceSummary>h2{margin-bottom:22px}
#overview #balanceSummary .balance-detail>h3{padding:12px 14px}}
.year-picker{position:relative;flex-shrink:0}
.year-menu{position:relative}
.year-menu summary{display:flex;align-items:center;gap:14px;min-width:245px;padding:16px 18px;cursor:pointer;list-style:none;transition:border-color .2s,box-shadow .2s}
.year-menu summary::-webkit-details-marker{display:none}
.year-calendar{width:42px;height:42px;display:grid;place-items:center}
.year-calendar svg{width:23px;height:23px}
.year-button-label{display:grid;gap:3px}
.year-button-label strong{line-height:1.2}
.year-chevron{margin-left:auto;transition:transform .2s}
.year-menu[open] .year-chevron{transform:rotate(180deg)}
.year-options{position:absolute;right:0;top:calc(100% + 9px);z-index:30;width:100%;padding:8px}
.year-option{display:flex;align-items:center;justify-content:space-between;width:100%;padding:13px 14px;text-align:left;cursor:pointer}
.year-option span{display:grid;gap:4px}
.year-option:focus-visible,.year-menu summary:focus-visible{outline:3px solid #c29edf;outline-offset:2px}
@media(max-width:650px){.year-menu summary{min-width:225px;padding:13px 16px}}
@media(prefers-reduced-motion:reduce){.year-menu summary,.year-chevron{transition:none}}
.overview-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end}
.department-picker{display:grid;gap:6px;min-width:240px}
.department-picker select{padding:12px 14px;min-height:46px}
.year-menu summary{min-width:195px;padding:11px 14px;gap:10px}
.year-calendar{width:34px;height:34px}
.year-calendar svg{width:20px;height:20px}
.year-option{padding:11px 12px}
#overview>header{align-items:center}
@media(max-width:1100px){.overview-controls{justify-content:flex-start}}
@media(max-width:650px){.overview-controls{width:100%;gap:10px;align-items:flex-end}
.department-picker{min-width:0;flex:1 1 180px}
.year-menu summary{min-width:165px;padding:10px 12px}
.year-options{min-width:165px}}
#overview>header{flex-wrap:wrap}
@media(max-width:650px){.department-picker{flex-basis:160px}}
