/*
 * Закреплённые фильтры + sticky-шапка таблицы (журналы УС.Д / УС.ОТ / УС.Р).
 * Разметка:
 *   body.list-freeze-page
 *   .list-freeze
 *     .list-freeze__toolbar | __filters | __chrome  (не скроллятся)
 *     .list-freeze__panel (card/panel) → .list-freeze__scroll → table
 * На < md — обычный скролл страницы.
 */

@media (min-width: 768px) {
  body.app-cabinet.list-freeze-page #main-content.content,
  body.app-cabinet.list-freeze-page #main-content .content-scrollable,
  body.app-cabinet.df-list-freeze-page #main-content.content,
  body.app-cabinet.df-list-freeze-page #main-content .content-scrollable {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }

  body.app-cabinet.list-freeze-page #main-content .content-scrollable,
  body.app-cabinet.df-list-freeze-page #main-content .content-scrollable {
    flex: 1 1 auto;
  }

  .list-freeze,
  .df-shell.df-list-freeze,
  .works-shell.list-freeze {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
  }

  .df-shell.df-list-freeze,
  .works-shell.list-freeze {
    padding-bottom: 0.75rem !important;
  }

  .list-freeze > .df-shell-header,
  .list-freeze > .works-shell-header,
  .df-shell.df-list-freeze > .df-shell-header,
  .works-shell.list-freeze > .works-shell-header {
    flex-shrink: 0;
  }

  .list-freeze__body,
  .df-list-freeze__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .list-freeze__toolbar,
  .list-freeze__filters,
  .list-freeze__chrome,
  .df-list-freeze__toolbar,
  .df-list-freeze__filters {
    flex-shrink: 0;
  }

  .list-freeze__panel,
  .df-list-freeze__panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
    overflow: hidden;
  }

  /* Bootstrap card: тело растягиваем под скролл */
  .list-freeze__panel > .card-header {
    flex-shrink: 0;
  }

  .list-freeze__panel > .card-body:not(.list-freeze__scroll) {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .list-freeze__panel > .card-body.list-freeze__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .list-freeze__scroll,
  .df-list-freeze__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* overflow:hidden на .table ломает position:sticky */
  .list-freeze__scroll > .table,
  .list-freeze__scroll > .table-responsive > .table,
  .df-list-freeze__scroll > .table,
  .df-list-freeze__scroll > .table-responsive > .table {
    overflow: visible;
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .list-freeze__scroll .table-responsive,
  .df-list-freeze__scroll .table-responsive {
    overflow: visible;
  }

  .list-freeze__scroll thead th,
  .df-list-freeze__scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  /* Заголовок/кнопки внутри карточки над скроллом */
  .list-freeze__panel > .card-body > .list-freeze__toolbar {
    flex-shrink: 0;
  }
}
