#costAnalysisStage {
  grid-column: 2;
  min-width: 0;
  max-width: 100%;
  align-self: start;
  color: #172033;
  background: #fff;
  border: 1px solid #d7dfe9;
  border-radius: 6px;
  letter-spacing: 0;
}
#costAnalysisStage *, #costAnalysisStage *::before, #costAnalysisStage *::after { box-sizing: border-box; letter-spacing: 0; }
#costAnalysisStage [hidden] { display: none !important; }
#costAnalysisStage h2 { margin: 0; font-size: 20px; line-height: 1.3; }
#costAnalysisStage h3 { margin: 0; font-size: 15px; line-height: 1.4; }
#costAnalysisStage p { margin: 0; }
#costAnalysisStage button, #costAnalysisStage input, #costAnalysisStage select { font-family: inherit; }
#costAnalysisStage button { cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
#costAnalysisStage button:disabled, #costAnalysisStage select:disabled { cursor: default; opacity: .55; }
#costAnalysisStage :focus-visible { outline: 2px solid #147d71; outline-offset: 3px; }
#costAnalysisStage .primary { background: #17665f; border-color: #17665f; color: #fff; box-shadow: none; }
#costAnalysisStage .primary:hover:not(:disabled) { background: #11534d; }
#costAnalysisStage .secondary { color: #344054; background: #fff; border: 1px solid #cbd4df; box-shadow: none; }
#costAnalysisStage .secondary:hover:not(:disabled) { background: #f3f6f8; }
#costAnalysisStage .primary, #costAnalysisStage .secondary { min-height: 38px; border-radius: 4px; padding: 8px 11px; font-size: 13px; line-height: 1.4; }
#costAnalysisStage .caIcon { display: inline-flex; flex: 0 0 38px; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; font-size: 21px; line-height: 1; }
.caHeader { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.caHeader > * { min-width: 0; }
.caToolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
.caMonthPicker { display: grid; grid-template-columns: 38px minmax(0, 156px) 38px; gap: 4px; max-width: 100%; }
#costAnalysisStage #caMonth { min-width: 0; width: 100%; min-height: 38px; height: 38px; padding: 5px 8px; font-size: 13px; border-radius: 4px; }
.caDisclosure { padding: 0 16px 14px; font-size: 12px; line-height: 1.6; color: #596579; }
.caDisclosure strong { color: #344054; font-weight: 600; }
.caMessages { padding: 0 16px; font-size: 13px; overflow-wrap: anywhere; }
.caMessages:has(> :not([hidden])) { padding-bottom: 12px; }
#costAnalysisStage .caMessages p + p { margin-top: 8px; }
.caError { color: #a52318; background: #fff3f1; border-left: 3px solid #c0392b; padding: 10px 12px; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.caNotice { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid #bd8516; background: #fff9e9; color: #694710; font-size: 13px; line-height: 1.5; }
.caNotice summary { cursor: pointer; }
.caNotice ul { margin: 8px 0 0; padding-left: 18px; max-height: 180px; overflow-y: auto; }
.caTabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(520px, 100%); padding: 0 16px; }
#costAnalysisStage .caTabs button { min-width: 0; min-height: 44px; background: transparent; color: #596579; border: 0; border-bottom: 3px solid transparent; padding: 9px 6px; font-size: 13px; font-weight: 600; line-height: 1.4; border-radius: 0; transition: none; }
#costAnalysisStage .caTabs button[aria-selected="true"] { color: #116256; border-bottom-color: #147d71; }
#costAnalysisStage .caTabs button:hover { background: #f5f8f8; }
.caPanel { min-width: 0; padding: 16px; border-top: 1px solid #d7dfe9; }
#costAnalysisStage .caScope { margin-bottom: 12px; font-size: 12px; color: #596579; }
.caMuted { color: #596579; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.caMetrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding-bottom: 16px; gap: 16px; }
.caMetric { min-width: 0; padding-top: 10px; border-top: 3px solid #147d71; }
.caMetric1 { border-color: #748394; }
.caMetric2 { border-color: #3285a0; }
.caMetric3 { border-color: #bd8516; }
.caMetric dt { font-size: 12px; color: #475467; line-height: 1.5; }
.caMetric dd { margin: 7px 0 0; min-width: 0; }
.caMetric strong { display: block; font-size: 22px; font-weight: 650; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.caMetric small { display: block; margin-top: 6px; color: #596579; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.caSection { min-width: 0; padding: 18px 0; border-top: 1px solid #e1e6ed; }
.caSection:last-child { padding-bottom: 0; }
.caSectionHead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.caSection > h3 { margin-bottom: 12px !important; }
.caAnalysisColumns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.caLegend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: #596579; }
.caLegend span::before { display: inline-block; width: 9px; height: 9px; content: ""; margin-right: 5px; background: #147d71; }
.caLegend .caPlanKey::before { background: #aeb9c6; }
.caTrend { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; padding: 8px 0; }
.caTrendMonth { min-width: 0; border-radius: 3px; padding: 4px; }
.caTrendMonth:hover, .caTrendMonth:focus-visible { background: #edf5f3; }
.caBarPlot { position: relative; height: 136px; width: 100%; }
.caZeroLine { position: absolute; left: 0; right: 0; height: 1px; background: #cbd4df; }
.caBar { position: absolute; width: 34%; max-width: 25px; }
.caActualBar { right: 52%; background: #147d71; }
.caPlanBar { left: 52%; background: #aeb9c6; }
.caNegativeBar { background: #b94b43; }
.caMonthLabel { display: block; margin-top: 7px; font-size: 11px; text-align: center; color: #596579; font-variant-numeric: tabular-nums; }
.caSelectedMonth .caMonthLabel { color: #116256; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
#caTrendDetails { margin-top: 6px; font-size: 12px; color: #596579; }
#caTrendDetails summary { cursor: pointer; padding: 6px 0; }
.caCategoryBar { display: block; height: 3px; margin-top: 7px; max-width: 100%; background: #579b8e; }
.caFilters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 0 0 12px; }
#caPlanFilters { margin-top: 16px; }
.caFilters label { flex: 1 1 165px; min-width: 0; }
.caFilters label:first-child { flex: 2 1 250px; }
.caFilters .caArchiveFilter { flex: 0 0 auto; }
#costAnalysisStage label { display: grid; gap: 5px; color: #475467; font-size: 12px; font-weight: 600; min-width: 0; }
#costAnalysisStage input, #costAnalysisStage select { min-width: 0; max-width: 100%; width: 100%; min-height: 38px; border: 1px solid #cbd4df; border-radius: 4px; padding: 7px 9px; background: #fff; color: #172033; font-size: 13px; }
#costAnalysisStage input:focus, #costAnalysisStage select:focus { border-color: #147d71; box-shadow: 0 0 0 2px #147d7117; }
#caRowCount, #caPlanCount { margin-bottom: 8px !important; }
.caTableScroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid #dde3ec; border-radius: 3px; }
.caTable { border-collapse: collapse; width: 100%; min-width: 320px; font-size: 13px; table-layout: auto; }
.caTable th { background: #f0f3f6; color: #475467; text-align: left; font-size: 11px; font-weight: 650; }
.caTable td, .caTable th { padding: 10px; border-bottom: 1px solid #e5e9ef; vertical-align: top; line-height: 1.45; overflow-wrap: anywhere; }
.caTable tr:last-child td { border-bottom: 0; }
.caTable tbody tr:hover { background: #f6faf9; }
.caTable small { display: block; color: #596579; font-size: 11px; font-weight: 400; margin-top: 4px; }
.caTable .caAmount { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.caTable .caDate { white-space: nowrap; font-variant-numeric: tabular-nums; }
.caTable .caAmount small { white-space: normal; }
.caRegisterTable { min-width: 1120px; }
.caRecurringTable { min-width: 920px; }
.caRegisterTable .caDescription { min-width: 210px; max-width: 320px; }
.caRegisterTable td:nth-child(3) { min-width: 170px; max-width: 250px; }
.caRecurringTable td:first-child { min-width: 210px; max-width: 320px; }
#costAnalysisStage .caInlineCategory { width: 175px; max-width: 200px; font-size: 12px; padding: 6px; }
.caRowActions { min-width: 130px; }
#costAnalysisStage .caRowActions button { display: block; margin-bottom: 6px; min-height: 32px; font-size: 12px; }
#costAnalysisStage .caLink { display: inline-block; padding: 3px 0; border: 0; border-radius: 0; background: none; color: #086252; font: inherit; font-weight: 600; text-align: left; min-height: 28px; }
#costAnalysisStage .caLink:hover:not(:disabled) { text-decoration: underline; }
#costAnalysisStage .caDanger { color: #a52318; }
.caSource { display: inline-block; border-radius: 3px; padding: 3px 6px; white-space: nowrap; font-size: 11px; font-weight: 650; }
.caKsef { background: #e8f2ef; color: #216557; }
.caManual { background: #edf0f5; color: #4b5970; }
.caReview { display: block; color: #92540e; font-size: 11px; font-weight: 700; margin-top: 6px; }
.caExcluded .caAmount { color: #7b5b31; }
#costAnalysisStage .caEmpty { padding: 24px 12px; color: #667085; font-size: 13px; text-align: center; font-weight: 400; }
#costAnalysisStage .caTableTotal { margin-top: 12px; text-align: right; font-size: 13px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
#costAnalysisStage .caDialog { width: min(640px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #cbd4df; border-radius: 6px; overflow-x: hidden; overflow-y: auto; color: #172033; }
.caDialog::backdrop { background: #17203366; }
.caDialogBody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; min-width: 0; margin: 0; }
.caDialogHead { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
#costAnalysisStage .caDialogHead h2 { font-size: 18px; overflow-wrap: anywhere; }
.caFormGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
.caFormGrid > * { min-width: 0; }
.caFull { grid-column: 1 / -1; }
.caFormGrid p { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#costAnalysisStage .caCheck { display: flex; align-items: center; gap: 8px; min-height: 38px; }
#costAnalysisStage .caCheck input { width: 18px; height: 18px; min-height: 18px; accent-color: #147d71; }
.caDialogActions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; border-top: 1px solid #e1e6ed; padding-top: 14px; }
#costAnalysisStage #caOriginal { margin-right: auto; font-size: 12px; }
#costAnalysisStage .caArchiveConfirm { background: #a52318; border-color: #a52318; }
#costAnalysisStage .caArchiveConfirm:hover:not(:disabled) { background: #871c14; }
#caFormStatus { font-size: 13px; color: #596579; }
#costAnalysisStage .caSrOnly { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1200px) {
  .caMetrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .caAnalysisColumns { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 1040px) { #costAnalysisStage { grid-column: 1; } }
@media (max-width: 600px) {
  .caHeader { padding: 12px; gap: 10px; }
  .caToolbar { width: 100%; gap: 6px; }
  .caMonthPicker { flex: 1 1 calc(100% - 44px); grid-template-columns: 38px minmax(0, 1fr) 38px; }
  .caToolbar > .primary, .caToolbar > .secondary:not(.caIcon) { flex: 1 1 110px; }
  .caDisclosure { padding: 0 12px 12px; }
  .caPanel { padding: 12px; }
  .caTabs { padding: 0 6px; }
  .caMetrics { gap: 12px; }
  .caMetric strong { font-size: 18px; }
  .caTrend { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 12px; }
  .caBarPlot { height: 96px; }
  .caFilters label { flex-basis: 100%; }
  .caDialogBody { padding: 14px; }
  .caFormGrid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #costAnalysisStage #caOriginal { flex-basis: 100%; }
  #costAnalysisStage .caFormGrid input, #costAnalysisStage .caFormGrid select { font-size: 16px; }
}
@media (max-width: 360px) { .caMetrics { grid-template-columns: minmax(0, 1fr); } }
