.table {
  color: $font-color;
  margin-bottom: 0;
}

.table-middle {
  td {
    vertical-align: middle;
  }
}

.table-text-center {
  th {
    text-align: center;
  }
  td {
    text-align: center;
  }
}

table.dataTable thead tr {
  background: transparent;
}

.table th {
  padding: .9rem;
  text-transform: capitalize;
  font-size: .95rem!important;
}

table.dataTable thead th, table.dataTable thead td, table.dataTable tfoot th, table.dataTable tfoot td {
  font-size: .9rem!important;
}

table.dataTable:not(.table-bordered) thead tr th {
  text-transform: capitalize;
}

table.dataTable {
  border: 0;
}

.table td {
  padding: .55rem;
  //height: 62px;
  line-height: 1.42857;
}

.table tr td:first-child, .table tr th:first-child {
  padding-left: 1.4rem;
}


.card-header.custom-data-table-header .table-responsive .top .dataTables_filter .form-control {
  box-shadow: $shadow-100;
}

.quick-search-clear {
  margin-left:-1.45rem;
  position: relative;
  color: $white;
}

// 解决 rwd-table 下拉选框显示bug
.table-responsive {
  border: 0!important;
  margin-bottom: 0!important;
  overflow-x: inherit;
}
.table-responsive[data-pattern=priority-columns] {
  overflow-y: auto!important;
}
.custom-data-table-header .table-responsive {
  overflow: visible!important;
  padding-bottom: 0!important;
}
.sticky-table-header {
  z-index: 45!important;
}

// 解决 rwd-table 下拉选框显示bug


table.table-bordered.dataTable:not(.complex-headers) tbody th, table.table-bordered.dataTable tbody td {
  border-bottom-width: 1px
}
table.table-bordered.dataTable th:not(.complex-headers), table.table-bordered.dataTable td {
  border-left-width: 1px;
}
table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable th:last-child, table.table-bordered.dataTable td:last-child, table.table-bordered.dataTable td:last-child {
  border-right-width: 1px;
}

table.dataTable.complex-headers {
  border: 1px solid $table-border-color;
}
table.dataTable.complex-headers thead th, table.dataTable.complex-headers thead td, table.dataTable.complex-headers tfoot th, table.dataTable.complex-headers tfoot td {
  border-bottom: 1px solid $table-border-color;
  border-right: 1px solid $table-border-color;
}

.dataTable.table-bordered:not(.complex-headers) thead th {
  border-right: 1px solid darken($border-color, 3%);
  border-bottom: 1px solid darken($border-color, 3%);
}
.dataTable.table-bordered:not(.complex-headers) tr:first-child th {
  border-top: 1px solid darken($border-color, 3%);
}
.dataTable.table-bordered:not(.complex-headers) thead tr th:first-child {
  border-left: 1px solid darken($border-color, 3%);
}

/* ------------------- 多表头 --------------------- */
table.table-bordered.dataTable.complex-headers {
  border-spacing: 0;
  margin-top: 12px!important;
  box-shadow: $shadow;

  thead th {
    vertical-align: middle;
    font-size: 1rem!important;
  }

  tbody tr {
    box-shadow: none;
    border-radius: 0;

    td {
      border-bottom: 1px solid lighten($table-border-color, 4%);
      border-right: 1px solid lighten($table-border-color, 4%);
    }

    td:first-child {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }

    td:last-child {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
      border-right: 0;
    }
  }

  tbody tr:last-child td {
    border-bottom: 0;
  }
}

.table-hover tbody tr:hover {
  color: $font-color;
  background-color: lighten($dark30, 1%);
}

/*--------------------------------------------------- */

.table.default-table {
  tr {
    box-shadow: none!important;
  }

  td {
    border-top: 1px solid #f0f4f8!important;
    border-radius: 0!important;
  }

  thead th {
    border-bottom: 2px solid #f0f4f8!important;
  }
}

.table.default-table.table-bordered th, .table.default-table.table-bordered td {
  border: 1px solid #f0f4f8!important;
}



$table-border-color: #eff3f8;

.table-collapse {
  .custom-data-table.dataTable tbody tr td:first-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  .custom-data-table.dataTable tbody tr td:last-child{
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .custom-data-table.dataTable tbody tr:first-child td:first-child {
    border-top-left-radius: $card-border-radius;
  }
  .custom-data-table.dataTable tbody tr:first-child td:last-child{
    border-top-right-radius: $card-border-radius;
  }

  .custom-data-table.dataTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: $card-border-radius;
  }
  .custom-data-table.dataTable tbody tr:last-child td:last-child{
    border-bottom-right-radius: $card-border-radius;
  }

  .table.custom-data-table {
    padding: 3px 7px 7px;
  }

  .table-fixed-left .table.custom-data-table {
    padding: 3px 0 0 7px;
  }
  .table-fixed-right .table.custom-data-table {
    padding: 3px 7px 0 0;
  }
  .table-fixed th {
    background: darken(#f7f7f9, 3.5%);
  }
}


$table-bg: darken(#f7f7f9, 3.5%);

body:not(.dark-mode) {
  .table-collapse {
    box-shadow: $shadow;
    background: $table-bg;
    margin-top: 1rem;

    .custom-data-table {
      border-spacing: 0;
      //border-collapse:collapse!important;
      margin-top: 0!important;
      background-color: $table-bg;
      //border-radius: $card-border-radius;
    }

    table.custom-data-table.dataTable thead th {
      //border-top: 1px solid $table-border-color;
      //border-bottom: 2px solid $table-border-color;
      height: 24px;
      vertical-align: middle;
      //background: $white;
    }

    .custom-data-table.dataTable tbody td {
      border-top: 1px solid $table-border-color;
      height: 45px;
    }

    .custom-data-table.dataTable tbody tr:first-child td {
      border-top: 0
    }

    table.custom-data-table.dataTable tbody tr {
      box-shadow: none;
    }

    .quick-create td {
      background: #f7f7f9 !important;
      border-radius: 0;
    }
  }
}

body.dark-mode {
  .table-collapse {
    table {
      border-spacing: 0 0.24rem;
    }

    table.custom-data-table.dataTable tbody td {
      height: 38px;
    }

    .table.custom-data-table {
      padding: 5px 10px 10px;
    }

    .table-fixed-left .table.custom-data-table {
      padding: 5px 0 0 10px;
    }
    .table-fixed-right .table.custom-data-table {
      padding: 5px 10px 0 0;
    }
  }

  //.table-fixed-left .table.custom-data-table {
  //  padding: 5px 0 0 10px;
  //}
  //.table-fixed-right .table.custom-data-table {
  //  padding: 5px 10px 0 0;
  //}
}