.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling on iOS */
}

.table {
  @apply bg-white w-full;

  thead {
    th {
      padding: 20px 18px;
      text-align: left;
      white-space: nowrap;
      /* Updated gradient background to match screenshot */
      background: #667eea;
      color: white;
      @apply font-bold align-middle text-left;

      &:first-child {
        min-width: 256px;
      }

      &:nth-child(2) {
        min-width: 200px;
      }
    }
  }

  tbody {
    border: none;
    padding: 0;
    margin: 0;

    td {
      @apply border-t border-border text-left align-middle;
      padding: 20px 18px;
    }
  }
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  background-color: rgba(255, 255, 255, var(--bg-opacity));
  border-top: 1px solid rgb(214, 213, 212);
  padding: 20px 40px 20px 0px;
  color: rgb(80, 90, 95);
  gap: 8px;

  svg {
    fill: theme(colors.text.secondary);
    @apply ml-md;
  }
}

.pagination button:nth-child(1) span::after {
  content: "\f105";
}

.fullWidth {
  width: 100% !important;
}

.customTable {
  width: 100%;

  th {
    font-weight: bold;
  }

  th,
  td {
    text-align: left;
    border-bottom: 1px solid #b1b4b6;
    padding: 15px 10px;
  }

  tr:nth-child(odd) {
    background-color: theme(colors.grey.mid);
  }

  tr:nth-child(even) {
    background-color: #fff;
  }

  thead {
    tr:first-child {
      background-color: unset;
    }
  }
}

.table-fixed-first-column {
  thead {
    th:first-child {
      position: sticky;
      background: #fff;
      left: 0;
      border-right: 1px solid #b1b4b6;
      border-top-left-radius: 4px;
    }
  }

  tbody {
    td:first-child {
      position: sticky;
      background: #fff;
      color: theme(colors.primary.main);
      left: 0;
      border-right: 1px solid #b1b4b6;
    }
  }
}

.table-fixed-last-column {
  thead {
    th:last-child {
      position: sticky;
      background: #fff;
      right: 0;
      left: 0;
      border-top-left-radius: 4px;
    }
  }

  tbody {
    td:last-child {
      position: sticky;
      background: #fff;
      color: theme(colors.primary.main);
      left: 0;
      right: 0;
    }
  }
}

.table-fixed-column-common-pay {
  thead {
    th:first-child {
      position: sticky;
      background: rgb(238, 238, 238);
      left: 0;
      border-top-left-radius: 4px;
    }

    th:last-child {
      position: sticky;
      background: rgb(238, 238, 238);
      right: 0;
      border-top-left-radius: 4px;
    }
  }

  tbody {
    td:first-child {
      position: sticky;
      background: rgb(238, 238, 238);
      left: 0;
    }

    td:last-child {
      position: sticky;
      background: rgb(238, 238, 238);
      right: 0;
    }
  }
}

.table-fixed-first-second-column {
  thead {
    th:nth-child(2) {
      position: sticky;
      left: 0;
      background-color: white;
    }
  }

  tbody {
    td:nth-child(2) {
      position: sticky;
      left: 0;
      background-color: inherit;
    }
  }
}

.table-border-style {
  border: 1px solid #b1b4b6;
  border-radius: 4px;
  border-spacing: 0;
  border-collapse: separate;
}

.dss-table-wrapper {
  width: 100%;
  display: block;
  overflow-x: auto;

  table {
    th {
      .tooltip {
        min-width: 80px;
      }
    }

    tr {
      td {
        span {
          white-space: pre;
          min-width: 80px;
        }
      }
    }
  }
}

.reports-table {
  margin-top: 2rem;

  thead {
    th {
      &:first-child {
        min-width: unset;
      }
    }
  }
}