/* Admin custom overrides */

/* Invoices list (invoices.php): hide low-priority columns on very small
   screens so the table never forces the page wider than the viewport,
   regardless of sidenav mode */
@media (max-width: 576px) {
  /* Hide some less-critical columns on the invoices list */
  #invoices_table th:nth-child(5),
  #invoices_table td:nth-child(5), /* Status */
  #invoices_table th:nth-child(6),
  #invoices_table td:nth-child(6), /* Charged */
  #invoices_table th:nth-child(7),
  #invoices_table td:nth-child(7)  /* Last email */
  {
    display: none;
  }
}

/* Invoice view: ensure layout wrappers never overflow viewport horizontally.
   Any horizontal scrolling should be handled only inside .table-responsive. */
#invoice-root #content,
#invoice-root .dashboard,
#invoice-root .page-profile {
  max-width: 100%;
  overflow-x: hidden;
}

#invoice-root .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Support Centre list (ac_support.php):
   - On small screens, hide Category, Assigned to and Last CM so only
     Member, Thread and Status remain.
   - Truncate long text in visible columns with ellipsis. */

#support_table {
  table-layout: fixed;
  width: 100%;
}

#support_table th,
#support_table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#support_table th:nth-child(1),
#support_table td:nth-child(1), /* Member */
#support_table th:nth-child(2),
#support_table td:nth-child(2), /* Thread title */
#support_table th:nth-child(6),
#support_table td:nth-child(6)  /* Status */
{
  overflow: hidden;
  text-overflow: ellipsis;
}

/* At <= 992px, drop secondary columns so Member + Thread + Status fit nicely */
@media (max-width: 992px) {
  #support_table th:nth-child(3),
  #support_table td:nth-child(3), /* Category */
  #support_table th:nth-child(4),
  #support_table td:nth-child(4), /* Assigned to */
  #support_table th:nth-child(5),
  #support_table td:nth-child(5)  /* Last CM */
  {
    display: none;
  }

  /* Rebalance visible columns on these narrower widths */
  #support_table th:nth-child(1),
  #support_table td:nth-child(1) { /* Member */
    width: 45%;
  }
  #support_table th:nth-child(2),
  #support_table td:nth-child(2) { /* Thread title */
    width: 40%;
  }
  #support_table th:nth-child(6),
  #support_table td:nth-child(6) { /* Status */
    width: 15%;
  }
}