/* Finanz-Controlling (FIN) und Budget (BUDG): Kennzahlen-Kacheln, Diagramme, Wochenwerte, Budget-Zelle, -Kacheln und -Panel. Regeln des Ist (index.html), soweit K1 sie nicht schon kennt. */
.kpi-tile.emphasis-critical.is-active{border-color:var(--status-critical); background:color-mix(in srgb, var(--status-critical) 10%, var(--surface-1));}
.bd-sort{cursor:pointer; user-select:none;}
.bd-block{padding:10px 0; border-top:1px solid var(--border);}
.bd-block:first-child{border-top:0; padding-top:0;}
.bd-title{font-size:.82rem; font-weight:var(--fw-semibold); margin-bottom:6px; display:flex; align-items:center; gap:8px;}
.bd-title .bd-hint{font-weight:var(--fw-regular);}
.bd-row{display:grid; grid-template-columns:minmax(120px,1fr) auto; gap:2px 12px; padding:3px 0; font-size:.84rem;}
.bd-label{color:var(--text-secondary);}
.bd-val{font-variant-numeric:tabular-nums; text-align:right; font-weight:var(--fw-semibold);}
.bd-val.status-critical{color:var(--status-critical-text);}
.bd-val.status-warning-val{color:var(--status-warning-text);}
.bd-hint{grid-column:1 / -1; font-size:.72rem; color:var(--text-muted); font-weight:var(--fw-regular);}
.bd-pos{margin-top:6px; font-size:.78rem; color:var(--text-secondary);}
.bd-pos summary{cursor:pointer;}
.bd-pos-tab{width:100%; border-collapse:collapse; margin-top:4px;}
.bd-pos-tab th,.bd-pos-tab td{padding:3px 6px; text-align:left; border-bottom:1px solid var(--grid); overflow-wrap:anywhere;}
.bd-pos-tab th{overflow-wrap:normal;}
.bd-pos-tab .num,.fin-table .num{text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums;}
.two-col{display:grid; grid-template-columns:1.9fr .8fr; gap:20px; align-items:start;}
.two-col--gleich{grid-template-columns:1fr 1fr;}
.two-col--gleich > *{min-width:0;}
@media (max-width:1100px){
  .two-col, .two-col--gleich{grid-template-columns:1fr;}
}
.progress-track{ width:100%; height:7px; border-radius:5px; background:var(--grid); overflow:hidden; position:relative; display:flex; background-image:repeating-linear-gradient(90deg, transparent, transparent calc(20% - 1px), var(--baseline) calc(20% - 1px), var(--baseline) 20%); }
.progress-fill{height:100%; border-radius:5px; background:var(--series-1);}
.progress-fill.open{background:color-mix(in srgb, var(--series-1-250) 55%, transparent);}
.progress-fill.over{background:var(--status-critical);}
.progress-wrap{display:flex; flex-direction:column; gap:4px; min-width:110px;}
.progress-wrap .pct{font-size:11.5px; color:var(--text-secondary); font-variant-numeric: tabular-nums;}
.progress-wrap .pct.status-critical{color:var(--status-critical-text);}
.table-scroll::-webkit-scrollbar{height:6px;}
.chart-title{font-size:13px; font-weight:var(--fw-semibold); color:var(--text-primary); margin-bottom:8px;}
.fin-inputs{display:flex; flex-wrap:wrap; gap:16px; margin-bottom:6px;}
.fin-field{display:flex; flex-direction:column; gap:5px; min-width:0;}
.fin-field > span{font-size:12px; color:var(--text-secondary);}
.fin-field input, .fin-field select{ font-variant-numeric:tabular-nums; font-size:14px; padding:7px 10px; border-radius:8px; border:1px solid var(--border); background:var(--surface-1); color:var(--text-primary); min-width:0; max-width:100%;}
.fin-field input[aria-invalid="true"]{border-color:var(--status-critical);}
.fin-fehler{font-size:12px; color:var(--status-critical-text); max-width:260px;}
.fin-h{font-size:14px; font-weight:var(--fw-semibold); margin:22px 0 10px; color:var(--text-primary);}
.fin-week-add{display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; margin-bottom:6px;}
.fin-week-add .btn-primary{white-space:nowrap;}
.kpi-row.fin-kpi-row{grid-template-columns:repeat(6,1fr); margin-bottom:16px;}
@media (max-width:1180px){
  .kpi-row.fin-kpi-row{grid-template-columns:repeat(3,1fr);}
}
@media (max-width:900px){
  .kpi-row.fin-kpi-row{grid-template-columns:repeat(2,1fr);}
}
.fin-table td{padding:6px 8px; vertical-align:middle;}
.fin-table td input[type=text], .fin-table td input[type=date]{ font-variant-numeric:tabular-nums; font-size:13px; padding:5px 8px; border-radius:6px; border:1px solid var(--border); background:var(--surface-1); color:var(--text-primary); width:100%; min-width:0;}
#finBudgetAlle{margin-top:10px;}
.aufklapp .table-scroll{overflow-x:auto; max-width:100%;}
.fin-table{min-width:520px;}
.fin-table td.fin-kw{font-variant-numeric:tabular-nums; font-size:13px; color:var(--text-secondary); white-space:nowrap;}
@media (max-width:760px){
  .fin-week-add{flex-direction:column; align-items:stretch;}
}
.kpi4-rahmen{container-type:inline-size;}
.detail-grid3.kpi4{grid-template-columns:repeat(2,minmax(0,1fr));}
/* Read-Only Intern (body.ro): Finanzwerte und Nachberechnungen sind nur zu lesen */
body.ro .panel:has(.fin-inputs), body.ro #finNbAdd, body.ro [data-fin-nb-del]{display:none !important;}
@media (max-width: 600px){
  tbody.byd-section .progress-wrap{flex-direction:row; align-items:center; gap:8px; min-width:0;}
  tbody.byd-section .progress-wrap .progress-track{flex:1 1 auto; min-width:40px;}
  tbody.byd-section .progress-wrap .pct{white-space:nowrap;}
}
