/* One outline icon family, inheriting the active navigation colour. */
.sidebar nav .nav-icon{width:20px;height:20px;flex:0 0 20px;display:block;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.sidebar nav a{gap:12px}
.sidebar nav a:focus-visible{outline-offset:-3px}
:root{--operation-income:#3f6653;--operation-income-bg:#eaf0e9;--operation-expense:#a04470;--operation-expense-bg:#fce7f0;--operation-transfer:#326786;--operation-transfer-bg:#e3f2fc;--operation-plan-text:#605e59;--operation-plan-bg:#eeeae5;--operation-plan-hover:#e5e0d9;--operation-plan-badge:#dedad3}
[data-theme=dark]{--operation-income:#a7c6b1;--operation-income-bg:#2b3730;--operation-expense:#f0b3cf;--operation-expense-bg:#412b36;--operation-transfer:#9ed4f4;--operation-transfer-bg:#253b4a;--operation-plan-text:#b6b2aa;--operation-plan-bg:#30302e;--operation-plan-hover:#383835;--operation-plan-badge:#41413d}
.operations-table .operation-amount{font-size:13px;font-weight:600}
.operation-value{display:inline-block;padding:4px 7px;border-radius:5px;color:var(--theme-foreground)}
.operation-value.income{color:var(--operation-income);background:var(--operation-income-bg)}
.operation-value.expense{color:var(--operation-expense);background:var(--operation-expense-bg)}
.operation-value.transfer{color:var(--operation-transfer);background:var(--operation-transfer-bg)}
.operation-amount-label{display:block;color:var(--muted);font-weight:400;margin-top:3px;white-space:normal;min-width:94px}
.operations-table .operation-planned td{background:var(--operation-plan-bg);color:var(--operation-plan-text)}
.operations-table .operation-planned:hover td{background:var(--operation-plan-hover)}
.operations-table .operation-planned td :is(strong,a,small,.muted,.fine,summary,.operation-value){color:var(--operation-plan-text)!important}
.operations-table .operation-planned .operation-value{background:transparent}
.operations-table .operation-planned .badge{color:var(--operation-plan-text);background:var(--operation-plan-badge);border:1px dashed currentColor;padding:4px 8px}
.operations-table .operation-planned :is(button,input){color:var(--operation-plan-text);background:var(--operation-plan-bg);border-color:var(--operation-plan-text)}
.operations-table .operation-planned a:hover{text-decoration:underline}
@media(max-width:760px){.sidebar nav .nav-icon{width:18px;height:18px;flex-basis:18px}.sidebar nav a{gap:8px;min-height:44px}.operations-table th,.operations-table td{padding-left:12px;padding-right:12px}}
.operations-table tr[hidden]{display:none}
.operations-table .operation-section td{padding:12px 18px;color:var(--theme-foreground);background:var(--theme-muted);font-weight:600;font-size:11px;letter-spacing:.3px}
.operation-section span{margin-left:6px;font-weight:400;color:var(--muted)}
.operations-table .operation-date td{padding:13px 18px;text-align:center;background:var(--theme-card);color:var(--muted);font-size:11px;font-weight:500}
.operation-date td>span{display:flex;align-items:center;gap:16px;justify-content:center}
.operation-date td>span::before,.operation-date td>span::after{content:'';height:1px;background:var(--theme-border);flex:1}
.operations-table .operation-date-plan td{background:var(--operation-plan-bg);color:var(--operation-plan-text)}
.operations-table .operation-plan-toggle td{text-align:center;background:var(--operation-plan-bg);padding:12px}
.operation-overdue{display:block;margin-top:5px;font-weight:600;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:3px}
.operation-cancel{min-width:150px;max-width:280px}
.operation-cancel summary{display:flex;align-items:center;gap:6px;list-style:none;font-size:11px;color:var(--muted)}
.operation-cancel summary::-webkit-details-marker{display:none}
.operation-cancel summary::marker{content:''}
.operation-cancel summary svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.operation-cancel form{min-width:210px;padding-top:10px}
.operation-cancel .fine{font-size:11px;line-height:1.5;margin-bottom:12px}
.operation-cancel label{font-size:11px}
.financial-metrics .financial-flow.flow-income{background:var(--operation-income-bg);border-color:color-mix(in srgb,var(--operation-income) 25%,var(--theme-border))}
.financial-metrics .financial-flow.flow-expense{background:var(--operation-expense-bg);border-color:color-mix(in srgb,var(--operation-expense) 25%,var(--theme-border))}
.financial-metrics .financial-flow.flow-income :is(strong,span,small){color:var(--operation-income)}
.financial-metrics .financial-flow.flow-expense :is(strong,span,small){color:var(--operation-expense)}
.financial-metrics .metric .money{font-size:clamp(18px,1.65vw,25px);overflow-wrap:anywhere;white-space:normal;line-height:1.35}
.financial-metrics-compact{margin-bottom:22px;gap:12px}
.financial-metrics-compact .metric{min-height:126px;padding:17px 19px}
.financial-metrics-compact .metric .money{font-size:clamp(17px,1.4vw,22px)}
@media(max-width:760px){.financial-metrics .metric{padding:14px;min-width:0}.financial-metrics .metric .money{font-size:20px}.financial-metrics-compact .metric .money{font-size:18px}}
.operation-detail-grid{display:grid;grid-template-columns:minmax(230px,.8fr) minmax(0,1.2fr);gap:22px}
.operation-detail-amount{display:flex;flex-direction:column;justify-content:center;min-width:0}
.operation-detail-amount>span{font-size:12px}
.operation-detail-amount>strong{display:block;font-size:clamp(28px,3.5vw,46px);font-weight:500;letter-spacing:-1px;line-height:1.2;overflow-wrap:anywhere;margin:15px 0}
.operation-detail-amount>p{font-size:12px;line-height:1.6;margin-bottom:0}
.operation-detail-amount.flow-income{background:var(--operation-income-bg);color:var(--operation-income)}
.operation-detail-amount.flow-expense{background:var(--operation-expense-bg);color:var(--operation-expense)}
.operation-detail-amount.flow-income>strong{color:var(--operation-income)}
.operation-detail-amount.flow-expense>strong{color:var(--operation-expense)}
.operation-detail-amount.flow-transfer{background:var(--operation-transfer-bg);color:var(--operation-transfer)}
.operation-detail-amount.flow-transfer>strong{color:var(--operation-transfer)}
.operation-detail-amount.operation-detail-planned{background:var(--operation-plan-bg);color:var(--operation-plan-text)}
.operation-detail-amount.operation-detail-planned>strong{color:var(--operation-plan-text)}
.operation-detail-actions{display:flex;align-items:flex-start;gap:20px;flex-wrap:wrap}
.operation-detail-actions .operation-cancel{max-width:420px}
.operation-detail-actions .operation-cancel form{padding-top:16px}
@media(max-width:760px){.operation-detail-grid{grid-template-columns:1fr;gap:14px}.operation-detail-amount>strong{font-size:34px}.operation-detail-amount{min-height:180px}}
/* Fact badges are distinct from neutral plans; amount colours keep their meaning. */
:root{--operation-fact-bg:#e2eeed;--operation-fact-text:#356366}
[data-theme=dark]{--operation-fact-bg:#2a3c3d;--operation-fact-text:#acd0d0}
.operations-table tr:not(.operation-planned) .badge,body:has(.operation-detail-grid):not(:has(.operation-detail-planned)) .pagehead>.entity-pill{background:var(--operation-fact-bg);color:var(--operation-fact-text)}
body:has(.operation-detail-planned) .pagehead>.entity-pill{background:var(--operation-plan-bg);color:var(--operation-plan-text)}

/* Project finance uses the existing ledger display and a separate budget sidebar. */
.project-finance-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:24px;align-items:start}
.project-finance-layout>*,.project-finance-layout .tablewrap{min-width:0;max-width:100%}
.project-finance-single{grid-template-columns:minmax(0,1fr)}
.project-finance-layout .sectionhead{gap:12px;flex-wrap:wrap;margin-top:0}
.project-finance-layout .sectionhead h2{font-size:19px}
.project-operations .operations-table{table-layout:fixed;width:100%}
.project-operations .operations-table :is(th,td){padding:12px 9px;white-space:normal;overflow-wrap:anywhere}
.project-operations .operations-table th:nth-child(1){width:17%}
.project-operations .operations-table th:nth-child(2){width:23%}
.project-operations .operations-table th:nth-child(3){width:25%}
.project-operations .operations-table th:nth-child(4){width:17%}
.project-operations .operations-table th:nth-child(5){width:18%}
.project-operations .operation-amount-label{min-width:0}
.project-budgets .panel{padding:20px}
.budget-chart h3,.budget-line h3{font-size:14px;line-height:1.5;margin:0;overflow-wrap:anywhere}
.budget-chart>.fine{margin:8px 0 16px;line-height:1.6}
.budget-ring-wrap{position:relative;width:min(100%,250px);aspect-ratio:1;margin:0 auto 20px}
.budget-ring{display:block;width:100%;height:100%}
.budget-ring-track{stroke:var(--theme-muted)}
.budget-slice{stroke:var(--budget-color)}
.budget-ring-center{position:absolute;inset:25% 13%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;pointer-events:none}
.budget-ring-center>span{font-size:10px;color:var(--muted)}
.budget-ring-center>strong{font-size:16px;line-height:1.4;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.budget-color-0{--budget-color:#89ac9a}.budget-color-1{--budget-color:#9db3cd}.budget-color-2{--budget-color:#c99eaf}.budget-color-3{--budget-color:#cbb58d}.budget-color-4{--budget-color:#ada3c8}.budget-color-5{--budget-color:#85b7bc}.budget-color-6{--budget-color:#c8957c}.budget-color-7{--budget-color:#a6b67d}.budget-color-8{--budget-color:#b28d9b}.budget-color-9{--budget-color:#87a5b4}
[data-theme=dark] .budget-color-0{--budget-color:#84ac96}[data-theme=dark] .budget-color-1{--budget-color:#879fbe}[data-theme=dark] .budget-color-2{--budget-color:#bd90a3}[data-theme=dark] .budget-color-3{--budget-color:#b8a27b}[data-theme=dark] .budget-color-4{--budget-color:#a196ba}[data-theme=dark] .budget-color-5{--budget-color:#76a7ad}[data-theme=dark] .budget-color-6{--budget-color:#b78d75}[data-theme=dark] .budget-color-7{--budget-color:#93a674}[data-theme=dark] .budget-color-8{--budget-color:#a57c90}[data-theme=dark] .budget-color-9{--budget-color:#789baa}
.budget-legend{list-style:none;margin:0;padding:0}
.budget-legend li{display:grid;grid-template-columns:10px minmax(0,1fr);gap:3px 9px;padding:9px 0;border-top:1px solid var(--theme-border);font-size:11px;line-height:1.5}
.budget-swatch{width:9px;height:9px;border-radius:3px;background:var(--budget-color);margin-top:4px}
.budget-legend-category{overflow-wrap:anywhere}
.budget-legend strong{grid-column:2;font-weight:500;font-variant-numeric:tabular-nums}
.budget-legend strong small{font-size:10px;font-weight:400;color:var(--muted);margin-left:7px}
.budget-chart-empty{font-size:12px;color:var(--muted);line-height:1.7;margin:20px 0 4px}
.budget-lines{display:grid;gap:12px}
.budget-line{border:1px solid var(--theme-border);border-radius:12px;background:var(--theme-card);padding:17px;min-width:0}
.budget-line header .fine{font-size:10px}
.budget-line dl{display:block;margin:12px 0 0}
.budget-line dl>div{display:flex;justify-content:space-between;align-items:baseline;gap:7px;flex-wrap:wrap;margin-top:7px}
.budget-line :is(dt,dd){margin:0;font-size:11px;min-width:0}
.budget-line dt{color:var(--muted)}
.budget-line dd{margin-left:auto;font-weight:600;overflow-wrap:anywhere}
.budget-note{margin:12px 0 0;overflow-wrap:anywhere;white-space:pre-line}
@media(max-width:1399px){.project-finance-layout{grid-template-columns:minmax(0,1fr)}.project-budgets .budget-chart{max-width:none}.budget-lines{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}}

/* The same rows become cards: grouping, pagination, plans and permissions stay shared. */
@media(max-width:760px){
 [data-operation-table].tablewrap{overflow:visible;border:0;border-radius:0;background:transparent}
 .operations-table,.operations-table tbody{display:block;width:100%;min-width:0}
 .operations-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .operations-table tr{display:block}
 .operations-table tr[data-operation-id]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 8px;padding:16px;margin:0 0 12px;border:1px solid var(--theme-border);border-radius:13px;background:var(--theme-card);box-shadow:0 3px 12px #00000005}
 .operations-table tr[data-operation-id]>td{display:block;padding:0;border:0;min-width:0;white-space:normal;overflow-wrap:anywhere;background:transparent!important}
 .operations-table tr[data-operation-id]:hover>td{background:transparent!important}
 .operations-table tr[data-operation-id].operation-planned{background:var(--operation-plan-bg);box-shadow:none;border-style:dashed}
 .operations-table .operation-date-cell{grid-column:1;grid-row:1;font-size:11px}
 .operations-table .operation-date-cell .badge{margin-top:5px}
 .operations-table .operation-amount{grid-column:2;grid-row:1;text-align:right;font-size:17px;line-height:1.4}
 .operations-table .operation-amount-label{font-size:10px;min-width:0;margin-top:5px}
 .operations-table .operation-description{grid-column:1/-1;line-height:1.6}
 .operations-table .operation-description strong>a{display:inline-block;font-size:14px;padding:3px 0}
 .operations-table .operation-description .block{margin:4px 0;white-space:pre-line}
 .operations-table .operation-project,.operations-table .operation-participants{font-size:11px;line-height:1.6}
 .operations-table td[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:9px;margin-bottom:3px}
 .operations-table .operation-actions-cell{grid-column:1/-1;display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:10px;padding-top:9px!important;border-top:1px solid var(--theme-border)!important}
 .operations-table .operation-actions-cell:empty{display:none!important}
 .operation-actions-cell .operation-cancel{max-width:100%;flex:1}
 .operation-actions-cell .operation-cancel form{min-width:0;width:100%}
 .operation-actions-cell :is(input,button){max-width:100%}
 .operations-table .operation-section td,.operations-table .operation-date td,.operations-table .operation-plan-toggle td{display:block;padding:12px 0;border:0;background:transparent}
 .operations-table .operation-plan-toggle{margin-bottom:16px}
 .operations-table .operation-plan-toggle button{min-height:42px;width:100%}
 .operations-table .empty{display:block}
 .operations-table tr[hidden]{display:none!important}
 .budget-lines{grid-template-columns:minmax(0,1fr)}
 .project-finance-layout{gap:24px}
 .budget-line dl>div{flex-wrap:nowrap}
}
@media(max-width:760px){.operations-table .operation-actions-cell:not(:has(form,details)){display:none!important}.budget-line dl>div{flex-wrap:wrap}}

.operation-entity-link{display:inline-flex;align-items:center;gap:7px;max-width:100%;vertical-align:middle;line-height:1.4}
.operation-entity-link>span:last-child{min-width:0;overflow-wrap:anywhere}.operation-entity-link .entity-avatar-small{width:25px;height:25px;flex:0 0 25px;font-size:11px}
.operation-participant{display:flex;align-items:center;gap:5px}.operation-participant+.operation-participant{margin-top:7px}.operation-direction{flex:none}
.operation-project .entity-avatar{border-radius:6px}
