table {
  margin-top: 1rem;
  border-collapse: collapse;
  width: auto;
  white-space: nowrap;

  &.small {
    font-size: 14px;
    line-height: 1.2;
  }

  &.sort {
    th:not(.no-sort) {
      cursor: pointer;

      &::after {
        content: '\00a0⇅';
      }
    }
  }

  caption {
    caption-side: bottom;
    text-align: left;
    padding: 0.3rem 0.5rem;
  }

  thead tr {
    border-bottom: 1px solid #ccc;
  }

  tr {
    th, td {
      &:last-child:has(a) {
        text-align: right;
      }
    }

    th {
      padding: 0.5rem;
      position: sticky;
      background-color: white;
      top: -1px;
      vertical-align: bottom;
      background-color: var(--table-header-color);
      text-align: left;
    }

    td {
      padding: 0.3rem 0.5rem;
      border-top: none;
      vertical-align: middle;
      border-bottom: 1px solid #ccc;
    }

    &:hover td {
      background-color: rgba(0, 0, 0, 0.075);
    }
  }

  button, .button, input[type='submit'] {
    font-size: 14px;
    padding: 3px 12px;
  }

  form {
    display: inline-block;
    margin-top: 0;
  }
}
