/* Mobile Table Fixes - Override Dark Mode Issues */

/* Force light theme for tables on all devices */
.table {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.table thead th {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-bottom: 2px solid #dee2e6 !important;
}

.table tbody tr {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.table tbody tr:hover {
    background-color: #e3f2fd !important;
    color: #212529 !important;
}

.table td {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

.table th {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

/* Override any dark mode styles */
@media (prefers-color-scheme: dark) {
    .table {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .table thead th {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
    
    .table tbody tr {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .table tbody tr:hover {
        background-color: #e3f2fd !important;
        color: #212529 !important;
    }
    
    .table td {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .table th {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
}

/* Mobile specific table improvements */
@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .table thead th {
        background-color: #f8f9fa !important;
        color: #212529 !important;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .table tbody tr {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .table tbody tr:hover {
        background-color: #e3f2fd !important;
        color: #212529 !important;
    }
    
    .table td {
        background-color: #ffffff !important;
        color: #212529 !important;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        border-color: #dee2e6 !important;
    }
    
    .table th {
        background-color: #f8f9fa !important;
        color: #212529 !important;
        border-color: #dee2e6 !important;
    }
    
    /* Ensure table containers are also light */
    .table-responsive {
        background-color: #ffffff !important;
    }
    
    .card .table {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .card .table thead th {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
    
    .card .table tbody tr {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .card .table td {
        background-color: #ffffff !important;
        color: #212529 !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .table {
        font-size: 0.8rem;
        background-color: #ffffff !important;
        color: #212529 !important;
    }
    
    .table thead th {
        background-color: #f8f9fa !important;
        color: #212529 !important;
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .table td {
        background-color: #ffffff !important;
        color: #212529 !important;
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .table th {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
}

/* Force light theme for all table-related elements */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.table-hover tbody tr:hover {
    background-color: #e3f2fd !important;
    color: #212529 !important;
}

/* Override any Bootstrap dark table classes */
.table-dark {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.table-dark thead th {
    background-color: #e9ecef !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

.table-dark tbody tr {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.table-dark td {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

.table-dark th {
    background-color: #e9ecef !important;
    color: #212529 !important;
    border-color: #dee2e6 !important;
}

/* Ensure cards containing tables are also light */
.card {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.card-body {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.card-header {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-bottom-color: #dee2e6 !important;
}
