/* ========================================
   LABORATORIO CLÍNICO - FRONTEND STYLES
   ======================================== */

/* --- FORMULARIO --- */
.lab-form-container {
    max-width: 700px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.lab-form h3 {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #2271b1;
    color: #1d2327;
    font-size: 22px;
}

.lab-form-group {
    margin-bottom: 20px;
}

.lab-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.lab-form-group input[type="text"],
.lab-form-group input[type="tel"],
.lab-form-group input[type="date"],
.lab-form-group input[type="file"],
.lab-form-group select,
.lab-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.4;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.lab-form-group input:focus,
.lab-form-group select:focus,
.lab-form-group textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
    background: #fff;
}

.lab-pdf-exists {
    padding: 8px 12px;
    background: #f0f6fc;
    border-left: 3px solid #2271b1;
    border-radius: 3px;
    font-size: 13px;
    color: #50575e;
}

.lab-form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* --- BOTONES --- */
.lab-btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.lab-btn-primary {
    background: #2271b1;
    color: #fff !important;
    border-color: #2271b1;
}

.lab-btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.lab-btn-secondary {
    background: transparent;
    color: #2271b1 !important;
    border-color: #2271b1;
}

.lab-btn-secondary:hover {
    background: #f0f6fc;
}

.lab-btn-small {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 4px;
}

.lab-btn-edit {
    background: #f0f0f0;
    color: #2271b1;
    border: 1px solid #d0d0d0;
}

.lab-btn-edit:hover {
    background: #2271b1;
    color: #fff;
}

.lab-btn-pdf {
    background: #fcf0e0;
    color: #b2621a;
    border: 1px solid #e0c090;
}

.lab-btn-pdf:hover {
    background: #b2621a;
    color: #fff;
}

.lab-btn-whatsapp {
    background: #dcf8c6;
    color: #075e54;
    border: 1px solid #25d366;
}

.lab-btn-whatsapp:hover {
    background: #25d366;
    color: #fff;
}

/* --- ERROR / MENSAJES --- */
.lab-error {
    padding: 15px 20px;
    background: #fce4e4;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 14px;
}

.lab-form-response {
    margin-top: 15px;
}

.lab-form-response .success {
    padding: 10px 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
}

.lab-form-response .error {
    padding: 10px 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

/* --- LISTA DE PACIENTES --- */
.lab-list-container {
    margin: 20px 0;
}

.lab-filters {
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.lab-filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.lab-filter-group {
    flex: 1;
    min-width: 180px;
}

.lab-filter-group input,
.lab-filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
}

.lab-filter-group .lab-btn {
    white-space: nowrap;
}

.lab-table-wrapper {
    overflow-x: auto;
}

.lab-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.lab-table thead {
    background: #f0f0f1;
}

.lab-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #50575e;
    border-bottom: 2px solid #d0d0d0;
}

.lab-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.lab-table tbody tr:hover {
    background: #f6f7f7;
}

.lab-table tbody tr:last-child td {
    border-bottom: none;
}

.lab-actions {
    white-space: nowrap;
}

.lab-no-results {
    text-align: center;
    padding: 40px !important;
    color: #888;
    font-style: italic;
}

/* --- BADGES DE ESTADO --- */
.lab-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.lab-status-pending {
    background: #fef8e6;
    color: #b8860b;
    border: 1px solid #f0d98c;
}

.lab-status-completed {
    background: #e6f7e6;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.lab-status-expired {
    background: #fce4e4;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.lab-status-archived {
    background: #f3e5f5;
    color: #6a1b9a;
    border: 1px solid #ce93d8;
}

/* --- PAGINACIÓN --- */
.lab-pagination {
    margin: 20px 0;
    text-align: center;
}

.lab-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    text-decoration: none;
    color: #2271b1;
    font-size: 14px;
}

.lab-pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.lab-pagination .page-numbers:hover:not(.current) {
    background: #f0f0f0;
}

.lab-list-stats {
    text-align: right;
    font-size: 13px;
    color: #888;
    margin-top: 10px;
}

/* --- VISOR PDF --- */
.lab-pdf-viewer-container {
    margin: 20px 0;
}

.lab-pdf-iframe {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.lab-pdf-actions {
    margin-top: 15px;
    text-align: center;
}

/* --- BÚSQUEDA --- */
.lab-search-container {
    max-width: 800px;
    margin: 20px auto;
}

.lab-search-group {
    display: flex;
    gap: 10px;
}

.lab-search-group input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    font-size: 16px;
}

.lab-search-group input:focus {
    border-color: #2271b1;
    outline: none;
}

.lab-search-results {
    margin-top: 20px;
}

/* --- REPORTES --- */
.lab-reports-container {
    max-width: 1100px;
    margin: 20px auto;
}

.lab-reports-container h3 {
    color: #1d2327;
    font-size: 24px;
    margin-bottom: 25px;
}

.lab-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.lab-stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.lab-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.lab-stat-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #2271b1;
    margin-bottom: 10px;
}

.lab-stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.lab-stat-label {
    font-size: 13px;
    color: #757575;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lab-stat-pending .lab-stat-number { color: #b8860b; }
.lab-stat-completed .lab-stat-number { color: #2e7d32; }
.lab-stat-month .lab-stat-number { color: #2271b1; }
.lab-stat-warning .lab-stat-number { color: #c62828; }

.lab-pdf-stats {
    margin-top: 20px;
}

.lab-pdf-stats h4,
.lab-export-section h4 {
    color: #1d2327;
    font-size: 18px;
    margin-bottom: 15px;
}

.lab-export-section {
    margin-top: 30px;
    padding: 20px;
    background: #f0f6fc;
    border-radius: 6px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .lab-form-container {
        padding: 20px;
        margin: 15px 10px;
    }

    .lab-filter-row {
        flex-direction: column;
    }

    .lab-filter-group {
        min-width: 100%;
    }

    .lab-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lab-form-actions {
        flex-direction: column;
    }

    .lab-form-actions .lab-btn {
        width: 100%;
        text-align: center;
    }

    .lab-table {
        font-size: 13px;
    }

    .lab-table th,
    .lab-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .lab-stats-grid {
        grid-template-columns: 1fr;
    }

    .lab-search-group {
        flex-direction: column;
    }
}
