.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    overflow-y: auto;
}

.modal-content {
    background-color: #fff;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    width: 80%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.close {
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: black;
}

.modal-content input[type="file"] {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.modal-content input[type="file"]:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.modal-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
    position: sticky;
    bottom: -15px;
    background: white;
    padding: 15px;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

#filterModal .modal-content {
    width: 90%;
    max-width: 800px;
    padding: 15px;
}

.filterForm {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    width: 100%;
}

.form-field {
    margin-bottom: 10px;
    break-inside: avoid;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.editable-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 21px;
}

.editable-field > span {
    flex: 1;
    text-align: left;
    margin-right: auto;
}

.edit-icon {
    color: #6c757d;
    margin-left: 8px;
    cursor: pointer;
    opacity: 0.6;
    flex-shrink: 0;
}

.edit-icon:hover {
    opacity: 1;
}

.editable-boolean {
    padding: 4px 8px;
    border-radius: 20px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    margin: 0 auto;
    display: block;
    width: fit-content;
    outline: none;
}

.editable-boolean-wrapper:has(option[value="true"]:checked) .editable-boolean {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.editable-boolean-wrapper:has(option[value="false"]:checked) .editable-boolean {
    background-color: #f8e7f2;
    color: #721c24;
    border-color: #f5c6cb;
}

.editable-boolean:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

#columnsModal input[type="checkbox"] {
    display: inline-block !important;
    visibility: visible !important;
}

.export-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-buttons-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.export-buttons-row .btn {
    flex: 1;
    max-width: 200px;
}

/* Import Results Modal Styles */
#importResultsModal .modal-content {
    max-width: 700px;
    width: 90%;
}

.import-summary {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.import-summary h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

.import-summary p {
    margin: 0;
    font-size: 16px;
}

.import-errors {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.import-errors h3 {
    color: #721c24;
    margin: 0 0 15px 0;
}

.error-groups {
    max-height: 400px;
    overflow-y: auto;
}

.error-group {
    background-color: #fff;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.error-group:last-child {
    margin-bottom: 0;
}

.error-group-header {
    background-color: #f8d7da;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f5c6cb;
    cursor: pointer;
    transition: background-color 0.2s;
}

.error-group-header:hover {
    background-color: #f1c2c7;
}

.error-group-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-type {
    font-weight: 600;
    color: #721c24;
    font-size: 15px;
}

.error-count {
    background-color: #dc3545;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.toggle-icon {
    color: #721c24;
    font-size: 12px;
    transition: transform 0.2s;
    user-select: none;
}

.error-examples {
    padding: 12px 15px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.error-examples.collapsed {
    max-height: 0;
    padding: 0 15px;
    opacity: 0;
}

.error-group:has(.error-examples.collapsed) .toggle-icon {
    transform: rotate(-90deg);
}

.examples-header {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.examples-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.example-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 6px;
    color: #495057;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.example-item:last-child {
    margin-bottom: 0;
}

.example-item.more {
    background-color: #e9ecef;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.warning-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
}

/* Dependent records update loader */
.dependent-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.loader-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.loader-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.loader-progress {
    font-size: 14px;
    color: #666;
    font-weight: bold;
}

.loader-progress span {
    color: #007bff;
}

/* Modern Modal Layout */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.modal-body {
    padding: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
}

.upload-section {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-text {
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #6c757d;
}

.btn {
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

.close-modal {
    cursor: pointer;
}
/* Exchange Rate Update Notification */
.exchange-rate-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: none;
    min-width: 350px;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.notification-content.success {
    background-color: #f8f9fa;
    border-left: 4px solid #28a745;
}

.notification-content.error {
    background-color: #f8f9fa;
    border-left: 4px solid #dc3545;
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.checkmark {
    width: 24px;
    height: 24px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.error-mark {
    width: 24px;
    height: 24px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.notification-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.notification-progress {
    width: 100%;
    height: 3px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    background-color: #007bff;
    border-radius: 2px;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .exchange-rate-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .notification-content {
        padding: 15px;
        gap: 12px;
    }

    .notification-text {
        font-size: 13px;
    }
}
