/* Reset y estilos globales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    display: flex;
    flex-direction: column;
    padding-bottom: 70px;
}

/* Página principal */
.main-container {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.header {
    background: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 10px;
}

.header h1 {
    color: #667eea;
    font-size: 2rem;
    font-weight: 600;
}

.header .subtitle {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Contenedor principal con dos columnas */
.main-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.image-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-selection {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-selection h2 {
    color: white;
    margin-bottom: 3rem;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
}

.access-card {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.access-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.access-card h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.access-card p {
    color: #666;
    font-size: 0.95rem;
}

.footer {
    background: rgba(255,255,255,0.1);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}

/* Página de login */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.header-small {
    background: white;
    padding: 1.5rem;
    border-radius: 15px 15px 0 0;
    text-align: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
}

.logo-small {
    width: 80px;
    height: auto;
    margin-bottom: 0.5rem;
    border-radius: 8px;
}

.header-small h2 {
    color: #667eea;
    font-size: 1.3rem;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: #999;
    font-size: 0.85rem;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #c33;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #3c3;
}

.back-link {
    text-align: center;
    margin-top: 1.5rem;
}

.back-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    background: #f5f7fa;
}

.dashboard-header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-header {
    width: 60px;
    height: auto;
    border-radius: 8px;
}

.dashboard-header h1 {
    color: #667eea;
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: #555;
    font-weight: 500;
}

.btn-logout {
    padding: 0.6rem 1.2rem;
    background: #ff4757;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #e84545;
    transform: translateY(-2px);
}

.dashboard-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 3rem;
}

.stat-info h3 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.stat-info p {
    color: #888;
    font-size: 0.95rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.upload-section,
.recent-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.upload-section h2,
.recent-section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f5f7fa;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    font-weight: 600;
    color: #555;
}

.btn-view-pdf {
    padding: 0.4rem 0.8rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: inline-block;
}

.btn-view-pdf:hover {
    background: #5568d3;
}

/* Panel empresa - Cards de usuarios */
.welcome-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.welcome-section h2 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.user-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.user-card-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.user-card h3 {
    color: #333;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.cedula-info {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.fecha-info {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.btn-view {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #999;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.user-details {
    padding: 1rem 0;
}

/* Grid layout para detalles del usuario */
.user-details-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    padding: 1rem 0;
}

.user-info-left {
    padding-right: 2rem;
    border-right: 2px solid #e0e0e0;
}

.user-pdf-right {
    display: flex;
    flex-direction: column;
}

.pdf-iframe-large {
    width: 100%;
    height: 600px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    flex: 1;
}

.detail-row {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
    display: block;
}

.detail-value {
    color: #333;
    font-size: 1.1rem;
    word-break: break-word;
}

.pdf-preview {
    margin-top: 2rem;
}

.pdf-preview h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.pdf-preview iframe {
    width: 100%;
    height: 500px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #667eea;
    font-size: 1.2rem;
}

/* Responsive */
/* Solo para dispositivos móviles pequeños */
@media (max-width: 600px) {
    .main-content-wrapper {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    body {
        padding-bottom: 60px;
    }
    
    .header {
        padding: 1.5rem 1rem;
    }
    
    .logo {
        width: 80px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header .subtitle {
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }
    
    .login-selection {
        padding: 1.5rem 1rem;
    }
    
    .login-selection h2 {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }
    
    .cards-container {
        gap: 1.5rem;
        grid-template-columns: 1fr;
    }
    
    .access-card {
        padding: 2rem 1.5rem;
    }
    
    .card-icon {
        font-size: 3rem;
    }
    
    .access-card h3 {
        font-size: 1.3rem;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .user-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .user-info-left {
        padding-right: 0;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
        padding-bottom: 1rem;
    }
    
    .pdf-iframe-large {
        height: 400px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header h1,
    .dashboard-header h1 {
        font-size: 1.3rem;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 1.5rem;
    }
    
    .dashboard-content {
        padding: 1.5rem 1rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .upload-section,
    .recent-section {
        padding: 1.5rem 1rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.7rem 0.5rem;
        font-size: 0.9rem;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2rem;
    }
    
    .header .subtitle {
        font-size: 0.85rem;
    }
    
    .login-selection h2 {
        font-size: 1.2rem;
    }
    
    .access-card {
        padding: 1.5rem 1rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .access-card h3 {
        font-size: 1.1rem;
    }
    
    .access-card p {
        font-size: 0.85rem;
    }
    
    .modal-content {
        padding: 1rem;
        margin: 5% auto;
    }
    
    .close {
        right: 1rem;
        top: 1rem;
        font-size: 1.5rem;
    }
}
