-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMAIN_UI.py
More file actions
645 lines (580 loc) Β· 23.3 KB
/
MAIN_UI.py
File metadata and controls
645 lines (580 loc) Β· 23.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
"""
UI/MAIN_UI.py
Professional Restaurant Billing System
- Multi-page: Dashboard, Order Entry, Order History, Reports, Menu Page, Menu Management,
Staff Management, Customer Management, Settings
- Theme switcher + modern gradient backgrounds
- CSV import for menu, searchable menu, invoice preview, JSON bill export
"""
import streamlit as st
from pathlib import Path
import sqlite3
import pandas as pd
import datetime as dt
import json
import os
try:
menu_df = pd.read_csv("DATA/menu.csv")
# Fix for NaN values (choose one)
menu_df = pd.read_csv("DATA/menu.csv").fillna("")
# menu_df = menu_df.dropna() # OR drop missing rows
except Exception as e:
st.error(f"Error loading menu.csv: {e}")
# --------------------------------------------------------------------------------------
# Paths & bootstrapping
# --------------------------------------------------------------------------------------
ROOT = Path(__file__).parents[1]
DB_DIR = ROOT / "DB"
DATA_DIR = ROOT / "DATA"
DB_PATH = DB_DIR / "RESTAURANT.DB"
# Ensure folders exist
DB_DIR.mkdir(parents=True, exist_ok=True)
DATA_DIR.mkdir(parents=True, exist_ok=True)
# --------------------------------------------------------------------------------------
# DB helpers
# --------------------------------------------------------------------------------------
def get_conn():
return sqlite3.connect(DB_PATH, check_same_thread=False)
def init_db():
conn = get_conn()
c = conn.cursor()
# Menu (with optional image url/path)
c.execute("""
CREATE TABLE IF NOT EXISTS menu(
item_id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
category TEXT,
price REAL,
gst_percent REAL DEFAULT 5,
image TEXT
)
""")
# Orders master
c.execute("""
CREATE TABLE IF NOT EXISTS orders(
order_id INTEGER PRIMARY KEY AUTOINCREMENT,
customer_name TEXT,
customer_contact TEXT,
customer_email TEXT,
notes TEXT,
mode TEXT,
table_no TEXT,
delivery_address TEXT,
discount REAL,
payment_method TEXT,
total REAL,
gst REAL,
created_at TEXT,
staff_id INTEGER,
customer_id INTEGER
)
""")
# Order line items (store price snapshot at time of order)
c.execute("""
CREATE TABLE IF NOT EXISTS order_items(
order_item_id INTEGER PRIMARY KEY AUTOINCREMENT,
order_id INTEGER,
item_id INTEGER,
qty INTEGER,
price REAL
)
""")
# Staff
c.execute("""
CREATE TABLE IF NOT EXISTS staff(
staff_id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
role TEXT,
contact TEXT
)
""")
# Customers
c.execute("""
CREATE TABLE IF NOT EXISTS customers(
customer_id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
contact TEXT,
email TEXT
)
""")
conn.commit()
conn.close()
init_db()
# --------------------------------------------------------------------------------------
# Theme system
# --------------------------------------------------------------------------------------
THEMES = {
"Luxury Red-Orange": "linear-gradient(135deg,#ff512f,#dd2476)",
"Elegant Blue-Purple": "linear-gradient(135deg,#1e3c72,#2a5298)",
"Modern Green-Teal": "linear-gradient(135deg,#11998e,#38ef7d)",
"Classy Black-Gold": "linear-gradient(135deg,#000000,#434343)",
"Spotify Dark": "linear-gradient(135deg,#0f0f0f,#1db954)"
}
def inject_theme(gradient_css):
css = f"""
<style>
:root {{
--accent-1:#FFD700;
--accent-2:#2ecc71;
--bg:{gradient_css};
--card:rgba(255,255,255,0.08);
}}
[data-testid="stAppViewContainer"] {{
background: var(--bg);
color: #fff;
}}
[data-testid="stSidebar"] {{
background: rgba(0,0,0,0.75);
color: #fff;
backdrop-filter: blur(6px);
}}
.app-title {{
text-align:center;
font-size:30px;
font-weight:900;
color: var(--accent-1);
margin: 6px 0 16px 0;
letter-spacing: .5px;
}}
.card {{
background: var(--card);
padding: 14px;
border-radius: 16px;
box-shadow: 0 10px 24px rgba(0,0,0,.25);
margin-bottom: 14px;
}}
.menu-card {{
background: var(--card);
padding: 12px;
border-radius: 16px;
box-shadow: 0 8px 20px rgba(0,0,0,.25);
margin-bottom: 12px;
}}
.menu-card h4 {{ margin:6px 0; color: var(--accent-1); }}
.menu-price {{ color: var(--accent-2); font-weight: 800; font-size: 18px; }}
.small-muted {{ opacity:.9; font-size: 12px; }}
</style>
"""
st.markdown(css, unsafe_allow_html=True)
# Persist theme in session
if "theme" not in st.session_state:
st.session_state.theme = "Elegant Blue-Purple"
inject_theme(THEMES[st.session_state.theme])
# --------------------------------------------------------------------------------------
# Page config
# --------------------------------------------------------------------------------------
st.set_page_config(page_title="Restaurant Billing", layout="wide")
st.markdown('<div class="app-title">π½οΈ Restaurant Billing System</div>', unsafe_allow_html=True)
# --------------------------------------------------------------------------------------
# Sidebar Navigation
# --------------------------------------------------------------------------------------
page = st.sidebar.radio(
"Navigate",
[
"π Dashboard",
"π§Ύ Order Entry",
"π Order History",
"π Reports",
"π Menu Page",
"π½οΈ Menu Management",
"π¨βπ³ Staff Management",
"π€ Customer Management",
"βοΈ Settings"
]
)
# --------------------------------------------------------------------------------------
# Helper utilities
# --------------------------------------------------------------------------------------
def calc_totals(items, discount=0.0):
"""
items: list of tuples (price, gst_percent, qty)
returns subtotal, gst, net
"""
subtotal = sum(p * q for p, g, q in items)
gst_total = sum((p * (g/100.0)) * q for p, g, q in items)
net = max(0.0, subtotal + gst_total - (discount or 0.0))
return round(subtotal, 2), round(gst_total, 2), round(net, 2)
def export_bill_json(order_id, payload):
out_path = DATA_DIR / f"bill_{order_id}.json"
with open(out_path, "w", encoding="utf-8") as f:
json.dump(payload, f, indent=2, ensure_ascii=False)
def to_date(s):
try:
return pd.to_datetime(s).date()
except Exception:
return None
# --------------------------------------------------------------------------------------
# Pages
# --------------------------------------------------------------------------------------
# DASHBOARD
if page == "π Dashboard":
st.header("π Dashboard Overview")
conn = get_conn()
orders = pd.read_sql("SELECT * FROM orders", conn)
conn.close()
if orders.empty:
st.info("No orders yet. Switch to **π§Ύ Order Entry** to create your first order.")
else:
orders["created_at"] = pd.to_datetime(orders["created_at"])
today = dt.date.today()
today_sales = orders[orders["created_at"].dt.date == today]["total"].sum()
total_orders = len(orders)
# Top item
conn = get_conn()
top_df = pd.read_sql("""
SELECT m.name, SUM(oi.qty) AS qty
FROM order_items oi
JOIN menu m ON m.item_id = oi.item_id
GROUP BY oi.item_id
ORDER BY qty DESC
LIMIT 1
""", conn)
conn.close()
top_item = top_df.iloc[0]["name"] if not top_df.empty else "β"
c1, c2, c3 = st.columns(3)
c1.metric("π° Today's Sales", f"βΉ{today_sales:.2f}")
c2.metric("π Orders (All-Time)", int(total_orders))
c3.metric("π΄ Top Item", top_item)
st.subheader("π Sales Trend (by Day)")
series = orders.groupby(orders["created_at"].dt.date)["total"].sum()
st.line_chart(series)
# ORDER ENTRY
elif page == "π§Ύ Order Entry":
st.header("π§Ύ New Order")
# Customer & mode
c1, c2, c3 = st.columns(3)
with c1:
cust_name = st.text_input("Customer Name")
with c2:
cust_contact = st.text_input("Contact")
with c3:
cust_email = st.text_input("Email")
notes = st.text_area("Special Notes (e.g., No Onion / Extra Spicy)")
mode = st.selectbox("Order Type", ["DINE-IN", "TAKEAWAY", "DELIVERY"])
table_no, delivery_address = None, None
if mode == "DINE-IN":
table_no = st.number_input("Table No", 1, 200, 1)
elif mode == "DELIVERY":
delivery_address = st.text_area("Delivery Address")
# Assign staff / customer (optional)
conn = get_conn()
staff_df = pd.read_sql("SELECT * FROM staff", conn)
cust_df = pd.read_sql("SELECT * FROM customers", conn)
menu_df = pd.read_sql("SELECT * FROM menu", conn)
conn.close()
sc1, sc2 = st.columns(2)
with sc1:
staff_id = None
if not staff_df.empty:
staff_map = {f"{r['name']} ({r['role']})": int(r["staff_id"]) for _, r in staff_df.iterrows()}
staff_pick = st.selectbox("Handled by (Staff)", ["β None β"] + list(staff_map.keys()))
staff_id = staff_map.get(staff_pick)
else:
st.caption("No staff yet. Add in **π¨βπ³ Staff Management**.")
with sc2:
customer_id = None
if not cust_df.empty:
cust_map = {f"{r['name']} ({r['contact']})": int(r["customer_id"]) for _, r in cust_df.iterrows()}
cust_pick = st.selectbox("Existing Customer", ["β None β"] + list(cust_map.keys()))
customer_id = cust_map.get(cust_pick)
else:
st.caption("No saved customers yet. Add in **π€ Customer Management**.")
# Menu selection
order_items = [] # (item_id, qty, price, gst%)
if not menu_df.empty:
st.subheader("π΄ Menu")
search = st.text_input("π Search dish")
if search:
show_df = menu_df[menu_df["name"].str.contains(search, case=False)]
else:
show_df = menu_df
cols = st.columns(3)
for idx, row in show_df.iterrows():
with cols[idx % 3]:
st.markdown("<div class='menu-card'>", unsafe_allow_html=True)
st.markdown(f"<h4>{row['name']}</h4>", unsafe_allow_html=True)
st.markdown(f"<div class='menu-price'>βΉ{row['price']:.2f}</div>", unsafe_allow_html=True)
st.caption(f"GST {row['gst_percent']}% Β· {row['category']}")
qty = st.number_input(f"Qty #{int(row['item_id'])}", 0, 50, 0, key=f"qty_{int(row['item_id'])}")
if qty > 0:
order_items.append((int(row["item_id"]), int(qty), float(row["price"]), float(row["gst_percent"])))
st.markdown("</div>", unsafe_allow_html=True)
else:
st.warning("No dishes in menu. Add some in **π½οΈ Menu Management**.")
discount = st.number_input("Discount (βΉ)", 0.0, 100000.0, 0.0, step=10.0)
pay_method = st.radio("Payment Method", ["Cash", "Card", "UPI"], horizontal=True)
# Preview
if st.button("Preview Invoice"):
if order_items:
items_for_calc = [(p, g, q) for _, q, p, g in order_items]
subtotal, gst_total, net = calc_totals(items_for_calc, discount)
st.subheader("π§Ύ Invoice Preview")
st.write(f"Customer: {cust_name or 'β'} | Mode: {mode} | Payment: {pay_method}")
st.write(f"Subtotal: βΉ{subtotal:.2f} | GST: βΉ{gst_total:.2f} | Discount: βΉ{discount:.2f}")
st.success(f"**Net Total: βΉ{net:.2f}**")
else:
st.warning("No items selected.")
# Place order
if st.button("Place Order"):
if order_items:
items_for_calc = [(p, g, q) for _, q, p, g in order_items]
subtotal, gst_total, net = calc_totals(items_for_calc, discount)
now = dt.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
conn = get_conn()
cur = conn.cursor()
cur.execute("""
INSERT INTO orders(customer_name,customer_contact,customer_email,notes,
mode,table_no,delivery_address,discount,payment_method,
total,gst,created_at,staff_id,customer_id)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
""", (cust_name, cust_contact, cust_email, notes, mode, table_no, delivery_address,
discount, pay_method, net, gst_total, now, staff_id, customer_id))
oid = cur.lastrowid
for item_id, qty, price, gstp in order_items:
cur.execute("INSERT INTO order_items(order_id,item_id,qty,price) VALUES(?,?,?,?)",
(oid, item_id, qty, price))
conn.commit()
conn.close()
bill_payload = {
"order_id": oid,
"customer": {
"name": cust_name, "contact": cust_contact, "email": cust_email
},
"mode": mode,
"table_no": table_no,
"delivery_address": delivery_address,
"notes": notes,
"payment_method": pay_method,
"items": [
{"item_id": i, "qty": q, "price": p} for i, q, p, _ in order_items
],
"totals": {"subtotal": subtotal, "gst": gst_total, "discount": discount, "net": net},
"created_at": now,
"staff_id": staff_id,
"customer_id": customer_id
}
export_bill_json(oid, bill_payload)
st.success(f"β
Order #{oid} placed. Net: βΉ{net:.2f}")
else:
st.warning("No items selected.")
# ORDER HISTORY
elif page == "π Order History":
st.header("π Order History")
conn = get_conn()
df = pd.read_sql("SELECT * FROM orders ORDER BY created_at DESC", conn)
conn.close()
if df.empty:
st.info("No orders yet.")
else:
# Quick filters
c1, c2, c3 = st.columns(3)
with c1:
search_id = st.text_input("Search by Order ID")
with c2:
search_name = st.text_input("Search by Customer Name")
with c3:
pay_filter = st.selectbox("Payment Filter", ["All", "Cash", "Card", "UPI"])
show = df.copy()
if search_id.strip():
try:
oid = int(search_id.strip())
show = show[show["order_id"] == oid]
except:
st.warning("Order ID must be a number.")
if search_name.strip():
show = show[show["customer_name"].fillna("").str.contains(search_name, case=False)]
if pay_filter != "All":
show = show[show["payment_method"] == pay_filter]
st.dataframe(show, use_container_width=True)
cancel_id = st.number_input("Cancel Order ID", 0, step=1)
if st.button("Cancel Order") and cancel_id > 0:
conn = get_conn()
cur = conn.cursor()
cur.execute("DELETE FROM order_items WHERE order_id=?", (cancel_id,))
cur.execute("DELETE FROM orders WHERE order_id=?", (cancel_id,))
conn.commit()
conn.close()
st.success(f"β Order {int(cancel_id)} cancelled")
# REPORTS
elif page == "π Reports":
st.header("π Sales Reports")
# Date range
c1, c2 = st.columns(2)
with c1:
start = st.date_input("From", dt.date.today() - dt.timedelta(days=7))
with c2:
end = st.date_input("To", dt.date.today())
conn = get_conn()
orders = pd.read_sql("SELECT * FROM orders", conn)
top_items = pd.read_sql("""
SELECT m.name, SUM(oi.qty) AS qty
FROM order_items oi
JOIN menu m ON m.item_id = oi.item_id
GROUP BY oi.item_id
ORDER BY qty DESC
LIMIT 10
""", conn)
conn.close()
if orders.empty:
st.info("No orders yet.")
else:
orders["created_at"] = pd.to_datetime(orders["created_at"])
mask = (orders["created_at"].dt.date >= start) & (orders["created_at"].dt.date <= end)
filt = orders[mask]
if filt.empty:
st.warning("No sales in selected range.")
else:
st.subheader("π° Sales Summary")
total_sales = filt["total"].sum()
total_orders = len(filt)
avg_ticket = (total_sales / total_orders) if total_orders else 0
c1, c2, c3 = st.columns(3)
c1.metric("Total Sales", f"βΉ{total_sales:.2f}")
c2.metric("Orders", int(total_orders))
c3.metric("Avg Ticket", f"βΉ{avg_ticket:.2f}")
st.subheader("π Sales by Day")
by_day = filt.groupby(filt["created_at"].dt.date)["total"].sum()
st.line_chart(by_day)
st.subheader("π Top Items (All-Time)")
if not top_items.empty:
st.bar_chart(top_items.set_index("name"))
# Export CSV
if st.button("Export orders CSV"):
out = DATA_DIR / f"sales_{start}_{end}.csv"
filt.to_csv(out, index=False)
st.success(f"Exported: {out}")
# MENU PAGE (Public view)
elif page == "π Menu Page":
st.header("π Our Menu")
conn = get_conn()
menu_df = pd.read_sql("SELECT * FROM menu", conn)
conn.close()
if menu_df.empty:
st.warning("No dishes yet. Add dishes in **π½οΈ Menu Management**.")
else:
cats = list(menu_df["category"].dropna().unique())
pick = st.multiselect("Filter by category", cats, default=cats)
show = menu_df[menu_df["category"].isin(pick)] if pick else menu_df
for cat in (show["category"].unique()):
st.subheader(f"π΄ {cat}")
cat_items = show[show["category"] == cat]
cols = st.columns(3)
for idx, row in cat_items.iterrows():
with cols[idx % 3]:
st.markdown("<div class='menu-card'>", unsafe_allow_html=True)
if row.get("image"):
try:
st.image(row["image"], use_container_width=True)
except Exception:
st.caption("Image not found")
st.markdown(f"<h4>{row['name']}</h4>", unsafe_allow_html=True)
st.markdown(f"<div class='menu-price'>βΉ{row['price']:.2f}</div>", unsafe_allow_html=True)
st.caption(f"GST {row['gst_percent']}%")
st.markdown("</div>", unsafe_allow_html=True)
# MENU MANAGEMENT (Admin)
elif page == "π½οΈ Menu Management":
st.header("π½οΈ Menu Management")
# Bulk import via CSV
with st.expander("π₯ Bulk Import via CSV (name,category,price,gst_percent,image)"):
up = st.file_uploader("Upload CSV", type=["csv"])
if up is not None:
try:
df = pd.read_csv(up)
need_cols = {"name","category","price","gst_percent"}
if not need_cols.issubset(set(df.columns)):
st.error("CSV must have columns: name, category, price, gst_percent (image optional)")
else:
df = df.fillna({"image": None})
conn = get_conn()
cur = conn.cursor()
cur.executemany(
"INSERT INTO menu(name,category,price,gst_percent,image) VALUES(?,?,?,?,?)",
list(df[["name","category","price","gst_percent","image"]].itertuples(index=False, name=None))
)
conn.commit(); conn.close()
st.success(f"Imported {len(df)} dishes β
")
except Exception as e:
st.error(f"Failed to import: {e}")
# Add single dish
with st.form("add_form", clear_on_submit=True):
c1, c2 = st.columns([2,1])
with c1:
n = st.text_input("Dish Name")
cat = st.text_input("Category", "Main")
img = st.text_input("Image URL/Path (optional)")
with c2:
price = st.number_input("Price βΉ", 0.0, 100000.0, 120.0)
gst = st.number_input("GST %", 0.0, 50.0, 5.0)
ok = st.form_submit_button("Add Dish")
if ok and n:
conn = get_conn(); cur = conn.cursor()
cur.execute("INSERT INTO menu(name,category,price,gst_percent,image) VALUES(?,?,?,?,?)",
(n, cat, price, gst, img or None))
conn.commit(); conn.close()
st.success("Dish added β
")
# Search & list
search = st.text_input("π Search dish")
conn = get_conn()
mdf = pd.read_sql("SELECT * FROM menu", conn)
conn.close()
if not mdf.empty:
if search:
mdf = mdf[mdf["name"].str.contains(search, case=False)]
st.dataframe(mdf, use_container_width=True)
else:
st.caption("No dishes yet.")
# STAFF
elif page == "π¨βπ³ Staff Management":
st.header("π¨βπ³ Staff Management")
with st.form("staff_form", clear_on_submit=True):
n = st.text_input("Staff Name")
role = st.selectbox("Role", ["Cashier", "Waiter", "Manager", "Chef"])
contact = st.text_input("Contact")
ok = st.form_submit_button("Add Staff")
if ok and n:
conn = get_conn(); cur = conn.cursor()
cur.execute("INSERT INTO staff(name,role,contact) VALUES(?,?,?)", (n, role, contact))
conn.commit(); conn.close()
st.success("Staff added β
")
conn = get_conn()
sdf = pd.read_sql("SELECT * FROM staff", conn)
conn.close()
st.subheader("Staff List")
if sdf.empty:
st.caption("No staff yet.")
else:
st.dataframe(sdf, use_container_width=True)
# CUSTOMERS
elif page == "π€ Customer Management":
st.header("π€ Customer Management")
with st.form("cust_form", clear_on_submit=True):
n = st.text_input("Customer Name")
contact = st.text_input("Contact")
email = st.text_input("Email")
ok = st.form_submit_button("Save Customer")
if ok and n:
conn = get_conn(); cur = conn.cursor()
cur.execute("INSERT INTO customers(name,contact,email) VALUES(?,?,?)", (n, contact, email))
conn.commit(); conn.close()
st.success("Customer saved β
")
conn = get_conn()
cdf = pd.read_sql("SELECT * FROM customers", conn)
conn.close()
st.subheader("Customer List")
if cdf.empty:
st.caption("No customers yet.")
else:
st.dataframe(cdf, use_container_width=True)
# SETTINGS
elif page == "βοΈ Settings":
st.header("βοΈ Appearance & Settings")
theme_choice = st.selectbox("π¨ Theme", list(THEMES.keys()), index=list(THEMES.keys()).index(st.session_state.theme))
apply = st.button("Apply Theme")
if apply:
st.session_state.theme = theme_choice
inject_theme(THEMES[theme_choice])
st.success(f"Applied: {theme_choice}")
st.markdown("β")
st.subheader("π Shortcuts")
st.caption("β’ Use **Menu Management** to upload CSV and bulk-create dishes.")
st.caption("β’ Bills are exported as JSON in the **DATA** folder automatically after placing an order.")