/* ARCHIVO COMPLETO: css/estilos.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* LOGIN STYLES */
.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    opacity: 0.9;
    font-size: 14px;
}

.lab-icon {
    font-size: 60px;
    margin-bottom: 20px;
    color: white;
}

.login-form {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.form-control {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input[type="text"].form-control:not(.input-group input),
input[type="date"].form-control,
input[type="email"].form-control,
input[type="password"].form-control:not(.input-group input),
select.form-control {
    padding: 12px 15px;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.error-message {
    display: none;
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fcc;
}

.error-message.show {
    display: block;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.login-footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #666;
    font-size: 13px;
}

/* DASHBOARD STYLES */
.dashboard-container {
    width: 100%;
    max-width: 1400px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dashboard-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    padding: 20px 30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header-left p {
    opacity: 0.9;
    font-size: 14px;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info {
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-logout {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #c0392b;
    transform: scale(1.05);
}

/* ADMIN PANEL */
.admin-panel {
    padding: 30px;
    background: #f8f9fa;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #dee2e6;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: white;
    border: none;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.tab-content.active {
    display: block;
}

/* UPLOAD FORM */
.upload-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

select {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.file-upload-box {
    border: 2px dashed #3498db;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background: #f0f8ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-box:hover {
    border-color: #2980b9;
    background: #e6f3ff;
}

.file-upload-box i {
    font-size: 48px;
    color: #3498db;
    margin-bottom: 10px;
}

.btn-submit {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.3);
}

/* CLIENT VIEW */
.client-view {
    padding: 30px;
}

.client-info-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.client-info-box div {
    text-align: center;
    padding: 10px;
}

.client-info-box .info-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.client-info-box .info-value {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.table-responsive {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.gestion-title {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 22px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.dosimetry-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.dosimetry-table thead {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.dosimetry-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dosimetry-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e0e0e0;
}

.dosimetry-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dosimetry-table td {
    padding: 15px;
    font-size: 14px;
    color: #333;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-right: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

/* ESTADOS DE CLIENTE */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-activo {
    background: #d4f4dd;
    color: #1e7e34;
}

.status-inactivo {
    background: #f8d7da;
    color: #721c24;
}

.status-suspendido {
    background: #fff3cd;
    color: #856404;
}

/* TABLA DE RESUMEN */
.resumen-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 13px;
}

.resumen-table th {
    background: #2c3e50;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 11px;
}

.resumen-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.resumen-table .cliente-name {
    text-align: left;
    font-weight: 600;
    background: #f8f9fa;
}

.tiene-reporte {
    background: #d4f4dd;
    color: #1e7e34;
    font-weight: bold;
}

.no-tiene-reporte {
    background: #f8d7da;
    color: #721c24;
}

/* BATCH UPLOAD */
.batch-upload-area {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.batch-list {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    margin: 15px 0;
}

.progress-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

/* LOADING */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.loading.show {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: none;
    animation: slideUp 0.3s ease;
    z-index: 2000;
    max-width: 300px;
}

.toast.show {
    display: block;
}

.toast.success {
    background: #d4f4dd;
    color: #1e7e34;
    border-left: 4px solid #27ae60;
}

.toast.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #e74c3c;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination button {
    padding: 5px 10px;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #f8f9fa;
}

.pagination button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* SEARCH BOX */
.search-box {
    margin: 20px 0;
}

.search-box input {
    width: 300px;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
}

/* DEPARTAMENTO BADGE */
.departamento-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #e9ecef;
    color: #495057;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 5px;
}

/* NUEVOS ESTILOS PARA BÚSQUEDA DE CLIENTES */
.codigo-input {
    text-transform: uppercase !important;
    font-weight: bold !important;
    font-family: 'Courier New', monospace !important;
    background: #f0f8ff !important;
    border: 2px solid #3498db !important;
}

.codigo-input:focus {
    background: white !important;
    border-color: #2980b9 !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2) !important;
}

.search-input {
    background: #f8f9ff !important;
    border: 2px solid #e0e0e0 !important;
}

.search-input:focus {
    background: white !important;
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1) !important;
}

.cliente-confirmacion {
    margin-top: 8px !important;
    padding: 8px 12px !important;
    background: #d4f4dd !important;
    border: 1px solid #27ae60 !important;
    border-radius: 5px !important;
    font-size: 13px !important;
    animation: slideIn 0.3s ease !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejorar el select cuando está seleccionado */
#clientSelect option:checked {
    background: #3498db;
    color: white;
}

#clientSelect:focus {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1) !important;
}

/* Animación para campos activos */
.form-control:focus,
.search-input:focus,
.codigo-input:focus {
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Estilos para small text */
.form-group small {
    display: block;
    margin-top: 5px;
    font-style: italic;
    font-size: 12px;
}

/* Mejorar iconos en labels */
.form-group label i {
    margin-right: 5px;
    color: #3498db;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .upload-form {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dosimetry-table {
        font-size: 12px;
    }
    
    .dosimetry-table th,
    .dosimetry-table td {
        padding: 10px;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .client-info-box {
        flex-direction: column;
    }
    
    .codigo-input,
    .search-input {
        font-size: 14px;
    }
}

/* AGREGAR AL FINAL DE estilos.css - ESTILOS PARA MODAL DE EDICIÓN MEJORADO */

/* Modal mejorado para edición */
.modal-content h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-content h4 i {
    color: #3498db;
}

.form-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* Grid para campos del modal */
.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content .form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.modal-content .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Enlaces para ver PDFs actuales */
.modal-content small a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
}

.modal-content small a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Botones del modal */
.modal-content .btn-submit {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    padding: 12px 25px;
}

.modal-content .btn {
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Mejorar inputs de archivo */
.modal-content input[type="file"] {
    padding: 8px;
    background: #fff;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
}

.modal-content input[type="file"]:hover {
    border-color: #3498db;
    background: #f8f9ff;
}

/* Responsivo para el modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        max-width: 90vw !important;
    }
    
    .modal-content [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}


