/* Custom styles for Mantine DataTable */

/* Default font size for all table cells - matches Incoming Payments style */
.mantine-datatable-table tbody td {
  font-size: var(--mantine-font-size-xs);
}

.mantine-datatable-table tbody td .mantine-Text-root {
  font-size: var(--mantine-font-size-xs);
}

/* Note: No !important here so inline rowStyle can override for overdue rows */
.mantine-datatable-table tbody tr:nth-of-type(odd) {
  background-color: var(--mantine-color-gray-0);
}

/* Overdue rows - override striping */
.mantine-datatable-table tbody tr.row-overdue,
.mantine-datatable-table tbody tr:nth-of-type(odd).row-overdue,
.mantine-datatable-table tbody tr:nth-of-type(even).row-overdue {
  background-color: #fee2e2 !important;
}

.mantine-datatable-table tbody tr:hover {
  background-color: var(--mantine-color-blue-0) !important;
}

.mantine-datatable-table tbody tr:nth-of-type(odd):hover {
  background-color: var(--mantine-color-blue-0) !important;
}

/* Overdue rows - hover state */
.mantine-datatable-table tbody tr.row-overdue:hover,
.mantine-datatable-table tbody tr:nth-of-type(odd).row-overdue:hover,
.mantine-datatable-table tbody tr:nth-of-type(even).row-overdue:hover {
  background-color: #fecaca !important;
}

/* Pagination footer - normal on mobile, sticky on desktop */
.mantine-datatable-pagination {
  background-color: var(--mantine-color-white);
  border-top: 1px solid var(--mantine-color-gray-2);
  padding: 14px 16px !important;
}

/* Sticky pagination only on screens >= 929px */
@media (min-width: 929px) {
  .mantine-datatable-pagination {
    position: fixed;
    bottom: 0px;
    right: 0;
    width: calc(100% - 240px);
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    padding: 14px 50px !important;
  }

  .mantine-datatable {
    padding-bottom: 50px;
  }
}

/* On mobile, account for bottom nav */
@media (max-width: 768px) {
  .mantine-datatable-pagination {
    margin-bottom: 80px; /* Space for bottom nav */
  }
}