/* Revoo AI ID — Frontend V85 Revisi 45.
   Presentational only: existing React header is already sticky, keep KPI summaries
   below it on desktop for Arus Kas and Pendapatan ONLY.
   Deliberately no change to sidebar, cash-layout/table scrolling, business JS or mobile.
 */
@media screen and (min-width:1150px) {
  /* The R44 base sets body overflow-x:hidden; computed overflow-y:auto then
     makes body a non-scrolling sticky container in Chromium. Use clip/visible
     *only* on these two active pages so topbar + KPI can stick to viewport. */
  html:not(:has(.modal-backdrop)):has(.persistent-page-panel.is-active .cash-summary-grid),
  html:not(:has(.modal-backdrop)):has(.persistent-page-panel.is-active .cash-summary-grid) body,
  html:not(:has(.modal-backdrop)):has(.persistent-page-panel.is-active .income-summary-grid),
  html:not(:has(.modal-backdrop)):has(.persistent-page-panel.is-active .income-summary-grid) body {
    overflow-x: clip !important;
    overflow-y: visible !important;
  }
  /* The existing topbar has position:sticky, z-index:160 and stays at top:0.
     Give the KPI block an opaque backing and a lower stacking level (140).
     This prevents the input form from showing through the gap while scrolling. */
  .page-content .persistent-page-panel.is-active .page-stack > .cash-summary-grid,
  .page-content .persistent-page-panel.is-active .income-page > .income-summary-grid {
    position: sticky;
    top: 72px;
    z-index: 140;
    align-self: start;
    padding: 9px 0;
    margin: -9px 0;
    border-radius: 0 0 15px 15px;
    background: #f7f6f2;
    box-shadow: 0 12px 16px -18px rgba(43,76,68,.36);
    isolation: isolate;
  }
  /* Keep the original colored KPI cards, internal gaps, size, grid and values. */
  html[data-theme="dark"] .page-content .persistent-page-panel.is-active .page-stack > .cash-summary-grid,
  html[data-theme="dark"] .page-content .persistent-page-panel.is-active .income-page > .income-summary-grid {
    background: var(--dark-bg, #101827);
    box-shadow: 0 10px 18px -14px rgba(0,0,0,.58);
  }
}
/* Mobile/tablet, low-height screens and printed reports keep natural document flow. */
@media screen and (max-width:1149px), screen and (max-height:520px) {
  .page-content .persistent-page-panel.is-active .page-stack > .cash-summary-grid,
  .page-content .persistent-page-panel.is-active .income-page > .income-summary-grid {
    position: static !important;
    inset-block-start: auto !important;
    box-shadow: none;
  }
}
@media print {
  .cash-summary-grid, .income-summary-grid {position: static !important;}
}
