* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}


/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    padding-right: 15px; /* Compensate for scrollbar width to prevent layout shift */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Source Target Layout */
.source-target-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.source-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.source-panel > .card {
    flex: 1;
}

.target-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.target-panel > .card {
    flex: 1;
}

/* Read Data Section */
.read-data-section {
    margin-bottom: 25px;
}

.read-data-section .action-buttons {
    text-align: center;
}

/* Results Layout */
.results-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

/* Bottom Actions */
.bottom-actions {
    margin-top: 25px;
}

.bottom-actions .action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Legacy Layout (keep for compatibility) */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
}

.left-panel {
    min-width: 0;
}

.right-panel {
    min-width: 0;
}

header {
    margin-bottom: 30px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.header-left {
    flex: 1;
}

.header-left h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-left p {
    font-size: 1.2em;
    opacity: 0.9;
}

.header-right {
    flex: 0 0 300px;
}

.environments-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    color: #333;
}

.environments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.environments-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.environments-list {
    max-height: 200px;
    overflow-y: auto;
}

.environments-placeholder {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.environment-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.environment-name {
    font-weight: 600;
    color: #333;
}

.environment-url {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.environment-actions {
    display: flex;
    gap: 5px;
}

.btn-tiny {
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* User Info Card Styles */
.user-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.user-info-header h3 {
    color: white;
    margin: 0;
    font-size: 1.2em;
}

.license-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.license-badge.trial {
    background: #ff9800;
    color: white;
}

.license-badge.licensed {
    background: #4caf50;
    color: white;
}

.user-info-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.user-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-info-label {
    font-size: 0.85em;
    opacity: 0.9;
    font-weight: 500;
}

.user-info-value {
    font-size: 1em;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.env-select {
    margin-bottom: 10px;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-info {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-info {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(45deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.log-output {
    background: #1e1e1e;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    padding: 20px;
    padding-bottom: 20px;
    border-radius: 8px;
    height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.4;
    border: 2px solid #333;
}

.log-output::-webkit-scrollbar {
    width: 8px;
}

.log-output::-webkit-scrollbar-track {
    background: #2e2e2e;
}

.log-output::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 16px 64px rgba(0,0,0,0.3);
    position: relative;
}

.validation-modal-content {
    padding: 15px !important;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 25px;
}

.close:hover,
.close:focus {
    color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.validation-modal-content .modal-actions {
    margin-top: 10px;
    margin-bottom: 0;
}

.connection-test-result {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.connection-test-result.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.connection-test-result.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.connection-test-result.testing {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.connection-test-details {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.8;
}

.connection-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

.connection-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
}

/* Environment Selection Styles */
.environments-selection {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 15px 0;
}

.environment-option {
    border-bottom: 1px solid #eee;
}

.environment-option:last-child {
    border-bottom: none;
}

.environment-radio {
    display: block;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.environment-radio:hover {
    background-color: #f8f9fa;
}

.environment-radio input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
}

.environment-details {
    flex: 1;
}

.environment-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
}

.environment-url {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    word-break: break-all;
}

.environment-info {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.environment-region,
.environment-state,
.environment-type {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.environment-region {
    background-color: #e3f2fd;
    color: #1976d2;
}

.environment-type {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.environment-state {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.environment-state.disabled {
    background-color: #ffebee;
    color: #c62828;
}

.no-environments {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2em;
    }

    .card {
        padding: 20px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* Success/Error States */
.success {
    border-left: 4px solid #28a745;
    background: #d4edda;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.error {
    border-left: 4px solid #dc3545;
    background: #f8d7da;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

/* Environment Badge */
.env-badge {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
}

/* File Input Styling */
input[type="file"] {
    border: 2px dashed #e1e5e9 !important;
    padding: 20px !important;
    text-align: center;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #667eea !important;
    background: #f8f9ff;
}

/* Table Selection Styles */
.table-selection-container {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.table-controls {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    flex-wrap: wrap;
}

.table-controls input[type="text"] {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.table-controls .btn-secondary {
    padding: 8px 16px;
    font-size: 12px;
    white-space: nowrap;
}

.table-selection-status {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #e9ecef;
    border-bottom: 1px solid #e1e5e9;
    font-size: 13px;
    color: #666;
}

.table-list {
    height: 400px;
    overflow-y: auto;
    background: white;
}

.table-list-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.table-item {
    border-bottom: 1px solid #f0f0f0;
}

.table-item:last-child {
    border-bottom: none;
}

.table-checkbox {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.table-checkbox:hover {
    background-color: #f8f9fa;
}

.table-checkbox input[type="checkbox"],
.table-checkbox input[type="radio"] {
    width: auto;
    margin-right: 12px;
    margin: 0 12px 0 0;
    transform: scale(1.2);
}

.table-info {
    flex: 1;
}

.table-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.table-details {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.table-logical-name {
    color: #666;
    font-family: monospace;
}

.table-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.table-badge.custom {
    background: #e3f2fd;
    color: #1976d2;
}

.table-badge.standard {
    background: #f3e5f5;
    color: #7b1fa2;
}

.table-cache-badge {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e3f2fd;
    color: #1976d2;
    display: none; /* Hidden by default, shown when cache exists */
}

.table-cache-badge.visible {
    display: inline-block;
}

.table-list::-webkit-scrollbar {
    width: 8px;
}

.table-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-list::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Data Preview Styles */
.data-output {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: auto;
    font-family: monospace;
    font-size: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: left;
    font-size: 11px;
}

.data-table th {
    background: #e9ecef;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.data-table tr:nth-child(even) {
    background: #f8f9fa;
}

/* Filter Row Styles */
.filter-row th {
    background: #f1f3f5;
    padding: 4px;
}

.column-filter {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 11px;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out;
}

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

.column-filter::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Sortable Header Styles */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease-in-out;
}

.sortable-header:hover {
    background-color: #dee2e6;
}

.sortable-header.sorted {
    background-color: #cbd3da;
    font-weight: 700;
}

/* Comparison Results Styles */
.comparison-output {
    font-size: 13px;
}

.comparison-section {
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-header {
    background: #f8f9fa;
    padding: 12px;
    font-weight: 600;
    border-bottom: 1px solid #e1e5e9;
}

.comparison-content {
    overflow-x: auto;
    max-width: 100%;
}

.comparison-content .data-table {
    min-width: 100%;
    white-space: nowrap;
}

.comparison-content .data-table th,
.comparison-content .data-table td {
    min-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comparison-content {
    padding: 15px;
}

.issue-item {
    padding: 10px;
    margin: 8px 0;
    border-radius: 6px;
    border-left: 4px solid;
}

.issue-error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.issue-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.issue-info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

.field-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 10px 0;
}

.field-detail {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
}

.field-detail.source {
    border-left: 3px solid #007bff;
}

.field-detail.target {
    border-left: 3px solid #28a745;
}

/* Responsive Design for Table Selection */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .table-controls {
        flex-direction: column;
    }

    .table-controls input[type="text"] {
        min-width: 100%;
    }

    .table-selection-status {
        flex-direction: column;
        gap: 5px;
    }

    .field-comparison {
        grid-template-columns: 1fr;
    }
}

/* Device Code Flow Styles */
.device-code-instructions {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.device-code-instructions ol {
    margin: 10px 0;
    padding-left: 20px;
}

.device-code-instructions li {
    margin: 8px 0;
    line-height: 1.4;
}

.device-code-status {
    margin: 20px 0;
    text-align: center;
}

.device-code-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.device-code-actions button {
    padding: 8px 16px;
    font-size: 14px;
}

/* Environment Selection Styles */
.environments-selection {
    max-height: 400px;
    overflow-y: auto;
    margin: 15px 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.environment-option {
    border-bottom: 1px solid #e9ecef;
}

.environment-option:last-child {
    border-bottom: none;
}

.environment-radio {
    display: block;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.environment-radio:hover {
    background-color: #f8f9fa;
}

.environment-radio input[type="radio"] {
    margin-right: 12px;
}

.environment-details {
    flex: 1;
}

.environment-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
}

.environment-url {
    font-family: monospace;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    word-break: break-all;
}

.environment-info {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.environment-region,
.environment-state,
.environment-type {
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.environment-region {
    background: #e3f2fd;
    color: #1976d2;
}

.environment-state {
    background: #e8f5e8;
    color: #2e7d32;
}

.environment-state.inactive {
    background: #ffebee;
    color: #c62828;
}

.environment-type {
    background: #f3e5f5;
    color: #7b1fa2;
}

.no-environments {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Account Management Styles */
.account-section {
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.account-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.account-environments {
    padding: 0;
}

.account-environments .environment-item {
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
}

.account-environments .environment-item:last-child {
    border-bottom: none;
}

.account-environments .environment-info {
    padding: 12px 15px;
}

.account-environments .environments-placeholder {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
}

.login-section {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.login-section h3 {
    margin-bottom: 10px;
    color: #333;
}

.login-section p {
    margin-bottom: 20px;
    color: #666;
}

.auth-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.auth-status span {
    color: #28a745;
    font-weight: 500;
}

@media (max-width: 768px) {
    .account-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .auth-status {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* ====================
   TWO-MODE UI STYLES
   ==================== */

/* Mode Switch */
.mode-switch {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.mode-btn.active {
    background: white;
    color: #4a90e2;
    border-color: white;
}

/* Mode Content */
.mode-content {
    margin-bottom: 25px;
}

/* Setup Mode Styles */
.accounts-section, .environments-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    color: #333;
    margin: 0;
}

/* Accounts List */
.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.accounts-placeholder {
    text-align: center;
    color: #666;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.account-info .account-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.account-info .account-email {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.account-info .account-stats {
    color: #888;
    font-size: 0.8em;
}

.account-actions {
    display: flex;
    gap: 10px;
}

/* Environments Grid */
.environments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.environments-placeholder {
    text-align: center;
    color: #666;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
    grid-column: 1 / -1;
}

.environment-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #4a90e2;
}

.environment-card .env-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.environment-card .env-url {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
    word-break: break-all;
}

.environment-card .env-account {
    color: #888;
    font-size: 0.8em;
}
.env-tag-row {
    margin-top: 8px;
    margin-bottom: 12px;
}

.env-tag-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    width: 140px;
    color: #333;
    transition: border-color 0.2s;
}

.env-tag-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.env-tag-input::placeholder {
    color: #aaa;
    font-style: italic;
}


.environment-card .btn-danger {
    margin-top: auto;
    align-self: flex-start;
    padding: 6px 12px;
    font-size: 0.75em;
    text-transform: none;
}

/* Button Sizes */
.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Data Table Styles */
.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.data-header h3 {
    color: #333;
    font-size: 1.2em;
}

.data-controls {
    display: flex;
    gap: 10px;
}

.data-controls button {
    padding: 8px 16px;
    font-size: 0.9em;
}

.data-table-container {
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.data-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.data-table th:first-child,
.data-table td:first-child {
    padding-left: 15px;
}

.data-table th:last-child,
.data-table td:last-child {
    padding-right: 15px;
}

.data-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: #666;
    font-size: 0.9em;
}

.has-more {
    color: #4a90e2;
    font-weight: 500;
}

.all-loaded {
    color: #28a745;
    font-weight: 500;
}

/* Data output container */
.data-output {
    overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .data-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .data-controls {
        flex-wrap: wrap;
        width: 100%;
    }

    .data-table-container {
        /* Height constraints removed for dynamic growth */
    }

    .data-table {
        font-size: 0.8em;
    }

    .data-table th,
    .data-table td {
        padding: 6px 4px;
        max-width: 120px;
    }
}

/* Multi-Table Data Preview Styles */
.data-preview-header {
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 20px;
}

.data-preview-header h2 {
    margin-bottom: 15px;
}

.table-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 0;
}

.table-tab {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 0.9em;
    font-weight: 500;
    color: #495057;
    position: relative;
    transition: all 0.2s ease;
    min-width: 120px;
    text-align: center;
}

.table-tab:hover {
    background: #e9ecef;
    color: #212529;
}

.table-tab.active {
    background: white;
    color: #007bff;
    border-color: #007bff;
    z-index: 10;
}

.table-tab-close {
    margin-left: 8px;
    color: #6c757d;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
}

.table-tab-close:hover {
    background: #e9ecef;
    color: #dc3545;
}

/* Loading Badge for Server Cache */
.loading-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 0.85em;
    border-radius: 4px;
    font-weight: 500;
}

.loading-badge.loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.loading-badge.complete {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.loading-badge.failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.table-contents {
    min-height: 200px;
}

.table-content {
    display: none;
    position: relative; /* For absolute positioning of loading overlay */
}

.table-content.active {
    display: block;
}

.table-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.table-summary-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.table-summary-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.table-summary-stats {
    color: #6c757d;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.btn-validate-table {
    padding: 12px 24px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-validate-table:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-validate-table:disabled,
.btn-validate-table.btn-disabled {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.btn-validate-table:disabled:hover,
.btn-validate-table.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-delete-selected,
.btn-delete-all {
    padding: 12px 24px;
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-delete-selected:hover:not(:disabled),
.btn-delete-all:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-delete-selected:disabled {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.btn-delete-selected:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-transfer-table {
    padding: 6px 12px;
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.btn-transfer-table:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-transfer-table:disabled,
.btn-transfer-table.btn-disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.btn-transfer-table:disabled:hover,
.btn-transfer-table.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Locked environment dropdowns */
.env-locked {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.env-locked:focus {
    box-shadow: none;
    border-color: #dee2e6;
}

.table-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.table-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Target Table Validation Styles */
.target-validation-container {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.validation-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.validation-status {
    font-size: 0.9em;
    font-weight: 500;
}

.validation-status.validating {
    color: #007bff;
}

.validation-status.success {
    color: #28a745;
}

.validation-status.warning {
    color: #ffc107;
}

.validation-status.error {
    color: #dc3545;
}

.target-tables-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    padding: 10px;
}

.target-tables-placeholder {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.target-table-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f3f4;
    margin-bottom: 5px;
    border-radius: 4px;
    background: #fafafa;
}

.target-table-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.target-table-name {
    font-weight: 500;
    color: #495057;
}

.target-table-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.status-icon {
    font-size: 1.1em;
    font-weight: bold;
}

.status-icon.exists {
    color: #28a745;
}

.status-icon.missing {
    color: #dc3545;
}

.status-icon.checking {
    color: #007bff;
}

.status-text {
    font-weight: 500;
}

.status-text.exists {
    color: #28a745;
}

.status-text.missing {
    color: #dc3545;
}

.status-text.checking {
    color: #007bff;
}

/* Create Table Button */
.btn-create-table {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-create-table:hover:not(:disabled) {
    background: #e55a2b;
}

.btn-create-table:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Compare Fields Button */
.btn-compare-fields {
    background: #007bff;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-compare-fields:hover:not(:disabled) {
    background: #0056b3;
}

.btn-compare-fields:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-compare-fields.btn-success {
    background: #28a745;
}

.btn-compare-fields.btn-success:hover {
    background: #1e7e34;
}

.btn-compare-fields.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-compare-fields.btn-warning:hover {
    background: #e0a800;
}

/* Field Comparison Results */
.comparison-table-header {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.comparison-table-header h3 {
    margin: 0 0 10px 0;
    color: #495057;
}

.comparison-summary {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.summary-item {
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
}

.summary-item.compatible {
    background: #d4edda;
    color: #155724;
}

.summary-item.incompatible {
    background: #f8d7da;
    color: #721c24;
}

.field-comparison-table {
    overflow-x: auto;
    margin-top: 15px;
}

.field-comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.field-comparison-table th {
    background: #495057;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
}

.field-comparison-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.field-row.identical {
    background: #d4edda;
}

.field-row.different {
    background: #fff3cd;
}

.field-row.source_only {
    background: #cce5ff;
}

.field-row.target_only {
    background: #e2e3e5;
}

.field-name {
    font-family: monospace;
    font-weight: 600;
    color: #495057;
}

.field-status {
    font-weight: 600;
    white-space: nowrap;
}

.field-source, .field-target {
    font-family: monospace;
    font-size: 0.9em;
    color: #6c757d;
}

.field-differences {
    font-size: 0.9em;
    color: #495057;
    max-width: 300px;
    word-break: break-word;
}

/* Field Comparison Modal Styles */
.comparison-modal-content {
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

.comparison-header {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 6px;
}

.comparison-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-weight: 500;
}

.summary-stat .count {
    font-weight: bold;
    color: #333;
}

.comparison-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.source-fields-panel,
.target-fields-panel {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.source-fields-panel h3,
.target-fields-panel h3 {
    margin: 0;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
    font-weight: 600;
}

.environment-name {
    padding: 8px 15px;
    background-color: #e9ecef;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.fields-list {
    max-height: 400px;
    overflow-y: auto;
}

.field-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.field-item:last-child {
    border-bottom: none;
}

.field-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.field-details {
    flex: 2;
    font-size: 13px;
    color: #666;
}

.field-type {
    display: inline-block;
    padding: 2px 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    margin-right: 8px;
    font-family: monospace;
}

.field-required {
    color: #dc3545;
    font-weight: 500;
}

.field-optional {
    color: #6c757d;
}

/* Field comparison status colors */
.field-item.identical {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.field-item.different {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.field-item.source-only {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

.field-item.target-only {
    background-color: #cce5ff;
    border-left: 4px solid #007bff;
}

.field-differences {
    margin-top: 5px;
    padding: 5px 8px;
    background-color: rgba(255, 193, 7, 0.1);
    border-radius: 3px;
    font-size: 12px;
    color: #856404;
}

.comparison-legend {
    display: flex;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.legend-color.identical {
    background-color: #28a745;
}

.legend-color.different {
    background-color: #ffc107;
}

.legend-color.source-only {
    background-color: #dc3545;
}

.legend-color.target-only {
    background-color: #007bff;
}

.comparison-error {
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    text-align: center;
}

.comparison-loading {
    padding: 40px;
    text-align: center;
    color: #666;
}

.comparison-loading::before {
    content: "⏳";
    margin-right: 8px;
}

/* Lookup Field Styling */
.lookup-field-label {
    background-color: #17a2b8;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 2px rgba(23, 162, 184, 0.3);
    border: 1px solid #17a2b8;
}

.regular-field-label {
    background-color: #6c757d;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-exists {
    color: #28a745;
    font-weight: 600;
}

.table-missing {
    color: #dc3545;
    font-weight: 600;
}

.no-targets {
    color: #ffc107;
    font-style: italic;
}

.not-applicable {
    color: #6c757d;
    font-style: italic;
}

/* Lookup field row highlighting */
.field-row.lookup-field {
    background-color: #fff5f5;
    border-left: 4px solid #dc3545;
}

.field-row.lookup-field:hover {
    background-color: #ffe6e6;
}

/* Lookup validation styles */
.lookup-validation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.validation-icon {
    font-size: 18px;
    min-width: 20px;
}

.target-tables {
    font-size: 13px;
    font-weight: 600;
}

.validation-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.validation-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.validation-unknown {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.no-targets {
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}

/* Filter Controls */
.filter-controls {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-label {
    font-weight: 600;
    margin-right: 10px;
    color: #495057;
}

.filter-btn {
    background-color: #ffffff;
    border: 2px solid #dee2e6;
    color: #6c757d;
    padding: 6px 12px;
    margin: 2px 4px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
}

.filter-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.filter-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.filter-btn.filter-identical.active {
    background-color: #28a745;
    border-color: #28a745;
}

.filter-btn.filter-different.active {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.filter-btn.filter-source-only.active {
    background-color: #dc3545;
    border-color: #dc3545;
}

.filter-btn.filter-target-only.active {
    background-color: #007bff;
    border-color: #007bff;
}

.filter-btn.filter-lookup.active {
    background-color: #6f42c1;
    border-color: #6f42c1;
}

/* Responsive filter controls */
@media (max-width: 768px) {
    .filter-controls {
        padding: 10px;
    }

    .filter-btn {
        padding: 4px 8px;
        font-size: 11px;
        margin: 1px 2px;
    }
}

/* Modal header layout */
.modal-header-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.issues-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.issues-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.issues-icon {
    font-size: 18px;
}

.issues-text {
    color: #333;
}

.summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    font-size: 13px;
}

.summary-stat .count {
    font-weight: 600;
    font-size: 14px;
}

.summary-stat .label {
    color: #6c757d;
}

/* Filter controls wrapper */
.filter-controls-wrapper {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}

.filter-controls.horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.filter-controls.horizontal .filter-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    text-align: center;
    white-space: nowrap;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-controls.horizontal .filter-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.filter-controls.horizontal .filter-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Compact filter controls for modal */
.filter-controls.compact {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    padding: 8px 0;
    margin-top: 10px;
    border-top: 1px solid #dee2e6;
}

.filter-controls.compact .filter-btn {
    padding: 3px 8px;
    font-size: 11px;
    margin: 0;
    border-radius: 12px;
    min-width: auto;
}

/* Lookup validation styles */
.lookup-target-table {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.lookup-validation-result {
    font-size: 12px;
    margin-top: 4px;
}

.validation-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Updated comparison header */
.comparison-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

/* 3-column layout: source, sync button, target */
.comparison-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    height: 500px;
    align-items: start;
}

.source-fields-panel,
.target-fields-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fields-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    background-color: #f8f9fa;
}

/* Sync controls column in the middle */
.sync-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 50px;
}

/* Icon-only sync button */
.sync-scroll-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #17a2b8;
    background-color: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sync-scroll-btn:hover {
    background-color: #17a2b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.sync-scroll-btn.active {
    background-color: #17a2b8;
    color: white;
    box-shadow: 0 2px 6px rgba(23, 162, 184, 0.4);
}

.sync-scroll-btn.active:hover {
    background-color: #138496;
    border-color: #138496;
}

/* Subtab styling for source/target data display */
.table-subtabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.table-subtab {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
    white-space: nowrap;
}


.table-subtab.active {
    background: white;
    color: #007bff;
    border-color: #007bff;
    border-bottom: 1px solid white;
    z-index: 1;
}

.table-subtab.disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.table-subtab:not(.disabled):hover {
    background: #e9ecef;
    color: #007bff;
}

.table-subtab.active:hover {
    background: white;
    color: #007bff;
}

.table-subcontent {
    display: none;
}

.table-subcontent.active {
    display: block;
}

.table-subcontent[data-env="source"] {
    border-left: 3px solid #28a745;
}

.table-subcontent[data-env="target"] {
    border-left: 3px solid #007bff;
}

/* Enhanced error styling for different error types */
.table-error {
    padding: 20px;
    border-radius: 8px;
    margin: 10px 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.table-error.error-privilege {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.table-error.error-permission {
    background: #f8d7da;
    border-color: #f1aeb5;
    color: #721c24;
}

.table-error.error-notfound {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 16px;
}

.error-icon {
    font-size: 20px;
}

.error-message {
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    word-break: break-word;
}

.error-suggestion {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(0, 123, 255, 0.1);
    border-left: 3px solid #007bff;
    border-radius: 4px;
    font-style: italic;
    font-size: 14px;
}

/* Warning styles for partial access */
.table-warning {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid;
    font-size: 14px;
}

.table-warning.warning-partial {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.table-warning.warning-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.warning-icon {
    font-size: 16px;
    margin-right: 8px;
}

.warning-text {
    font-weight: 500;
}

.warning-details {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #666;
    word-break: break-word;
}

/* Delete button styling */
.btn-delete-selected, .btn-delete-all {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-left: 5px;
}

.btn-clear-all {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-left: 5px;
}

.btn-delete-selected:hover:not(:disabled), .btn-delete-all:hover:not(:disabled), .btn-clear-all:hover:not(:disabled) {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

.btn-delete-selected:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-delete-all {
    background-color: #ff6b6b;
    border-color: #ff5252;
}

.btn-delete-all:hover:not(:disabled) {
    background-color: #ff5252;
    border-color: #ff1744;
}

/* Checkbox column styling */
.checkbox-column {
    width: 40px;
    text-align: center;
    padding: 8px 4px !important;
}

.checkbox-column input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

.data-table[data-env-type="target"] .checkbox-column {
    background-color: rgba(0, 123, 255, 0.05);
}

/* No data styling */
.no-data {
    text-align: center;
    font-style: italic;
    color: #6c757d;
    padding: 20px !important;
    background-color: #f8f9fa;
}

/* Loading Indicator Styling */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 300px;
    animation: slideUp 0.3s ease-out;
}

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

.loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Authentication Required Overlay */
.auth-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(8px);
    z-index: 99999 !important;
    /* display controlled by inline style - removed !important so inline style works */
    justify-content: center !important;
    align-items: center !important;
}

/* When overlay is shown, display as flex */
.auth-overlay[style*="display: flex"] {
    display: flex !important;
}

.auth-content {
    background: white !important;
    padding: 50px 60px !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
    text-align: center !important;
    max-width: 500px !important;
    min-width: 400px !important;
    position: relative !important;
    z-index: 100000 !important;
}

.auth-content-wide {
    max-width: 700px !important;
    min-width: 600px !important;
}

.auth-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.auth-buttons .btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-buttons .btn-secondary:hover {
    background: #5a6268;
}

.auth-icon {
    font-size: 72px;
    line-height: 1;
    margin-bottom: 20px;
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

.auth-content h2 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 600;
}

.auth-content p {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.auth-details {
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    border-radius: 4px;
}

.auth-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #495057;
}

.auth-details strong {
    color: #212529;
}

.auth-content .btn-primary {
    margin-top: 10px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    min-width: 200px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

/* Different loading spinner colors for different button types */
.btn-delete-selected.btn-loading::after,
.btn-delete-all.btn-loading::after,
.btn-clear-all.btn-loading::after {
    border-top-color: white;
}

.btn-validate-table.btn-loading::after {
    border-top-color: #333;
}

.btn-transfer-table.btn-loading::after {
    border-top-color: white;
}

/* Data Validation Modal Styles */
.validation-modal-content {
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    margin: 1vh auto;
    overflow-y: auto;
    position: relative;
    top: 0;
    padding: 15px;
}

.validation-header {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.validation-table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.validation-table-info .table-name {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
}

.validation-table-info .environment-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #6c757d;
}

.validation-steps-container {
    margin: 20px 0;
}

.validation-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #fff;
    transition: all 0.3s ease;
}

.validation-step.active {
    opacity: 1 !important;
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateX(5px);
}

.validation-step.completed {
    opacity: 1 !important;
    border-color: #28a745;
    background: #f8fff9;
}

.validation-step.error {
    opacity: 1 !important;
    border-color: #dc3545;
    background: #fff8f8;
}

.step-icon {
    font-size: 20px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.validation-step.active .step-icon {
    background: #007bff;
    color: white;
    border-color: #007bff;
    animation: pulse 2s infinite;
}

.validation-step.completed .step-icon {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.validation-step.error .step-icon {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.step-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.step-progress {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #007bff, #0056b3);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.validation-results {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
}

.validation-results h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
}

.validation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.summary-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    text-align: center;
}

.summary-item.success {
    border-left-color: #28a745;
}

.summary-item.warning {
    border-left-color: #ffc107;
}

.summary-item.error {
    border-left-color: #dc3545;
}

.summary-item.todo {
    border-left-color: #6f42c1;
    background: #f8f7ff;
}

.summary-item .count {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.summary-item .label {
    color: #6c757d;
    font-size: 14px;
}

.validation-details {
    background: white;
    border-radius: 4px;
    padding: 8px;
    word-wrap: break-word;
    overflow-x: hidden;
}

.validation-issue {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

.validation-issue:last-child {
    border-bottom: none;
}

.issue-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.issue-content {
    flex: 1;
    min-width: 0;
}

.issue-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.issue-description {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.3;
}

.validation-issue.error {
    background: #fff5f5;
    margin: 5px -10px;
    padding: 10px;
    border-radius: 4px;
}

.validation-issue.warning {
    background: #fffbf0;
    margin: 5px -10px;
    padding: 10px;
    border-radius: 4px;
}

.validation-issue.info {
    background: #f0f8ff;
    margin: 5px -10px;
    padding: 10px;
    border-radius: 4px;
}

/* Migration Options Styles */
.migration-options {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.migration-options h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

.option-section {
    margin-bottom: 10px;
}

.option-section:last-child {
    margin-bottom: 0;
}

/* Radio button styling */
.radio-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.radio-container input[type="radio"] {
    display: none;
}

.radiomark {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 10px;
    margin-top: 2px;
    position: relative;
    background: white;
    flex-shrink: 0;
}

.radio-container:hover .radiomark {
    border-color: #007bff;
}

.radio-container input[type="radio"]:checked + .radiomark {
    background-color: #007bff;
    border-color: #007bff;
}

.radio-container input[type="radio"]:checked + .radiomark:after {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* Legacy checkbox styling (keeping for backward compatibility) */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    gap: 8px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.1);
}

.option-text {
    flex: 1;
    line-height: 1.4;
}

.option-description {
    margin-top: 5px;
    margin-left: 28px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #666;
    line-height: 1.3;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .validation-modal-content {
        width: 95%;
        margin: 2vh auto;
        max-height: 85vh;
    }

    .validation-table-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .validation-summary {
        grid-template-columns: 1fr;
    }

    .validation-step {
        padding: 12px;
        margin-bottom: 12px;
    }

    .validation-header {
        padding: 10px;
        margin-bottom: 12px;
    }

    .validation-results {
        padding: 12px;
        margin-top: 15px;
    }

    .migration-options {
        margin: 10px 0;
        padding: 12px;
    }

    .option-description {
        margin-left: 20px;
    }
}

/* ToDo Modal Specific Styles */
.validation-todo-modal-content {
    max-width: 1000px !important; /* Make it much wider */
    width: 95% !important;
    max-height: 80vh !important; /* Limit height to 80% of viewport */
    margin: 2% auto !important; /* Reduce top margin */
    padding: 20px !important;
    overflow: hidden !important; /* Prevent content overflow */
    display: flex !important;
    flex-direction: column !important;
}

.validation-todo-modal-content h2 {
    margin-bottom: 15px !important;
    flex-shrink: 0 !important; /* Don't shrink header */
}

.validation-todo-modal-content > p {
    margin-bottom: 15px !important;
    flex-shrink: 0 !important; /* Don't shrink description */
}

.todo-list-container {
    flex: 1 !important; /* Take remaining space */
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.todo-list-content {
    flex: 1 !important;
    overflow-y: auto !important; /* Make it scrollable vertically */
    overflow-x: hidden !important;
    padding-right: 10px !important; /* Space for scrollbar */
    max-height: 100% !important;
}

/* Improve todo item styling for wider modal */
.todo-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 15px !important;
    margin-bottom: 15px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    background: #f9f9f9 !important;
}

.todo-item-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 15px !important;
}

.todo-item-title {
    font-weight: bold !important;
    flex: 1 !important;
    color: #333 !important;
}

.todo-item-status {
    font-size: 14px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    background: #e9ecef !important;
    color: #495057 !important;
    min-width: 80px !important;
    text-align: center !important;
}

.todo-item-description {
    color: #666 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.todo-item-actions {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

.todo-dependencies {
    font-size: 12px !important;
    color: #856404 !important;
    background: #fff3cd !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    border: 1px solid #ffeaa7 !important;
}

/* Modal actions stay at bottom */
.validation-todo-modal-content .modal-actions {
    flex-shrink: 0 !important; /* Don't shrink actions */
    margin-top: 20px !important;
    padding-top: 15px !important;
    border-top: 1px solid #e0e0e0 !important;
}

/* Custom scrollbar styling for better look */
.todo-list-content::-webkit-scrollbar {
    width: 8px !important;
}

.todo-list-content::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px !important;
}

.todo-list-content::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 4px !important;
}

.todo-list-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
}

/* Responsive adjustments for todo modal */
@media (max-width: 1200px) {
    .validation-todo-modal-content {
        max-width: 90% !important;
    }
}

@media (max-width: 768px) {
    .validation-todo-modal-content {
        max-width: 95% !important;
        margin: 1% auto !important;
        max-height: 90vh !important;
    }

    .todo-item-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    .todo-item-actions {
        justify-content: flex-start !important;
    }
}

/* Todo Data Preview Modal */
.todo-preview-container {
    margin: 20px 0;
}

.preview-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item strong {
    color: #495057;
    font-weight: 600;
}

.info-item span {
    color: #007bff;
    font-weight: 500;
}

.preview-tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.preview-tab {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.preview-tab:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

.preview-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background-color: #f8f9fa;
}

.preview-content {
    min-height: 300px;
}

.preview-tab-content {
    display: none;
}

.preview-tab-content.active {
    display: block;
}

.preview-tab-content h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.data-table-container {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: auto;
    background: white;
    min-height: 200px;
}

.data-table-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.data-table-container th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
}

.data-table-container td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
    color: #495057;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table-container tr:hover {
    background-color: #f8f9fa;
}

.data-table-container tr:last-child td {
    border-bottom: none;
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.error-state {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 20px 0;
}

/* Load More Button Styles */
.load-more-container {
    text-align: left;
    padding: 20px;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    margin-top: 10px;
}

.btn-load-more {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
    margin-bottom: 8px;
    display: inline-block;
    margin-left: 0;
    margin-right: 8px;
}

.btn-load-more:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-load-more:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.btn-load-more:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.load-more-info {
    display: block;
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
    margin-top: 8px;
}

/* Missing IDs Container Styles */
.missing-ids-container {
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 10px 0;
}

.todo-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 15px;
}

.todo-header h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.todo-description {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

.todo-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.todo-info-item {
    font-size: 13px;
    color: #495057;
}

.todo-info-item strong {
    color: #2c3e50;
    font-weight: 600;
}

.ids-section {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}

.ids-section h5 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.missing-ids-container h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.id-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.selectable-id {
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #495057;
    user-select: text;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.selectable-id .id-text {
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.btn-diagnose {
    padding: 4px 8px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-diagnose:hover {
    background: #138496;
    transform: scale(1.05);
}

.btn-diagnose:active {
    transform: scale(0.95);
}

/* Lookup Diagnosis Modal Styles */
.diagnosis-summary {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #17a2b8;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.diagnosis-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
}

.diagnosis-section.warning {
    border-left: 4px solid #ffc107;
    background: #fff8e1;
}

.diagnosis-section.success {
    border-left: 4px solid #28a745;
    background: #f8fff9;
}

.diagnosis-section.info {
    border-left: 4px solid #17a2b8;
    background: #f0feff;
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.field-item {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
    word-break: break-word;
}

.match-item {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
}

.match-header {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.match-id {
    font-family: monospace;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

.match-differences ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.match-differences li {
    margin-bottom: 4px;
    font-size: 12px;
}

.diff-different_value {
    color: #856404;
}

.diff-missing_in_target {
    color: #dc3545;
}

.diff-missing_in_source {
    color: #0c5460;
}

.perfect-match {
    color: #28a745;
    font-weight: 600;
    font-size: 13px;
}

/* ====================
   MIGRATION PROGRESS STYLES
   ==================== */

.migration-progress-content {
    width: 600px;
    max-width: 90vw;
}

.migration-progress-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.migration-progress-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.migration-progress-body {
    text-align: left;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #17a2b8 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progress-stripes 2s linear infinite;
}

@keyframes progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-text {
    font-weight: 500;
    color: #495057;
    margin: 10px 0;
    font-size: 14px;
}

.progress-details {
    font-size: 13px;
    color: #6c757d;
    margin: 5px 0;
    min-height: 16px;
}

.migration-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    margin-top: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #495057;
    line-height: 1.4;
}

.migration-log:empty::after {
    content: 'Waiting for migration logs...';
    color: #adb5bd;
    font-style: italic;
}

/* ====================
   MIGRATION SUMMARY MODAL STYLES
   ==================== */

.migration-summary-container {
    margin-top: 20px;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.summary-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-number.success {
    color: #28a745;
}

.stat-number.error {
    color: #dc3545;
}

.stat-number.warning {
    color: #ffc107;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-details {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.summary-section {
    border-bottom: 1px solid #f1f3f4;
}

.summary-section:last-child {
    border-bottom: none;
}

.summary-section-header {
    background: #f8f9fa;
    padding: 12px 20px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-section-content {
    padding: 20px;
}

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

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

.record-item:last-child {
    border-bottom: none;
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.record-name {
    font-weight: 500;
    color: #333;
}

.record-details {
    font-size: 12px;
    color: #6c757d;
}

.record-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.record-status.success {
    background: #d4edda;
    color: #155724;
}

.record-status.error {
    background: #f8d7da;
    color: #721c24;
}

.error-message {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.error-code {
    font-size: 11px;
    color: #6c757d;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

/* Migration Summary Modal Improvements */
#migrationSummaryModal .modal-content {
    margin: 2% auto !important; /* Move modal higher up the screen */
    max-height: 90vh !important; /* Limit height to 90% of viewport */
    overflow-y: auto !important; /* Enable vertical scrolling */
    max-width: 900px !important; /* Make it wider for better content display */
}

#migrationSummaryModal .migration-summary-container {
    max-height: 70vh !important; /* Limit container height */
    overflow-y: auto !important; /* Enable scrolling within container */
}

#migrationSummaryModal .summary-details {
    max-height: 50vh !important; /* Limit details section height */
    overflow-y: auto !important; /* Enable scrolling within details */
}

/* Custom scrollbar for migration summary modal */
#migrationSummaryModal .modal-content::-webkit-scrollbar,
#migrationSummaryModal .migration-summary-container::-webkit-scrollbar,
#migrationSummaryModal .summary-details::-webkit-scrollbar {
    width: 8px;
}

#migrationSummaryModal .modal-content::-webkit-scrollbar-track,
#migrationSummaryModal .migration-summary-container::-webkit-scrollbar-track,
#migrationSummaryModal .summary-details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#migrationSummaryModal .modal-content::-webkit-scrollbar-thumb,
#migrationSummaryModal .migration-summary-container::-webkit-scrollbar-thumb,
#migrationSummaryModal .summary-details::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#migrationSummaryModal .modal-content::-webkit-scrollbar-thumb:hover,
#migrationSummaryModal .migration-summary-container::-webkit-scrollbar-thumb:hover,
#migrationSummaryModal .summary-details::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== ERROR DETAILS MODAL STYLES ===== */

/* Clickable stat item for errors */
.stat-item.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stat-item.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background-color: #f8f9fa;
}

.stat-item.clickable .stat-label {
    text-decoration: underline dotted;
}

/* Error Details Modal - wider for detailed content */
#errorDetailsModal .modal-content {
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Error Details Header - filters and actions */
.error-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.error-count-badge {
    font-weight: 600;
    color: #d32f2f;
    font-size: 1.1em;
    white-space: nowrap;
}

.error-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Search and filter inputs */
.error-search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.error-search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.error-filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.error-filter-select:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Error Details List Container */
.error-details-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

/* Individual Error Card */
.error-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #d32f2f;
    border-radius: 8px;
    padding: 16px;
    transition: box-shadow 0.2s ease;
}

.error-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Error Card Header */
.error-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.error-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05em;
}

/* Error Badge Styling */
.error-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.error-badge-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.error-badge-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

.error-badge-critical {
    background-color: #d32f2f;
    color: white;
    border: 1px solid #b71c1c;
}

.error-badge-auth {
    background-color: #e0e0e0;
    color: #424242;
    border: 1px solid #9e9e9e;
}

.error-badge-default {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #e0e0e0;
}

/* Small Copy Button */
.btn-copy-small {
    padding: 6px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.btn-copy-small:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.btn-copy-small:active {
    transform: scale(0.95);
}

/* Error Card Body */
.error-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Error Field Display */
.error-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.error-field strong {
    color: #424242;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-value {
    color: #666;
    font-size: 0.95em;
}

.error-value code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Error Message Box */
.error-message-box {
    background-color: #fff8f8;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    padding: 12px;
    color: #c62828;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Raw Error Details Expand */
.error-details-expand {
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

.error-details-expand summary {
    cursor: pointer;
    color: #1976d2;
    font-weight: 500;
    padding: 4px 0;
    user-select: none;
}

.error-details-expand summary:hover {
    color: #1565c0;
    text-decoration: underline;
}

.error-raw {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    margin-top: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    color: #424242;
}

/* Responsive adjustments for error modal */
@media (max-width: 1250px) {
    #errorDetailsModal .modal-content {
        max-width: 95%;
        margin: 2% auto;
    }
}

@media (max-width: 768px) {
    .error-details-header {
        flex-direction: column;
        align-items: stretch;
    }

    .error-actions {
        flex-direction: column;
        width: 100%;
    }

    .error-search-input,
    .error-filter-select {
        width: 100%;
    }

    .error-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ===== V2 SPECIFIC STYLES ===== */

/* Beta Badge */
.beta-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    font-size: 0.6em;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(238, 90, 111, 0.3);
}

/* V2 Info Banner */
.v2-info-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.v2-info-banner h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.v2-info-banner ul {
    list-style: none;
    padding: 0;
}

.v2-info-banner li {
    padding: 8px 0;
    font-size: 1.05em;
}

/* Progress Tracker */
.progress-tracker {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.progress-header {
    text-align: center;
    margin-bottom: 25px;
}

.progress-header h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.progress-header p {
    color: #666;
    font-size: 1.1em;
}

.progress-bar-container {
    width: 100%;
    height: 40px;
    background: #e9ecef;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-text {
    color: white;
    font-weight: bold;
    font-size: 1.1em;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 0 10px;
    color: #666;
}

.progress-batch {
    font-weight: 600;
    font-size: 1.05em;
}

.progress-time {
    font-size: 1.05em;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: #f8f9fa;
}

.stat-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
}

.stat-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
}

.stat-pending {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    border: 2px solid #6c757d;
}

.stat-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
}

/* Progress Complete State */
.progress-complete {
    border: 3px solid #28a745;
}

.progress-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.summary-stat {
    text-align: center;
    padding: 30px;
    border-radius: 12px;
}

.summary-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 3px solid #28a745;
}

.summary-failed {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 3px solid #dc3545;
}

.summary-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.summary-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.summary-label {
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
}

/* Progress Error State */
.progress-error {
    border: 3px solid #dc3545;
}

.error-message {
    background: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    color: #721c24;
    font-size: 1.05em;
}

/* Progress Actions */
.progress-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.progress-actions button {
    min-width: 180px;
}

/* Tabulator Overrides for V2 */
.tabulator {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.tabulator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.tabulator-header .tabulator-col {
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.tabulator-header .tabulator-col-title {
    color: white;
}

.tabulator-row.tabulator-selected {
    background-color: #e7f3ff !important;
}

.tabulator-row:hover {
    background-color: #f8f9fa !important;
}

/* Responsive V2 Styles */
@media (max-width: 768px) {
    .progress-stats {
        grid-template-columns: 1fr;
    }

    .progress-summary {
        grid-template-columns: 1fr;
    }

    .progress-actions {
        flex-direction: column;
    }

    .progress-actions button {
        width: 100%;
    }

    .beta-badge {
        display: block;
        margin: 10px 0 0 0;
        width: fit-content;
    }
}

/* ========================================
   V2 CACHE STATUS CARD
   ======================================== */

.cache-status-card {
    background: white;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.cache-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cache-status-header h3 {
    color: #333;
    margin: 0;
}

.cache-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.cache-stat {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #ccc;
}

.cache-stat.source-stat {
    background: rgba(52, 211, 153, 0.2);
    border: 2px solid rgba(52, 211, 153, 0.5);
}

.cache-stat.target-stat {
    background: rgba(251, 146, 60, 0.2);
    border: 2px solid rgba(251, 146, 60, 0.5);
}

.cache-stat-label {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-bottom: 8px;
    font-weight: 500;
}

.cache-stat-value {
    display: block;
    color: #333;
    font-size: 1.8em;
    font-weight: bold;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Cache Details Section */
.cache-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.cache-details-header {
    color: #333;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.cache-details-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Table layout for cache details */
.cache-details-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.cache-detail-row {
    background: #f5f5f5;
}

.cache-detail-row td {
    padding: 10px 12px;
}

.cache-detail-row td:first-child {
    border-radius: 6px 0 0 6px;
}

.cache-detail-row td:last-child {
    border-radius: 0 6px 6px 0;
}

.cache-detail-table {
    color: #333;
    font-weight: 500;
    font-size: 0.9em;
    width: 200px;
    vertical-align: top;
}

.cache-progress-cell {
    width: auto;
    vertical-align: top;
}

/* Legacy styles for backwards compatibility */
.cache-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 8px;
}

.cache-detail-counts {
    display: flex;
    gap: 8px;
}

.cache-source-badge,
.cache-target-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.cache-source-badge {
    background: rgba(52, 211, 153, 0.9);
    color: white;
}

.cache-target-badge {
    background: rgba(251, 146, 60, 0.9);
    color: white;
}

.cache-progress-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-left: 20px;
}

.cache-progress-bar {
    position: relative;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    min-width: 150px;
}

.cache-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.cache-progress-source {
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.7) 0%, rgba(52, 211, 153, 0.9) 100%);
}

.cache-progress-target {
    background: linear-gradient(90deg, rgba(251, 146, 60, 0.7) 0%, rgba(251, 146, 60, 0.9) 100%);
}

.cache-progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75em;
    font-weight: 600;
    color: #333;
    z-index: 1;
    text-shadow: 0 0 2px white;
}

/* To Do's Card Styles */
.todos-card {
    margin-bottom: 20px;
}

.todos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.todos-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.todos-actions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.todos-view-all-btn {
    flex-shrink: 0;
    height: auto;
    padding: 12px 16px !important;
    display: flex;
    align-items: center;
    border-radius: 6px;
    line-height: 1.5;
    min-height: fit-content;
}

.todos-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.todo-action-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    transition: all 0.2s ease;
}

.todo-action-card:hover {
    background: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.todo-action-icon {
    font-size: 1.5em;
}

.todo-action-content {
    flex: 1;
}

.todo-action-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    font-size: 0.9em;
}

.todo-action-subtitle {
    font-size: 0.75em;
    color: #666;
}

.todo-action-button {
    padding: 6px 12px;
    font-size: 0.85em;
    white-space: nowrap;
}

/* Side by Side Container for Cache Status and Migration Log */
.side-by-side-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.side-by-side-left,
.side-by-side-right {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

.side-by-side-left {
    max-width: 50%;
}

.side-by-side-right {
    max-width: 50%;
}

/* Migration Log Header */
.migration-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.migration-log-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

/* ========================================
   V2 AG GRID CONTAINER
   ======================================== */

.aggrid-container {
    margin-top: 20px;
    height: calc(100vh - 400px); /* Dynamic height based on viewport */
    min-height: 400px;
    max-height: 800px;
    width: 100%;
    overflow: auto; /* Enable scrolling for wide tables */
}

/* Customize AG Grid alpine theme to match our design */
.ag-theme-alpine {
    --ag-header-background-color: #f8f9fa;
    --ag-header-foreground-color: #333;
    --ag-row-hover-color: #f5f5f5;
    --ag-selected-row-background-color: #e3f2fd;
    --ag-border-color: #dee2e6;
    --ag-font-size: 14px;
    --ag-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ag-theme-alpine .ag-header-cell {
    font-weight: 600;
}

.ag-theme-alpine .ag-cell {
    display: flex;
    align-items: center;
}

/* Ensure horizontal scrolling */
.ag-theme-alpine .ag-body-horizontal-scroll {
    height: 14px !important;
}

.ag-theme-alpine .ag-body-horizontal-scroll-viewport {
    overflow-x: auto !important;
}

/* Loading Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Data Loading Overlay */
.data-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: all;
    user-select: none;
}

/* Tier-based license badges */
.license-badge.free {
    background: #9e9e9e;
    color: white;
}

.license-badge.starter {
    background: #2196f3;
    color: white;
}

.license-badge.basic {
    background: #4caf50;
    color: white;
}

.license-badge.pro {
    background: #9c27b0;
    color: white;
}

.license-badge.enterprise {
    background: #ff5722;
    color: white;
}

/* Export buttons */
.btn-export {
    padding: 8px 16px;
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-left: 8px;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
    background: linear-gradient(45deg, #138496, #0d6a7a);
}
