/* DataTables Bootstrap 5 to Tailwind override */

.dataTables_wrapper {
    font-size: 0.875rem;
    color: #334155;
}

/* Toolbar: length + filter */
.dataTables_wrapper .row:first-child {
    margin-bottom: 1rem;
}

.dataTables_length label,
.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #475569;
}

.dataTables_length select,
.dataTables_filter input {
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    background-color: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dataTables_length select:focus,
.dataTables_filter input:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.dataTables_filter input {
    min-width: 220px;
}

/* Table */
table.dataTable {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.75rem;
    overflow: hidden;
}

table.dataTable thead th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

table.dataTable tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

table.dataTable tbody tr:hover {
    background-color: #f8fafc;
}

table.dataTable tbody tr.odd {
    background-color: #ffffff;
}

table.dataTable tbody tr.even {
    background-color: #fafafa;
}

/* Sorting icons */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none !important;
    position: relative;
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.75rem;
}

table.dataTable thead .sorting::after {
    content: "\f0dc";
}

table.dataTable thead .sorting_asc::after {
    content: "\f0de";
    color: #1e3a8a;
}

table.dataTable thead .sorting_desc::after {
    content: "\f0dd";
    color: #1e3a8a;
}

/* Pagination */
.dataTables_paginate .pagination {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 1rem 0 0 0;
    justify-content: flex-end;
}

.dataTables_paginate .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: #475569;
    background-color: white;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.dataTables_paginate .page-item .page-link:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.dataTables_paginate .page-item.active .page-link {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
    color: white;
}

.dataTables_paginate .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info text */
.dataTables_info {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 1rem;
}

/* Processing indicator */
.dataTables_processing {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Responsive child row */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    background-color: #1e3a8a !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0.375rem !important;
    line-height: 1rem !important;
    font-size: 0.75rem !important;
}
