/* Survey Processor Styles */

/* Header buttons */
.header-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Batches Modal - Documents Grid */
.batches-list {
    overflow-x: auto;
}

.download-all-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(67, 91, 107, 0.05);
    border: 1px solid rgba(67, 91, 107, 0.3);
    border-radius: 8px;
    text-align: center;
}

.download-all-section .btn {
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    margin-bottom: 0.5rem;
}

.download-all-section .text-muted {
    margin: 0;
    font-size: 0.9rem;
}

.documents-section {
    margin-bottom: 2rem;
}

.documents-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 1rem;
}

.document-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
    padding-left: 3rem;
}

.document-checkbox {
    position: absolute;
    left: 1rem;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    z-index: 2;
}

.select-all-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.select-all-checkbox {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.download-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.document-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.document-card.document-missing {
    opacity: 0.6;
    border-color: var(--accent-error);
}

.document-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-name {
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(35, 97, 146, 0.2);
    color: var(--accent-success);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-warning);
}

.badge-error {
    background: rgba(248, 113, 113, 0.2);
    color: var(--accent-error);
}

/* SIC survey number badge */
.sic-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(35, 97, 146, 0.12);
    color: var(--accent-success);
    border: 1px solid rgba(35, 97, 146, 0.3);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

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

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    display: block;
    animation: btn-spin 0.6s linear infinite;
}

.btn-secondary.btn-loading::after,
.btn-secondary-body.btn-loading::after {
    border-top-color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Comment cells */
.comment-cell {
    max-width: 400px;
}

.comment-text {
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-style: italic;
    color: var(--text-primary);
}

/* Structured comment with individual classification */
.comment-text-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.5rem;
    margin: 0.25rem 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    gap: 0.5rem;
}

.comment-text-value {
    flex: 1;
    font-style: italic;
    color: var(--text-primary);
}

.comment-text-class {
    flex-shrink: 0;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    background: rgba(67, 91, 107, 0.15);
    color: var(--accent-primary);
    border-radius: 4px;
    font-family: monospace;
}

.question-label-cell {
    max-width: 200px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Pricing Summary */
.pricing-summary {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.pricing-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.pricing-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pricing-total {
    margin-left: auto;
    padding-left: 2rem;
    border-left: 1px solid var(--border-color);
}

.pricing-total .pricing-value {
    color: var(--accent-success);
    font-size: 1.3rem;
}

:root {
    /* Colores Corporativos EMC2 */
    --emc2-primary: #435b6b;
    --emc2-primary-rgb: 67, 91, 107;
    --emc2-gray-dark: #54585A;
    --emc2-gray-light: #B1B3B3;
    --emc2-white: #FFFFFF;

    /* Colores complementarios */
    --emc2-gray-11: #53565A;
    --emc2-gray-10: #63666A;
    --emc2-gray-9: #75787B;
    --emc2-gray-8: #888B8D;
    --emc2-gray-7: #97999B;
    --emc2-blue-navy-1: #0C2340;
    --emc2-blue-navy-2: #002554;
    --emc2-blue-navy-3: #003C71;
    --emc2-blue-navy-4: #236192;

    /* Variables del sistema - Tema Claro */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-panel: #FFFFFF;
    --bg-tertiary: #F1F3F5;
    --accent-primary: #435b6b;
    --accent-secondary: #54585A;
    --accent-success: #236192;
    --accent-error: #dc3545;
    --accent-warning: #fbbf24;
    --text-primary: #54585A;
    --text-secondary: #75787B;
    --text-muted: #888B8D;
    --border-color: #E0E0E0;
}

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

body {
    font-family: 'Lato', 'Calibri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--emc2-primary);
    border-bottom: 2px solid var(--emc2-gray-dark);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 55px;
    width: auto;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
}

.app-header h1 {
    font-size: 1.5rem;
    color: var(--emc2-white);
    font-weight: 600;
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.main-content-single {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Panels */
.questionnaire-panel,
.batches-panel,
.upload-panel,
.upload-panel-full {
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.upload-panel-full {
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

/* Select Dropdown */
.select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-select:hover {
    border-color: var(--accent-primary);
}

.custom-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--emc2-primary);
    color: white;
    font-weight: 500;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 91, 107, 0.4);
    background: rgba(67, 91, 107, 0.9);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-success), #003C71);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 97, 146, 0.4);
}

.btn-secondary {
    background: var(--emc2-white);
    color: var(--emc2-primary);
    border: 1px solid var(--emc2-white);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--emc2-white);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-secondary-body {
    background: var(--emc2-gray-dark);
    color: var(--emc2-white);
    border: 1px solid var(--emc2-gray-dark);
}

.btn-secondary-body:hover {
    background: rgba(84, 88, 90, 0.85);
    border-color: var(--emc2-gray-dark);
}

.btn-danger-outline {
    background: transparent;
    color: var(--accent-error);
    border: 1.5px solid var(--accent-error);
    font-weight: 500;
    opacity: 0.85;
    transition: all 0.2s;
}

.btn-danger-outline:hover:not(:disabled) {
    background: var(--accent-error);
    color: white;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.35);
}

.btn-danger-outline:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Processing Status (Old - keeping for compatibility) */
.processing-status {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.status-icon {
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

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

    100% {
        transform: rotate(360deg);
    }
}

.progress-bar {
    height: 8px;
    background: #E0E0E0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* New Processing Section - Full Screen */
.processing-section-full {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    padding: 3rem;
}

.sending-status {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    margin-bottom: 2.5rem;
    border: 2px solid rgba(35, 97, 146, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.sending-status .status-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid #E0E0E0;
    border-top-color: var(--accent-success);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Document loading spinner */
.doc-image-container {
    position: relative;
    min-height: 200px;
}

.doc-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.doc-loader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.doc-loader span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* When spinner is inside a small button, match the text line-height */
.btn-sm .spinner-small {
    width: 14px;
    height: 14px;
    border-width: 2px;
    vertical-align: middle;
}

/* Prevent btn-sm from shrinking when content is replaced with spinner */
.btn-sm {
    min-width: 70px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.processing-section-full[hidden] {
    display: none !important;
}

.processing-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

/* Spinner Circle */
.spinner-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    border: 6px solid #E0E0E0;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.processing-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: spin 2s linear infinite;
}

.processing-container h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.processing-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.progress-bar-large {
    height: 40px;
    background: #E0E0E0;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill-large {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 20px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 1rem;
    box-shadow: 0 2px 8px rgba(67, 91, 107, 0.4);
}

.progress-percentage {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.progress-info {
    margin-bottom: 1rem;
}

.progress-count {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.current-file-info {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.current-file-info .label {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.25rem;
}

.current-file-info .filename {
    color: var(--accent-primary);
    font-weight: 500;
    word-break: break-all;
}

/* Results Section - Full Screen */
.results-section-full {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.results-section-full[hidden] {
    display: none !important;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.results-header h2,
.results-header h3 {
    margin: 0;
    text-align: center;
}

.results-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.results-header h2 {
    font-size: 2.2rem;
    color: var(--accent-success);
    margin-bottom: 1rem;
    font-weight: 600;
}

.results-summary {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.results-summary p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.survey-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.survey-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.survey-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    border-left: 4px solid var(--accent-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 91, 107, 0.15);
}

.survey-item h4 {
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.survey-item p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Status indicators and badges */
.status-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
}

.status-badge.status-success {
    background: rgba(35, 97, 146, 0.12);
    color: var(--accent-success);
    border: 1px solid rgba(35, 97, 146, 0.3);
}

.status-badge.status-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--accent-error);
    border: 1px solid rgba(220, 53, 69, 0.25);
}

.status-badge.status-processing {
    background: rgba(67, 91, 107, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(67, 91, 107, 0.25);
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.status-pending {
    background: rgba(136, 139, 141, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(136, 139, 141, 0.25);
}

/* Small button styles for retry buttons */
.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-retry {
    background: rgba(67, 91, 107, 0.08);
    color: var(--accent-primary);
    border: 1px solid rgba(67, 91, 107, 0.25);
}

.btn-retry:hover {
    background: rgba(67, 91, 107, 0.15);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Retry buttons alignment inside survey items */
.survey-item .btn-sm {
    margin-top: 0.4rem;
}

.survey-list.view-list .survey-item .btn-sm {
    margin-top: 0;
    margin-left: 0.4rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 3rem;
    flex-wrap: wrap;
}

/* Batches List */
.batches-list {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    grid-column: 1 / -1;
}

.batch-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.batch-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(67, 91, 107, 0.15);
}

.batch-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.batch-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.batch-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.status-processing {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-warning);
}

.status-completed {
    background: rgba(35, 97, 146, 0.2);
    color: var(--accent-success);
}

.status-error {
    background: rgba(248, 113, 113, 0.2);
    color: var(--accent-error);
}

.batch-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Drop Zone */
.upload-group {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.upload-group h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.drop-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(67, 91, 107, 0.05);
}

.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(67, 91, 107, 0.1);
}

.drop-zone-control {
    border-color: rgba(147, 51, 234, 0.3);
}

.drop-zone-control:hover {
    border-color: rgba(147, 51, 234, 0.6);
    background: rgba(147, 51, 234, 0.05);
}

.drop-zone-control.drag-over {
    border-color: rgba(147, 51, 234, 0.8);
    background: rgba(147, 51, 234, 0.1);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.browse-link {
    color: var(--accent-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* Selected Files */
.selected-files {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.selected-files h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

#fileList {
    list-style: none;
    margin-bottom: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-name {
    flex: 1;
    margin-right: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-right: 0.75rem;
}

.btn-remove {
    background: rgba(248, 113, 113, 0.2);
    color: var(--accent-error);
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: rgba(248, 113, 113, 0.3);
}

/* Action Buttons */
.action-buttons {
    text-align: center;
    margin: 1.5rem 0;
}

/* Messages */
.error-message,
.success-message {
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

.error-message[hidden],
.success-message[hidden] {
    display: none !important;
}

.error-message {
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid var(--accent-error);
    color: var(--accent-error);
}

.success-message {
    background: rgba(35, 97, 146, 0.15);
    border: 2px solid var(--accent-success);
    color: var(--accent-success);
    box-shadow: 0 2px 8px rgba(35, 97, 146, 0.15);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Remesa Info */
.remesa-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.75rem;
}

.remesa-info p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-box {
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo img {
    max-width: 250px;
    width: 100%;
    height: auto;
    background: transparent;
    mix-blend-mode: multiply;
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-weight: 500;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-header p {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Remesa Selection Page */
.remesa-panel {
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filters-section {
    margin-bottom: 2rem;
}

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

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Remesa Table */
.remesa-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

.remesa-table thead {
    background: var(--bg-tertiary);
}

.remesa-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.remesa-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.remesa-table tbody tr {
    cursor: pointer;
    transition: all 0.2s;
}

.remesa-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-online {
    background: rgba(35, 97, 146, 0.2);
    color: var(--accent-success);
}

.badge-presencial {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-warning);
}

.badge-cerrada {
    background: rgba(248, 113, 113, 0.2);
    color: var(--accent-error);
}

.badge-en-curso {
    background: rgba(67, 97, 238, 0.2);
    color: var(--accent-primary);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn,
.btn-pagination {
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
    min-width: 44px;
    text-align: center;
}

.pagination-btn:hover:not(:disabled),
.btn-pagination:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.pagination-btn:disabled,
.btn-pagination:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.btn-pagination.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.page-number {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: 6px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-dialog {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-large {
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header-error {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(239, 68, 68, 0.2));
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(248, 113, 113, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon {
    font-size: 2rem;
}

.modal-header-error h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body-error {
    padding: 2rem;
}

.modal-actions,
.modal-footer {
    padding: 1.5rem 2rem 2.5rem 2rem;
    /* Added more bottom padding */
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Survey Detail View Styles */
.view-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.view-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.view-tab:hover {
    color: var(--text-primary);
}

.view-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.view-panel {
    display: flex;
    flex-direction: column;
}

.results-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.results-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    margin-top: 1rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.results-table thead {
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.results-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* Centrar columna de acciones en tablas */
.results-table th:last-child,
.results-table td:last-child {
    text-align: center;
}

.results-table td.item-actions {
    padding: 0.5rem;
    width: 1%;
    white-space: nowrap;
}




.results-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.value-cell {
    padding: 0.5rem;
}

/* Value select (readonly dropdown) */
.value-select {
    width: 100%;
    max-width: 350px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    appearance: auto;
    transition: all 0.2s;
}

.value-select:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.value-select.invalid {
    border-color: var(--accent-error);
    background: rgba(248, 113, 113, 0.05);
    color: var(--accent-error);
}

.value-select.invalid:hover {
    background: rgba(248, 113, 113, 0.1);
}

/* Value input (readonly text field) */
.value-input {
    width: 100%;
    max-width: 350px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: default;
    transition: all 0.2s;
}

.value-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.value-input:read-only {
    cursor: default;
}

/* Comment textarea */
.comment-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    min-height: 50px;
    cursor: default;
    transition: all 0.2s;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.comment-textarea:read-only {
    cursor: default;
}

/* Classification group */
.classification-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.classification-input {
    width: 100%;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: default;
    text-align: center;
}

.classification-input:focus {
    outline: none;
}

/* Comment continuation rows (multiple texts for same question) */
.comment-continuation td:first-child {
    border-top: none;
    padding-top: 0;
}

.options-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.option-tag {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    background: rgba(67, 91, 107, 0.15);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

/* Options dropdown */
.options-dropdown {
    cursor: pointer;
}

.options-summary {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: rgba(67, 91, 107, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.options-summary:hover {
    background: rgba(67, 91, 107, 0.2);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.options-summary::marker {
    content: '▶ ';
    font-size: 0.7rem;
}

.options-dropdown[open] .options-summary::marker {
    content: '▼ ';
}

.options-list {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.option-item {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

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

/* Split View Layout (for survey detail) */
.split-view {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    height: calc(90vh - 180px);
    overflow: hidden;
}

.split-left {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
}

.split-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.document-viewer {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.doc-viewer-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.doc-viewer-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.doc-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.doc-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.doc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0 0.5rem;
}

.doc-viewer-content {
    flex: 1;
    overflow: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    position: relative;
    cursor: default;
    display: block;
    /* Changed from flex to block for better scroll control */
}

.doc-image-container {
    display: block;
    width: 100%;
    min-height: 100%;
    text-align: center;
}

.doc-viewer-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform-origin: center top;
    /* Zoom from top center feels more natural for documents */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

/* Make modal body scrollable */
.modal-large .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}


/* Live Results in Processing */
.live-results-container-full {
    margin-top: 3rem;
    width: 100%;
    padding: 0 2rem 2rem 2rem;
}

.live-results-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
    position: relative;
}

.live-results-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.processing-section-full {
    flex-direction: column;
    align-items: center;
}

.survey-item,
.list-header {
    border-left: 4px solid var(--border-color) !important;
}

.survey-item.error {
    border-left: 4px solid var(--accent-error) !important;
}



.error-text {
    color: var(--accent-error);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Instant Tooltip Styling */
[data-tooltip] {
    position: relative;
    overflow: visible;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 6px 12px;
    background: #2c3e50;
    color: white;
    font-size: 0.8rem;
    border-radius: 4px;
    text-align: center;
    width: max-content;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s, visibility 0.1s;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    line-height: 1.4;
    white-space: normal;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    border: 6px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s, visibility 0.1s;
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */

/* View Toggle Controls */
.view-controls-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

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

.view-btn {
    padding: 0.4rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.view-btn.active {
    background: var(--emc2-primary);
    color: white;
    border-color: var(--emc2-primary);
}

.view-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.survey-list.view-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-bottom: 0 !important;
    /* Override global survey-list margin */
}

.survey-list.view-list .survey-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    gap: 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    min-width: 800px;
    /* Minimum width to prevent squashing */
}

.survey-list.view-list .survey-item:last-child {
    border-bottom: none;
}

.survey-list.view-list .survey-item:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.survey-list.view-list .survey-item h4,
.survey-list.view-list .survey-item .survey-number {
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: normal;
    flex: 0 0 150px;
}

/* SIC number column slot — always rendered to keep column alignment */
.survey-list.view-list .survey-item .sic-slot {
    flex: 0 0 90px;
    margin-bottom: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-success);
    opacity: 0.75;
}

.survey-list.view-list .survey-item p {
    margin-bottom: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.survey-list.view-list .survey-item .survey-stats {
    flex: 0 0 220px;
    margin-bottom: 0;
    display: flex;
    gap: 0.5rem;
}

.survey-list.view-list .survey-item .survey-stats span {
    flex: 1;
    text-align: center;
}

.survey-list.view-list .survey-item .item-actions {
    flex: 0 0 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.survey-list.view-list .survey-item .document-checkbox {
    position: static;
    flex: 0 0 auto;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.survey-list.view-list .survey-item .btn,
.survey-list.view-list .survey-item button {
    margin: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    flex: 0 0 auto;
    /* Allow natural sizing while centered */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* List Table Header */
.list-header {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    gap: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--bg-tertiary);
    /* Match survey-item border-left + its own 1px */
    border-bottom: 2px solid var(--border-color);

    margin-bottom: 0;
    min-width: 800px;
    /* Match item min-width */
}

.list-header+.survey-list.view-list {
    margin-top: 0;
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.view-list+.survey-list.view-list {
    margin-top: 0;
}

/* Consolidating list view styles */
.survey-list.view-list {
    background: #fff;
}

.list-header span {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.list-header .header-survey {
    flex: 0 0 150px;
}

.list-header .header-sic {
    flex: 0 0 90px;
    font-size: 0.78rem;
}

.list-header .header-file {
    flex: 1;
}

.list-header .header-stats-group {
    flex: 0 0 220px;
    display: flex;
    gap: 0.5rem;
}

.list-header .header-resp,
.list-header .header-comm {
    flex: 1;
    text-align: center;
}

.list-header .header-actions,
.item-actions {
    display: flex;
    justify-content: center;
    /* Center for consistent vertical alignment with header */
    align-items: center;
    gap: 0.5rem;
}

/* List view specific slot sizing */
.list-header .header-actions,
.survey-item .item-actions {
    flex: 0 0 280px;
    /* Consistently apply a wider slot for centering */
}

/* Base button styles in actions area */
.item-actions .btn,
.item-actions button {
    margin: 0;
    min-width: auto;
    flex-shrink: 0;
    justify-content: center;
    text-align: center;
}

/* Table specific overrides for actions container if used inside td */
td.item-actions {
    display: table-cell !important;
    vertical-align: middle;
}

td.item-actions>div {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

td.item-actions>button {
    margin: 0 auto;
    display: block;
}



.view-list-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
}

.view-list-wrapper .survey-list.view-list {
    border: none;
    border-radius: 0;
}

.view-list-wrapper .list-header {
    border: none;
    border-bottom: 2px solid var(--border-color);
}

.view-list-wrapper .list-header {
    display: flex;
}


.documents-grid.view-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    width: 100%;
    overflow-x: auto;
}

.documents-grid.view-list .document-card {
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    min-width: 600px;
    gap: 1.5rem;
}

.documents-grid.view-list .document-card:last-child {
    border-bottom: none;
}

.documents-grid.view-list .document-card:hover {
    transform: none;
    box-shadow: none;
    background: var(--bg-secondary);
}

.documents-grid.view-list .document-card .document-checkbox {
    top: auto;
    left: auto;
    position: static;
}

.documents-grid.view-list .document-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.documents-grid.view-list .document-meta {
    margin-top: 0;
    flex: 0 0 100px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .split-view {
        grid-template-columns: 1fr;
    }
}

/* Config Questionnaire Modal Enhancements */
.config-form-layout .modal-body {
    padding: 1.5rem;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem !important;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.questionnaire-list-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 300px;
    overflow-y: auto;
    background: var(--bg-secondary);
}

.q-list-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

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

.q-list-item:hover {
    background: rgba(67, 91, 107, 0.05);
}

.q-list-item.active {
    background: var(--emc2-primary);
    color: white;
}

.q-list-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.q-list-item-id {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

.q-list-item.active .q-list-item-id {
    color: rgba(255, 255, 255, 0.9);
}

.file-upload-wrapper {
    position: relative;
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-upload-design {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-secondary);
}

.file-upload-design:hover {
    border-color: var(--accent-primary);
    background: rgba(67, 91, 107, 0.05);
}

.upload-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-text {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.selected-filename {
    display: block;
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 600;
    word-break: break-all;
}

@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

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

    .header-buttons {
        justify-content: stretch;
    }

    .header-buttons button {
        flex: 1;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .pagination-container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-content-single {
        padding: 1rem;
    }

    .split-view {
        grid-template-columns: 1fr;
    }
}

/* ========== Remesa Group Cards (Encuestas Procesadas Modal) ========== */

.remesa-groups {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.remesa-group-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    transition: box-shadow 0.2s;
    overflow: visible;
}

.remesa-group-card:hover {
    box-shadow: 0 2px 10px rgba(67, 91, 107, 0.12);
}

.remesa-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    gap: 1rem;
    cursor: pointer;
    background: var(--bg-secondary);
    border-bottom: 1px solid transparent;
    user-select: none;
    flex-wrap: wrap;
    transition: background 0.15s;
}

.remesa-group-header:hover {
    background: var(--bg-tertiary);
}

.remesa-group-header[aria-expanded="true"] {
    border-bottom-color: var(--border-color);
    background: var(--bg-tertiary);
}

.remesa-group-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.remesa-group-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-primary);
    white-space: nowrap;
}

.remesa-group-title .chevron-icon {
    fill: var(--accent-primary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.remesa-group-meta {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.remesa-group-meta.muted {
    color: var(--text-muted);
}

.remesa-group-stats {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.stat-chip {
    font-size: 0.82rem;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.stat-chip.muted {
    color: var(--text-muted);
}

.stat-chip.date {
    color: var(--text-muted);
    font-style: italic;
}

.stat-chip strong {
    color: var(--text-primary);
}

.remesa-group-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Sub-table inside expanded group */
.remesa-group-batches {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.batches-subtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.batches-subtable th {
    background: rgba(67, 91, 107, 0.06);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.55rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.batches-subtable td {
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.batches-subtable tr:last-child td {
    border-bottom: none;
}

.batches-subtable tr:hover td {
    background: rgba(67, 91, 107, 0.04);
}

.muted-id {
    font-family: monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
}