<div class="modal fade" id="modalHistorialPaciente" tabindex="-1" role="dialog" aria-hidden="true">
    
    <div class="modal-dialog modal-xl modal-dialog-scrollable">
        
        <div class="modal-content shadow-lg border-0">
            
            <div class="modal-header bg-navy text-white">
                <h5 class="modal-title">
                    <i class="fas fa-file-medical-alt mr-2"></i> 
                    HISTORIAL DE ATENCIONES DE EMERGENCIA
                </h5>
                <button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>

            <div class="modal-body bg-light">
                
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-12">
                            <div id="timelineHistorial">
                                <div class="text-center py-5">
                                    <i class="fas fa-spinner fa-spin fa-3x text-muted"></i>
                                    <p class="mt-2">Buscando registros previos...</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

            <div class="modal-footer bg-white">
                <p class="text-muted small mr-auto">
                    <i class="fas fa-info-circle mr-1"></i> 
                    Los registros se muestran en orden descendente (más recientes primero).
                </p>
                <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">
                    <i class="fas fa-times mr-1"></i> Cerrar Visor
                </button>
            </div>

        </div>

    </div>

</div>