:root {
    --blue: #0B1224;
    --red: #FF2800;
    --gray: #959595;
    --light: #f8f9fa;
    --white: #FFFFFF;
    --shadow: 0 10px 30px rgba(11, 18, 36, 0.08);
}

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

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light);
    color: var(--blue);
    line-height: 1.6;
}

h1, h2, h6 {
    font-family: 'Raleway', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--blue);
}

h1 { font-weight: 700; }
h2 { font-weight: 600; }
h6 { font-weight: 500; }

p {
    font-family: 'Raleway', sans-serif;
    color: var(--gray);
    letter-spacing: 2px;
}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: var(--blue);
    color: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header h1 {
    color: var(--white);
    font-size: 28px;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.file-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.file-selector label {
    font-weight: 600;
    color: var(--white);
    letter-spacing: 1px;
}

.file-selector input[type="file"] {
    padding: 8px 12px;
    border: 2px solid var(--white);
    border-radius: 6px;
    cursor: pointer;
    background: var(--white);
}

.file-info {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--white);
}

.file-chip-secondary {
    background: rgba(255,255,255,0.08);
    border-style: dashed;
    font-weight: 600;
}

.file-chip-label {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1.5px;
    opacity: 0.9;
}

.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.stat-card {
    background: rgba(255,255,255,0.08);
    padding: 12px 20px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    border: 1px solid rgba(255,255,255,0.15);
}

.stat-label {
    font-size: 13px;
    color: var(--light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    margin-top: 5px;
}

.stat-value.xml { color: var(--light); }
.stat-value.icr { color: #ffd8cf; }
.stat-value.conflicto { color: #f7c7b8; }
.stat-value.pendiente { color: #e0e4eb; }
.stat-value.extrano { color: #f2c94c; }
.stat-value.total { color: var(--white); }

.controls {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.view-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tab-btn {
    border: 1px solid #dfe3ea;
    background: #f5f7fa;
    color: var(--blue);
    padding: 9px 14px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    background: #e9edf5;
}

.tab-btn.active {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
    box-shadow: 0 6px 16px rgba(255, 40, 0, 0.2);
}

.search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 10px 12px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    min-width: 260px;
    font-size: 14px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Raleway', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.btn-primary {
    background: var(--red);
    color: var(--white);
}

.btn-success {
    background: var(--blue);
    color: var(--white);
}

.btn-danger {
    background: #b10000;
    color: var(--white);
}

.btn-warning {
    background: #e8ecf2;
    color: var(--blue);
    border: 1px solid var(--blue);
}

.btn-secondary {
    background: #dfe3ea;
    color: var(--blue);
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e6ee;
}

.case-number {
    font-size: 18px;
    color: var(--gray);
    font-weight: 600;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.status-badge.mantener {
    background: rgba(11, 18, 36, 0.08);
    color: var(--blue);
}

.status-badge.xml {
    background: rgba(11, 18, 36, 0.08);
    color: var(--blue);
}

.status-badge.icr {
    background: #ffe1d9;
    color: var(--red);
}

.status-badge.pendiente {
    background: #e8ecf2;
    color: var(--blue);
}

.status-badge.conflicto {
    background: #ffe1d9;
    color: #b13100;
    border: 1px solid #ffb79d;
}

.status-badge.extrano {
    background: #fff4d4;
    color: #d48600;
}

.review-table {
    background: #fdfdff;
    border-left-color: #b1b7d7;
}

.review-table-wrapper {
    overflow-x: auto;
}

.review-table-inner {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.review-table-inner th,
.review-table-inner td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7ef;
    text-align: left;
}

.review-table-inner th {
    background: #f3f5fb;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: 1px;
}

.review-table-inner td:nth-child(2) {
    font-weight: 700;
    color: var(--red);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.info-item {
    background: var(--light);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--red);
}

.info-label {
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--blue);
    word-break: break-word;
}

.comparison-section {
    background: var(--light);
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.comparison-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comparison-values {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.value-box {
    flex: 1;
    min-width: 200px;
    background: var(--white);
    padding: 15px;
    border-radius: 6px;
    border: 2px solid;
    display: flex;
    flex-direction: column;
}

.value-box.xml {
    border-color: var(--blue);
}

.value-box.icr {
    border-color: var(--red);
}

.proposed-value {
    margin: 12px 0 16px 0;
    padding: 12px;
    background: #f7f8fc;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
}

.proposed-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
    margin-bottom: 6px;
}

.proposed-row input {
    padding: 10px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    min-width: 120px;
    font-size: 14px;
}

.value-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1.5px;
}

.value-label.xml { color: var(--blue); }
.value-label.icr { color: var(--red); }

.value-content {
    font-size: 24px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 15px;
}

.value-box-btn {
    margin-top: auto;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Raleway', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.value-box-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.value-box-btn.xml {
    background: var(--blue);
    color: var(--white);
}

.value-box-btn.icr {
    background: var(--red);
    color: var(--white);
}

.pendiente-btn-container {
    margin-top: 15px;
}

.pendiente-btn,
.extrano-btn {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--blue);
    background: #e8ecf2;
    color: var(--blue);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Raleway', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.pendiente-btn:hover {
    background: var(--blue);
    color: var(--white);
}

.extrano-btn {
    margin-top: 10px;
    border-color: #d48600;
    background: #fff4d4;
    color: #8c5a00;
}

.extrano-btn:hover {
    background: #ffebae;
}

.notes-section {
    background: #fdf1ec;
    border-left: 4px solid var(--red);
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.notes-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 8px;
}

.notes-content {
    font-size: 14px;
    color: var(--gray);
    white-space: pre-line;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e2e6ee;
}

.action-buttons .btn {
    flex: 1;
    justify-content: center;
    padding: 15px;
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e6ee;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--red));
    transition: width 0.3s ease;
}

.details-toggle {
    background: var(--light);
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    padding: 12px 15px;
    margin: 15px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    transition: all 0.2s;
}

.details-toggle:hover {
    background: #e8ecf2;
}

.details-content {
    display: none;
    background: var(--light);
    border: 1px solid #dfe3ea;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 15px;
    margin-top: -15px;
    margin-bottom: 15px;
}

.details-content.expanded {
    display: block;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    font-size: 13px;
}

.detail-label {
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-value {
    color: var(--blue);
}

.arrow {
    transition: transform 0.2s;
}

.arrow.expanded {
    transform: rotate(180deg);
}

.acta-section {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

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

.acta-header h3 {
    font-size: 18px;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.acta-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.acta-controls button {
    padding: 6px 12px;
    border: 1px solid #dfe3ea;
    background: var(--light);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.acta-controls button:hover {
    background: #e8ecf2;
    border-color: var(--blue);
}

.acta-container {
    position: relative;
    background: #e8ecf2;
    border-radius: 6px;
    overflow: auto;
    min-height: 800px;
    max-height: 900px;
    display: block;
}

.acta-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.acta-container::-webkit-scrollbar-track {
    background: #dfe3ea;
    border-radius: 6px;
}

.acta-container::-webkit-scrollbar-thumb {
    background: var(--blue);
    border-radius: 6px;
}

.acta-container::-webkit-scrollbar-thumb:hover {
    background: var(--red);
}

.acta-image {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: grab;
    transition: transform 0.08s ease-out;
    user-select: none;
    transform-origin: top left;
}

.acta-image.dragging {
    cursor: grabbing;
}

.acta-loading {
    padding: 40px;
    text-align: center;
    color: var(--gray);
}

.acta-error {
    padding: 40px;
    text-align: center;
    color: var(--red);
    background: #ffe8e0;
    border-radius: 6px;
}

.zoom-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
}

.modal-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 90vh;
    max-width: 95vw;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    cursor: grab;
}

.modal-viewport.grabbing {
    cursor: grabbing;
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-content canvas {
    display: block;
    transform-origin: 0 0;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(0,0,0,0.8);
}

.two-column-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

@media (min-width: 1440px) {
    .container {
        max-width: 1760px;
    }

    .two-column-layout {
        grid-template-columns: 1.4fr 1fr;
        gap: 24px;
    }

    .acta-container {
        min-height: 900px;
    }
}

@media (max-width: 1200px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

.candidate-highlight {
    background: #ffe8e0;
    border: 3px solid var(--red);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.candidate-highlight-label {
    font-size: 14px;
    color: var(--blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.candidate-highlight-name {
    font-size: 32px;
    font-weight: 700;
    color: #0B1224;
    line-height: 1.2;
}

.candidate-highlight-code {
    font-size: 18px;
    color: var(--gray);
    margin-top: 8px;
    font-weight: 600;
}

.keyboard-hints {
    background: var(--light);
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--blue);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.keyboard-hint {
    display: flex;
    align-items: center;
    gap: 5px;
}

.key {
    background: var(--white);
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid var(--blue);
    font-family: monospace;
    font-weight: 600;
    color: var(--blue);
}

.dashboard-section {
    margin-top: 32px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 12px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-upload {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--blue);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.dashboard-upload input {
    display: none;
}

.dashboard-content.empty {
    opacity: 0.85;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.dashboard-card {
    border: 1px solid #e4e8f0;
    border-radius: 12px;
    padding: 16px;
    background: linear-gradient(180deg, #fdfdff 0%, #f7f8fc 100%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.dashboard-title {
    font-size: 18px;
    font-weight: 700;
    color: #0B1224;
    margin-bottom: 10px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.stat-pill {
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #0B1224;
    background: #eef2f9;
}
.stat-pill span {
    font-size: 18px;
}
.stat-pill.success { background: #e5f7ef; color: #207a4c; }
.stat-pill.primary { background: #e8f0ff; color: #1c4b9c; }
.stat-pill.warning { background: #fff4e6; color: #c76a12; }
.stat-pill.danger { background: #ffe9e7; color: #b2352e; }

.dashboard-subtitle {
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 6px;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.pill {
    background: #f0f3fa;
    color: #0B1224;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #e0e5f1;
}

.dashboard-footer {
    font-size: 12px;
    color: var(--gray);
}

.generated-at {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 8px;
}

.help-trigger {
    background: rgba(255,255,255,0.12);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.4);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.help-trigger:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 36, 0.35);
    display: none;
    justify-content: flex-end;
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.help-overlay.active {
    display: flex;
}

.help-panel {
    background: var(--white);
    width: min(440px, 92vw);
    height: 100%;
    padding: 26px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    overflow-y: auto;
}

.help-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.help-eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--gray);
    margin-bottom: 4px;
}

.help-panel h2 {
    margin: 0;
    color: var(--blue);
}

.help-close {
    border: none;
    background: #e8ecf2;
    color: var(--blue);
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.help-close:hover {
    background: #dfe3ea;
}

.help-intro {
    color: var(--gray);
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}

.help-section {
    margin-bottom: 18px;
}

.help-section-title {
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 13px;
}

.help-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.help-list li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    align-items: start;
    background: var(--light);
    padding: 10px 12px;
    border-radius: 8px;
}

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

.help-list strong {
    color: var(--blue);
}

body.no-scroll {
    overflow: hidden;
}

@media (max-width: 768px) {
    .comparison-values {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-buttons {
        width: 100%;
        flex-direction: column;
    }

    .nav-buttons .btn {
        width: 100%;
    }
}
