﻿/* ==========================================================================
   Sales Administration System
   Enterprise Table
   File        : table.css
   Description : Enterprise Table Component
   Dependency  : theme.css
   ========================================================================== */


/* ==========================================================================
   TABLE WRAPPER
   ========================================================================== */

.table-wrapper {
    background: #FFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

/* ==========================================================================
   TABLE TOOLBAR
   ========================================================================== */

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: #FFF;
}

.table-toolbar-left,
.table-toolbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   SEARCH
   ========================================================================== */

.table-search {
    position: relative;
    min-width: 260px;
}

    .table-search i {
        position: absolute;
        left: .85rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-secondary);
    }

    .table-search .form-control {
        padding-left: 2.5rem;
    }

/* ==========================================================================
   TABLE CONTAINER
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
}

/* ==========================================================================
   TABLE
   ========================================================================== */

.table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    /* ==========================================================================
   HEADER
   ========================================================================== */

    .table thead {
        position: sticky;
        top: 0;
        z-index: 10;
    }

        .table thead th {
            background: var(--table-header-bg);
            color: var(--table-header-color);
            border-bottom: 1px solid var(--border-color);
            border-top: none;
            font-weight: 600;
            font-size: .875rem;
            white-space: nowrap;
            padding: .85rem 1rem;
            vertical-align: middle;
        }

    /* ==========================================================================
   BODY
   ========================================================================== */

    .table tbody td {
        padding: .85rem 1rem;
        vertical-align: middle;
        border-bottom: 1px solid var(--table-border);
        background: white;
    }

    /* ==========================================================================
   FOOTER
   ========================================================================== */

    .table tfoot td {
        background: var(--table-header-bg);
        border-top: 1px solid var(--border-color);
    }

/* ==========================================================================
   HOVER
   ========================================================================== */

.table-hover tbody tr:hover {
    background: var(--table-hover);
}

    .table-hover tbody tr:hover td {
        background: var(--table-hover);
    }

/* ==========================================================================
   STRIPED
   ========================================================================== */

.table-striped tbody tr:nth-child(even) td {
    background: var(--table-striped);
}

/* ==========================================================================
   BORDERLESS
   ========================================================================== */

.table-borderless td,
.table-borderless th {
    border: none;
}

/* ==========================================================================
   COMPACT
   ========================================================================== */

.table-sm td {
    padding: .55rem .75rem;
}

.table-sm th {
    padding: .60rem .75rem;
}

/* ==========================================================================
   ALIGNMENT
   ========================================================================== */

.table .text-start {
    text-align: left;
}

.table .text-center {
    text-align: center;
}

.table .text-end {
    text-align: right;
}

/* ==========================================================================
   STICKY COLUMN
   ========================================================================== */

.table-sticky-start {
    position: sticky;
    left: 0;
    z-index: 11;
    background: inherit;
}

.table-sticky-end {
    position: sticky;
    right: 0;
    z-index: 11;
    background: inherit;
}

/* ==========================================================================
   SORT ICON
   ========================================================================== */

th.sorting,
th.sorting_asc,
th.sorting_desc {
    cursor: pointer;
}

/* ==========================================================================
   CHECKBOX COLUMN
   ========================================================================== */

.table-checkbox {
    width: 48px;
    text-align: center;
}

/* ==========================================================================
   ACTION COLUMN
   ========================================================================== */

.table-action {
    width: 70px;
    text-align: center;
}

/* ==========================================================================
   STATUS COLUMN
   ========================================================================== */

.table-status {
    width: 140px;
}

/* ==========================================================================
   NUMBER COLUMN
   ========================================================================== */

.table-number {
    text-align: right;
}

/* ==========================================================================
   TABLE TITLE
   ========================================================================== */

.table-title {
    font-weight: 600;
}

.table-subtitle {
    font-size: .80rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   LOADING
   ========================================================================== */

.table-loading {
    height: 250px;
}

    .table-loading td {
        text-align: center;
        vertical-align: middle;
    }

/* ==========================================================================
   EMPTY
   ========================================================================== */

.table-empty {
    padding: 3rem;
    text-align: center;
}

    .table-empty i {
        font-size: 3rem;
        color: #CED4DA;
        margin-bottom: 1rem;
    }

.table-empty-title {
    font-weight: 600;
    margin-bottom: .5rem;
}

.table-empty-description {
    color: var(--text-secondary);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: white;
}

.table-footer-left {
    color: var(--text-secondary);
}

.table-footer-right {
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ==========================================================================
   DATATABLE
   ========================================================================== */

.dataTables_wrapper {
    width: 100%;
}

.dataTables_length {
    margin-bottom: 1rem;
}

.dataTables_filter {
    display: none;
}

.dataTables_info {
    padding-top: 0 !important;
    color: var(--text-secondary);
}

.dataTables_paginate {
    padding-top: 0 !important;
}

/* ==========================================================================
   PAGINATION BUTTON
   ========================================================================== */

.dataTables_wrapper .paginate_button {
    min-width: 34px;
    height: 34px;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
}

    .dataTables_wrapper .paginate_button.current {
        background: var(--color-primary) !important;
        color: white !important;
        border-color: var(--color-primary) !important;
    }

/* ==========================================================================
   ROW SELECTED
   ========================================================================== */

.table tbody tr.selected td {
    background: rgba(11,61,145,.08);
}

/* ==========================================================================
   CLICKABLE ROW
   ========================================================================== */

.table-row-clickable {
    cursor: pointer;
}

/* ==========================================================================
   EXPAND ROW
   ========================================================================== */

.table-expand {
    width: 40px;
    text-align: center;
}

/* ==========================================================================
   IMAGE CELL
   ========================================================================== */

.table-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

/* ==========================================================================
   TOOLBAR FILTER
   ========================================================================== */

.table-filter-group {
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width:992px) {

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-toolbar-left,
    .table-toolbar-right {
        width: 100%;
    }

    .table-search {
        min-width: 100%;
    }
}

@media (max-width:768px) {

    .table-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .table thead th,
    .table tbody td {
        white-space: nowrap;
    }
}
