/* Global Styles */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar Styles */
.bg-dark {
    background-color: #343a40 !important;
}



/* Card Styles */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,.125);
    padding: 0.75rem 1.25rem;
}

/* Table Styles */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table th {
    background-color: #f8f9fa;
}

/* Form Styles */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button Styles */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

/* Department Section Styles */
.department-section {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.department-section h4 {
    margin-bottom: 1rem;
}

/* Date Input Adjustment for Mobile */
input[type="date"] {
    min-width: 150px;
}

/* Alert Styles */
.alert {
    border-radius: 0.5rem;
}

/* Stats Card */
.stats-card {
    transition: transform 0.3s;
}

.stats-card:hover {
    transform: translateY(-5px);
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.4em 0.6em;
}

/* Fix for chart rendering issues */
.chart-container {
    position: relative;
    height: 300px;
    max-width: 100%;
    overflow: hidden;
}

/* Ensure tables don't stretch beyond their container */
.table-responsive {
    overflow-x: auto;
    max-width: 100%;
}

/* Prevent long text from breaking layout */
.table td, .table th {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* DataTables Styling */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: #333;
    margin-bottom: 10px;
}

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

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5em;
}

/* Pagination styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    box-sizing: border-box;
    display: inline-block;
    min-width: 1.5em;
    padding: 0.25em 0.5em;
    margin-left: 2px;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    color: #333 !important;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    border: 1px solid #007bff;
    background: #007bff;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #fff !important;
    border: 1px solid #0069d9;
    background: #0069d9;
}

/* Responsive table styling */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before, 
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background-color: #007bff;
}
/* Dashboard tables (simplified DataTables) */
.dashboard-table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Improved table row hover effect */
table.dataTable tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}
/* Sidebar Styles */
@media (max-width: 767.98px) {

    .col-auto.col-md-3.col-xl-2 {
        width: 4.5rem !important;
    }
    .d-sm-inline {
        display: none !important;
    }
    .content-area {
        padding: 0.5rem !important;
    }
    /* Default state: sidebar hidden on mobile */
    #sidebar {
        margin-left: -100%;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 999;
        transition: all 0.3s;
        width: 250px !important;
    }
    
    /* When sidebar is shown */
    #sidebar.show {
        margin-left: 0;
    }
    
    /* Push the main content when sidebar is shown */
    .main-content {
        width: 100%;
        transition: all 0.3s;
    }
    
    /* Dark overlay when sidebar is shown */
    .sidebar-overlay {
        display: none;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        z-index: 998;
        opacity: 0;
        transition: all 0.5s ease-in-out;
        top: 0;
        left: 0;
    }
    
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
    
    /* Make sure icons are visible on mobile */
    #menu li a i {
        font-size: 1.2rem;
        margin-right: 5px;
    }
    
    /* Show text for menu items on mobile when sidebar is expanded */
    #sidebar.show .d-none.d-sm-inline {
        display: inline !important;
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left;
    }
    
    .dataTables_wrapper .dataTables_filter {
        margin-top: 10px;
    }
    
    /* Adjust search box to full width on mobile */
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
    }
    
    /* Ensure tables are scrollable on small screens */
    .table-responsive {
        overflow-x: auto;
    }
}

/* Always show full sidebar on larger screens */
@media (min-width: 768px) {
    #sidebar {
        margin-left: 0;
    }
}