//
// tables.scss
//

@use "../variables" as *;
@use "../utils/mixins" as *;
@use "sass:map";

.table{
    background-color: $white;
    margin-bottom: 0 !important;
    thead{
        tr{
            th {
                font-weight: $font-weight-semibold;
                padding: 12px 16px;
                color: $heading-color;
            }
        }
    }
    tbody {
        tr{
            td{
                padding: 12px 16px 12px 16px !important; 
                color: $body-color;
                    vertical-align: middle;
            }
        }
        td {
            vertical-align: middle;
        }
    }
}

th {
    font-weight: $font-weight-semibold;
    color: $gray-900;
}

.thead-sm {
    > * > * {
        padding: 0.5rem 0.5rem !important;
    }
}
.table.table-dark > :not(caption) > * > * {
    background-color: #0B0D0E !important;
    border-color: rgba(255, 255, 255, 0.1);
}
.table-custom {
    tfoot > tr > th:first-child, 
    thead > tr > th:first-child, 
    tr th:first-child, 
    tr td:first-child {
        padding-left: 1.125rem !important;
    }

    tfoot > tr > th:last-child, 
    thead > tr > th:last-child, 
    tr th:last-child, 
    tr td:last-child {
        padding-right: 1.125rem !important;
    }
}

// Tables fluid
.table-nowrap {

    th,
    td {
        white-space: nowrap;
        color: $gray-600;
    }
}
.table tbody th {
    vertical-align: middle;
    padding: 12px 16px 12px 16px !important;
}
.table-light th {
    background: $light !important;
}
.action-item > a {
    width: 22px;
    height: 22px;
    border: 1px solid $border-color;
    border-radius: 7px;
    color: $gray-500;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: $box-shadow;
}

.table-header{
    padding: 8px 16px;
}

.table-search {
    margin-bottom: 20px;
}
.table.dataTable th {
    padding: 8px 16px;
}
.search-input {
    input {
        font-size: 12px;
    }
    .btn-searchset {
        border-radius: 50px;
    }
}

table.dataTable>thead .sorting:before, table.dataTable>thead .sorting_asc:before, table.dataTable>thead .sorting_desc:before, table.dataTable>thead .sorting_asc_disabled:before, table.dataTable>thead .sorting_desc_disabled:before {
    right: 5px !important;
    content: "\ea1d" !important;
    font-family: "tabler-icons";
    top: 50% !important;
    color: var(--gray-900) !important;
    font-size: 12px !important;
    opacity: 1 !important;
    position: absolute;
    font-weight: 400;
    line-height: 1px !important;
}

table.dataTable>thead .sorting:after, table.dataTable>thead .sorting_asc:after, table.dataTable>thead .sorting_desc:after, table.dataTable>thead .sorting_asc_disabled:after, table.dataTable>thead .sorting_desc_disabled:after {
    right: 0 !important;
    content: "\ea1a" !important;
    font-family: "tabler-icons";
    bottom: 12px !important;
    color: var(--gray-900) !important;
    font-size: 12px !important;
    opacity: 1 !important;
    position: absolute;
    font-weight: 400;
    line-height: 1px !important;
}
.table-dark th {
    color: $white !important;
}

.border-primary {
  thead {
    tr {
      th {
        border-color: $primary !important;
      }
    }
  }
}
.border-success {
  thead {
    tr {
      th {
        border-color: $success !important;
      }
    }
  }
}
@each $state in map.keys($theme-colors) {
    .table > :not(caption) > .table-#{$state} > * {
        background-color: var(--#{$state});
        border-color: rgb(var(--#{$state}-rgb), 0.1);
        color: #fff;
    }
}
