@media screen {
  html {
    max-width: 100%;
  }

  body.mcg-responsive-system {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.mcg-responsive-system *,
  body.mcg-responsive-system *::before,
  body.mcg-responsive-system *::after {
    min-width: 0;
  }

  body.mcg-responsive-system img,
  body.mcg-responsive-system svg,
  body.mcg-responsive-system video,
  body.mcg-responsive-system canvas,
  body.mcg-responsive-system iframe {
    max-width: 100%;
  }

  body.mcg-responsive-system input,
  body.mcg-responsive-system select,
  body.mcg-responsive-system textarea,
  body.mcg-responsive-system button,
  body.mcg-responsive-system .btn,
  body.mcg-responsive-system .button {
    max-width: 100%;
  }

  body.mcg-responsive-system .page {
    width: min(100% - 24px, 1680px);
    max-width: min(1680px, calc(100vw - 24px));
  }

  body.mcg-responsive-system .topbar,
  body.mcg-responsive-system .filters,
  body.mcg-responsive-system .bulkbar,
  body.mcg-responsive-system .formrow,
  body.mcg-responsive-system .actions {
    flex-wrap: wrap;
  }

  body.mcg-responsive-system .panel,
  body.mcg-responsive-system .box,
  body.mcg-responsive-system .card,
  body.mcg-responsive-system .tile,
  body.mcg-responsive-system .jobcard,
  body.mcg-responsive-system .kpi,
  body.mcg-responsive-system .stat {
    max-width: 100%;
  }

  body.mcg-responsive-system .grid,
  body.mcg-responsive-system .grid2,
  body.mcg-responsive-system .grid-2,
  body.mcg-responsive-system .grid3,
  body.mcg-responsive-system .kpi-grid,
  body.mcg-responsive-system .stats {
    min-width: 0;
  }

  @media screen and (max-width: 1500px) {
    body.mcg-responsive-system .grid,
    body.mcg-responsive-system .grid2,
    body.mcg-responsive-system .grid-2,
    body.mcg-responsive-system .grid3,
    body.mcg-responsive-system .kpi-grid,
    body.mcg-responsive-system .stats {
      grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)) !important;
    }
  }

  body.mcg-responsive-system .table-wrap,
  body.mcg-responsive-system .table-responsive {
    max-width: 100%;
  }

  body.mcg-responsive-system .mcg-card-table-wrap {
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  body.mcg-responsive-system table.mcg-card-table {
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
  }

  body.mcg-responsive-system table.mcg-card-table thead {
    display: none !important;
  }

  body.mcg-responsive-system table.mcg-card-table,
  body.mcg-responsive-system table.mcg-card-table tbody,
  body.mcg-responsive-system table.mcg-card-table tr,
  body.mcg-responsive-system table.mcg-card-table td {
    display: block !important;
    width: 100% !important;
  }

  body.mcg-responsive-system table.mcg-card-table tr {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    gap: 10px !important;
    padding: 12px !important;
    margin: 0 0 12px !important;
    border: 1px solid #d8dde6 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 3px 10px rgba(0,0,0,.03) !important;
  }

  body.mcg-responsive-system table.mcg-card-table td {
    min-width: 0 !important;
    border: 1px solid #edf1f6 !important;
    border-radius: 9px !important;
    padding: 8px !important;
    background: #fbfcfd !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  body.mcg-responsive-system table.mcg-card-table td::before {
    content: attr(data-mcg-label);
    display: block;
    margin-bottom: 5px;
    color: #526070;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
  }

  body.mcg-responsive-system table.mcg-card-table td.mcg-full-row,
  body.mcg-responsive-system table.mcg-card-table td.mcg-wide-cell {
    grid-column: 1 / -1 !important;
  }

  body.mcg-responsive-system table.mcg-card-table input:not([type="checkbox"]):not([type="radio"]),
  body.mcg-responsive-system table.mcg-card-table select,
  body.mcg-responsive-system table.mcg-card-table textarea {
    width: 100% !important;
    max-width: none !important;
  }

  body.mcg-responsive-system table.mcg-card-table button,
  body.mcg-responsive-system table.mcg-card-table .btn,
  body.mcg-responsive-system table.mcg-card-table .button {
    white-space: normal !important;
  }

  body.mcg-responsive-system table.mcg-card-table .actions,
  body.mcg-responsive-system table.mcg-card-table .row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  body.mcg-responsive-system table.mcg-card-table .actions > *,
  body.mcg-responsive-system table.mcg-card-table .row-actions > * {
    flex: 1 1 120px;
  }
}

@media screen and (max-width: 760px) {
  body.mcg-responsive-system .page {
    width: calc(100% - 16px);
    max-width: calc(100vw - 16px);
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  body.mcg-responsive-system table.mcg-card-table tr {
    grid-template-columns: 1fr !important;
  }

  body.mcg-responsive-system .filters .field,
  body.mcg-responsive-system .bulkbar .field,
  body.mcg-responsive-system .formrow .field {
    flex: 1 1 100%;
  }
}
