.budget-head{display:flex;align-items:center;justify-content:space-between;gap:24px}.budget-head h1{font-size:26px;margin:0 0 8px}.budget-head p,.budget-note{color:var(--text2);font-size:12px}.budget-content{padding:24px 32px}.budget-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.budget-tools label,.budget-field{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--text2)}#section-budget input,#section-budget select{font:inherit;border:1px solid var(--border);border-radius:8px;padding:9px 10px;color:var(--text);background:var(--bg);min-width:0}#section-budget select{max-width:100%}.budget-filters{margin-bottom:14px}.budget-filters select{width:310px}.budget-note{margin:10px 0 20px;line-height:1.6}.budget-notice:not(:empty){padding:12px 16px;background:#fff4e5;border-left:3px solid #f59e0b;border-radius:6px;margin-bottom:12px}.budget-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:16px 0 24px}.budget-card,.budget-box{background:white;border:1px solid var(--border);border-radius:12px;padding:20px}.budget-card span{font-size:12px;color:var(--text2)}.budget-card strong{display:block;font-size:25px;margin-top:12px;white-space:nowrap}.budget-card small{display:block;margin-top:10px;color:var(--text2)}.budget-box{margin-bottom:18px}.budget-box h3{font-size:15px;margin:0 0 16px}.budget-table-wrap{overflow:auto;margin-top:14px}#section-budget table{width:100%;border-collapse:collapse;font-size:12px}#section-budget th,#section-budget td{padding:7px 10px!important;text-align:left;vertical-align:middle;white-space:nowrap;line-height:1.4}#section-budget th{background:var(--bg);color:var(--text2);font-size:11px}#section-budget td{border-bottom:1px solid var(--border)}#section-budget .budget-number{text-align:right;font-variant-numeric:tabular-nums}#section-budget .budget-link{color:var(--purple);border:0;background:none;padding:0;cursor:pointer;font:inherit}#section-budget .budget-bad{color:#dc2626}#section-budget .budget-good{color:#15803d}.budget-search{min-width:260px}.budget-empty{text-align:center;padding:36px;color:var(--text2)}#budgetEditor{width:min(960px,92vw);max-height:90vh;overflow:auto;border:1px solid var(--border);border-radius:16px;padding:24px;color:var(--text)}#budgetEditor::backdrop{background:#1f123860}.budget-dialog-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:20px}.budget-dialog-head h2{font-size:21px;margin:0}.budget-dialog-head p{color:var(--text2);font-size:12px}.budget-grow{flex:1}.budget-field{margin:16px 0}.budget-total{text-align:right;font-size:18px;padding:20px 0}.budget-dialog-actions{border-top:1px solid var(--border);padding-top:18px}#budgetLines td:first-child{width:32px}#budgetLines select{width:100%}#budgetLines input{width:150px;text-align:right}#budgetEditorError{color:#dc2626;font-size:13px}#budgetPanel[aria-busy=true]{opacity:.5;pointer-events:none}.budget-bar{height:6px;background:#eee7f6;border-radius:4px;width:150px;overflow:hidden}.budget-bar i{display:block;height:100%;background:#9500d4}#section-budget .budget-tree-row td{background:#f8f4fc;font-weight:600}@media(max-width:1100px){.budget-head{align-items:flex-start;flex-direction:column}.budget-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.budget-card strong{font-size:20px}}@media(max-width:650px){.budget-cards{grid-template-columns:1fr}.budget-content{padding:16px}.budget-filters select{width:100%}}

/* Use the shared report header and a compact document journal. */
#section-budget .budget-tools h3{margin:0}
#section-budget .budget-filters{align-items:flex-end}
.budget-journal-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.budget-journal-head h3{margin:0;flex-shrink:0}
.budget-journal-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#section-budget .budget-journal-actions .budget-search{width:330px;max-width:100%;font-size:12px}
#section-budget .budget-journal-actions .btn{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;height:42px}
#section-budget .budget-link{min-height:0;height:auto;line-height:1.4;margin:0;padding:0;display:inline;color:var(--purple)}
#section-budget .budget-link:hover{text-decoration:underline}
#budgetJournal table{table-layout:fixed;min-width:950px}
#budgetJournal th:nth-child(1){width:115px}
#budgetJournal th:nth-child(2){width:90px}
#budgetJournal th:nth-child(3){width:25%}
#budgetJournal th:nth-child(4){width:115px}
#budgetJournal th:nth-child(5){width:140px}
#budgetJournal th:nth-child(7){width:100px}
#section-budget #budgetJournal td,#section-budget #budgetJournal th{padding:8px 10px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:auto}
#section-budget .budget-doc-status{display:inline-block;font-size:11px;line-height:1.4;border-radius:4px;padding:2px 6px;color:#85718e;background:#f1ebf7}
#section-budget .budget-doc-status.is-posted{color:#168345;background:#e4f7eb}
#section-budget .budget-table-wrap{border:1px solid var(--border);border-radius:9px}
#section-budget tbody tr:last-child td{border-bottom:0}
#section-budget .budget-box>.budget-note{margin:12px 0}
@media(max-width:700px){.budget-journal-actions{width:100%}#section-budget .budget-journal-actions .budget-search{flex:1;min-width:180px}.budget-filters label{width:100%}}

.budget-dep-filter{position:relative;min-width:310px;font-size:12px;color:var(--text-muted)}
:is(#budgetDepartmentPicker,#budgetArticlePicker)>summary{list-style:none;cursor:pointer;border:1px solid var(--border);border-radius:8px;padding:13px 15px;margin-top:5px;background:var(--bg);color:var(--text)}
:is(#budgetDepartmentPicker,#budgetArticlePicker)>summary::after{content:' ▾';float:right}
.budget-dep-popup{position:absolute;top:100%;left:0;width:min(550px,80vw);z-index:50;background:white;border:1px solid var(--border);border-radius:10px;padding:12px;box-shadow:0 8px 30px #0002}
:is(#budgetDepartmentTree,#budgetArticleTree){max-height:380px;overflow:auto;margin:10px 0;color:var(--text)}
.budget-dep-node .budget-dep-node{margin-left:20px}
.budget-dep-node summary{cursor:pointer}
.budget-dep-node label{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:8px;padding:6px 2px;cursor:pointer}
.budget-dep-node input[type=checkbox]{width:16px!important;height:16px!important;min-width:16px;margin:0;padding:0;accent-color:#9000db}

#budgetDepartmentTree .budget-dep-node,#budgetArticleTree .budget-dep-node{padding:0;margin-top:0;margin-bottom:0;min-height:0}
#budgetDepartmentTree label,#budgetArticleTree label{padding:4px 2px!important;margin:0!important;min-height:0!important;line-height:20px}
.budget-dep-node>summary{display:list-item!important;list-style:disclosure-closed!important;padding:0!important}
.budget-dep-node[open]>summary{list-style:disclosure-open!important}
.budget-dep-node>summary label{font-weight:600}
.budget-dep-node .budget-dep-node{border-left:1px solid #e5daef;padding-left:12px!important}

#section-budget .budget-tree-line{display:flex;align-items:center;gap:6px;min-height:30px;padding:0;margin:0}
#section-budget .budget-tree-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 26px;width:26px;height:26px;min-height:0;padding:0;margin:0;border:1px solid #ddd0e9;border-radius:4px;background:#f7f1fc;color:#8300bb;font-size:18px;cursor:pointer}
#section-budget .budget-tree-toggle:disabled{border-color:transparent;background:transparent;color:#aaa;cursor:default}
#section-budget .budget-tree-line label{flex:1;min-width:0;width:auto!important;height:auto!important;white-space:normal}
#section-budget .budget-tree-children{margin-left:13px;padding-left:15px;border-left:1px solid #d9c4e7}
#section-budget .budget-tree-children[hidden]{display:none!important}
#section-budget .budget-dep-node .budget-dep-node{margin-left:0;border-left:0;padding-left:0!important}

/* Compact budget pickers; override the shared 42px minimum on inputs. */
#section-budget .budget-dep-popup{padding:10px}
#section-budget .budget-dep-popup .budget-tools{gap:8px}
#section-budget .budget-dep-popup .btn{min-height:28px;height:28px;padding:4px 10px;border-radius:6px;font-size:11px;line-height:18px}
#section-budget .budget-tree-line{min-height:24px;gap:5px}
#section-budget .budget-tree-toggle{flex-basis:20px;width:20px;height:20px;min-height:20px;font-size:13px;border-radius:3px}
#section-budget .budget-dep-node input[type=checkbox]{min-height:0!important;width:14px!important;height:14px!important;min-width:14px!important;padding:0!important;margin:0!important}
#section-budget #budgetDepartmentTree label,#section-budget #budgetArticleTree label{padding:2px 0!important;line-height:20px;gap:6px;font-size:12px}
#section-budget .budget-tree-children{margin-left:10px;padding-left:12px}
#section-budget :is(#budgetDepartmentTree,#budgetArticleTree){margin:6px 0}
#section-budget :is(#budgetDepartmentPicker,#budgetArticlePicker)>summary{padding:9px 12px}

#section-budget .budget-picker-close{position:absolute;right:8px;top:8px;width:26px;height:26px;min-height:0;padding:0;border:0;border-radius:5px;background:transparent;color:var(--text2);font-size:22px;line-height:24px;cursor:pointer}
#section-budget .budget-picker-close:hover{background:#f1e8f8;color:var(--purple)}
#section-budget .budget-dep-popup>.budget-tools:first-of-type{padding-right:30px}

/* Keep each popup aligned with its filter field. */
#section-budget .budget-dep-filter{width:310px;min-width:0;max-width:100%}
#section-budget .budget-dep-popup{width:100%;max-width:100%;box-sizing:border-box}
#section-budget .budget-tree-line label{overflow-wrap:anywhere}
#section-budget .budget-tree-line input[type=checkbox]{flex-shrink:0}
#section-budget .budget-tree-line small{flex-shrink:0}
@media(max-width:650px){#section-budget .budget-dep-filter{width:100%}}

#section-budget .budget-dep-filter.budget-article-filter{width:520px;max-width:100%}
@media(max-width:650px){#section-budget .budget-dep-filter.budget-article-filter{width:100%}}

#section-budget .budget-dep-filter{width:520px;max-width:100%}
@media(max-width:650px){#section-budget .budget-dep-filter{width:100%}}

#section-budget #budgetCatalogRefresh{height:34px;min-height:34px;padding:7px 12px;font-size:12px;line-height:18px;box-sizing:border-box;white-space:nowrap}
#section-budget #budgetCatalogRefresh[hidden]{display:none!important}

#section-budget #budgetFacts .budget-table-wrap{max-height:45vh;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
#section-budget #budgetFacts thead th{position:sticky;top:0;z-index:2;background:var(--bg);box-shadow:0 1px 0 var(--border)}

#budgetLines .budget-article-search{min-width:240px;white-space:normal}
#budgetLines input.budget-article-query{width:100%;text-align:left;box-sizing:border-box}
#budgetLines select[hidden]{display:none!important}
#budgetLines .budget-article-results{max-height:240px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--border);border-radius:8px;margin-top:4px;background:white}
#budgetLines .budget-article-results[hidden]{display:none}
#budgetLines .budget-article-result{display:block;width:100%;text-align:left;white-space:normal;border:0;border-bottom:1px solid var(--border);background:white;padding:8px 10px;cursor:pointer;font:inherit;color:var(--text);min-height:0}
#budgetLines .budget-article-result:hover,#budgetLines .budget-article-result.is-active{background:#f0e2fa}
#budgetLines .budget-article-result small{display:block;color:var(--text2);font-size:10px;margin-top:3px}
#budgetLines .budget-article-empty{padding:12px;color:var(--text2)}
