/*
 LGFT v4.51.27.9 — Mobile Table Card Fit / No Side Scroll
 Scope: screen only. Print remains untouched. Converts operational tables to card rows on mobile
 so values fit the viewport and no longer rely on horizontal scrolling/header alignment.
*/
@media screen and (max-width: 768px){
  html,body{overflow-x:hidden!important;max-width:100%!important;}

  .lgft-mobile-card-host,
  .lgft-mobile-card-host.table-wrap,
  .lgft-mobile-card-host.table-scroll,
  .lgft-mobile-card-host.table-responsive,
  .lgft-mobile-card-host.datatable-wrap,
  .lgft-mobile-card-host.datatable-container,
  .lgft-mobile-card-host.lgft-mobile-table-scroll,
  .lgft-mobile-card-host.report-table-wrap,
  .lgft-mobile-card-host.data-table-wrap{
    width:100%!important;max-width:100%!important;min-width:0!important;
    overflow-x:hidden!important;overflow-y:visible!important;
  }

  table.table.lgft-mobile-card-table,
  table.lgft-data-table.lgft-mobile-card-table,
  .lgft-mobile-card-table{
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
    table-layout:auto!important;border-collapse:separate!important;border-spacing:0!important;
    overflow:visible!important;white-space:normal!important;
  }

  table.table.lgft-mobile-card-table thead,
  table.table.lgft-mobile-card-table colgroup,
  table.table.lgft-mobile-card-table tr.lgft-mobile-header-row,
  table.lgft-data-table.lgft-mobile-card-table thead,
  table.lgft-data-table.lgft-mobile-card-table colgroup,
  table.lgft-data-table.lgft-mobile-card-table tr.lgft-mobile-header-row{
    display:none!important;visibility:hidden!important;width:0!important;height:0!important;overflow:hidden!important;
  }

  table.table.lgft-mobile-card-table tbody,
  table.table.lgft-mobile-card-table tfoot,
  table.lgft-data-table.lgft-mobile-card-table tbody,
  table.lgft-data-table.lgft-mobile-card-table tfoot{
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
  }

  table.table.lgft-mobile-card-table tr:not(.lgft-dt-filtered):not(.lgft-dt-paged):not(.lgft-mobile-header-row),
  table.lgft-data-table.lgft-mobile-card-table tr:not(.lgft-dt-filtered):not(.lgft-dt-paged):not(.lgft-mobile-header-row){
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
    margin:0 0 10px!important;padding:8px 10px!important;
    border:1px solid rgba(148,163,184,.18)!important;border-radius:16px!important;
    background:rgba(7,16,31,.58)!important;box-shadow:inset 3px 0 0 rgba(214,171,54,.18)!important;
  }

  table.table.lgft-mobile-card-table tr.lgft-dt-filtered,
  table.table.lgft-mobile-card-table tr.lgft-dt-paged,
  table.lgft-data-table.lgft-mobile-card-table tr.lgft-dt-filtered,
  table.lgft-data-table.lgft-mobile-card-table tr.lgft-dt-paged,
  table.table.lgft-mobile-card-table .lgft-dt-hidden-col,
  table.lgft-data-table.lgft-mobile-card-table .lgft-dt-hidden-col{
    display:none!important;
  }

  table.table.lgft-mobile-card-table td,
  table.table.lgft-mobile-card-table tbody th,
  table.lgft-data-table.lgft-mobile-card-table td,
  table.lgft-data-table.lgft-mobile-card-table tbody th{
    display:grid!important;grid-template-columns:minmax(92px,34%) minmax(0,1fr)!important;
    align-items:start!important;gap:8px!important;width:100%!important;max-width:100%!important;min-width:0!important;
    padding:8px 0!important;margin:0!important;border:0!important;border-bottom:1px solid rgba(148,163,184,.12)!important;
    background:transparent!important;color:inherit!important;white-space:normal!important;overflow:visible!important;
    overflow-wrap:anywhere!important;word-break:break-word!important;text-align:left!important;vertical-align:top!important;
  }

  table.table.lgft-mobile-card-table tr > td:last-child,
  table.table.lgft-mobile-card-table tr > th:last-child,
  table.lgft-data-table.lgft-mobile-card-table tr > td:last-child,
  table.lgft-data-table.lgft-mobile-card-table tr > th:last-child{
    border-bottom:0!important;
  }

  table.table.lgft-mobile-card-table .table-card-label,
  table.lgft-data-table.lgft-mobile-card-table .table-card-label{
    display:block!important;grid-column:1!important;align-self:start!important;
    margin:0!important;padding:0!important;color:#94a3b8!important;
    font-size:10.5px!important;line-height:1.2!important;font-weight:800!important;
    letter-spacing:.055em!important;text-transform:uppercase!important;white-space:normal!important;
    overflow-wrap:anywhere!important;word-break:break-word!important;opacity:.95!important;
  }

  table.table.lgft-mobile-card-table .table-card-value,
  table.lgft-data-table.lgft-mobile-card-table .table-card-value{
    display:block!important;grid-column:2!important;min-width:0!important;max-width:100%!important;
    color:#f8fafc!important;font-size:13px!important;line-height:1.28!important;font-weight:650!important;
    white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important;text-align:left!important;
  }

  table.table.lgft-mobile-card-table .table-card-value > *,
  table.lgft-data-table.lgft-mobile-card-table .table-card-value > *{
    max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:break-word!important;
  }

  table.table.lgft-mobile-card-table .status,
  table.table.lgft-mobile-card-table .pill,
  table.table.lgft-mobile-card-table .badge,
  table.lgft-data-table.lgft-mobile-card-table .status,
  table.lgft-data-table.lgft-mobile-card-table .pill,
  table.lgft-data-table.lgft-mobile-card-table .badge{
    display:inline-flex!important;width:auto!important;max-width:100%!important;white-space:normal!important;
    line-height:1.1!important;vertical-align:top!important;
  }

  table.table.lgft-mobile-card-table a.btn,
  table.table.lgft-mobile-card-table button,
  table.lgft-data-table.lgft-mobile-card-table a.btn,
  table.lgft-data-table.lgft-mobile-card-table button{
    width:auto!important;max-width:100%!important;min-width:0!important;white-space:normal!important;
  }

  /* Data-table toolbars must fit the viewport as well. */
  .lgft-dt-toolbar,
  .lgft-dt-topline,
  .lgft-dt-actions,
  .lgft-dt-column-panel,
  .lgft-dt-filter-grid{
    width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:hidden!important;
  }
  .lgft-dt-actions{display:flex!important;flex-wrap:wrap!important;gap:8px!important;}
  .lgft-dt-actions > *{flex:1 1 130px!important;min-width:0!important;max-width:100%!important;}
  .lgft-dt-column-panel{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;}
  .lgft-dt-filter-grid{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;}
  .lgft-dt-column-panel label{display:flex!important;align-items:center!important;gap:8px!important;max-width:100%!important;overflow-wrap:anywhere!important;white-space:normal!important;}
  .lgft-dt-filter-grid input{width:100%!important;max-width:100%!important;min-width:0!important;}
}

@media screen and (max-width: 420px){
  table.table.lgft-mobile-card-table td,
  table.table.lgft-mobile-card-table tbody th,
  table.lgft-data-table.lgft-mobile-card-table td,
  table.lgft-data-table.lgft-mobile-card-table tbody th{
    grid-template-columns:minmax(82px,32%) minmax(0,1fr)!important;gap:7px!important;padding:7px 0!important;
  }
  table.table.lgft-mobile-card-table .table-card-label,
  table.lgft-data-table.lgft-mobile-card-table .table-card-label{font-size:10px!important;}
  table.table.lgft-mobile-card-table .table-card-value,
  table.lgft-data-table.lgft-mobile-card-table .table-card-value{font-size:12.5px!important;}
}
@media print{ /* screen-only repair; do not alter portrait print */ }
