@import (reference) '../../../../design/index.less';
@border-color: #cecece4d;

.basic-table {
  &-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  &-row__striped {
    td {
      background: #fafafa;
    }
  }

  &-img__preview {
    display: flex;

    img {
      margin-right: 4px;
    }
  }

  &-action {
    display: flex;
  }

  &-toolbar {
    display: flex;
    align-items: center;

    > * {
      margin-right: 10px;
    }
  }

  .ant-table-wrapper {
    padding: 8px;
    background: #fff;
    border-radius: 2px;

    .ant-table-title {
      padding: 0 0 8px 0 !important;
    }

    .ant-table.ant-table-bordered .ant-table-title {
      border: none !important;
    }
  }

  &.inset {
    .ant-table-wrapper {
      padding: 0;
    }
  }

  //
  .ant-table {
    border: none;

    &-title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 6px;
      border-bottom: none;
    }

    .ant-table-thead > tr > th,
    .ant-table-header {
      background: #f1f3f4;
      background-color: #f1f3f4 !important;
    }

    .ant-table-tbody > tr.ant-table-row-selected td {
      background: fade(@primary-color, 8%) !important;
    }
  }

  .ant-table-bordered .ant-table-header > table,
  .ant-table-bordered .ant-table-body > table,
  .ant-table-bordered .ant-table-fixed-left table,
  .ant-table-bordered .ant-table-fixed-right table {
    border: 1px solid @border-color !important;
  }

  .ant-table-thead {
    tr {
      border: none;
    }

    th {
      border: none;
    }
  }

  .ant-table-bordered .ant-table-tbody > tr > td {
    border-bottom: 1px solid @border-color !important;

    &:last-child {
      border-right: none !important;
    }
  }

  .ant-table.ant-table-bordered .ant-table-footer,
  .ant-table.ant-table-bordered .ant-table-title {
    border: 1px solid @border-color !important;
  }

  .ant-table-bordered.ant-table-empty .ant-table-placeholder {
    border: 1px solid @border-color !important;
  }

  .ant-table td {
    white-space: nowrap;
  }

  .ant-table-row-cell-last {
    border-right: none !important;
  }

  .ant-table-bordered .ant-table-thead > tr > th,
  .ant-table-bordered .ant-table-tbody > tr > td {
    border-right: 1px solid @border-color !important;
  }

  .ant-pagination {
    margin: 10px 0 0 0;
  }

  .ant-table-body {
    overflow-x: auto !important;
    overflow-y: scroll !important;
  }

  .ant-table-header {
    margin-bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
  }

  .ant-table-fixed-right .ant-table-header {
    border-left: 1px solid @border-color !important;

    .ant-table-fixed {
      border-bottom: none;

      .ant-table-thead th {
        background: rgb(241, 243, 244);
      }
    }
  }

  .ant-table-fixed-left {
    .ant-table-header {
      overflow-y: hidden !important;
    }

    .ant-table-fixed {
      border-bottom: none;
    }
  }

  .ant-radio {
    &-inner {
      border-color: @text-color-base;
    }
  }

  .ant-checkbox {
    &:not(.ant-checkbox-checked) {
      .ant-checkbox-inner {
        border-color: @text-color-base;
      }
    }
  }

  .ant-table-bordered .ant-table-thead > tr:not(:last-child) > th,
  .ant-table-tbody > tr > td {
    word-break: break-word;
    border-color: @border-color !important;
  }

  .ant-table-footer {
    padding: 0;

    .ant-table-wrapper {
      padding: 0;
    }

    table {
      border: none !important;
    }

    .ant-table-body {
      overflow-x: hidden !important;
      overflow-y: scroll !important;
    }

    td {
      padding: 12px 8px;
    }
  }
}

.table-form-container {
  padding: 16px;

  .ant-form {
    padding: 20px 20px 4px 12px;
    margin-bottom: 18px;
    background: #fff;
    border-radius: 2px;
  }

  .ant-table-wrapper {
    border-radius: 2px;
  }
}
