/* DataTables skin tuned for Tabler + Bootstrap 5 */
:root {
    --fun-primary: #2563eb;
    --fun-primary-hover: #1d4ed8;
    --fun-border: #e5e7eb;
    --fun-muted: #64748b;
    --fun-heading: #0f172a;
    --fun-surface: #ffffff;
    --fun-soft: #f8fafc;
}

.datatable-card {
    border: 1px solid var(--fun-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.datatable-card .card-header {
    background: var(--fun-surface);
    border-bottom: 1px solid var(--fun-border);
    padding: 1rem 1.25rem;
}

.datatable-card .card-header strong {
    color: var(--fun-heading);
    font-size: 0.95rem;
    font-weight: 650;
}

.datatable-card .card-body {
    padding: 1rem;
}

.dataTables_wrapper {
    color: #334155;
    font-size: 0.875rem;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
}

.dataTables_wrapper .dataTables_scroll,
.dataTables_wrapper .dataTables_scrollHead,
.dataTables_wrapper .dataTables_scrollBody,
.dataTables_wrapper .dataTables_scrollFoot {
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

table.dataTable tbody tr {
    min-height: 0 !important;
    height: auto !important;
}

table.dataTable tbody tr:empty,
table.dataTable tbody tr:blank {
    display: none !important;
}

.dataTables_wrapper .dataTables_scrollBody {
    border-bottom: 1px solid var(--fun-border) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper > .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 0.75rem;
    align-items: center;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    float: none;
    margin: 0;
    padding: 0;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fun-muted);
    font-size: 0.8125rem;
    margin: 0;
}

.dataTables_wrapper .dataTables_filter label {
    justify-content: flex-end;
    width: 100%;
}

.dataTables_wrapper .form-select,
.dataTables_wrapper .form-control,
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #1e293b;
    font-size: 0.8125rem;
    min-height: 34px;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_length select {
    min-width: 76px;
    padding: 0.375rem 2rem 0.375rem 0.625rem;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0;
    max-width: 260px;
    padding: 0.375rem 0.75rem;
    width: min(260px, 100%);
}

.dataTables_wrapper .form-select:focus,
.dataTables_wrapper .form-control:focus,
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--fun-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    outline: 0;
}

.table-responsive {
    border-radius: 8px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table.dataTable,
.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
    margin: 0 !important;
    max-width: none !important;
    min-width: 100%;
    width: 100% !important;
}

.dataTables_scrollHead {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.dataTables_scrollBody {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.dataTables_scrollBody table.dataTable {
    margin-top: 0 !important;
}

.dataTables_scrollHead table.dataTable {
    margin-bottom: 0 !important;
}

table.dataTable thead tr {
    height: auto;
    line-height: normal;
}

table.dataTable thead tr[style*="height: 0"] {
    display: none !important;
}

table.dataTable tbody tr:first-child td {
    border-top: 0 !important;
}

.dataTables_wrapper .dataTables_scroll {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.dataTables_wrapper .dataTables_scrollHead {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.dataTables_scrollBody table.dataTable {
    width: max-content !important;
}

.dataTable thead th,
table.dataTable thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--fun-border) !important;
    border-top: 0 !important;
    color: #475569;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem !important;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

.dataTable tbody td,
table.dataTable tbody td {
    border-bottom: 1px solid #edf2f7 !important;
    border-top: 0 !important;
    color: #334155;
    font-size: 0.8125rem;
    padding: 0.75rem 1rem !important;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.dataTable tbody td .btn,
.dataTable tbody td .badge,
.dataTable tbody td .dropdown,
.dataTable tbody td .form-check,
.dataTable tbody td.text-nowrap,
.dataTable tbody td .text-nowrap {
    overflow-wrap: normal;
    white-space: nowrap !important;
}

.dataTable tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.dataTable tbody tr:hover td {
    background: #eff6ff;
}

.dataTable tbody tr:last-child td {
    border-bottom: 0 !important;
}

.dataTable thead .sorting,
.dataTable thead .sorting_asc,
.dataTable thead .sorting_desc,
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    cursor: pointer;
    padding-right: 2rem !important;
    position: relative;
}

table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after {
    bottom: auto;
    color: #94a3b8;
    font-family: remixicon !important;
    font-size: 0.875rem;
    line-height: 1;
    opacity: 1;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

table.dataTable thead .sorting::before,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::before {
    content: "" !important;
}

table.dataTable thead .sorting::after {
    content: "\ea4e" !important;
}

table.dataTable thead .sorting_asc::after {
    color: var(--fun-primary);
    content: "\ea78" !important;
}

table.dataTable thead .sorting_desc::after {
    color: var(--fun-primary);
    content: "\ea4d" !important;
}

.dataTables_wrapper .dataTables_info {
    color: var(--fun-muted);
    font-size: 0.8125rem;
    padding-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
}

.dataTables_wrapper .pagination {
    gap: 0.25rem;
    margin: 0;
}

.dataTables_wrapper .page-link {
    align-items: center;
    border: 1px solid var(--fun-border);
    border-radius: 6px !important;
    color: #475569;
    display: inline-flex;
    font-size: 0.8125rem;
    justify-content: center;
    min-height: 34px;
    min-width: 34px;
    padding: 0.375rem 0.625rem;
}

.dataTables_wrapper .page-item.active .page-link,
.dataTables_wrapper .paginate_button.current .page-link {
    background: var(--fun-primary);
    border-color: var(--fun-primary);
    color: #fff;
}

.dataTables_wrapper .page-item:not(.disabled) .page-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--fun-primary-hover);
}

.dataTables_wrapper .page-item.disabled .page-link {
    background: #f8fafc;
    color: #cbd5e1;
}

.dataTables_wrapper .dataTables_empty {
    color: var(--fun-muted);
    font-size: 0.875rem;
    padding: 2.5rem 1rem !important;
    text-align: center;
}

.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--fun-border);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    color: var(--fun-primary);
    font-weight: 600;
    left: 50%;
    padding: 1rem 1.5rem;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.dataTable .btn,
.dataTables_wrapper .btn {
    align-items: center;
    display: inline-flex;
    gap: 0.25rem;
    justify-content: center;
    white-space: nowrap;
}

.dataTable .btn-sm {
    border-radius: 6px;
    height: 32px;
    min-width: 32px;
    padding: 0.25rem 0.5rem;
}

.dataTable .btn-sm i {
    font-size: 0.95rem;
    line-height: 1;
}

.dataTable .badge,
.dataTables_wrapper .badge {
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    text-transform: none;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .dataTables_wrapper > .row > [class*="col-"] {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter input {
        max-width: none;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        justify-content: center;
        text-align: center;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dataTable thead th,
    table.dataTable thead th,
    .dataTable tbody td,
    table.dataTable tbody td {
        padding: 0.625rem 0.75rem !important;
    }

    .dataTable,
    table.dataTable {
        font-size: 0.8125rem;
    }
}
