:root {
    --crm-salesforce: #0176d3;
    --crm-salesforce-glow: rgba(1, 118, 211, 0.25);
    --crm-hubspot: #ff7a59;
    --crm-hubspot-glow: rgba(255, 122, 89, 0.25);
    --crm-salesforce-rgb: 1, 118, 211;
    --crm-hubspot-rgb: 255, 122, 89;
    --crm-accent-color: var(--crm-salesforce);
    --crm-accent-glow: var(--crm-salesforce-glow);
    --crm-accent-color-rgb: var(--crm-salesforce-rgb);
    --card-panel-gradient-start: rgba(255, 255, 255, 0.96);
    --card-panel-gradient-end: #ffffff;
    --card-panel-border: rgba(15, 23, 42, 0.06);
}

:root[data-crm-mode="salesforce"] {
    --crm-accent-color: var(--crm-salesforce);
    --crm-accent-glow: var(--crm-salesforce-glow);
    --crm-accent-color-rgb: var(--crm-salesforce-rgb);
}

:root[data-crm-mode="hubspot"] {
    --crm-accent-color: var(--crm-hubspot);
    --crm-accent-glow: var(--crm-hubspot-glow);
    --crm-accent-color-rgb: var(--crm-hubspot-rgb);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

body.auth-body {
    background-color: var(--color-bg-secondary) !important;
}

.navbar {
    background-color: var(--color-nav-bg);
    box-shadow: var(--shadow-md);
}

.crm-mode-nav-item {
    min-width: 210px;
}

.crm-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-mode-pill {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.3s ease;
    min-width: 200px;
}

.crm-mode-pill::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    border-radius: 999px;
    background: var(--crm-salesforce);
    transform: translateX(0);
    transition: transform 0.3s ease, background 0.3s ease;
    z-index: 0;
}

.crm-mode-pill[data-active="hubspot"]::before {
    transform: translateX(100%);
    background: var(--crm-hubspot);
}

.crm-mode-toggle-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 8px 0 10px;
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 1;
}

.crm-mode-input {
    display: none;
}

.crm-mode-option {
    flex: 1;
    border-radius: 999px;
    padding: 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
    text-align: center;
    position: relative;
    z-index: 1;
}

.crm-mode-option:hover {
    color: #000;
}

.crm-mode-option.active {
    color: #fff;
    font-weight: 700;
}

.crm-mode-ribbon {
    transition: background-color 0.25s ease;
}

.crm-ribbon-salesforce {
    background-color: var(--crm-salesforce) !important;
}

.crm-ribbon-hubspot {
    background-color: var(--crm-hubspot) !important;
}

.navbar-brand {
    font-weight: bold;
    color: var(--color-nav-text) !important;
}

.auth-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 20px;
    background-color: var(--color-surface);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
}

.main-container {
    max-width: 1200px;
    margin: 30px auto;
    background-color: var(--color-surface);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 20px;
    width: 95%;
}

.transcript-container {
    display: flex;
    min-height: calc(100vh - 200px); /* Viewport height minus navbar and margins */
    max-height: calc(100vh - 200px);
    flex-wrap: nowrap;
    position: relative;
    margin-bottom: 30px;
}

.transcript-left, .transcript-right {
    padding: 15px 15px 20px 15px;
    border-radius: 6px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    position: relative;
    height: 100%;
    justify-content: space-between;
}

.transcript-left {
    background-color: var(--color-bg-tertiary);
    margin-right: 10px;
    border: var(--border-width-thin) solid var(--color-border-primary);
    box-shadow: var(--shadow-sm);
    flex: 0 0 55%;
    width: 55%;
    overflow: auto;
    min-width: 400px;
    position: relative;
}

.transcript-right {
    background-color: var(--color-bg-tertiary);
    margin-left: 10px;
    border: var(--border-width-thin) solid var(--color-border-primary);
    box-shadow: var(--shadow-sm);
    flex: 0 0 45%;
    width: 45%;
    min-width: 380px;
}

.textarea-container {
    position: relative;
    height: 100%;
    flex: 1;
    min-height: 450px;
    max-height: calc(100vh - 400px);
    margin-bottom: 20px;
    margin-top: 10px;
    z-index: 1;
    overflow: hidden;
}

#transcript {
    width: 100%;
    height: 100%;
    border: var(--border-width-thin) solid var(--color-input-border);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    font-size: 14px;
    resize: none;
    min-height: 350px;
    background-color: var(--color-input-bg);
    color: var(--color-input-text);
}

.json-container {
    position: relative;
    background-color: var(--color-surface);
    border: var(--border-width-thin) solid var(--color-border-primary);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    overflow: hidden;
    flex: 1;
    margin-bottom: 20px;
    margin-top: 10px;
    min-height: calc(100vh - 400px);
    max-height: calc(100vh - 400px);
    display: flex;
    flex-direction: column;
}

/* Style for the ECharts container inside the json-container */
.json-container > div {
    width: 100% !important;
    height: 370px !important; /* Fixed height minus padding */
    min-height: 370px;
}

/* Fullscreen styles for tree container */
.transcript-right:fullscreen .json-container,
.transcript-right:fullscreen .json-container > div {
    width: 100vw !important;
    height: 90vh !important;
    min-height: 90vh;
    max-width: 100vw;
    max-height: 100vh;
    background: #fff;
    border-radius: 0;
    padding: 0;
}

.transcript-right:fullscreen {
    background: #fff;
    border-radius: 0;
    padding: 0;
}

/* Ensure the canvas inside ECharts container is responsive */
.json-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Improved JSON formatter styling */
.json-formatter-row {
    font-family: monospace;
    margin-left: 1em;
}

.json-formatter-row a {
    color: var(--color-primary) !important;
}

.json-formatter-row .json-formatter-string {
    color: var(--color-success);
}

.json-formatter-row .json-formatter-number {
    color: var(--color-error);
}

.json-formatter-row .json-formatter-boolean {
    color: var(--color-primary);
}

.json-formatter-row .json-formatter-null {
    color: var(--color-text-tertiary);
}

.btn-extract, .btn-push {
    margin-top: auto;
    width: 100%;
    position: relative;
    bottom: 0;
    z-index: 20;
    cursor: pointer !important;
    pointer-events: auto !important;
    min-height: 48px;
}

/* Specific fix for Extract button clickability */
#extract-btn {
    position: relative !important;
    /* Low z-index so modal elements stay on top */
    z-index: 20 !important; 
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Salesforce settings form */
#salesforce-form {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

#salesforce-form .btn-primary {
    /* Modern button styles handled by modern-buttons.css */
    padding: 10px 20px;
}

#salesforce-form .form-control:focus {
    border-color: var(--color-input-border-focus);
    box-shadow: 0 0 0 0.25rem rgba(231, 91, 48, 0.25);
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
    vertical-align: middle;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    color: var(--color-text-primary);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.loading-overlay .spinner {
    color: var(--color-primary);
}

.loading-text {
    margin-left: 12px;
    font-size: 1rem;
}

.hidden {
    display: none;
}

/* Custom alerts styling */
.alert {
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: var(--color-alert-error-bg);
    color: var(--color-alert-error-text);
    border-color: var(--color-alert-error-border);
    border-left: 6px solid var(--color-error);
}

.alert-warning {
    background-color: var(--color-alert-warning-bg);
    color: var(--color-alert-warning-text);
    border-color: var(--color-alert-warning-border);
    border-left: 6px solid var(--color-warning);
}

.alert-success {
    background-color: var(--color-alert-success-bg);
    color: var(--color-alert-success-text);
    border-color: var(--color-alert-success-border);
    border-left: 6px solid var(--color-success);
}

.alert-info {
    background-color: var(--color-alert-info-bg);
    color: var(--color-alert-info-text);
    border-color: var(--color-alert-info-border);
    border-left: 6px solid var(--color-info);
}

/* Media Queries for Responsive Design */
@media screen and (min-width: 1200px) {
    .transcript-left {
        flex: 0 0 58%;
        width: 58%;
        min-width: 500px; /* Larger minimum width on big screens */
    }
    
    .transcript-right {
        flex: 0 0 42%;
        width: 42%;
        min-width: 420px; /* Larger minimum width on big screens */
    }
}

@media screen and (max-width: 768px) {
    .main-container {
        padding: 15px;
        margin: 15px auto;
    }
    
    .transcript-container {
        flex-direction: column;
        min-height: auto;
        max-height: none;
    }
    
    .transcript-left, .transcript-right {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        margin: 0 0 15px 0;
        flex: none;
    }
    
    .transcript-left {
        margin-right: 0;
    }
    
    .transcript-right {
        margin-left: 0;
    }
    
    .textarea-container, .json-container {
        height: 300px;
        min-height: 300px;
        max-height: 300px;
    }
    
    .auth-container {
        max-width: 90%;
        margin: 30px auto;
    }
}

@media screen and (max-width: 576px) {
    h2 {
        font-size: 1.5rem;
    }
    
    h5 {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.375rem 0.5rem;
    }
    
    #salesforce-form .btn-primary {
        padding: 8px 16px;
    }
    
    .textarea-container, .json-container {
        height: 250px;
    }
}

/* Fix button alignment on small screens */
@media screen and (max-width: 480px) {
    #salesforce-form .d-flex {
        flex-direction: column;
    }
    
    #salesforce-form .d-flex button {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Enhanced Alert Styling */
.alert {
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.alert .alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.alert-success .alert-icon {
    color: #155724;
}

.alert-danger .alert-icon {
    color: #721c24;
}

.alert-warning .alert-icon {
    color: #856404;
}

.alert-info .alert-icon {
    color: #0c5460;
}

.alert-message {
    font-size: 0.95rem;
}

.alert .btn-outline-success,
.alert .btn-outline-danger,
.alert .btn-outline-warning,
.alert .btn-outline-info {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.alert .card-body {
    background-color: rgba(0, 0, 0, 0.03);
    font-family: monospace;
    font-size: 0.8rem;
    overflow-x: auto;
}

@media screen and (max-width: 576px) {
    .alert {
        padding: 0.75rem;
        flex-direction: column;
    }
    
    .alert .alert-icon {
        margin-bottom: 0.5rem;
    }
    
    .alert .ms-auto {
        margin-top: 0.5rem;
        margin-left: 0 !important;
    }
    
    .alert .btn-close {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
}

/* Duplicates Confirmation Modal Styling */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Standard modal backdrop layer */
    z-index: 5000;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    /* Standard modal layer */
    z-index: 10000;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    display: none;
}

/* Custom modals created via JS need extra specificity */
#edit-card-modal.modal {
    z-index: 10000 !important;
    pointer-events: auto !important; 
}

#edit-modal-backdrop.modal-backdrop {
    z-index: 5000 !important;
}

/* Ensure modal dialog and content receive pointer events */
.modal-dialog {
    pointer-events: auto !important;
}

.modal-content {
    pointer-events: auto !important;
}

/* Ensure form inputs inside modals are clickable */
.modal-body input,
.modal-body textarea,
.modal-body select,
.modal-body button,
.modal-body .form-check,
.modal-body .form-switch,
.modal-footer button {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

/* Button specific fixes */
.btn-extract, .btn-push {
    z-index: 100;
    position: relative;
}

#extract-btn {
    position: relative !important;
    /* Lower z-index so modal elements (10k+) can stay on top */
    z-index: 500 !important; 
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Ensure echarts modals have proper styling too */
.echarts-modal {
    z-index: 10000 !important;
}

.echarts-modal-backdrop {
    z-index: 5000 !important;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal-lg {
    max-width: 800px;
}

/* Enhanced Push Modal - Properly Centered */
#enhanced-push-modal .modal-dialog {
    max-width: 95vw;
    width: 95vw;
    margin: 1.75rem auto;
    transform: none;
}

/* For larger screens, use a more reasonable max width and ensure centering */
@media (min-width: 1200px) {
    #enhanced-push-modal .modal-dialog {
        max-width: 1140px;
        width: 1140px;
        margin: 1.75rem auto;
    }
}

@media (min-width: 1400px) {
    #enhanced-push-modal .modal-dialog {
        max-width: 1320px;
        width: 1320px;
        margin: 1.75rem auto;
    }
}

/* Ensure content areas utilize the space well */
#enhanced-push-modal .modal-body {
    min-height: 70vh;
    max-height: 80vh;
    overflow-y: auto;
}

/* Manual Contact Creation Form Styles */
#create-contact-form {
    border: 2px dashed #0d6efd;
    border-radius: 8px;
    animation: slideDown 0.3s ease-out;
}

#create-contact-form .card-header {
    background: linear-gradient(135deg, #0d6efd, #0056b3) !important;
}

#create-contact-form .form-label {
    font-weight: 600;
    color: #495057;
}

#create-contact-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#create-contact-form .text-danger {
    font-weight: bold;
}

/* Animation for form appearance */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced contact card styling */
.contact-card.manual-contact {
    border: 2px solid var(--color-success);
    background: linear-gradient(135deg, var(--color-success-light), var(--color-blue-50));
}

.contact-card.manual-contact::before {
    content: "NEW";
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-success);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
}

/* Salesforce Loading Progress Modal Styles */
#salesforce-progress-modal {
    z-index: 16000;
    backdrop-filter: blur(5px);
}

/* Brighter Web Search Progress Modal */
.search-progress-header {
    background: linear-gradient(135deg, #2b88ff, #00c2ff) !important;
}

#search-progress-modal-backdrop.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.35) !important;
}

#search-progress-modal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

#search-progress-modal .modal-body {
    background: #ffffff;
}

#salesforce-progress-modal .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#salesforce-progress-modal .modal-header {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
    color: white;
    border-bottom: none;
    padding: 1.5rem;
}

#salesforce-progress-modal .modal-header h5 {
    margin: 0;
    font-weight: 600;
}

.progress-container {
    padding: 1rem 0;
}

.progress-step {
    display: flex;
    align-items: flex-start;
    padding: 1rem 0;
    border-left: 2px solid #e9ecef;
    margin-left: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.progress-step:last-child {
    border-left: none;
}

.progress-step.active {
    border-left-color: #0d6efd;
}

.progress-step.completed {
    border-left-color: var(--color-success);
}

.progress-step.error {
    border-left-color: var(--color-error);
}

.progress-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -17px;
    margin-right: 1rem;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.progress-step.active .progress-icon {
    border-color: #0d6efd;
    background: #e7f3ff;
}

.progress-step.completed .progress-icon {
    border-color: var(--color-success);
    background: var(--color-success-light);
}

.progress-step.error .progress-icon {
    border-color: var(--color-error);
    background: var(--color-error-light);
}

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

.progress-message {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.progress-step.active .progress-message {
    color: #0d6efd;
}

.progress-step.completed .progress-message {
    color: var(--color-success);
}

.progress-step.error .progress-message {
    color: var(--color-error);
}

.progress-detail {
    font-size: 0.875rem;
    color: #6c757d;
    display: none;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.progress-step.active .progress-detail,
.progress-step.completed .progress-detail {
    display: block;
    animation: fadeInDetail 0.3s ease-in;
}

@keyframes fadeInDetail {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress step animations */
.progress-step.active .progress-icon {
    animation: pulseActive 2s infinite;
}

@keyframes pulseActive {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(13, 110, 253, 0);
    }
}

.progress-step.completed .progress-icon {
    animation: bounceComplete 0.6s ease-out;
}

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

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.3rem - 1px);
    border-top-right-radius: calc(0.3rem - 1px);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
    overflow-y: auto;
    max-height: 70vh;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(0.3rem - 1px);
    border-bottom-left-radius: calc(0.3rem - 1px);
}

.modal-footer .btn {
    margin: 0.25rem;
}

/* Duplicates Card Styling */
.modal-body .card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.25rem;
}

.modal-body .card-header {
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.modal-body .card-body {
    padding: 1rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-footer {
        padding: 0.5rem;
    }
    
    .modal-body .card-body {
        padding: 0.75rem;
    }
}

/* Add disabled button color */
.btn:disabled, .btn.disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* Disabled button styles handled by modern-buttons.css */

.tree-view-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-primary);
    background-color: transparent;
    border: none;
    z-index: 10;
    transition: var(--transition-normal);
}

.tree-view-icon:hover {
    transform: scale(1.2);
}

.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--color-primary);
    background-color: transparent;
    border: none;
    z-index: 10;
    transition: var(--transition-normal);
    display: block;
}

.transcript-left .fullscreen-btn {
    top: 5px; /* Position it a bit higher */
    right: 10px;
    z-index: 20; /* Increase z-index to ensure it's above other elements */
}

.transcript-right .fullscreen-btn {
    right: 40px;
}

.fullscreen-btn:hover {
    transform: scale(1.2);
}

.minimize-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #00796B;
    background-color: transparent;
    border: none;
    z-index: 10;
    transition: transform 0.2s ease;
    display: none;
}

.transcript-right .minimize-btn {
    right: 40px;
}

.minimize-btn:hover {
    transform: scale(1.2);
}

.app-fullscreen .fullscreen-btn {
    display: none;
}

.app-fullscreen .minimize-btn {
    display: block;
}

.transcript-right.app-fullscreen .minimize-btn {
    right: 40px;
}

.transcript-left, .transcript-right {
    position: relative;
}

.echarts-container {
    width: 100%;
    height: 600px;
}

.json-fullscreen-btn {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.json-fullscreen-btn:hover {
    background-color: #e9ecef;
}

.tree-fullscreen-btn {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.tree-fullscreen-btn:hover {
    background-color: #e9ecef;
}

/* App fullscreen mode */
.app-fullscreen {
    position: fixed !important;
    top: 60px !important; /* Space for navbar */
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100vh - 60px) !important;
    max-width: none !important;
    max-height: none !important;
    z-index: 1000 !important;
    background: white !important;
    border-radius: 0 !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25) !important;
    padding: 20px !important;
    margin: 0 !important;
    overflow: auto !important;
}

.app-fullscreen .json-container {
    height: calc(100% - 80px) !important;
    min-height: 500px !important;
}

.app-fullscreen .json-container > div {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px !important;
}

.app-fullscreen .btn-push {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: calc(100% - 40px);
}

.app-fullscreen .btn-extract {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: calc(100% - 40px);
}

.app-fullscreen h5 {
    margin-bottom: 20px;
}

.app-fullscreen-modal {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100vh - 60px) !important;
    max-width: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.app-fullscreen-modal .modal-body {
    height: calc(100% - 60px);
    max-height: none;
}

.app-fullscreen-modal #json-formatter-container {
    height: 100%;
    max-height: none;
}

/* Add styles for form error messages */
.form-error {
    animation: fadeIn 0.3s;
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Salesforce data cards */
.sf-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 0;
    /* Keep container scrollbar on the right to avoid overlapping with card scrollbars */
    direction: ltr;
}

.sf-cards-container > * {
    /* Reset direction for card content */
    direction: ltr;
}

.sf-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.sf-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

.sf-card.selected {
    border-color: var(--color-success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.sf-card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    padding: 12px 15px;
}

.sf-card-body {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Move card body scrollbar to the left to avoid overlap with container */
    direction: rtl;
}

.sf-card-body > * {
    /* Reset direction for card content */
    direction: ltr;
}

.sf-fields-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sf-field-row {
    display: flex;
    flex-direction: column;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.sf-field-name {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sf-field-name .badge {
    font-size: 0.65rem;
    font-weight: normal;
}

.sf-field-value {
    color: #333;
    word-break: break-word;
}

/* Array and Object Display Styling */
.array-display {
    margin: 8px 0;
    padding: 0;
    list-style: none;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.array-display li {
    margin: 0;
    padding: 6px 12px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.array-display li:last-child {
    border-bottom: none;
}

.array-display li strong {
    color: #00796B;
    font-weight: 600;
    min-width: 20px;
    font-size: 0.85em;
}

.object-display {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin: 4px 0;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8em;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
}

/* Better JSON formatting */
.formatted-json {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    font-size: 0.85em;
}

.formatted-json .json-key {
    color: #0066cc;
    font-weight: 600;
}

.formatted-json .json-value {
    color: #333;
}

.formatted-json .json-string {
    color: #22863a;
}

.formatted-json .json-number {
    color: #005cc5;
}

.edit-card-btn {
    border: none;
    background: transparent;
    padding: 5px 8px;
    border-radius: 4px;
}

.edit-card-btn:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Style the checkbox to be more noticeable */
.sf-card .card-select-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.sf-card .form-check-label {
    cursor: pointer;
    font-weight: 600;
}

/* Make the "Select All" checkbox more noticeable */
#select-all-cards {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

#select-all-cards + label {
    cursor: pointer;
    font-weight: 600;
}

/* Visualization buttons */
.data-visualization-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 10;
}

.visualization-icon {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px 10px;
    transition: all 0.2s ease;
}

.visualization-icon:hover {
    background-color: #e9ecef;
    color: #212529;
}

/* Toggle fullscreen function - keep only for transcript side */
.app-fullscreen .fullscreen-btn {
    display: none;
}

.app-fullscreen .minimize-btn {
    display: inline-block;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.minimize-btn {
    display: none;
}

/* Make sure the tree view modal looks good */
#tree-chart-container {
    min-height: 500px;
}

/* Add a placeholder to show when no cards */
.card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-style: italic;
    min-height: 200px;
    grid-column: 1 / -1; /* Take full width in grid */
}

.card-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Microphone button and recording styles */
.mic-button {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s ease;
}

/* Reduce overlap when buttons are adjacent in a .btn-group */
.btn-group .mic-button + .mic-button {
    margin-left: 8px; /* counteracts bootstrap's -1px gap and adds spacing */
}

.mic-button:hover {
    background-color: #00796B;
    border-color: #00796B;
    color: white;
    transform: scale(1.05);
}

.mic-button.recording {
    background-color: var(--color-error);
    border-color: var(--color-error);
    color: white;
    animation: pulse 1.5s infinite;
}

.mic-button.recording:hover {
    background-color: #c82333;
    border-color: #c82333;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Recording indicator */
.recording-indicator {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recording-text {
    font-weight: 500;
    color: var(--color-error);
    margin-right: 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Audio wave animation */
.audio-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
}

.wave-bar {
    width: 4px;
    background: linear-gradient(to top, var(--color-error), var(--color-error-hover));
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0.1s; }
.wave-bar:nth-child(2) { animation-delay: 0.2s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.4s; }
.wave-bar:nth-child(5) { animation-delay: 0.5s; }

@keyframes wave {
    0%, 100% { height: 8px; }
    50% { height: 24px; }
}

/* Responsive adjustments for microphone */
@media screen and (max-width: 768px) {
    .mic-button {
        min-width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Merged into the main .data-visualization-buttons rule above */

.visualization-icon {
    background: none;
    border: 1px solid #00796B;
    color: #00796B;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
}

.visualization-icon:hover {
    background-color: #00796B;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 121, 107, 0.2);
}

/* Responsive adjustments for mobile */
@media screen and (max-width: 768px) {
    .visualization-icon {
        padding: 6px 8px;
        font-size: 14px;
        min-width: 32px;
        height: 32px;
    }
}

@media screen and (max-width: 576px) {
    .visualization-icon {
        padding: 5px 7px;
        font-size: 13px;
        min-width: 30px;
        height: 30px;
    }
}

/* Extract button states */
.btn-extract {
    transition: all 0.3s ease;
}

.btn-extract:disabled,
.btn-extract-disabled {
    background-color: var(--color-gray-500) !important;
    border-color: var(--color-gray-500) !important;
    color: var(--color-text-inverse) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.btn-extract-enabled {
    /* Use success button variant from modern-buttons.css */
    cursor: pointer !important;
    opacity: 1;
}

/* Extract button hover handled by modern-buttons.css */

/* Ensure the transcript container has a fixed layout */
.transcript-right {
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ensure push button always stays at the bottom with proper spacing */
.btn-push {
    /* Use success button styling from modern-buttons.css */
    margin-top: auto;
    width: 100%;
    position: relative;
    bottom: 0;
    min-height: 48px;
    z-index: 100;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.preview-actions .btn-push {
    background: var(--crm-accent-color) !important;
    border-color: var(--crm-accent-color) !important;
    box-shadow: 0 16px 40px var(--crm-accent-glow) !important;
    color: #ffffff !important;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.preview-actions .btn-push:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 50px var(--crm-accent-glow) !important;
}

/* Button hover styles handled by modern-buttons.css */

/* Disabled button styles handled by modern-buttons.css */

/* Add responsive breakpoints for cards */
@media (min-width: 600px) {
    .sf-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (min-width: 992px) {
    .sf-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (min-width: 1400px) {
    .sf-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}



/* Better card layout when there are few cards */
.few-cards .sf-card {
    flex: 1 1 100%;
    max-width: 100%;
}

/* For a single card */
.sf-card-solo {
    flex: 1 1 100% !important;
    max-width: 100% !important;
}

/* Placeholder content should maintain height */
.sf-cards-container .text-center {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 350px;
}

/* Create a flex structure inside panels */
.transcript-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    position: relative;
    z-index: 5;
    padding-top: 10px;
}

.transcript-content h5 {
    margin-bottom: 35px;
}

/* Ensure inputs inside modal are clickable */
.modal-body input, 
.modal-body textarea, 
.modal-body select, 
.modal-body .form-check-input {
    position: relative;
    z-index: 1; /* Higher than parent but lower than modal z-index */
    pointer-events: auto;
}

/* Modal display states */
.modal.show {
    display: block;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.3rem;
    outline: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Echarts modal styles */
.echarts-modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 11500;
}

.echarts-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 12000;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    display: none;
}

.echarts-modal.show {
    display: block;
}

/* Responsive viewport adjustments */
@media screen and (max-height: 800px) {
    .transcript-container {
        min-height: calc(100vh - 150px);
        max-height: calc(100vh - 150px);
    }
    
    .textarea-container, .json-container {
        min-height: calc(100vh - 350px);
        max-height: calc(100vh - 350px);
    }
}

@media screen and (max-height: 600px) {
    .transcript-container {
        min-height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
    
    .textarea-container, .json-container {
        min-height: calc(100vh - 300px);
        max-height: calc(100vh - 300px);
    }
}

/* Fix the layout for cards container to expand properly */
.json-container {
    display: flex !important;
    flex-direction: column !important;
}

.sf-cards-container {
    flex: 1 !important;
    height: auto !important;
    min-height: 0 !important;
}

/* Style placeholder text to match textarea placeholder - higher specificity than Bootstrap */
.json-container .placeholder-text {
    color: #6c757d !important;
    font-style: normal !important;
    opacity: 0.8 !important;
    font-size: 14px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-weight: normal !important;
    user-select: none;
    pointer-events: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    margin: 0;
    padding: 0;
    line-height: normal;
    text-align: center;
}

/* Fix the layout for cards container to expand properly */
.json-container {
    display: flex !important;
    flex-direction: column !important;
}

.sf-cards-container {
    flex: 1 !important;
    height: auto !important;
    min-height: 0 !important;
}

/* Terms and Privacy Policy Styling */
.terms-content, .privacy-content {
    line-height: 1.6;
    color: #333;
}

.terms-content h3, .privacy-content h3 {
    color: #00796B;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.terms-content h5, .privacy-content h5 {
    color: #495057;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.terms-content ul, .privacy-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.terms-content li, .privacy-content li {
    margin-bottom: 0.5rem;
}

.terms-content section, .privacy-content section {
    border-left: 3px solid #e9ecef;
    padding-left: 1rem;
    margin-bottom: 2rem;
}

.terms-content strong, .privacy-content strong {
    color: #00796B;
}

/* Form check styling for terms agreement */
.form-check-label a {
    color: #00796B;
    text-decoration: none;
}

.form-check-label a:hover {
    color: #004d40;
    text-decoration: underline;
}

.form-check-input:required {
    box-shadow: none;
}

.form-check-input:required:invalid {
    border-color: var(--color-error);
}

.form-check-input:required:valid {
    border-color: var(--color-success);
}

/* Auth footer links styling */
.auth-footer-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.auth-footer-links a {
    color: #6c757d;
    text-decoration: none;
    margin: 0 5px;
}

.auth-footer-links a:hover {
    color: #00796B;
    text-decoration: underline;
}

/* Search Progress Modal Styling */
.search-progress-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-bottom: none;
}

.search-progress-header .btn-close {
    filter: invert(1);
}

/* Enhanced Push Modal Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    position: relative;
    padding: 10px;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -50%;
    width: 100%;
    height: 2px;
    background-color: #dee2e6;
    z-index: 1;
}

.step.completed:not(:last-child)::after {
    background-color: #28a745;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.step.active .step-number {
    background-color: #007bff;
    color: white;
}

.step.completed .step-number {
    background-color: #28a745;
    color: white;
}

.step-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.step.active .step-label {
    color: #007bff;
    font-weight: 600;
}

.step.completed .step-label {
    color: #28a745;
    font-weight: 600;
}

/* Enhanced Data Cards */
.enhanced-data-card {
    transition: all 0.2s ease;
}

.enhanced-data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.enhanced-card-checkbox:checked + label {
    font-weight: 600;
}

.provenance-icon {
    font-size: 0.8em;
}

/* NoQ5 Enhancement Summary Styling */
.noq5-summary {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 2px solid #00796B;
    border-radius: 12px;
    margin: 20px 0;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 121, 107, 0.15);
    animation: slideInUp 0.5s ease-out;
}

.noq5-summary-header {
    background: #00796B;
    color: white;
    padding: 12px 20px;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.noq5-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.noq5-stat {
    text-align: center;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 100px;
}

.noq5-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #00796B;
    line-height: 1;
}

.noq5-stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.noq5-section {
    margin-bottom: 15px;
}

.noq5-section h6 {
    color: #00796B;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.noq5-list li {
    background: white;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid #00796B;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.noq5-edit {
    border-left-color: #ff9800 !important;
}

.noq5-addition {
    border-left-color: #4caf50 !important;
}

/* Highlight NoQ5 markings in card content */
.sf-card .field-value {
    position: relative;
}

.noq5-marking {
    background: rgba(0, 121, 107, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    position: relative;
}

.noq5-marking.noq5-edited {
    background: rgba(255, 152, 0, 0.15);
    color: #e65100;
}

.noq5-marking.noq5-added {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.noq5-marking::before {
    content: "🤖";
    font-size: 0.8em;
    margin-right: 2px;
}

/* NoQ5 Description styling for enhanced field descriptions */
.noq5-description {
    background: rgba(0, 121, 107, 0.05);
    border-left: 3px solid #00796B;
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    font-style: italic;
    color: #00695C;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.sf-field-value .noq5-description {
    margin-top: 8px;
    margin-bottom: 4px;
}

.noq5-edited + .noq5-description {
    background: rgba(255, 152, 0, 0.08);
    border-left-color: #ff9800;
    color: #e65100;
}

.noq5-added + .noq5-description {
    background: rgba(76, 175, 80, 0.08);
    border-left-color: #4caf50;
    color: #2e7d32;
}

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

/* Invitation-only registration styling */
.invitation-notice {
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.invitation-notice .text-muted {
    color: #6c757d !important;
    font-size: 0.9em;
}

.invitation-notice i {
    margin-right: 5px;
    color: #007bff;
}

/* Invitation code field styling */
#invitation-code {
    border: 2px solid #007bff !important;
    background-color: #f8f9ff;
}

#invitation-code:focus {
    border-color: #0056b3 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Readonly invitation code (pre-filled from URL) */
#invitation-code[readonly] {
    background-color: #e8f5e8 !important;
    border-color: var(--color-success) !important;
    color: #155724;
    cursor: not-allowed;
}

#invitation-code[readonly]:focus {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.form-text.text-muted {
    font-size: 0.875em;
    color: #6c757d !important;
    margin-top: 5px;
}

/* Update form-check styling for smaller checkboxes */
/* Keep generic checkbox size sane, registration page overrides in auth-styles.css */
.form-check-input {
    width: 16px;
    height: 16px;
}

.form-check-label {
    font-size: 14px;
}

/* NoQ5 Info Icons and Tooltips */
.noq5-info-icon {
    font-size: 0.8rem;
    margin-left: 5px;
    cursor: help;
    transition: color 0.2s ease;
}

.noq5-info-icon:hover {
    color: #0056b3 !important;
}

/* Custom tooltip styling for NoQ5 info */
.noq5-tooltip {
    background-color: #2c3e50 !important;
    color: #ecf0f1 !important;
    border: 1px solid #34495e !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    max-width: 300px !important;
    padding: 8px 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.noq5-tooltip .tooltip-arrow {
    border-top-color: #34495e !important;
}

.noq5-tooltip .tooltip-inner {
    background-color: #2c3e50 !important;
    color: #ecf0f1 !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
}

/* Enhanced field value styling for NoQ5 modified fields */
.sf-field-value .text-primary {
    color: #0066cc !important;
}

.sf-field-value .text-success {
    color: var(--color-success) !important;
}

/* Salesforce form validation styling */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--color-error);
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-control:not(.is-invalid) ~ .invalid-feedback {
    display: none;
}

/* Test connection button styling */
#test-connection-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#test-connection-btn:not(:disabled):hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #000;
}

/* Save button styling */
#save-sf-settings-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Forgot Password Modal Specific Styles */
.forgot-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    overflow-x: hidden;
    overflow-y: auto;
}

.forgot-password-modal .modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
}

.forgot-password-modal .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    outline: 0;
}

.forgot-password-modal .form-control {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: text !important;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.forgot-password-modal .form-control:focus {
    background-color: #ffffff !important;
    border-color: #00796B !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 121, 107, 0.25) !important;
    outline: 0 !important;
}

.forgot-password-modal .form-control:disabled,
.forgot-password-modal .form-control[disabled] {
    background-color: #e9ecef !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.forgot-password-modal .form-control::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

/* Ensure modal inputs are never disabled by default */
.forgot-password-modal input[type="email"],
.forgot-password-modal input[type="text"],
.forgot-password-modal input[type="password"] {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    box-shadow: none !important;
}

/* Prevent browser autofill styling */
.forgot-password-modal input:-webkit-autofill,
.forgot-password-modal input:-webkit-autofill:hover,
.forgot-password-modal input:-webkit-autofill:focus,
.forgot-password-modal input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #212529 !important;
}

.forgot-password-modal .btn-primary {
    background-color: #00796B !important;
    border-color: #00796B !important;
    color: #fff !important;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.forgot-password-modal .btn-primary:hover {
    background-color: #005a52 !important;
    border-color: #005a52 !important;
}

.forgot-password-modal .btn-primary:focus,
.forgot-password-modal .btn-primary.focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 121, 107, 0.5) !important;
}

.forgot-password-modal .btn-primary:disabled,
.forgot-password-modal .btn-primary.disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    opacity: 0.65;
}

/* Modal backdrop styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Reset code specific styling */
.forgot-password-modal #reset-code {
    text-align: center;
    letter-spacing: 2px;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Alert styling within modal */
.forgot-password-modal .alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.forgot-password-modal .alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.forgot-password-modal .alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Enhanced Salesforce Push Modal Styles */
#enhanced-push-modal {
    z-index: 15000; /* High priority modal */
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#enhanced-push-modal .modal-dialog {
    position: relative;
    margin: auto;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 3.5rem);
}

#enhanced-push-modal-backdrop {
    z-index: 14900; /* Modal backdrop below modal */
}

.progress-container {
    border-bottom: 1px solid #dee2e6;
}

.progress-steps {
    position: relative;
    padding: 0 20px;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    height: 2px;
    background-color: #e9ecef;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 120px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
    transition: color 0.3s ease;
}

.step.active .step-number {
    background-color: var(--crm-accent-color);
    color: white;
    border-color: var(--crm-accent-color);
    transform: scale(1.1);
    box-shadow: 0 0 0 3px var(--crm-accent-glow);
}

.step.active .step-label {
    color: var(--crm-accent-color);
    font-weight: 600;
}

.step.completed .step-number {
    background-color: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

.step.completed .step-label {
    color: var(--color-success);
    font-weight: 600;
}

.step-content-container {
    background-color: #fff;
}

.step-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Account and Opportunity Cards */
.account-card, .opportunity-card, .contact-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent !important;
}

.account-card:hover, .opportunity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.account-card.border-primary, .opportunity-card.border-primary {
    border-color: #0d6efd !important;
    background-color: #f8f9ff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2) !important;
}

.account-card .btn, .opportunity-card .btn {
    transition: all 0.2s ease;
}

.account-card:hover .btn, .opportunity-card:hover .btn {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* Contact Cards */
.contact-card {
    border: 1px solid #dee2e6 !important;
}

.contact-card:hover {
    border-color: #0d6efd !important;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15) !important;
}

.contact-checkbox:checked ~ .form-check-label {
    color: #0d6efd;
    font-weight: 600;
}

/* Data Review Cards */
.step-content .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-content .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Search Input Styling */
#account-search {
    border-radius: 8px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

#account-search:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Create New Sections */
.card.border-success {
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e9 100%);
    border-width: 2px !important;
}

.card.border-success:hover {
    background: linear-gradient(135deg, #f0fff1 0%, #dff0d8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15) !important;
}

/* Validation Summary */
.card.border-warning {
    background: linear-gradient(135deg, #fffdf5 0%, #fff3cd 100%);
}

.card.border-success {
    background: linear-gradient(135deg, #f8fff9 0%, #d4edda 100%);
}

/* Modal Navigation Buttons */
#enhanced-push-modal .modal-footer .btn {
    padding: 8px 20px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#enhanced-push-modal .modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .progress-steps {
        padding: 0 10px;
    }
    
    .progress-steps::before {
        left: 40px;
        right: 40px;
    }
    
    .step {
        min-width: 80px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .account-card, .opportunity-card {
        margin-bottom: 15px !important;
    }
    
    .step-content-container {
        max-height: 400px;
    }
}

/* Loading Overlay for Modal */
#enhanced-push-modal .modal-body.loading {
    position: relative;
}

#enhanced-push-modal .modal-body.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* Similarity Badges */
.badge.bg-success {
    background-color: var(--color-success) !important;
}

.badge.bg-warning {
    background-color: var(--color-warning) !important;
    color: var(--color-warning-dark) !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

/* Account Grid Scrolling */
.account-grid {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
}

.account-grid::-webkit-scrollbar {
    width: 6px;
}

.account-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.account-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.account-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Missing Field Styles */
.missing-field {
    background-color: var(--color-warning-light);
    border-left: 3px solid var(--color-warning);
    padding-left: 8px;
}

.missing-field .sf-field-name {
    color: #856404;
}

.missing-field .sf-field-value {
    font-style: italic;
    color: #6c757d;
}

.missing-fields-badge {
    margin-top: 4px;
}

.missing-fields-badge .badge {
    font-size: 0.75em;
}

/* Contact card specific styling */
.sf-card[data-object-type="Contact"] {
    border-left: 4px solid #0d6efd;
}

.sf-card[data-object-type="Contact"]:hover {
    border-left-color: #0a58ca;
}

/* Event card specific styling */
.sf-card[data-object-type="Event"] {
    border-left: 4px solid #198754;
}

.sf-card[data-object-type="Event"]:hover {
    border-left-color: #146c43;
}

/* Task card specific styling */
.sf-card[data-object-type="Task"] {
    border-left: 4px solid #fd7e14;
}

.sf-card[data-object-type="Task"]:hover {
    border-left-color: #e8650e;
}
/* Data Provenance Legend Component */
.data-provenance-legend {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-width: fit-content;
    width: auto;
    display: inline-block;
}

.data-provenance-legend h6 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.legend-item:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.legend-badge {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.legend-item.direct {
    background-color: var(--color-provenance-direct-bg);
    border-left: 4px solid var(--color-provenance-direct);
}

.legend-item.web-enhanced {
    background-color: var(--color-provenance-web-bg);
    border-left: 4px solid var(--color-provenance-web);
}

.legend-item.ai-enhanced {
    background-color: var(--color-provenance-ai-bg);
    border-left: 4px solid var(--color-provenance-ai);
}

.legend-item.mixed {
    background-color: var(--color-provenance-mixed-bg);
    border-left: 4px solid var(--color-provenance-mixed);
}

/* Data Provenance Field Styling */
.field-direct {
    color: var(--color-provenance-direct) !important;
    font-weight: 500;
}

.field-web-enhanced {
    color: var(--color-provenance-web) !important;
    font-weight: 600;
    border-bottom: 2px dashed var(--color-provenance-web);
    padding-bottom: 1px;
}

.field-ai-enhanced {
    color: var(--color-provenance-ai) !important;
    font-weight: 600;
    font-style: italic;
    border-bottom: 2px dotted var(--color-provenance-ai);
    padding-bottom: 1px;
}

.field-mixed {
    color: var(--color-provenance-mixed) !important;
    font-weight: 600;
    background: linear-gradient(45deg, var(--color-provenance-web), var(--color-provenance-ai));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Provenance badges for cards */
.provenance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.provenance-badge.direct {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.provenance-badge.web-enhanced {
    background-color: rgba(0, 123, 255, 0.15);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.provenance-badge.ai-enhanced {
    background-color: rgba(255, 193, 7, 0.15);
    color: #e68900;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.provenance-badge.mixed {
    background-color: rgba(111, 66, 193, 0.15);
    color: #6f42c1;
    border: 1px solid rgba(111, 66, 193, 0.3);
}

/* Enhanced card borders for provenance */
.sf-card.provenance-direct {
    border-left: 4px solid #28a745;
}

.sf-card.provenance-web-enhanced {
    border-left: 4px solid #007bff;
    border-style: dashed;
}

.sf-card.provenance-ai-enhanced {
    border-left: 4px solid #ffc107;
    border-style: dotted;
}

.sf-card.provenance-mixed {
    border-left: 4px solid;
    border-image: linear-gradient(45deg, #007bff, #ffc107) 1;
}

/* Provenance icons in data cards */
.provenance-icon {
    font-size: 0.8em;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

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

/* Enhanced Push Modal Button States */
#enhanced-push-next:disabled,
#enhanced-push-complete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

#enhanced-push-next:disabled:hover,
#enhanced-push-complete:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Enhanced card selection styling */
.enhanced-data-card {
    transition: all 0.2s ease-in-out;
}

.enhanced-data-card .enhanced-card-checkbox:checked + label {
    font-weight: 600;
}

.enhanced-data-card:has(.enhanced-card-checkbox:checked) {
    border-color: var(--crm-accent-color);
    box-shadow: 0 0 0 3px var(--crm-accent-glow);
}

/* Enhanced card organization and formatting - Enhanced existing styles */
.sf-cards-container {
    gap: 1.25rem;
    margin-top: 0.5rem;
}

/* Enhanced Cards Display Styles */
.enhanced-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.enhanced-card {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 8px 24px var(--crm-accent-glow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    background: #ffffff;
}

.enhanced-card:hover {
    box-shadow: 0 16px 36px var(--crm-accent-glow);
    transform: translateY(-4px);
}

.enhanced-card.selected {
    border-color: var(--crm-accent-color);
    box-shadow: 0 0 0 3px var(--crm-accent-glow), 0 16px 32px var(--crm-accent-glow);
}

.enhanced-card .card-header {
    border-radius: 12px 12px 0 0;
    padding: 0.85rem 1.1rem;
}

.enhanced-card .card-title {
    font-weight: 600;
    font-size: 1rem;
}

.enhanced-card .record-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.75rem;
    font-size: 0.75rem;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.record-status-badge.status-create {
    background: var(--crm-accent-color);
    color: #ffffff;
    box-shadow: 0 6px 14px var(--crm-accent-glow);
}

.record-status-badge.status-update {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--crm-accent-color);
    color: var(--crm-accent-color);
}

.enhanced-card .card-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.enhanced-card .edit-card-btn {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.enhanced-card .edit-card-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.fields-section {
    margin-bottom: 1rem;
}

.field-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

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

.field-label {
    font-weight: 500;
    color: #6c757d;
    min-width: 120px;
    flex-shrink: 0;
}

.field-value {
    flex: 1;
    text-align: right;
    word-break: break-word;
}


.diff-section {
    border: 1px solid var(--crm-accent-glow);
    border-radius: 10px;
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.55);
    margin-bottom: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.diff-header {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--crm-accent-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.diff-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
}

.diff-row:last-child {
    border-bottom: none;
}

.diff-field {
    font-weight: 600;
    color: #475569;
    min-width: 120px;
}

.diff-values {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: flex-end;
    flex: 1;
    text-align: right;
}

.diff-old {
    color: #94a3b8;
    font-size: 0.85rem;
    max-width: 190px;
    overflow-wrap: anywhere;
}

.diff-new {
    color: var(--crm-accent-color);
    font-weight: 600;
    font-size: 0.85rem;
    max-width: 190px;
    overflow-wrap: anywhere;
}

.diff-arrow {
    font-size: 1.25rem;
    color: #adb5bd;
}

.additional-fields-toggle .btn {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.additional-fields-content {
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
    margin-top: 0.5rem;
}

.preview-card {
    border-top: 4px solid var(--crm-accent-color);
}

.preview-card-header {
    background: linear-gradient(135deg, var(--crm-accent-color) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: #ffffff;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    margin-right: 0.6rem;
}

.preview-card-icon i {
    font-size: 1rem;
}

.preview-card-header .card-controls .btn {
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

.preview-card-header .card-controls .btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.8);
}

.preview-help-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 16000;
}

.preview-help-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(640px, 90vw);
    max-height: 85vh;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
    z-index: 16001;
    padding: 2rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow-y: auto;
}

.preview-help-content h4 {
    font-weight: 700;
    color: var(--color-text-primary);
}

.preview-help-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 999px;
    color: #475569;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.preview-help-close:hover {
    background: rgba(148, 163, 184, 0.2);
    color: var(--color-text-primary);
}

.help-intro {
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.preview-help-steps {
    counter-reset: help-steps;
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

.preview-help-steps li {
    counter-increment: help-steps;
    margin-bottom: 1rem;
    padding-left: 3rem;
    position: relative;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.preview-help-steps li::before {
    content: counter(help-steps);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--crm-accent-color) 0%, rgba(255, 255, 255, 0.24) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 8px 18px var(--crm-accent-glow);
}

.preview-help-steps strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.preview-help-footer {
    font-size: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding-top: 1rem;
    color: var(--color-text-secondary);
}

@media (max-width: 600px) {
    .preview-help-modal {
        width: calc(100vw - 2rem);
        padding: 1.5rem;
        border-radius: 14px;
        max-height: 88vh;
    }

    .preview-help-steps li {
        padding-left: 2.6rem;
    }

    .preview-help-steps li::before {
        width: 2rem;
        height: 2rem;
    }
}

.edit-card-modal {
    color: var(--color-text-primary);
}

.edit-card-modal .alert {
    margin-bottom: 1rem;
}

.profile-theme-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-theme-toggle-wrapper #current-theme-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.profile-theme-toggle.theme-toggle-compact {
    min-width: 52px;
}

.profile-header {
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .profile-theme-toggle-wrapper {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Ensure custom modals stay above page layers */
.modal.fade.show {
    z-index: 17000;
}

.modal-backdrop.fade.show {
    z-index: 16900;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.provenance-section {
    background: rgba(248, 250, 252, 0.9);
    border-radius: 8px;
    padding: 0.6rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.provenance-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: var(--crm-accent-glow);
    color: var(--crm-accent-color);
    font-weight: 600;
}

.provenance-badge.direct,
.provenance-badge.ai-enhanced,
.provenance-badge.web-enhanced {
    background: var(--crm-accent-glow);
    color: var(--crm-accent-color);
}

.no-data-message {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.no-data-message i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* CRM Comparison Styles */
.crm-match-card {
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    background: #ffffff;
    transition: all 0.25s ease;
    border-left: 5px solid var(--crm-accent-color);
    box-shadow: 0 18px 38px var(--crm-accent-glow);
}

.crm-match-card:hover {
    box-shadow: 0 26px 48px var(--crm-accent-glow);
    transform: translateY(-3px);
}

.crm-match-card.exact-match {
    background: rgba(255, 255, 255, 0.97);
}

.crm-match-card.similar-match {
    background: rgba(var(--crm-accent-color-rgb), 0.05);
}

.crm-match-card.potential-match {
    border-left-color: rgba(var(--crm-accent-color-rgb), 0.35);
    background: rgba(var(--crm-accent-color-rgb), 0.02);
}

.crm-match-card.selected {
    border-color: var(--crm-accent-color);
    box-shadow: 0 0 0 3px var(--crm-accent-glow), 0 26px 48px var(--crm-accent-glow);
}

.crm-match-card .card-header {
    background: linear-gradient(135deg, rgba(var(--crm-accent-color-rgb), 0.08) 0%, rgba(255, 255, 255, 0) 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.85rem 1.1rem;
}

.crm-sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: var(--crm-accent-glow);
    color: var(--crm-accent-color);
}

.crm-match-card .card-body {
    padding: 1.1rem;
}

.match-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.match-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.custom-object-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: inline-block;
}

.matched-field {
    background: rgba(40, 167, 69, 0.05);
    border-radius: 4px;
    padding: 0.25rem;
}

.matched-fields-summary {
    background: rgba(40, 167, 69, 0.05);
    border-radius: 4px;
    padding: 0.5rem;
}

.crm-empty-card {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
}

.crm-empty-card .card-header {
    background: transparent;
    border-bottom: 1px dashed #dee2e6;
    padding: 0.75rem 1rem;
}

.crm-empty-card .card-body {
    padding: 1rem;
}

.empty-state-message {
    text-align: center;
    color: #6c757d;
    padding: 1rem 0;
}

.empty-state-message i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.new-record-preview {
    background: white;
    border-radius: 4px;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
}

.field-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.field-preview .field-label {
    color: #6c757d;
    font-weight: 500;
}

.field-preview .field-value {
    font-weight: 600;
}

.empty-state-header,
.matches-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    margin-bottom: 1rem;
}

.object-type-section {
    margin-bottom: 2rem;
}

.object-type-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.error-state {
    padding: 1rem;
}

.retry-btn {
    margin-top: 0.5rem;
}

/* Visual Indicators for Record States */
.record-state-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.record-state-indicator.new-record {
    background: linear-gradient(135deg, var(--crm-accent-color), rgba(var(--crm-accent-color-rgb), 0.65));
    color: #ffffff;
    box-shadow: 0 4px 14px var(--crm-accent-glow);
}

.record-state-indicator.new-record::before {
    content: "✨";
    margin-right: 0.25rem;
}

.record-state-indicator.update-record {
    background: rgba(var(--crm-accent-color-rgb), 0.12);
    color: var(--crm-accent-color);
    border: 1px solid var(--crm-accent-glow);
    box-shadow: none;
}

.record-state-indicator.update-record::before {
    content: "🔄";
    margin-right: 0.25rem;
}

.record-state-indicator.similar-record {
    background: rgba(var(--crm-accent-color-rgb), 0.08);
    color: var(--crm-accent-color);
    border: 1px dashed var(--crm-accent-glow);
}

.record-state-indicator.similar-record::before {
    content: "🔍";
    margin-right: 0.25rem;
}

.record-state-indicator.exact-match {
    background: linear-gradient(135deg, #28a745, #155724);
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.4);
}

.record-state-indicator.exact-match::before {
    content: "✅";
    margin-right: 0.25rem;
}

/* Enhanced Card State Styling */
.enhanced-card.new-record {
    border-left: 5px solid var(--crm-accent-color);
    background: rgba(var(--crm-accent-color-rgb), 0.05);
}

.enhanced-card.update-record {
    border-left: 5px solid rgba(var(--crm-accent-color-rgb), 0.65);
    background: rgba(var(--crm-accent-color-rgb), 0.03);
}

.enhanced-card.similar-record,
.enhanced-card.exact-match {
    border-left: 5px solid rgba(var(--crm-accent-color-rgb), 0.55);
    background: rgba(var(--crm-accent-color-rgb), 0.04);
}

/* CRM Match Card State Indicators */
.crm-match-card.exact-match::before,
.crm-match-card.similar-match::before,
.crm-match-card.potential-match::before {
    content: "";
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #ffffff;
}

.crm-match-card.exact-match::before {
    background: var(--crm-accent-color);
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--crm-accent-color);
}

.crm-match-card.similar-match::before {
    background: rgba(var(--crm-accent-color-rgb), 0.65);
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(var(--crm-accent-color-rgb), 0.65);
}

.crm-match-card.potential-match::before {
    background: rgba(var(--crm-accent-color-rgb), 0.35);
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px rgba(var(--crm-accent-color-rgb), 0.35);
}

.crm-match-card {
    position: relative;
}

/* Action Indicators */
.action-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    font-weight: 500;
}

.action-indicator.will-create,
.action-indicator.will-update,
.action-indicator.will-merge,
.action-indicator.no-action {
    background: rgba(var(--crm-accent-color-rgb), 0.08);
    color: var(--crm-accent-color);
    border: 1px solid var(--crm-accent-glow);
}

/* Comparison Summary Panel */
.comparison-summary {
    background: linear-gradient(135deg, rgba(var(--crm-accent-color-rgb), 0.06), rgba(255, 255, 255, 0.95));
    border: 1px solid var(--crm-accent-glow);
    border-radius: 14px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.comparison-summary h6 {
    color: var(--crm-accent-color);
    font-weight: 700;
}

.comparison-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #495057;
}

.comparison-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.comparison-stat {
    text-align: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.comparison-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

.comparison-stat.new-records .comparison-stat-number {
    color: #28a745;
}

.comparison-stat.updates .comparison-stat-number {
    color: #ffc107;
}

.comparison-stat.matches .comparison-stat-number {
    color: #17a2b8;
}

.comparison-stat.total .comparison-stat-number {
    color: #495057;
}

/* Animated State Transitions */
@keyframes slideInFromRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.enhanced-card {
    animation: slideInFromRight 0.3s ease-out;
}

.crm-match-card,
.crm-empty-card {
    animation: slideInFromLeft 0.3s ease-out;
}

/* Responsive Adjustments for Visual Indicators */
@media (max-width: 768px) {
    .record-state-indicator {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .comparison-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .comparison-stat-number {
        font-size: 1.25rem;
    }
}

/* Enhanced card hover effects */
.sf-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Enhanced field layout */
.sf-field-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
    align-items: start;
}

.sf-field-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sf-field-name {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sf-field-value {
    color: #333;
    word-break: break-word;
    line-height: 1.4;
}

/* Better responsive handling */
@media (max-width: 768px) {
    .sf-field-row {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }
    
    .sf-field-name {
        font-size: 0.85rem;
    }
}

/* Two-Page Layout Styles */

/* Home page input container - centered single panel */
.home-input-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    padding: 2rem 1rem;
}

.home-input-panel {
    width: 100%;
    max-width: 600px;
    background: var(--color-card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

/* Preview page two-column layout */
.preview-container {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.preview-header {
    margin-bottom: 2rem;
}

#preview-help-btn {
    background: var(--crm-accent-color);
    border-color: var(--crm-accent-color);
    color: #ffffff;
    box-shadow: 0 12px 28px var(--crm-accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#preview-help-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px var(--crm-accent-glow);
}

.comparison-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.crm-current-column,
.crm-changes-column {
    position: relative;
    background: linear-gradient(180deg, var(--card-panel-gradient-start) 0%, var(--card-panel-gradient-end) 75%);
    border-radius: 18px;
    padding: 1.75rem;
    border: 1px solid var(--card-panel-border);
    box-shadow: 0 24px 48px var(--crm-accent-glow);
    border-top: 6px solid var(--crm-accent-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.column-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.column-header h5 {
    margin-bottom: 0.4rem;
    color: var(--crm-accent-color);
    font-weight: 700;
}

.column-header small {
    color: rgba(var(--crm-accent-color-rgb), 0.65);
}

/* CRM data containers */
.crm-data-container,
.extracted-data-container {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#select-all-container .form-check-input:checked {
    background-color: var(--crm-accent-color);
    border-color: var(--crm-accent-color);
    box-shadow: 0 0 0 3px var(--crm-accent-glow);
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.no-data-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: var(--color-text-secondary);
}

.no-data-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* CRM record cards */
.crm-records-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crm-record-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-left: 4px solid var(--crm-accent-color);
    border-radius: 12px;
    padding: 1.1rem;
    transition: all 0.25s ease;
    box-shadow: 0 14px 30px var(--crm-accent-glow);
}

.crm-record-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px var(--crm-accent-glow);
}

.record-header h6 {
    margin-bottom: 0.35rem;
    color: var(--crm-accent-color);
    font-weight: 700;
}

.record-header small {
    color: rgba(var(--crm-accent-color-rgb), 0.6);
}

.record-details {
    margin: 0.75rem 0;
}

.record-details p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.record-details i {
    width: 16px;
    margin-right: 0.5rem;
    color: var(--crm-accent-color);
}

.record-opportunities {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

/* Preview actions */
.preview-actions {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

/* Enhanced Navigation and Progress Indicators */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item {
    font-size: 0.9rem;
}

.breadcrumb-item .btn-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
    font-size: inherit;
    transition: color 0.2s ease;
}

.breadcrumb-item .btn-link:hover {
    color: var(--crm-accent-color);
}

.breadcrumb-item.active {
    color: var(--crm-accent-color);
    font-weight: 500;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.progress-steps {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid var(--color-border);
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
}

.progress-step.completed .step-circle {
    background: var(--crm-accent-color);
    border-color: var(--crm-accent-color);
    color: white;
}

.progress-step.active .step-circle {
    background: var(--color-bg-primary);
    border-color: var(--crm-accent-color);
    color: var(--crm-accent-color);
    box-shadow: 0 0 0 3px var(--crm-accent-glow);
}

.step-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
    color: var(--color-text-primary);
}

.progress-line {
    width: 60px;
    height: 2px;
    background: var(--color-border);
    transition: background-color 0.3s ease;
}

.progress-line.completed {
    background: var(--crm-accent-color);
}

/* Intelligent Matching Styles */
.matches-section,
.other-records-section {
    margin-bottom: 2rem;
}

.section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.section-header h6 {
    margin-bottom: 0.25rem;
    color: var(--color-text-primary);
    font-weight: 600;
}

.matched-record {
    border-left: 4px solid var(--crm-accent-color);
    background: linear-gradient(90deg, var(--crm-accent-glow), transparent);
}

.matched-record[data-confidence="0.8"],
.matched-record[data-confidence="0.9"],
.matched-record[data-confidence="1.0"] {
    border-left-color: #28a745;
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.1), transparent);
}

.record-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.match-badges {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}

.confidence-badge,
.action-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(var(--crm-accent-color-rgb), 0.1);
    color: var(--crm-accent-color);
    border: 1px solid var(--crm-accent-glow);
}

.preview-container .badge-success,
.preview-container .badge-warning,
.preview-container .badge-info {
    background: rgba(var(--crm-accent-color-rgb), 0.1) !important;
    color: var(--crm-accent-color) !important;
}

.badge-primary {
    background: var(--crm-accent-color);
    color: white;
}

.badge-secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.match-reasons {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}

.match-reasons small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading Skeleton */
.loading-skeleton {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-header {
    margin-bottom: 0.75rem;
}

.skeleton-title {
    height: 1.2rem;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    width: 70%;
}

.skeleton-subtitle {
    height: 0.9rem;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    width: 50%;
}

.skeleton-content {
    margin-bottom: 0.75rem;
}

.skeleton-line {
    height: 0.8rem;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-footer {
    display: flex;
    gap: 0.5rem;
}

.skeleton-badge {
    height: 1.5rem;
    width: 80px;
    background: var(--color-bg-tertiary);
    border-radius: 12px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: var(--color-text-secondary);
}

/* Enhanced Error State */
.enhanced-error-state {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin: 1rem 0;
}

.enhanced-error-state .error-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.enhanced-error-state .error-message {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.enhanced-error-state .error-step {
    display: block;
    font-style: italic;
    color: #6c757d;
    margin-bottom: 1rem;
}

.enhanced-error-state .error-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.enhanced-error-state .error-help {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
    margin-top: 1rem;
}

.enhanced-error-state .error-help a {
    color: #0d6efd;
    font-weight: 500;
}

.enhanced-error-state .error-help a:hover {
    color: #0b5ed7;
    text-decoration: underline !important;
}

/* Spinning animation for test button */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-state h6 {
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.error-state p {
    margin-bottom: 1.5rem;
}

/* Records Summary */
.records-summary {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    margin-top: 1rem;
}

/* Enhanced Enhancement Modal Styles */
.enhancement-modal {
    backdrop-filter: blur(3px);
}

.enhancement-modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.enhancement-progress-header {
    border-radius: 12px 12px 0 0;
    padding: 1.5rem;
}

.enhancement-modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.detected-terms {
    background: var(--color-bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--crm-accent-color);
}

.detected-terms li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.enhancement-log-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--color-bg-primary), var(--color-bg-secondary));
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.enhancement-log-container::-webkit-scrollbar {
    width: 6px;
}

.enhancement-log-container::-webkit-scrollbar-track {
    background: var(--color-bg-tertiary);
    border-radius: 3px;
}

.enhancement-log-container::-webkit-scrollbar-thumb {
    background: var(--crm-accent-color);
    border-radius: 3px;
}

.enhancement-log-container::-webkit-scrollbar-thumb:hover {
    background: var(--crm-accent-color)dd;
}

#search-log-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    animation: slideInFromLeft 0.3s ease-out;
}

#search-log-list li:last-child {
    border-bottom: none;
}

#search-log-list li span:first-child {
    font-size: 1.2em;
    min-width: 2rem;
    display: inline-block;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* CRM Mode Specific Theming */
.crm-salesforce .enhancement-progress-header {
    background: linear-gradient(135deg, #0176d3, #0176d3dd) !important;
}

.crm-hubspot .enhancement-progress-header {
    background: linear-gradient(135deg, #ff7a59, #ff7a59dd) !important;
}

.crm-salesforce .detected-terms {
    border-left-color: #0176d3;
}

.crm-hubspot .detected-terms {
    border-left-color: #ff7a59;
}

.crm-salesforce .enhancement-log-container::-webkit-scrollbar-thumb {
    background: #0176d3;
}

.crm-hubspot .enhancement-log-container::-webkit-scrollbar-thumb {
    background: #ff7a59;
}

/* Enhanced Touch Interactions for Mobile */
@media (max-width: 768px) {
    .crm-record-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
        touch-action: manipulation;
    }
    
    .crm-record-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .match-badges {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .progress-steps {
        gap: 0.5rem;
    }
    
    .progress-line {
        width: 40px;
    }
    
    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
    
    .step-label {
        font-size: 0.7rem;
    }
    
    .breadcrumb-item {
        font-size: 0.8rem;
    }
    
    /* Mobile Enhancement Modal */
    .enhancement-modal .modal-dialog {
        max-width: 95vw !important;
        width: 95vw !important;
        margin: 0.5rem !important;
    }
    
    .enhancement-progress-header {
        padding: 1rem;
    }
    
    .enhancement-modal-body {
        padding: 1rem;
        max-height: 60vh;
    }
    
    .enhancement-log-container {
        max-height: 300px;
        padding: 1rem;
    }
}

/* Responsive design for smaller screens */
@media (max-width: 1024px) {
    .comparison-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .crm-current-column,
    .crm-changes-column {
        padding: 1rem;
    }
    
    .crm-data-container,
    .extracted-data-container {
        max-height: 50vh;
    }
}

@media (max-width: 768px) {
    .home-input-panel {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .preview-container {
        padding: 0.5rem;
    }
    
    .comparison-layout {
        gap: 1rem;
    }
    
    .crm-current-column,
    .crm-changes-column {
        padding: 1rem;
    }

    .profile-theme-toggle-wrapper {
        width: 100%;
        justify-content: flex-start;
    }
}
