/* DataTables Dark Mode & Modern Polish */
.dark .dataTables_wrapper {
    color: #cbd5e1;
}

.dark .dataTables_wrapper .dataTables_length,
.dark .dataTables_wrapper .dataTables_filter,
.dark .dataTables_wrapper .dataTables_info,
.dark .dataTables_wrapper .dataTables_processing,
.dark .dataTables_wrapper .dataTables_paginate {
    color: #94a3b8 !important;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
    outline: none;
    margin-left: 0.5rem;
}

.dark .dataTables_wrapper .dataTables_filter input {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
}

.dark .dataTables_wrapper .dataTables_length select {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

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

.dark table.dataTable thead th {
    border-bottom: 2px solid #334155 !important;
    color: #94a3b8 !important;
}

table.dataTable tbody td {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 0.85rem 1rem !important;
    font-size: 0.875rem !important;
}

.dark table.dataTable tbody td {
    border-bottom: 1px solid #1e293b !important;
    color: #e2e8f0 !important;
}

.dark table.dataTable tbody tr {
    background-color: transparent !important;
}

.dark table.dataTable tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.5) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.375rem !important;
    border: 1px solid transparent !important;
    padding: 0.3rem 0.6rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border: 1px solid #4f46e5 !important;
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #cbd5e1 !important;
}

.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

/* Custom form inputs styling */
.form-input, .form-select, .form-textarea {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.15s ease-in-out;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.dark .form-input, .dark .form-select, .dark .form-textarea {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .form-input:focus, .dark .form-select:focus, .dark .form-textarea:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

/* Completely remove sorting styling, icons, and click cursors on no-sort/checkbox headers */
table.dataTable thead th.no-sort,
table.dataTable thead th.no-sort.sorting,
table.dataTable thead th.no-sort.sorting_asc,
table.dataTable thead th.no-sort.sorting_desc,
table.dataTable thead th[data-orderable="false"],
table.dataTable thead th:has(input[type="checkbox"]) {
    background-image: none !important;
    cursor: default !important;
    padding-right: 0.75rem !important;
}

table.dataTable thead th.no-sort:before,
table.dataTable thead th.no-sort:after,
table.dataTable thead th.no-sort::before,
table.dataTable thead th.no-sort::after,
table.dataTable thead th[data-orderable="false"]:before,
table.dataTable thead th[data-orderable="false"]:after,
table.dataTable thead th[data-orderable="false"]::before,
table.dataTable thead th[data-orderable="false"]::after,
table.dataTable thead th:has(input[type="checkbox"])::before,
table.dataTable thead th:has(input[type="checkbox"])::after {
    display: none !important;
    content: "" !important;
}

/* Global search styles */
#global-search-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.dark #global-search-dropdown {
    scrollbar-color: #475569 transparent;
}
.search-result-item.selected {
    background-color: #eef2ff !important;
}
.dark .search-result-item.selected {
    background-color: rgba(99, 102, 241, 0.25) !important;
}

