/* Wincos DataTable Dark Mode Styling */

/* Light Mode - Table Header */
.table thead th,
.dataTables_wrapper .table thead th,
.dataTable thead th,
table thead th,
thead th {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #cbd5e0 100%) !important;
    color: #64748b !important;
    border-bottom: 1px solid rgba(160, 174, 192, 0.2) !important;
    font-weight: 600 !important;
}

/* Dark Mode - Table Header - Ultra Specific Selectors with Higher Priority */
[data-bs-theme="dark"] .table thead th,
[data-bs-theme="dark"] .dataTables_wrapper .table thead th,
[data-bs-theme="dark"] .dataTable thead th,
[data-bs-theme="dark"] table thead th,
[data-bs-theme="dark"] thead th,
[data-bs-theme="dark"] .table>thead>tr>th,
[data-bs-theme="dark"] .dataTables_wrapper .table>thead>tr>th,
[data-bs-theme="dark"] .dataTable>thead>tr>th,
[data-bs-theme="dark"] table>thead>tr>th,
html[data-bs-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .dataTables_wrapper .table thead th,
html[data-bs-theme="dark"] .dataTable thead th,
html[data-bs-theme="dark"] table thead th,
html[data-bs-theme="dark"] thead th,
body[data-bs-theme="dark"] .table thead th,
body[data-bs-theme="dark"] .dataTables_wrapper .table thead th,
body[data-bs-theme="dark"] .dataTable thead th,
body[data-bs-theme="dark"] table thead th,
body[data-bs-theme="dark"] thead th {
    background: linear-gradient(90deg, #1a202c 0%, #2d3748 50%, #4a5568 100%) !important;
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-weight: 600 !important;
}

/* Dark Mode - Search Input and Controls */
[data-bs-theme="dark"] .dataTables_filter input[type="search"],
[data-bs-theme="dark"] .dataTables_length select,
[data-bs-theme="dark"] input[type="search"],
[data-bs-theme="dark"] select {
    background: #2d3748 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
    border-radius: 6px !important;
}

[data-bs-theme="dark"] .dataTables_filter input[type="search"]:focus,
[data-bs-theme="dark"] .dataTables_length select:focus {
    background: #374151 !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1) !important;
}

/* Dark Mode - Action Buttons */
[data-bs-theme="dark"] .btn-outline-primary {
    color: #60a5fa !important;
    border-color: #60a5fa !important;
    background: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background: #60a5fa !important;
    border-color: #60a5fa !important;
    color: #1a202c !important;
}

[data-bs-theme="dark"] .btn-outline-success {
    color: #34d399 !important;
    border-color: #34d399 !important;
    background: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-success:hover {
    background: #34d399 !important;
    border-color: #34d399 !important;
    color: #1a202c !important;
}

[data-bs-theme="dark"] .btn-outline-danger {
    color: #f87171 !important;
    border-color: #f87171 !important;
    background: transparent !important;
}

[data-bs-theme="dark"] .btn-outline-danger:hover {
    background: #f87171 !important;
    border-color: #f87171 !important;
    color: #1a202c !important;
}

/* Dark Mode - Table Body */
[data-bs-theme=dark] .table tbody td,
[data-bs-theme=dark] .dataTables_wrapper .table tbody td,
[data-bs-theme=dark] .dataTable tbody td {
    background: #2d3748 !important;
    color: #cbd5e0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Dark Mode - Table Row Hover */
[data-bs-theme=dark] .table tbody tr:hover td,
[data-bs-theme=dark] .dataTables_wrapper .table tbody tr:hover td,
[data-bs-theme=dark] .dataTable tbody tr:hover td {
    background: #4a5568 !important;
    color: #f7fafc !important;
}

/* Dark Mode - Table Striped Rows */
[data-bs-theme=dark] .table-striped tbody tr:nth-of-type(odd) td,
[data-bs-theme=dark] .dataTables_wrapper .table-striped tbody tr:nth-of-type(odd) td {
    background: #374151 !important;
}

/* Dark Mode - DataTables Wrapper */
[data-bs-theme=dark] .dataTables_wrapper {
    background: #1a202c !important;
    color: #e2e8f0 !important;
}

/* Dark Mode - DataTables Info and Pagination */
[data-bs-theme=dark] .dataTables_info,
[data-bs-theme=dark] .dataTables_length,
[data-bs-theme=dark] .dataTables_filter {
    color: #cbd5e0 !important;
}

[data-bs-theme=dark] .dataTables_filter input {
    background: #2d3748 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme=dark] .dataTables_length select {
    background: #2d3748 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
}

/* Dark Mode - Pagination */
[data-bs-theme=dark] .pagination .page-link {
    background: #2d3748 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #cbd5e0 !important;
}

[data-bs-theme=dark] .pagination .page-link:hover {
    background: #4a5568 !important;
    color: #f7fafc !important;
}

[data-bs-theme=dark] .pagination .page-item.active .page-link {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
    color: #ffffff !important;
}

/* Dark Mode - Table Container */
[data-bs-theme=dark] .card {
    background: #1a202c !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme=dark] .card-header {
    background: linear-gradient(90deg, #1a202c 0%, #2d3748 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme=dark] .card-body {
    background: #1a202c !important;
    color: #cbd5e0 !important;
}

/* Dark Mode - Buttons in Table */
[data-bs-theme=dark] .btn-primary {
    background: #4a5568 !important;
    border-color: #4a5568 !important;
}

[data-bs-theme=dark] .btn-primary:hover {
    background: #718096 !important;
    border-color: #718096 !important;
}

/* Dark Mode - Status Badges */
[data-bs-theme=dark] .badge {
    color: #1a202c !important;
}

/* Responsive Table Dark Mode */
[data-bs-theme=dark] .table-responsive {
    background: #1a202c !important;
}

/* Dark Mode - Table Borders */
[data-bs-theme=dark] .table,
[data-bs-theme=dark] .table th,
[data-bs-theme=dark] .table td {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* For
ce Dark Mode Table Header - Maximum Specificity */
[data-bs-theme="dark"] * th,
[data-bs-theme="dark"] * thead th,
[data-bs-theme="dark"] * table thead th,
[data-bs-theme="dark"] .table-responsive table thead th,
[data-bs-theme="dark"] .card .table thead th,
[data-bs-theme="dark"] .card-body .table thead th,
[data-bs-theme="dark"] div table thead th,
[data-bs-theme="dark"] .container table thead th,
[data-bs-theme="dark"] .container-fluid table thead th {
    background: #2d3748 !important;
    background-image: linear-gradient(90deg, #1a202c 0%, #2d3748 50%, #4a5568 100%) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* Override any Bootstrap or DataTables default styling */
[data-bs-theme="dark"] th[style*="background"],
[data-bs-theme="dark"] thead th[style*="background"],
[data-bs-theme="dark"] .table thead th[style*="background"] {
    background: #2d3748 !important;
    background-image: linear-gradient(90deg, #1a202c 0%, #2d3748 50%, #4a5568 100%) !important;
}

/* Force override any inline styles */
[data-bs-theme="dark"] th[style],
[data-bs-theme="dark"] thead th[style] {
    background: #2d3748 !important;
    background-image: linear-gradient(90deg, #1a202c 0%, #2d3748 50%, #4a5568 100%) !important;
    color: #e2e8f0 !important;
}

/* Additional fallback selectors */
html[data-bs-theme="dark"] th,
html[data-bs-theme="dark"] thead th,
body[data-bs-theme="dark"] th,
body[data-bs-theme="dark"] thead th {
    background: #2d3748 !important;
    background-image: linear-gradient(90deg, #1a202c 0%, #2d3748 50%, #4a5568 100%) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* DataTables Pagination - Icon Only Previous/Next Buttons */
.dataTables_paginate .paginate_button.previous,
.dataTables_paginate .paginate_button.next {
    position: relative !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: 40px !important;
}

/* Hide text content for Previous/Next buttons */
.dataTables_paginate .paginate_button.previous a,
.dataTables_paginate .paginate_button.next a {
    font-size: 0 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

/* Add icons using pseudo-elements */
.dataTables_paginate .paginate_button.previous a::before {
    content: "‹" !important;
    font-size: 18px !important;
    font-weight: bold !important;
    color: inherit !important;
}

.dataTables_paginate .paginate_button.next a::before {
    content: "›" !important;
    font-size: 18px !important;
    font-weight: bold !important;
    color: inherit !important;
}

/* Dark mode pagination icons */
[data-bs-theme="dark"] .dataTables_paginate .paginate_button.previous a::before,
[data-bs-theme="dark"] .dataTables_paginate .paginate_button.next a::before {
    color: #cbd5e0 !important;
}

[data-bs-theme="dark"] .dataTables_paginate .paginate_button.previous:hover a::before,
[data-bs-theme="dark"] .dataTables_paginate .paginate_button.next:hover a::before {
    color: #f7fafc !important;
}

/* D
ark Mode - Additional Form Controls and UI Elements */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: #2d3748 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background: #374151 !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1) !important;
}

/* Dark Mode - Dropdown Menus */
[data-bs-theme="dark"] .dropdown-menu {
    background: #2d3748 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e0 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background: #4a5568 !important;
    color: #f7fafc !important;
}

/* Dark Mode - Modal Dialogs */
[data-bs-theme="dark"] .modal-content {
    background: #1a202c !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .modal-header {
    background: #2d3748 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .modal-body {
    background: #1a202c !important;
    color: #cbd5e0 !important;
}

[data-bs-theme="dark"] .modal-footer {
    background: #2d3748 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* Dark Mode - Alert Messages */
[data-bs-theme="dark"] .alert {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .alert-success {
    background: rgba(52, 211, 153, 0.1) !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
    color: #34d399 !important;
}

[data-bs-theme="dark"] .alert-danger {
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    color: #f87171 !important;
}

[data-bs-theme="dark"] .alert-warning {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
    color: #fbbf24 !important;
}

[data-bs-theme="dark"] .alert-info {
    background: rgba(96, 165, 250, 0.1) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
    color: #60a5fa !important;
}

/* Dark Mode - Text Colors */
[data-bs-theme="dark"] .text-muted {
    color: #9ca3af !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #9ca3af !important;
}

/* Dark Mode - Background Colors */
[data-bs-theme="dark"] .bg-light {
    background: #2d3748 !important;
}

[data-bs-theme="dark"] .bg-white {
    background: #1a202c !important;
}

/* Dark Mode - Border Colors */
[data-bs-theme="dark"] .border {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .border-light {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Dark Mode - Status Badge Improvements */
[data-bs-theme="dark"] .badge.bg-success {
    background: #059669 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-danger {
    background: #dc2626 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-warning {
    background: #d97706 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-info {
    background: #0284c7 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-primary {
    background: #2563eb !important;
    color: #ffffff !important;
}

/* Dark Mode - DataTables Processing Indicator */
[data-bs-theme="dark"] .dataTables_processing {
    background: rgba(26, 32, 44, 0.9) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Dark Mode - DataTables Empty State */
[data-bs-theme="dark"] .dataTables_empty {
    color: #9ca3af !important;
}

/* Dark Mode - Loading Spinner */
[data-bs-theme="dark"] .spinner-border {
    color: #60a5fa !important;
}

/* Dark Mode - Breadcrumb */
[data-bs-theme="dark"] .breadcrumb {
    background: #2d3748 !important;
}

[data-bs-theme="dark"] .breadcrumb-item a {
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
    color: #cbd5e0 !important;
}

/* Dark Mode - Nav Tabs */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #cbd5e0 !important;
    border: 1px solid transparent !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f7fafc !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background: #2d3748 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    border-bottom-color: #2d3748 !important;
    color: #e2e8f0 !important;
}

/* Dark Mode - List Group */
[data-bs-theme="dark"] .list-group-item {
    background: #2d3748 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #cbd5e0 !important;
}

[data-bs-theme="dark"] .list-group-item:hover {
    background: #4a5568 !important;
    color: #f7fafc !important;
}

/* Dark Mode - Progress Bar */
[data-bs-theme="dark"] .progress {
    background: #374151 !important;
}

[data-bs-theme="dark"] .progress-bar {
    background: #60a5fa !important;
}