/* v2.10.5 — Responsive table recovery
   Desktop tables remain full-width. Horizontal table scrolling is applied only
   where the viewport is too narrow to display the complete table. */
html, body { max-width: 100%; }
#app, #appShell, .app-shell, .main-shell, main, .main-content,
.content-area, .page-content, .view, [data-view], [data-page] {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.amoda-table-wrap,
.table-wrap,
.table-wrapper,
.responsive-table,
.overflow-x-auto,
[data-table-wrap],
section:has(> table),
div:has(> table) {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Desktop and tablet: use all available space and allow sensible wrapping. */
@media (min-width: 768px) {
  .amoda-table-wrap,
  .table-wrap,
  .table-wrapper,
  .responsive-table,
  .overflow-x-auto,
  [data-table-wrap],
  section:has(> table),
  div:has(> table) {
    overflow-x: auto;
  }

  .amoda-table-wrap > table,
  .table-wrap > table,
  .table-wrapper > table,
  .responsive-table > table,
  .overflow-x-auto > table,
  [data-table-wrap] > table,
  section:has(> table) > table,
  div:has(> table) > table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }

  table th, table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  table th:last-child,
  table td:last-child,
  .amoda-row-actions {
    white-space: nowrap;
  }
}

/* Phones: the table itself may be wider, while its host scrolls horizontally. */
@media (max-width: 767px) {
  html, body { overflow-x: hidden; }

  main, .main-content, .content-area, .page-content,
  #dashboard, #committees, #members, #tasks, #mytasks,
  #guests, #accommodation, #vendors, #reports {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-left: .75rem !important;
    padding-right: .75rem !important;
    box-sizing: border-box;
  }

  .amoda-workspace-shell,
  .amoda-workspace-card,
  .amoda-activities-card,
  .amoda-section-heading,
  .amoda-dialog,
  .modal-content {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .amoda-table-wrap,
  .table-wrap,
  .table-wrapper,
  .responsive-table,
  .overflow-x-auto,
  [data-table-wrap],
  section:has(> table),
  div:has(> table) {
    overflow-x: auto !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    margin-inline: 0 !important;
    border-radius: .75rem;
  }

  .amoda-table-wrap > table,
  .table-wrap > table,
  .table-wrapper > table,
  .responsive-table > table,
  .overflow-x-auto > table,
  [data-table-wrap] > table,
  section:has(> table) > table,
  div:has(> table) > table {
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
  }

  table { font-size: .9rem; }
  table th, table td {
    padding: .75rem .8rem !important;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
  table td p, table td small, table td .wrap,
  table td[data-wrap], table td .activity-description {
    white-space: normal;
    min-width: 14rem;
  }
  .amoda-row-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: .5rem;
    min-width: max-content;
  }
}
