/* =========================================================
   Shared DataTables theme
   Applies to every table initialised through jQuery DataTables
   so all admin lists look consistent.
   ========================================================= */

.dataTables_wrapper {
    font-family: inherit;
    color: var(--app-ink, #0f2036);
    margin-bottom: 6px;
}

.dataTables_wrapper::after {
    content: '';
    display: block;
    clear: both;
}

/* ---------- Length + search controls ---------- */
html body div.dataTables_wrapper div.dataTables_length,
html body div.dataTables_wrapper div.dataTables_filter {
    margin-bottom: 16px;
    font-size: 13px;
    color: #607d8b;
}

html body div.dataTables_wrapper div.dataTables_length label,
html body div.dataTables_wrapper div.dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
    color: #546e7a;
    white-space: nowrap;
}

html body div.dataTables_wrapper div.dataTables_length select {
    width: auto !important;
    min-width: 78px;
    height: 38px !important;
    margin-left: 0 !important;
    padding: 6px 30px 6px 12px !important;
    border: 1px solid #dbe6f1 !important;
    border-radius: 8px !important;
    background-color: #fff !important;
    color: #0f2036 !important;
    font-size: 13px !important;
    font-weight: 500;
    box-shadow: none !important;
}

html body div.dataTables_wrapper div.dataTables_filter input {
    width: 260px !important;
    max-width: 100%;
    height: 38px !important;
    margin-left: 0 !important;
    padding: 6px 12px !important;
    border: 1px solid #dbe6f1 !important;
    border-radius: 8px !important;
    background-color: #fff !important;
    color: #0f2036 !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

html body div.dataTables_wrapper div.dataTables_filter input:focus,
html body div.dataTables_wrapper div.dataTables_length select:focus {
    outline: 0 !important;
    border-color: #1e88e5 !important;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, .12) !important;
}

/* ---------- Table ---------- */
html body table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #e3ebf4 !important;
    border-radius: 12px;
    font-size: 14px;
}

html body table.dataTable thead th {
    padding: 13px 16px !important;
    background: #f6f9fd !important;
    color: #607d8b !important;
    border: 0 !important;
    border-bottom: 1px solid #e3ebf4 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

html body table.dataTable thead th:first-child {
    border-top-left-radius: 11px;
}

html body table.dataTable thead th:last-child {
    border-top-right-radius: 11px;
}

html body table.dataTable tbody td {
    padding: 14px 16px !important;
    border: 0 !important;
    border-bottom: 1px solid #eef3f9 !important;
    vertical-align: middle;
    color: #263238;
    background-color: transparent;
}

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

html body table.dataTable tbody tr {
    background-color: #fff;
}

html body table.dataTable.stripe tbody tr.odd,
html body table.dataTable.display tbody tr.odd {
    background-color: #fafcff;
}

html body table.dataTable tbody tr:hover,
html body table.dataTable.hover tbody tr:hover,
html body table.dataTable.display tbody tr:hover {
    background-color: #f2f8ff !important;
}

html body table.dataTable tbody tr.selected {
    background-color: #e3f2fd !important;
}

/* Disable the old Bootstrap zebra/table-bordered look */
html body table.dataTable.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: transparent !important;
    box-shadow: none !important;
}

html body table.dataTable.table-bordered thead th,
html body table.dataTable.table-bordered tbody td {
    border-left: 0 !important;
    border-right: 0 !important;
}

html body table.dataTable td.dataTables_empty {
    padding: 30px 16px !important;
    color: #90a4ae !important;
    text-align: center;
}

/* ---------- Sorting indicators ---------- */
html body table.dataTable thead th.sorting,
html body table.dataTable thead th.sorting_asc,
html body table.dataTable thead th.sorting_desc,
html body table.dataTable thead th.sorting_asc_disabled,
html body table.dataTable thead th.sorting_desc_disabled {
    position: relative;
    padding-right: 30px !important;
    background-image: none !important;
    cursor: pointer;
}

html body table.dataTable thead th.sorting::after,
html body table.dataTable thead th.sorting_asc::after,
html body table.dataTable thead th.sorting_desc::after,
html body table.dataTable thead th.sorting_asc_disabled::after,
html body table.dataTable thead th.sorting_desc_disabled::after {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-family: FontAwesome;
    font-size: 11px;
    font-weight: normal;
    line-height: 1;
    color: #b0bec5;
    opacity: 1;
}

html body table.dataTable thead th.sorting:hover::after {
    color: #78909c;
}

html body table.dataTable thead th.sorting::after { content: '\f0dc'; }
html body table.dataTable thead th.sorting_asc::after { content: '\f0de'; color: #1565c0; }
html body table.dataTable thead th.sorting_desc::after { content: '\f0dd'; color: #1565c0; }
html body table.dataTable thead th.sorting_asc_disabled::after,
html body table.dataTable thead th.sorting_desc_disabled::after { content: ''; }

/* ---------- Info + pagination ---------- */
html body div.dataTables_wrapper div.dataTables_info {
    padding-top: 14px;
    font-size: 13px;
    color: #78909c;
}

html body div.dataTables_wrapper div.dataTables_paginate {
    padding-top: 9px;
}

html body div.dataTables_wrapper div.dataTables_paginate .paginate_button,
html body div.dataTables_wrapper div.dataTables_paginate .paginate_button.current,
html body div.dataTables_wrapper div.dataTables_paginate .paginate_button:hover {
    float: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    margin: 0 3px !important;
    padding: 0 10px !important;
    border: 1px solid #dbe6f1 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #455a64 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

html body div.dataTables_wrapper div.dataTables_paginate .paginate_button:hover {
    background: #e3f2fd !important;
    border-color: #90caf9 !important;
    color: #1565c0 !important;
}

html body div.dataTables_wrapper div.dataTables_paginate .paginate_button.current,
html body div.dataTables_wrapper div.dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%) !important;
    border-color: #1565c0 !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(21, 101, 192, .22) !important;
}

html body div.dataTables_wrapper div.dataTables_paginate .paginate_button.disabled,
html body div.dataTables_wrapper div.dataTables_paginate .paginate_button.disabled:hover {
    opacity: .45 !important;
    background: #f7fafd !important;
    border-color: #e3ebf4 !important;
    color: #90a4ae !important;
    box-shadow: none !important;
    cursor: default;
}

/* ---------- Export buttons (DataTables Buttons) ---------- */
html body div.dt-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

html body div.dt-buttons .dt-button,
html body div.dt-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 14px !important;
    border: 1px solid #cfdce9 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #0f2036 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

html body div.dt-buttons .dt-button:hover,
html body div.dt-buttons .btn:hover {
    background: #e3f2fd !important;
    border-color: #90caf9 !important;
    color: #1565c0 !important;
}

/* ---------- Desktop control layout ---------- */
@media (min-width: 768px) {
    html body div.dataTables_wrapper div.dataTables_length {
        float: left;
    }

    html body div.dataTables_wrapper div.dataTables_filter {
        float: right;
        text-align: right;
    }

    html body div.dataTables_wrapper div.dataTables_info {
        float: left;
    }

    html body div.dataTables_wrapper div.dataTables_paginate {
        float: right;
        text-align: right;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    html body div.dataTables_wrapper div.dataTables_length,
    html body div.dataTables_wrapper div.dataTables_filter {
        float: none !important;
        width: 100% !important;
        text-align: left !important;
        margin-bottom: 10px;
    }

    html body div.dataTables_wrapper div.dataTables_filter input {
        width: 100% !important;
    }

    html body div.dataTables_wrapper div.dataTables_info,
    html body div.dataTables_wrapper div.dataTables_paginate {
        float: none !important;
        width: 100% !important;
        text-align: center !important;
    }

    html body div.dataTables_wrapper div.dataTables_paginate {
        margin-top: 6px;
    }
}
