/* Budgets & TPMs (js/views/budgets.js) */
.bud-acts { display: contents; }
.bud-body { display: flex; flex-direction: column; gap: var(--gap); }
.bud-body > * { margin-bottom: 0 !important; }
.bud-controls { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); align-items: flex-end; padding: var(--pad); }
.bud-ctl { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); color: var(--text-2); }
.bud-ctl > .input, .bud-ctl > .btn { color: var(--text); }
.bud-lab { font-weight: 600; font-size: var(--fs-xs); color: var(--text-2); }
.bud-ctl:has(.bud-num) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; }
.bud-ctl:has(.bud-num) > .bud-lab { flex-basis: 100%; }
.bud-q { width: 180px; }
.bud-unit { width: 90px; }
.bud-num { width: 64px; padding: 4px 6px; }
.bud-conts { display: flex; gap: 10px; flex-wrap: wrap; }
.bud-cont { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.bud-cont > span { color: var(--muted); }
.bud-empty { margin-bottom: 12px; }
.bud-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--gap); }
.bud-tile { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--tone, var(--border-strong)); border-radius: var(--r-card); padding: var(--pad); }
.bud-tile-l { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.bud-tile-v { font-size: var(--fs-xl); line-height: 28px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.bud-tile.over { --tone: var(--danger); }
.bud-tile.over .bud-tile-v { color: var(--danger); }
.bud-tile.low { --tone: var(--warn); }
.bud-tile.low .bud-tile-v { color: var(--warn); }
.bud-tile.ok { --tone: var(--ok); }
.bud-tile.ok .bud-tile-v { color: var(--ok); }
.bud-table-card { overflow: hidden; margin-bottom: 12px; }
.bud-table-card .table-wrap { max-height: 62vh; }
.bud-table th, .tpm-table th { cursor: default; }
.bud-table td, .tpm-table td { vertical-align: middle; }
.bud-name { white-space: nowrap; }
.bud-name a { color: var(--text); }
.bud-name a:hover { color: var(--accent); }
.bud-cell { padding: 3px 6px; font-size: var(--fs-sm); width: 120px; }
select.input.bud-cell { width: 120px; }
.bud-qty { width: 64px; min-width: 0; }
.bud-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.bud-warn { color: var(--warn); cursor: help; }
.bud-flag { font-size: 12px; font-weight: 600; white-space: nowrap; }
.bud-flag.over { color: var(--danger); }
.bud-flag.low { color: var(--warn); }
.bud-flag.ok { color: var(--ok); }
.bud-table tr.f-over td[data-col="margin"], .bud-table tr.f-over td[data-col="marginpct"] { color: var(--danger); font-weight: 600; }
.bud-table tr.f-low td[data-col="margin"], .bud-table tr.f-low td[data-col="marginpct"] { color: var(--warn); font-weight: 600; }
.bud-foot { max-width: 900px; }

/* TPMs */
.tpm-table tbody tr { cursor: pointer; }
.tpm-status { display: inline-block; font-size: var(--fs-xs); font-weight: 600; padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--line); white-space: nowrap; }
.tpm-status.ok { color: var(--ok); border-color: var(--ok); }
.tpm-status.risk { color: var(--warn); border-color: var(--warn); }
.tpm-status.breach { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.tpm-status.none { color: var(--muted); }
.tpm-detail .card-head { flex-wrap: wrap; }
.tpm-detail .card-head a { color: var(--text); }
.tpm-row { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: flex-end; margin-bottom: 8px; }
.tpm-row .field { margin: 0; }
.tpm-ce { width: 170px; }
.tpm-kv { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
.tpm-kv b { color: var(--text); font-size: 14px; font-weight: 600; }
.tpm-actions { display: flex; gap: 8px; margin-left: auto; }
.tpm-chart-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 6px; }
.tpm-chart { display: block; max-height: 340px; }
.tpm-chart .tpm-grid line { stroke: var(--line); stroke-width: 1; }
.tpm-chart .tpm-tick { fill: var(--muted); font-size: 11px; }
.tpm-chart .tpm-empty { fill: var(--muted); font-size: 13px; }
.tpm-chart .tpm-breach { fill: var(--danger); opacity: .08; }
.tpm-chart .tpm-thr { stroke: var(--danger); stroke-width: 1.5; }
.tpm-chart .tpm-obj { stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 6 4; }
.tpm-chart .tpm-today { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.tpm-chart .tpm-plan { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.tpm-chart .tpm-plan-pt { fill: var(--panel); stroke: var(--muted); stroke-width: 2; }
.tpm-chart .tpm-actual { fill: none; stroke: var(--accent); stroke-width: 2; }
.tpm-chart .tpm-actual-pt { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.tpm-chart circle:hover { stroke-width: 3; }
.tpm-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin: 6px 2px 12px; }
.tpm-legend .lg::before { content: ''; display: inline-block; width: 18px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.tpm-legend .lg.actual::before { border-color: var(--accent); }
.tpm-legend .lg.plan::before { border-color: var(--muted); border-top-style: dashed; }
.tpm-legend .lg.thr::before { border-color: var(--danger); }
.tpm-legend .lg.obj::before { border-color: var(--ok); border-top-style: dashed; }
.tpm-legend .lg.breach::before { height: 10px; border: 0; background: var(--danger); opacity: .15; }
.tpm-tables h4 { margin: 4px 0 6px; font-size: 13px; }
.tpm-tables .grid-table th { cursor: default; }
@media (max-width: 700px) { .tpm-actions { margin-left: 0; } .bud-q { width: 140px; } }

/* Parametric Solve preview (js/views/diagrams-sysml.js) */
.par-solve h4 { margin: 14px 0 6px; font-size: 13px; }
.par-solve .grid-table th { cursor: default; }
.par-state { font-size: 12px; font-weight: 600; white-space: nowrap; }
.par-state.pass, .par-state.computed, .par-state.solved { color: var(--ok); }
.par-state.fail, .par-state.error { color: var(--danger); }
.par-state.pending { color: var(--muted); }
