body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.card {
    border-radius: 15px;
    background: #fff;
    border: none;
}

h2 {
    color: #333;
    font-weight: bold;
}

.form-label {
    font-weight: 500;
    display: flex;
    align-items: center;
}

.tooltip-icon {
    margin-left: 5px;
    cursor: pointer;
    color: #007bff;
}

.tooltip-icon:hover {
    color: #0056b3;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    width: 100%; /* Ensure consistent width */
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

/* Ensure the grid layout for date inputs remains stable */
.row {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping of columns */
}

.col {
    flex: 1; /* Ensure columns take equal space */
    min-width: 0; /* Prevent overflow issues */
}

/* Reduce the space between form elements */
.mb-3 {
    margin-bottom: 1rem !important; /* Reduced from default 1.5rem */
}

/* Reserve minimal space for validation messages to prevent layout shift */
.invalid-feedback-wrapper {
    min-height: 1em; /* Reduced from 1.5em to minimize space */
    margin-top: 0.1em; /* Reduced from 0.25em */
}

.invalid-feedback {
    display: none;
    font-size: 0.875em;
    color: #dc3545;
}

/* Only show invalid styles and feedback when the form has been validated */
.was-validated .form-control:invalid {
    border-color: #dc3545;
}

.was-validated .form-control:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}

.was-validated .form-control:invalid ~ .invalid-feedback-wrapper .invalid-feedback {
    display: block;
}

.btn-primary {
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-primary:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Style the spinner in the button */
.btn-primary .spinner-border {
    margin-right: 8px;
    vertical-align: middle;
}

.btn-success {
    border-radius: 8px;
    transition: background-color 0.3s;
}

.btn-success:hover {
    background-color: #218838;
}

.modal-content {
    border-radius: 15px;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: none;
}

.table {
    margin-bottom: 0;
    width: 100%; /* Ensure table takes full width */
}

.table th, .table td {
    vertical-align: middle;
}

/* Illustration Image Styling */
.illustration-img {
    width: 100%; /* Make the image fill the section width */
    height: 90vh; /* Increase height to make it bigger */
    object-fit: cover; /* Ensure it scales properly */
    max-height: 90vh; /* Ensure it fits within the viewport height */
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transform: scale(0.1);
    transition: transform 0.3s ease-in-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Custom Backdrop for All Layers */
#custom-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1040; /* Below modals but above page content */
    display: none;
    transition: backdrop-filter 0.3s ease;
}

#custom-backdrop.show {
    display: block;
    backdrop-filter: blur(10px); /* Default blur for report modal */
}

#custom-backdrop.email-modal-open {
    backdrop-filter: blur(20px); /* Stronger blur for email modal */
}

/* Fixed Size Modal with Scrollable Table */
#reportModal .modal-dialog {
    max-width: 800px; /* Fixed width */
    max-height: 80vh; /* Fixed height */
    z-index: 1050; /* Ensure report modal is above default backdrop */
}

.modal-body {
    padding: 15px;
}

.table-container {
    max-height: 400px; /* Scrollable height for the table */
    overflow-y: auto; /* Enable vertical scrolling */
}

/* Custom Scrollbar Styling */
.table-container::-webkit-scrollbar {
    width: 6px; /* Thinner scrollbar */
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1; /* Track color */
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888; /* Thumb color */
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555; /* Thumb color on hover */
}

/* Project Selector (Dropdown) Styling */
.project-selector {
    padding: 10px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: block !important; /* Ensure it's not hidden */
}

.project-selector .dropdown {
    width: 100%; /* Match the width of the table */
}

.project-selector .dropdown-toggle {
    width: 100%;
    text-align: left;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 8px 16px;
}

.project-selector .dropdown-toggle::after {
    float: right;
    margin-top: 8px;
}

.project-selector .dropdown-menu {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 8px;
}

/* Email Modal Styling */
#emailModal .modal-dialog {
    max-width: 500px; /* Adjusted width for better fit */
    z-index: 1060; /* Ensure email modal is above report modal and backdrop */
}

#emailModal .modal-content {
    border-radius: 15px;
    background: #fff; /* Ensure email modal is not blurred */
}

#emailModal .modal-header {
    background-color: #f8f9fa;
    border-bottom: none;
}

#emailModal .modal-body {
    padding: 10px; /* Reduced padding to make it more compact */
    display: flex;
    align-items: center;
    gap: 10px; /* Space between input and button */
}

#emailModal .btn-primary {
    height: fit-content; /* Ensure button height matches input */
    white-space: nowrap; /* Prevent button text wrapping */
}

/* Toast Styling */
.toast-container {
    z-index: 1070; /* Ensure toasts are above modals */
}

.toast {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.toast-header {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.toast-success .toast-header {
    background-color: #d4edda;
    color: #155724;
}

.toast-error .toast-header {
    background-color: #f8d7da;
    color: #721c24;
}

.toast-success .toast-body {
    background-color: #e6f4ea;
    color: #155724;
}

.toast-error .toast-body {
    background-color: #f8e1e3;
    color: #721c24;
}