Index: frontend/src/pages/billing/BillingDetail.js
===================================================================
--- frontend/src/pages/billing/BillingDetail.js	(revision e1f74f6c04f9d460135de378f659fedfd9c74b44)
+++ frontend/src/pages/billing/BillingDetail.js	(revision cdcff72e9765342b84a5e4b5d98ca5cb050a5500)
@@ -22,11 +22,8 @@
 
   useEffect(() => {
-    fetchBilling();
-  }, [id]);
-
-  const fetchBilling = async () => {
-    try {
-      setLoading(true);
-      const response = await billingService.getBillingById(id);
+    const fetchBilling = async () => {
+      try {
+        setLoading(true);
+        const response = await billingService.getBillingById(id);
       setBilling(response.data);
       setPaymentStatus(response.data.paymentStatus);
@@ -39,11 +36,14 @@
         console.error('Could not fetch billing details:', err);
       }
-    } catch (err) {
-      setError('Failed to fetch billing record');
-      console.error(err);
-    } finally {
-      setLoading(false);
-    }
-  };
+      } catch (err) {
+        setError('Failed to fetch billing record');
+        console.error(err);
+      } finally {
+        setLoading(false);
+      }
+    };
+
+    fetchBilling();
+  }, [id]);
 
   const handleUpdatePaymentStatus = async () => {
@@ -81,8 +81,8 @@
   if (user.role === 'DOCTOR' || user.role === 'LAB_TECHNICIAN') {
     return (
-        <div style={{ padding: '20px', textAlign: 'center' }}>
-          <h1 className="text-2xl font-bold" style={{ color: '#7c3aed', marginBottom: '10px' }}>Access Denied</h1>
-          <p style={{ color: 'var(--color-neutral-600)' }}>You do not have permission to access billing records.</p>
-        </div>
+      <div style={{ padding: '20px', textAlign: 'center' }}>
+        <h1 className="text-2xl font-bold" style={{ color: '#7c3aed', marginBottom: '10px' }}>Access Denied</h1>
+        <p style={{ color: 'var(--color-neutral-600)' }}>You do not have permission to access billing records.</p>
+      </div>
     );
   }
@@ -90,144 +90,144 @@
   if (!billing) {
     return (
-        <div>
-          <ErrorAlert message="Billing record not found" onClose={() => navigate('/billing')} />
-        </div>
+      <div>
+        <ErrorAlert message="Billing record not found" onClose={() => navigate('/billing')} />
+      </div>
     );
   }
 
   return (
-      <div>
-        <div className="flex justify-between items-center mb-6">
-          <h1 className="text-3xl font-bold" style={{ color: '#7c3aed' }}>Billing Record #{billing.billId}</h1>
-          <div className="space-x-2">
-            <button
-                onClick={handleDownloadInvoice}
-                disabled={downloading}
-                className="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 disabled:opacity-50"
-            >
-              {downloading ? 'Downloading...' : 'Download Invoice (PDF)'}
-            </button>
-            <button onClick={() => navigate('/billing')} className="bg-gray-300 text-gray-700 px-4 py-2 rounded hover:bg-gray-400">
-              Back
-            </button>
-          </div>
+    <div>
+      <div className="flex justify-between items-center mb-6">
+        <h1 className="text-3xl font-bold" style={{ color: '#7c3aed' }}>Billing Record #{billing.billId}</h1>
+        <div className="space-x-2">
+          <button
+            onClick={handleDownloadInvoice}
+            disabled={downloading}
+            className="bg-green-600 text-white px-4 py-2 rounded hover:bg-green-700 disabled:opacity-50"
+          >
+            {downloading ? 'Downloading...' : 'Download Invoice (PDF)'}
+          </button>
+          <button onClick={() => navigate('/billing')} className="bg-gray-300 text-gray-700 px-4 py-2 rounded hover:bg-gray-400">
+            Back
+          </button>
         </div>
-
-        {error && <ErrorAlert message={error} onClose={() => setError(null)} />}
-        {success && <SuccessAlert message={success} onClose={() => setSuccess(null)} />}
-
-        <div className={`grid gap-6 mb-6 ${isPatient ? 'grid-cols-1 lg:grid-cols-2' : 'grid-cols-1 lg:grid-cols-3'}`}>
+      </div>
+
+      {error && <ErrorAlert message={error} onClose={() => setError(null)} />}
+      {success && <SuccessAlert message={success} onClose={() => setSuccess(null)} />}
+
+      <div className={`grid gap-6 mb-6 ${isPatient ? 'grid-cols-1 lg:grid-cols-2' : 'grid-cols-1 lg:grid-cols-3'}`}>
+        <div className="bg-white rounded-lg shadow p-6">
+          <h2 className="text-xl font-bold mb-4">Billing Information</h2>
+          <div className="space-y-3">
+            <InfoRow label="Patient" value={billing.patientName} />
+            <InfoRow label="Total Cost" value={`$${billing.totalCost}`} />
+            <InfoRow label="Current Status" value={billing.paymentStatus} />
+            <InfoRow label="Payment Date" value={billing.paymentDate || 'Not paid'} />
+          </div>
+        </div>
+
+        {!isPatient && (
           <div className="bg-white rounded-lg shadow p-6">
-            <h2 className="text-xl font-bold mb-4">Billing Information</h2>
-            <div className="space-y-3">
-              <InfoRow label="Patient" value={billing.patientName} />
-              <InfoRow label="Total Cost" value={`$${billing.totalCost}`} />
-              <InfoRow label="Current Status" value={billing.paymentStatus} />
-              <InfoRow label="Payment Date" value={billing.paymentDate || 'Not paid'} />
+            <h2 className="text-xl font-bold mb-4">Update Payment Status</h2>
+            <div className="space-y-4">
+              <div>
+                <label className="block text-sm font-semibold mb-2">Payment Status</label>
+                <select
+                  value={paymentStatus}
+                  onChange={(e) => setPaymentStatus(e.target.value)}
+                  className="w-full px-4 py-2 border rounded-lg"
+                >
+                  <option value="PENDING">Pending</option>
+                  <option value="PAID">Paid</option>
+                  <option value="CANCELLED">Cancelled</option>
+                </select>
+              </div>
+              <button
+                onClick={handleUpdatePaymentStatus}
+                disabled={updating || paymentStatus === billing.paymentStatus}
+                className="w-full bg-purple-600 text-white px-4 py-2 rounded hover:bg-purple-700 disabled:opacity-50"
+              >
+                {updating ? 'Updating...' : 'Update Status'}
+              </button>
             </div>
           </div>
-
-          {!isPatient && (
-              <div className="bg-white rounded-lg shadow p-6">
-                <h2 className="text-xl font-bold mb-4">Update Payment Status</h2>
-                <div className="space-y-4">
-                  <div>
-                    <label className="block text-sm font-semibold mb-2">Payment Status</label>
-                    <select
-                        value={paymentStatus}
-                        onChange={(e) => setPaymentStatus(e.target.value)}
-                        className="w-full px-4 py-2 border rounded-lg"
-                    >
-                      <option value="PENDING">Pending</option>
-                      <option value="PAID">Paid</option>
-                      <option value="CANCELLED">Cancelled</option>
-                    </select>
-                  </div>
-                  <button
-                      onClick={handleUpdatePaymentStatus}
-                      disabled={updating || paymentStatus === billing.paymentStatus}
-                      className="w-full bg-purple-600 text-white px-4 py-2 rounded hover:bg-purple-700 disabled:opacity-50"
-                  >
-                    {updating ? 'Updating...' : 'Update Status'}
-                  </button>
-                </div>
-              </div>
-          )}
-
-          <div className="bg-white rounded-lg shadow p-6">
-            <h2 className="text-xl font-bold mb-4">Patient Details</h2>
-            <div className="space-y-3">
-              {billingDetail && (
-                  <>
-                    <InfoRow label="EMBG" value={billingDetail.patientEmbg} />
-                    <InfoRow label="Phone" value={billingDetail.patientPhone} />
-                    <InfoRow label="Bill Date" value={billingDetail.billDate} />
-                  </>
-              )}
+        )}
+
+        <div className="bg-white rounded-lg shadow p-6">
+          <h2 className="text-xl font-bold mb-4">Patient Details</h2>
+          <div className="space-y-3">
+            {billingDetail && (
+              <>
+                <InfoRow label="EMBG" value={billingDetail.patientEmbg} />
+                <InfoRow label="Phone" value={billingDetail.patientPhone} />
+                <InfoRow label="Bill Date" value={billingDetail.billDate} />
+              </>
+            )}
+          </div>
+        </div>
+      </div>
+
+      <div className="bg-white rounded-lg shadow p-6">
+        <h2 className="text-xl font-bold mb-4">Itemized Services</h2>
+
+        {billingDetail && (billingDetail.procedures.length > 0 || billingDetail.labTests.length > 0) ? (
+          <div className="space-y-4">
+            {billingDetail.procedures.length > 0 && (
+              <div>
+                <h3 className="font-semibold text-lg mb-2">Procedures</h3>
+                <table className="w-full">
+                  <thead className="bg-gray-100">
+                    <tr>
+                      <th className="px-4 py-2 text-left">Description</th>
+                      <th className="px-4 py-2 text-right">Cost</th>
+                    </tr>
+                  </thead>
+                  <tbody>
+                    {billingDetail.procedures.map((proc, idx) => (
+                      <tr key={idx} className="border-t">
+                        <td className="px-4 py-2">{proc.description}</td>
+                        <td className="px-4 py-2 text-right">${proc.cost}</td>
+                      </tr>
+                    ))}
+                  </tbody>
+                </table>
+              </div>
+            )}
+
+            {billingDetail.labTests.length > 0 && (
+              <div>
+                <h3 className="font-semibold text-lg mb-2">Lab Tests</h3>
+                <table className="w-full">
+                  <thead className="bg-gray-100">
+                    <tr>
+                      <th className="px-4 py-2 text-left">Description</th>
+                      <th className="px-4 py-2 text-right">Cost</th>
+                    </tr>
+                  </thead>
+                  <tbody>
+                    {billingDetail.labTests.map((test, idx) => (
+                      <tr key={idx} className="border-t">
+                        <td className="px-4 py-2">{test.description}</td>
+                        <td className="px-4 py-2 text-right">${test.cost}</td>
+                      </tr>
+                    ))}
+                  </tbody>
+                </table>
+              </div>
+            )}
+
+            <div className="border-t-2 pt-4 mt-4 flex justify-end">
+              <div className="text-right">
+                <p className="text-gray-600">Total Amount:</p>
+                <p className="text-2xl font-bold text-purple-600">${billing.totalCost}</p>
+              </div>
             </div>
           </div>
-        </div>
-
-        <div className="bg-white rounded-lg shadow p-6">
-          <h2 className="text-xl font-bold mb-4">Itemized Services</h2>
-
-          {billingDetail && (billingDetail.procedures.length > 0 || billingDetail.labTests.length > 0) ? (
-              <div className="space-y-4">
-                {billingDetail.procedures.length > 0 && (
-                    <div>
-                      <h3 className="font-semibold text-lg mb-2">Procedures</h3>
-                      <table className="w-full">
-                        <thead className="bg-gray-100">
-                        <tr>
-                          <th className="px-4 py-2 text-left">Description</th>
-                          <th className="px-4 py-2 text-right">Cost</th>
-                        </tr>
-                        </thead>
-                        <tbody>
-                        {billingDetail.procedures.map((proc, idx) => (
-                            <tr key={idx} className="border-t">
-                              <td className="px-4 py-2">{proc.description}</td>
-                              <td className="px-4 py-2 text-right">${proc.cost}</td>
-                            </tr>
-                        ))}
-                        </tbody>
-                      </table>
-                    </div>
-                )}
-
-                {billingDetail.labTests.length > 0 && (
-                    <div>
-                      <h3 className="font-semibold text-lg mb-2">Lab Tests</h3>
-                      <table className="w-full">
-                        <thead className="bg-gray-100">
-                        <tr>
-                          <th className="px-4 py-2 text-left">Description</th>
-                          <th className="px-4 py-2 text-right">Cost</th>
-                        </tr>
-                        </thead>
-                        <tbody>
-                        {billingDetail.labTests.map((test, idx) => (
-                            <tr key={idx} className="border-t">
-                              <td className="px-4 py-2">{test.description}</td>
-                              <td className="px-4 py-2 text-right">${test.cost}</td>
-                            </tr>
-                        ))}
-                        </tbody>
-                      </table>
-                    </div>
-                )}
-
-                <div className="border-t-2 pt-4 mt-4 flex justify-end">
-                  <div className="text-right">
-                    <p className="text-gray-600">Total Amount:</p>
-                    <p className="text-2xl font-bold text-purple-600">${billing.totalCost}</p>
-                  </div>
-                </div>
-              </div>
-          ) : (
-              <p className="text-gray-500">No services itemized for this billing record.</p>
-          )}
-        </div>
-      </div>
+        ) : (
+          <p className="text-gray-500">No services itemized for this billing record.</p>
+        )}
+      </div>
+    </div>
   );
 }
@@ -235,8 +235,8 @@
 function InfoRow({ label, value }) {
   return (
-      <div className="flex justify-between">
-        <span className="text-gray-800">{label}:</span>
-        <span className="text-gray-800">{value || 'N/A'}</span>
-      </div>
+    <div className="flex justify-between">
+      <span className="text-gray-800">{label}:</span>
+      <span className="text-gray-800">{value || 'N/A'}</span>
+    </div>
   );
 }
Index: frontend/src/pages/billing/BillingList.js
===================================================================
--- frontend/src/pages/billing/BillingList.js	(revision e1f74f6c04f9d460135de378f659fedfd9c74b44)
+++ frontend/src/pages/billing/BillingList.js	(revision cdcff72e9765342b84a5e4b5d98ca5cb050a5500)
@@ -89,6 +89,6 @@
       // Refresh the list
       const response = user.role === 'BILLING_ADMIN'
-          ? await billingService.getAllBillings()
-          : await billingService.getBillingHistoryForPatient(patientId || user.patientId);
+        ? await billingService.getAllBillings()
+        : await billingService.getBillingHistoryForPatient(patientId || user.patientId);
       setBillings(response.data || []);
     } catch (err) {
@@ -101,8 +101,8 @@
   if (user.role === 'DOCTOR' || user.role === 'LAB_TECHNICIAN') {
     return (
-        <div style={{ padding: '20px', textAlign: 'center' }}>
-          <h1 className="text-2xl font-bold" style={{ color: '#7c3aed', marginBottom: '10px' }}>Access Denied</h1>
-          <p style={{ color: 'var(--color-neutral-600)' }}>You do not have permission to access billing records.</p>
-        </div>
+      <div style={{ padding: '20px', textAlign: 'center' }}>
+        <h1 className="text-2xl font-bold" style={{ color: '#7c3aed', marginBottom: '10px' }}>Access Denied</h1>
+        <p style={{ color: 'var(--color-neutral-600)' }}>You do not have permission to access billing records.</p>
+      </div>
     );
   }
@@ -111,73 +111,73 @@
 
   return (
-      <div>
-        <h1 className="text-3xl font-bold mb-6" style={{ color: '#7c3aed' }}>{patientId ? 'Patient Billing History' : 'Billing Records'}</h1>
-
-        {error && <ErrorAlert message={error} onClose={() => setError(null)} />}
-        {success && <SuccessAlert message={success} onClose={() => setSuccess(null)} />}
-
-        {/* Filters for Billing Admin */}
-        {user.role === 'BILLING_ADMIN' && (
-            <div className="bg-white rounded-lg shadow p-6 mb-6">
-              <h2 className="text-lg font-bold mb-4">Filters</h2>
-              <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
+    <div>
+      <h1 className="text-3xl font-bold mb-6" style={{ color: '#7c3aed' }}>{patientId ? 'Patient Billing History' : 'Billing Records'}</h1>
+
+      {error && <ErrorAlert message={error} onClose={() => setError(null)} />}
+      {success && <SuccessAlert message={success} onClose={() => setSuccess(null)} />}
+
+      {/* Filters for Billing Admin */}
+      {user.role === 'BILLING_ADMIN' && (
+        <div className="bg-white rounded-lg shadow p-6 mb-6">
+          <h2 className="text-lg font-bold mb-4">Filters</h2>
+          <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
+            <div>
+              <label className="block text-sm font-semibold mb-2">Status</label>
+              <select
+                value={statusFilter}
+                onChange={(e) => setStatusFilter(e.target.value)}
+                className="w-full px-4 py-2 border rounded-lg"
+              >
+                <option value="">All Statuses</option>
+                <option value="PENDING">Pending</option>
+                <option value="PAID">Paid</option>
+                <option value="PROCESSING">Processing</option>
+              </select>
+            </div>
+            <div>
+              <label className="block text-sm font-semibold mb-2">Patient</label>
+              <select
+                value={patientFilter}
+                onChange={(e) => setPatientFilter(e.target.value)}
+                className="w-full px-4 py-2 border rounded-lg"
+              >
+                <option value="">All Patients</option>
+                {patients.map(p => (
+                  <option key={p.patientId} value={`${p.firstName} ${p.lastName}`}>
+                    {p.firstName} {p.lastName}
+                  </option>
+                ))}
+              </select>
+            </div>
+          </div>
+        </div>
+      )}
+
+      {/* Pending Billing Records Section (for Billing Admin) */}
+      {user.role === 'BILLING_ADMIN' && pendingBillings.length > 0 && (
+        <div className="bg-yellow-50 rounded-lg shadow p-6 mb-6 border-l-4 border-yellow-500">
+          <h2 className="text-lg font-bold mb-4">Pending Billing Records ({pendingBillings.length})</h2>
+          <div className="space-y-3">
+            {pendingBillings.map(billing => (
+              <div key={billing.billId} className="bg-white rounded p-4 flex justify-between items-center">
                 <div>
-                  <label className="block text-sm font-semibold mb-2">Status</label>
-                  <select
-                      value={statusFilter}
-                      onChange={(e) => setStatusFilter(e.target.value)}
-                      className="w-full px-4 py-2 border rounded-lg"
-                  >
-                    <option value="">All Statuses</option>
-                    <option value="PENDING">Pending</option>
-                    <option value="PAID">Paid</option>
-                    <option value="PROCESSING">Processing</option>
-                  </select>
+                  <p className="font-semibold">{billing.patientName}</p>
+                  <p className="text-sm text-gray-600">${billing.totalCost}</p>
                 </div>
-                <div>
-                  <label className="block text-sm font-semibold mb-2">Patient</label>
-                  <select
-                      value={patientFilter}
-                      onChange={(e) => setPatientFilter(e.target.value)}
-                      className="w-full px-4 py-2 border rounded-lg"
-                  >
-                    <option value="">All Patients</option>
-                    {patients.map(p => (
-                        <option key={p.patientId} value={`${p.firstName} ${p.lastName}`}>
-                          {p.firstName} {p.lastName}
-                        </option>
-                    ))}
-                  </select>
-                </div>
+                <button
+                  onClick={() => handleUpdateStatus(billing.billId, 'PAID')}
+                  className="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600 text-sm"
+                >
+                  Mark Paid
+                </button>
               </div>
-            </div>
-        )}
-
-        {/* Pending Billing Records Section (for Billing Admin) */}
-        {user.role === 'BILLING_ADMIN' && pendingBillings.length > 0 && (
-            <div className="bg-yellow-50 rounded-lg shadow p-6 mb-6 border-l-4 border-yellow-500">
-              <h2 className="text-lg font-bold mb-4">Pending Billing Records ({pendingBillings.length})</h2>
-              <div className="space-y-3">
-                {pendingBillings.map(billing => (
-                    <div key={billing.billId} className="bg-white rounded p-4 flex justify-between items-center">
-                      <div>
-                        <p className="font-semibold">{billing.patientName}</p>
-                        <p className="text-sm text-gray-600">${billing.totalCost}</p>
-                      </div>
-                      <button
-                          onClick={() => handleUpdateStatus(billing.billId, 'PAID')}
-                          className="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600 text-sm"
-                      >
-                        Mark Paid
-                      </button>
-                    </div>
-                ))}
-              </div>
-            </div>
-        )}
-
-        <div className="bg-white rounded-lg shadow overflow-hidden">
-          <table className="w-full">
-            <thead className="bg-gray-100">
+            ))}
+          </div>
+        </div>
+      )}
+
+      <div className="bg-white rounded-lg shadow overflow-hidden">
+        <table className="w-full">
+          <thead className="bg-gray-100">
             <tr>
               <th className="px-6 py-3 text-left text-sm font-semibold">Patient</th>
@@ -187,37 +187,37 @@
               <th className="px-6 py-3 text-left text-sm font-semibold">Actions</th>
             </tr>
-            </thead>
-            <tbody>
+          </thead>
+          <tbody>
             {filteredBillings.map(billing => (
-                <tr key={billing.billId} className="border-t hover:bg-gray-50">
-                  <td className="px-6 py-3">{billing.patientName}</td>
-                  <td className="px-6 py-3">${billing.totalCost}</td>
-                  <td className="px-6 py-3">
+              <tr key={billing.billId} className="border-t hover:bg-gray-50">
+                <td className="px-6 py-3">{billing.patientName}</td>
+                <td className="px-6 py-3">${billing.totalCost}</td>
+                <td className="px-6 py-3">
                   <span className={`px-3 py-1 rounded text-sm font-semibold ${
-                      billing.paymentStatus === 'PENDING' ? 'bg-yellow-100 text-yellow-800' :
-                          billing.paymentStatus === 'PAID' ? 'bg-green-100 text-green-800' :
-                              'bg-red-100 text-red-800'
+                    billing.paymentStatus === 'PENDING' ? 'bg-yellow-100 text-yellow-800' :
+                    billing.paymentStatus === 'PAID' ? 'bg-green-100 text-green-800' :
+                    'bg-red-100 text-red-800'
                   }`}>
                     {billing.paymentStatus}
                   </span>
-                  </td>
-                  <td className="px-6 py-3">{billing.paymentDate || 'Not paid'}</td>
-                  <td className="px-6 py-3">
-                    <Link to={`/billing/${billing.billId}`} style={{ color: '#7c3aed', textDecoration: 'none', fontWeight: '400' }} onMouseEnter={(e) => e.currentTarget.style.textDecoration = 'underline'} onMouseLeave={(e) => e.currentTarget.style.textDecoration = 'none'}>
-                      View
-                    </Link>
-                  </td>
-                </tr>
+                </td>
+                <td className="px-6 py-3">{billing.paymentDate || 'Not paid'}</td>
+                <td className="px-6 py-3">
+                  <Link to={`/billing/${billing.billId}`} style={{ color: '#7c3aed', textDecoration: 'none', fontWeight: '400' }} onMouseEnter={(e) => e.currentTarget.style.textDecoration = 'underline'} onMouseLeave={(e) => e.currentTarget.style.textDecoration = 'none'}>
+                    View
+                  </Link>
+                </td>
+              </tr>
             ))}
-            </tbody>
-          </table>
-
-          {filteredBillings.length === 0 && (
-              <div className="p-6 text-center text-gray-500">
-                {billings.length === 0 ? 'No billing records found' : 'No records match the selected filters'}
-              </div>
-          )}
-        </div>
+          </tbody>
+        </table>
+
+        {filteredBillings.length === 0 && (
+          <div className="p-6 text-center text-gray-500">
+            {billings.length === 0 ? 'No billing records found' : 'No records match the selected filters'}
+          </div>
+        )}
       </div>
+    </div>
   );
 }
