:root {
    --bg-light: #f3f4f6; 
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --primary-blue: #1e3a8a; 
    --btn-blue: #1d4ed8;
    
    --color-success: #10b981;
    --color-success-bg: #d1fae5;
    
    --font-family: 'Inter', Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-primary);
}

/* Header */
.top-navbar {
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
}

.nav-left, .nav-right { display: flex; align-items: center; gap: 15px; }
.logo-exa { font-weight: bold; background: rgba(255,255,255,0.2); padding: 4px 8px; border-radius: 4px; }
.module-name { font-size: 1.1rem; font-weight: 500;}

.user-info { font-size: 0.9rem; }
.btn-top { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.btn-top-primary { background: white; color: var(--primary-blue); border: none; padding: 6px 12px; border-radius: 4px; font-weight: bold; cursor: pointer; }

/* Tabs Bar */
.tabs-bar {
    background: white;
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

.tab {
    padding: 15px 20px;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    font-weight: 500;
}
.tab:hover { color: var(--primary-blue); }
.tab.active {
    color: var(--btn-blue);
    border-bottom-color: var(--btn-blue);
}

/* Main Content */
.main-content { padding: 24px; }
.hidden-input { display: none; }

/* Grid Tarjetas */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.upload-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.upload-card.highlight {
    border: 1px solid var(--btn-blue);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.1);
}

.card-title { font-weight: 600; color: var(--text-primary); margin-bottom: 15px; }
.drop-zone {
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    padding: 30px 10px;
    text-align: center;
    cursor: pointer;
    background: #f9fafb;
}
.drop-zone:hover { background: #f3f4f6; }
.drop-zone p { font-size: 0.85rem; color: var(--text-secondary); }

.center { text-align: center; }
.btn-process {
    background: var(--btn-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}
.btn-process:hover { background: #1e3a8a; }

/* Stats Bar */
.dashboard-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: white; border: 1px solid var(--border-color); border-radius: 8px;
    padding: 16px;
}
.stat-label { display: block; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: bold; color: var(--text-primary); }
.stat-value.success { color: var(--color-success); }
.stat-value.primary-color { color: var(--btn-blue); }

/* Expediente Card */
.expediente-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.exp-header {
    display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px;
}
.exp-id { font-size: 0.85rem; color: #9ca3af; margin-bottom: 4px; }
.exp-title { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); }

.exp-actions { display: flex; align-items: center; gap: 12px; }
.badge-cuadrado { 
    background: var(--color-success-bg); 
    color: var(--color-success); 
    padding: 6px 12px; 
    border-radius: 16px; 
    font-size: 0.8rem; 
    font-weight: 600; 
}
.btn-generar-pdf {
    background: var(--btn-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

/* Flow (Línea de documentos) */
.exp-flow {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 30px;
    gap: 15px;
}

.doc-thumb-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.doc-thumbnail {
    width: 70px;
    height: 90px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.05);
}

.doc-label { font-size: 0.8rem; font-weight: 500; text-align: center; color: var(--text-primary); line-height: 1.2; margin-bottom: 2px; }
.doc-sublabel { font-size: 0.75rem; color: var(--text-secondary); text-align: center; }

.arrow { color: #9ca3af; font-size: 1.2rem; margin-top: -30px; }

/* Grid de detalles */
.exp-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
    row-gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.detail-row {
    display: flex;
    justify-content: flex-start;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 8px;
}

.d-label {
    width: 150px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.d-value { color: var(--text-primary); font-size: 0.9rem; }
.bold { font-weight: 600; }
.green-text { color: var(--color-success); }


/* CLASES NUEVAS DE ERROR Y ADVERTENCIA (SECCIÓN 6) */
.mt-2 { margin-top: 10px; }
.opacity-50 { opacity: 0.7; }
.warning-color { color: #d97706; }
.error-color { color: #dc2626; }

.card-error {
    border: 1px solid #fca5a5;
    background-color: #fef2f2;
}
.error-motivo {
    color: #b91c1c;
    font-size: 0.9rem;
    padding: 8px 12px;
    background-color: #fee2e2;
    border-radius: 6px;
    display: inline-block;
}
.badge-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
}
.btn-disabled {
    background: #9ca3af;
    cursor: not-allowed;
}
.btn-disabled:hover { background: #9ca3af; }
.thumb-missing {
    background: #fee2e2;
    border: 2px dashed #f87171;
    color: #ef4444;
}
.error-text { color: #dc2626; font-weight: 600; }

/* Modal PDF */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(9, 30, 66, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: #fff;
    width: 80%;
    height: 85%;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #5e6c84;
    cursor: pointer;
}
.modal-close:hover {
    color: #dc2626;
}
.modal-body {
    flex: 1;
    padding: 0;
}
.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.doc-thumbnail {
    cursor: pointer;
    transition: transform 0.2s;
}
.doc-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
