/* ============================
   DataTables — Clean Style
   Reference: Products List UI
   ============================ */

/* Spacing between Card Header and DataTables */
.card-body div.dataTables_wrapper {
    padding-top: 1.25rem;
}

/* -- Wrapper top controls -- */
.datatables div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_length {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7c8fac;
    font-size: 0.875rem;
}
.datatables div.dataTables_wrapper div.dataTables_length label,
div.dataTables_wrapper div.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    font-weight: 600;
    color: #7c8fac;
}
.datatables div.dataTables_wrapper div.dataTables_length select,
div.dataTables_wrapper div.dataTables_length select {
    height: 34px;
    min-width: 64px;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    padding: 4px 28px 4px 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #2a3547;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(93, 135, 255, 0.08);
    cursor: pointer;
    appearance: auto;
}

/* -- Search input -- */
.datatables div.dataTables_wrapper div.dataTables_filter,
div.dataTables_wrapper div.dataTables_filter {
    text-align: right;
}
.datatables div.dataTables_wrapper div.dataTables_filter label,
div.dataTables_wrapper div.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 0;
    font-weight: 600;
    font-size: 0.875rem;
    color: #7c8fac;
}
.datatables div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_filter input {
    height: 34px;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.875rem;
    color: #2a3547;
    background-color: #fff;
    outline: none;
    transition: border-color 0.2s;
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(93, 135, 255, 0.08);
}
.datatables div.dataTables_wrapper div.dataTables_filter input:focus,
div.dataTables_wrapper div.dataTables_filter input:focus {
    border-color: var(--bs-primary);
    background-color: #fff;
}

/* -- Table borders: minimal bottom border only -- */
.datatables table.dataTable,
table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
}
.datatables table.dataTable thead th,
.datatables table.dataTable thead td,
table.dataTable thead th,
table.dataTable thead td {
    border-top: none !important;
    border-bottom: 1px solid #edf2f7 !important;
    font-size: 0.78rem;
    font-weight: 600;
    color: #7c8fac;
    letter-spacing: 0.02em;
    padding: 14px 16px;
    background-color: #fafcff;
}
.datatables table.dataTable tbody tr td,
table.dataTable tbody tr td {
    border-top: none !important;
    border-bottom: 1px solid #edf2f7 !important;
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #2a3547;
    background-color: #fff;
}
.datatables table.dataTable tbody tr:last-child td,
table.dataTable tbody tr:last-child td {
    border-bottom: none !important;
}
.datatables table.dataTable tbody tr:hover td,
table.dataTable tbody tr:hover td {
    background-color: #f5f9ff;
}

/* -- Info text (Showing X to Y of Z) -- */
.datatables div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_info {
    font-size: 0.85rem;
    color: #7c8fac;
    padding-top: 0;
}

/* ========================
   PAGINATION — Clean Style
   ======================== */
.datatables div.dataTables_wrapper .dataTables_paginate,
div.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.datatables div.dataTables_wrapper .dataTables_paginate .pagination,
div.dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0;
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.datatables div.dataTables_wrapper .dataTables_paginate .page-item,
div.dataTables_wrapper .dataTables_paginate .page-item {
    display: flex;
}
/* Remove legacy Datatables button box styling */
.datatables div.dataTables_wrapper .dataTables_paginate .paginate_button,
div.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.datatables div.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
div.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: transparent !important;
}
/* Bootstrap adds negative margins to collapse borders. Remove for spaced buttons. */
.datatables
    div.dataTables_wrapper
    .dataTables_paginate
    .page-item:not(:first-child)
    .page-link,
div.dataTables_wrapper
    .dataTables_paginate
    .page-item:not(:first-child)
    .page-link {
    margin-left: 0;
}
/* Reset Bootstrap page-link defaults */
.datatables div.dataTables_wrapper .dataTables_paginate .page-link,
div.dataTables_wrapper .dataTables_paginate .page-link {
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #7c8fac;
    border: 1px solid #e6edf5;
    background: #fff;
    border-radius: 50% !important;
    transition: all 0.18s ease;
    line-height: 1;
    box-shadow: none;
    white-space: nowrap;
}
/* Number pages: circles */
.datatables
    div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button:not(.previous):not(.next)
    .page-link,
div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button:not(.previous):not(.next)
    .page-link {
    width: 36px;
    border-radius: 50% !important;
}
/* Active page number */
.datatables
    div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button.active
    .page-link,
div.dataTables_wrapper .dataTables_paginate .paginate_button.active .page-link {
    background-color: #5d87ff !important;
    border-color: #5d87ff !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(93, 135, 255, 0.35) !important;
}
/* Hover on non-active, non-disabled */
.datatables
    div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button:not(.active):not(.disabled):hover
    .page-link,
div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button:not(.active):not(.disabled):hover
    .page-link {
    background-color: #5d87ff;
    border-color: #5d87ff;
    color: #fff;
}
/* Disabled state */
.datatables
    div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button.disabled
    .page-link,
div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button.disabled
    .page-link {
    color: #c5cdd8 !important;
    background-color: #fff !important;
    border-color: #e8eef4 !important;
    pointer-events: none;
    cursor: default;
}
/* Previous button */
.datatables
    div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button.previous
    .page-link,
div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button.previous
    .page-link {
    width: auto !important;
    min-width: 80px;
    border-radius: 8px !important;
    padding: 0 16px !important;
    font-size: 0.82rem;
    font-weight: 500;
    color: #7c8fac;
}
/* Next button */
.datatables
    div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button.next
    .page-link,
div.dataTables_wrapper .dataTables_paginate .paginate_button.next .page-link {
    width: auto !important;
    min-width: 70px;
    border-radius: 8px !important;
    padding: 0 16px !important;
    font-size: 0.82rem;
    font-weight: 500;
    color: #7c8fac;
}
/* Ellipsis …  */
.datatables
    div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button.disabled:not(.previous):not(.next)
    .page-link,
div.dataTables_wrapper
    .dataTables_paginate
    .paginate_button.disabled:not(.previous):not(.next)
    .page-link {
    border-color: transparent !important;
    background: transparent !important;
    color: #adb5bd !important;
    pointer-events: none;
    min-width: 20px;
}

@media (max-width: 575.98px) {
    .datatables div.dataTables_wrapper .dataTables_paginate,
    div.dataTables_wrapper .dataTables_paginate {
        justify-content: center;
    }
    .datatables
        div.dataTables_wrapper
        .dataTables_paginate
        .paginate_button.previous
        .page-link,
    .datatables
        div.dataTables_wrapper
        .dataTables_paginate
        .paginate_button.next
        .page-link,
    div.dataTables_wrapper
        .dataTables_paginate
        .paginate_button.previous
        .page-link,
    div.dataTables_wrapper
        .dataTables_paginate
        .paginate_button.next
        .page-link {
        min-width: 64px;
        padding: 0 12px !important;
        font-size: 0.78rem;
    }
}
