/* WindWatch Forecasting/Stoppages production fix
   Purpose:
   - Make turbine stoppage table vertically scrollable.
   - Keep table header visible.
   - Prevent bottom rows/actions from being hidden below the viewport/taskbar.
   - Keep Forecasting side panel usable on smaller screens.
*/

html,
body,
#root {
  min-height: 100%;
}

/* Stoppages page main scroll */
.st-page {
  height: calc(100dvh - 86px);
  overflow-y: auto !important;
  overflow-x: hidden;
  padding-bottom: 80px !important;
  scroll-behavior: smooth;
}

.st-shell {
  min-height: max-content;
  padding-bottom: 56px !important;
}

/* Logged stoppages table scroll */
.st-table-wrap {
  max-height: 42dvh !important;
  overflow: auto !important;
  border-radius: 18px;
  scrollbar-width: thin;
}

/* Keep stoppage table header visible while scrolling rows */
.st-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, #0d6f84, #075e75) !important;
}

/* Keep action buttons visible */
.st-row-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  white-space: nowrap;
}

/* Do not let long notes break the layout */
.st-reason {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Forecasting page: allow full-page scroll when content is taller than screen */
.fc-page {
  min-height: calc(100dvh - 86px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 80px !important;
}

/* Forecasting right panel should remain usable */
.fc-panel {
  max-height: calc(100dvh - 130px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Tables inside Forecasting should not hide bottom rows */
.fc-card,
.fc-panel-inner {
  min-height: 0;
}

@media (max-width: 1100px) {
  .st-page,
  .fc-page {
    height: auto;
    min-height: calc(100dvh - 86px);
  }

  .st-table-wrap {
    max-height: 58dvh !important;
  }

  .fc-panel {
    max-height: none;
  }
}
