Classical jurisprudence was elaborated by private religious scholars, largely through legal opinions (fatwas) issued by qualified jurists (muftis). It was historically applied in sharia courts by ruler-appointed judges, who dealt mainly with civil disputes and community affairs.[1][2] Sultanic courts, the police and market inspectors administered criminal justice, which was influenced by sharia but not bound by its rules.[9][8] Non-Muslim (dhimmi) communities had legal autonomy to adjudicate their internal affairs.[4] Over the centuries, Sunni muftis were gradually incorporated into state bureaucracies,[10] and fiqh was complemented by various economic, criminal and administrative laws issued by Muslim rulers.[11] The Ottoman civil code of 1869–1876 was the first partial attempt to codify sharia.[4]