-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1093 lines (1015 loc) · 63.4 KB
/
Copy pathindex.html
File metadata and controls
1093 lines (1015 loc) · 63.4 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
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="my">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Debt Tracker - ဆိုင်အကြွေးစာရင်း နှင့် ငွေစာရင်း မှတ်တမ်းစနစ်</title>
<meta name="description"
content="မြန်မာနိုင်ငံရှိ အရောင်းဆိုင်များအတွက် အကောင်းဆုံး အကြွေးစာရင်း မှတ်တမ်းတင် စနစ်။ ဖောက်သည် စီမံခန့်ခွဲမှု၊ ကြွေးကျန် စာရင်းနှင့် ငွေရှင်းမှတ်တမ်းများကို လွယ်ကူစွာ အသုံးပြုနိုင်ပါသည်။ (Offline Support)">
<meta name="keywords"
content="Debt Tracker Myanmar, Myanmar POS, အကြွေးစာရင်း, စာရင်းကိုင်စနစ်, ဆိုင်စာရင်း, အကြွေးမှတ်, Ledger App Myanmar">
<link rel="canonical" href="https://debt-tracker-mm.com/">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Debt Tracker",
"operatingSystem": "Android, iOS, Web",
"applicationCategory": "FinanceApplication",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "MMK"
},
"description": "မြန်မာနိုင်ငံရှိ အရောင်းဆိုင်များအတွက် အကောင်းဆုံး အကြွေးစာရင်း မှတ်တမ်းတင် စနစ်။"
}
</script>
<meta property="og:type" content="website">
<meta property="og:url" content="https://debt-tracker-mm.com/">
<meta property="og:title" content="Debt Tracker - ဆိုင်အကြွေးစာရင်း မှတ်တမ်းစနစ်">
<meta property="og:description"
content="ဆိုင်ရှင်များအတွက် အခမဲ့ အကြွေးစာရင်းမှတ်တမ်း App။ အင်တာနက်မလို၊ ဖုန်းထဲမှာတင် Install လုပ်ပြီး သုံးနိုင်ပါတယ်။">
<meta property="og:image"
content="https://debt-tracker-mm.com/images/android-chrome-512x512.png">
<!-- PWA Meta Tags -->
<meta name="description" content="ကြွေးစာရင်း မှတ်တမ်း - Debt Tracking System">
<meta name="theme-color" content="#FACC15">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Debt Tracker">
<!-- Icons -->
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="manifest" href="site.webmanifest">
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="styles/fonts.css">
<link rel="stylesheet" href="styles/animations.css">
<link rel="stylesheet" href="styles/brutalist.css">
<link rel="stylesheet" href="styles/gradients.css">
<link rel="stylesheet" href="styles/scrollbar.css">
<link rel="stylesheet" href="styles/toast.css">
<link rel="stylesheet" href="styles/dropdown.css">
<link rel="stylesheet" href="styles/responsive.css">
<!-- Flatpickr CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<link rel="stylesheet" href="styles/datepicker.css">
<link rel="stylesheet" href="styles/pin.css">
</head>
<body class="bg-white min-h-screen">
<!-- Toast Notification Container -->
<div id="toast-container" class="toast-container"></div>
<!-- App Container -->
<div id="app" class="max-w-md mx-auto min-h-screen bg-white">
<!-- Top Sticky Area: Header + Nav -->
<div class="sticky top-0 z-40 bg-white pt-4 pb-2">
<!-- Header -->
<header class="gradient-yellow p-4 brutalist-card mb-3">
<h1 class="text-2xl font-black text-center flex items-center justify-center gap-2">
<img src="images/logo.svg" alt="Debt Tracker Logo - ဆိုင်အကြွေးစာရင်း" class="w-8 h-8">
Debt Tracking System
</h1>
<p class="text-center text-xs font-bold mt-1">ကြွေးစာရင်း မှတ်တမ်း</p>
</header>
<!-- Navigation -->
<nav class="p-4 pt-0">
<div class="grid grid-cols-4 gap-2 mb-2">
<button onclick="showView('dashboard')" class="nav-btn active py-2 text-xs" id="nav-dashboard">
📊<br>ပင်မစာမျက်နှာ
</button>
<button onclick="showView('customers')" class="nav-btn py-2 text-xs" id="nav-customers">
👥<br>ဖောက်သည်များ
</button>
<button onclick="showView('debts')" class="nav-btn py-2 text-xs" id="nav-debts">
📝<br>ကြွေးမှတ်ရန်
</button>
<button onclick="showView('payments')" class="nav-btn py-2 text-xs" id="nav-payments">
💰<br>ပြန်ဆပ်ငွေ မှတ်ရန်
</button>
</div>
<div class="grid grid-cols-2 gap-2">
<button onclick="showView('settings')" class="nav-btn py-2 text-xs" id="nav-settings">
⚙️<br>Settings
</button>
<button onclick="showView('lock')" class="nav-btn py-2 text-xs" id="nav-lock">
🔒<br>Lock ခတ်ရန်
</button>
</div>
</nav>
</div>
<!-- Main Content -->
<main class="p-4 pb-24 pt-4">
<!-- Dashboard View -->
<div id="view-dashboard" class="view-content">
<!-- Date Filter -->
<div class="brutalist-card bg-white p-4 mb-4">
<div class="flex items-center justify-between mb-3">
<h3 class="font-black text-sm">📅 ရက်စွဲအလိုက် စစ်ထုတ်ရန်</h3>
<button id="clear-dashboard-filter" class="text-xs font-bold text-blue-600 hidden"
onclick="clearDashboardFilter()">
✕ ရှင်းမယ်
</button>
</div>
<div class="grid grid-cols-2 gap-2 mb-3">
<button id="filter-today" onclick="applyDashboardFilter('today')"
class="dashboard-filter-btn brutalist-btn bg-blue-100 text-black py-2 text-xs font-bold">
ဒီနေ့
</button>
<button id="filter-yesterday" onclick="applyDashboardFilter('yesterday')"
class="dashboard-filter-btn brutalist-btn bg-blue-100 text-black py-2 text-xs font-bold">
မနေ့က
</button>
<button id="filter-week" onclick="applyDashboardFilter('week')"
class="dashboard-filter-btn brutalist-btn bg-blue-100 text-black py-2 text-xs font-bold">
ဒီအပတ်
</button>
<button id="filter-month" onclick="applyDashboardFilter('month')"
class="dashboard-filter-btn brutalist-btn bg-blue-100 text-black py-2 text-xs font-bold">
ဒီလ
</button>
</div>
<div class="text-xs font-bold mb-2">သို့မဟုတ် ရက်စွဲအပိုင်းအခြား ရွေးပါ:</div>
<div class="grid grid-cols-2 gap-2 mb-2">
<input type="text" id="dashboard-start-date" placeholder="စတဲ့ရက်..."
class="brutalist-input w-full p-2 text-sm" style="font-family: Arial, sans-serif;">
<input type="text" id="dashboard-end-date" placeholder="ဆုံးရက်..."
class="brutalist-input w-full p-2 text-sm" style="font-family: Arial, sans-serif;">
</div>
<button onclick="applyDashboardFilter('custom')"
class="brutalist-btn bg-green-500 text-white w-full py-2 text-sm font-bold">
စစ်မယ်
</button>
</div>
<!-- Filter Status -->
<div id="dashboard-filter-status"
class="hidden brutalist-card bg-yellow-100 border-3 border-yellow-600 p-3 mb-4">
<div class="flex items-center justify-between">
<div class="text-sm font-bold">
🔍 <span id="dashboard-filter-text"></span>
</div>
</div>
</div>
<!-- Metrics Cards -->
<div class="grid grid-cols-2 gap-4 mb-6">
<div class="brutalist-card gradient-red p-4 metric-card animate-slideInUp">
<div class="text-xs font-bold mb-1">📉 ကြွေးကျန်စုစုပေါင်း</div>
<div class="text-2xl font-black" id="total-debt">0 Ks</div>
</div>
<div class="brutalist-card gradient-green p-4 metric-card animate-slideInUp"
style="animation-delay: 0.1s">
<div class="text-xs font-bold mb-1">💵 ဒီနေ့ရငွေ</div>
<div class="text-2xl font-black" id="today-payment">0 Ks</div>
</div>
</div>
<div class="grid grid-cols-2 gap-4 mb-6">
<div class="brutalist-card gradient-blue p-4 metric-card animate-slideInUp"
style="animation-delay: 0.2s">
<div class="text-xs font-bold mb-1">👥 ဖောက်သည် ဦးရေ</div>
<div class="text-2xl font-black" id="total-customers">0</div>
</div>
<div class="brutalist-card gradient-purple p-4 metric-card animate-slideInUp"
style="animation-delay: 0.3s">
<div class="text-xs font-bold mb-1">📅 လစဉ်အကြွေး</div>
<div class="text-2xl font-black" id="month-debt">0 Ks</div>
</div>
</div>
<!-- Top Debtors -->
<div class="brutalist-card gradient-orange p-4 mb-6 animate-slideInUp" style="animation-delay: 0.4s">
<h2 class="text-lg font-black mb-3 border-b-3 border-black pb-2">📈 အကြွေးအများဆုံး ဖောက်သည်များ
</h2>
<div id="top-debtors" class="space-y-2 max-h-60 overflow-y-auto hide-scrollbar">
<!-- Populated by JS -->
</div>
</div>
<!-- Transactions -->
<div class="brutalist-card bg-white p-4">
<h2 class="text-lg font-black mb-3 border-b-3 border-black pb-2">
<span id="transactions-title">🕐 ဒီနေ့ ပြန်ဆပ်ငွေစာရင်း</span>
</h2>
<div id="today-transactions" class="space-y-2 max-h-60 overflow-y-auto hide-scrollbar">
<!-- Populated by JS -->
</div>
</div>
</div>
<!-- Customers View -->
<div id="view-customers" class="view-content hidden">
<!-- Add Customer Form -->
<div class="brutalist-card gradient-yellow p-4 mb-6 animate-slideInUp">
<h2 class="text-lg font-black mb-3">➕ ဖောက်သည် အသစ်ထည့်မယ်</h2>
<form id="add-customer-form" class="space-y-3">
<input type="text" id="customer-name" placeholder="အမည် (ထည့်ရန်လို)"
class="brutalist-input w-full p-3" required>
<input type="tel" id="customer-phone" placeholder="ဖုန်းနံပါတ် (ရှိလျှင်ထည့်ပါ)"
class="brutalist-input w-full p-3">
<button type="submit" class="brutalist-btn bg-black text-white w-full py-3">
သိမ်းမယ်
</button>
</form>
</div>
<!-- Search -->
<div class="mb-4">
<input type="text" id="customer-search" placeholder="🔍 နာမည်နဲ့ရှာပါ..."
class="brutalist-input w-full p-3">
</div>
<!-- Customer List -->
<div id="customer-list" class="space-y-3 max-h-60 overflow-y-auto hide-scrollbar">
<!-- Populated by JS -->
</div>
</div>
<!-- Debts View -->
<div id="view-debts" class="view-content hidden">
<!-- Add Debt Form -->
<div class="brutalist-card gradient-pink p-4 mb-6 animate-slideInUp">
<h2 class="text-lg font-black mb-3">📝 ကြွေးအသစ်မှတ်မယ်</h2>
<form id="add-debt-form" class="space-y-3">
<div class="custom-dropdown" id="debt-customer-dropdown">
<button type="button" class="custom-dropdown-button brutalist-input w-full p-3 empty"
id="debt-customer-btn">
<span id="debt-customer-text">ဖောက်သည်ရွေးပါ</span>
<span class="dropdown-arrow">▼</span>
</button>
<div class="custom-dropdown-panel" id="debt-customer-panel">
<div class="custom-dropdown-search">
<input type="text" id="debt-customer-search" placeholder="🔍 ရှာရန်..."
class="w-full p-2 border-2 border-black font-bold" autocomplete="off">
</div>
<div class="custom-dropdown-list" id="debt-customer-list">
<!-- Populated by JS -->
</div>
</div>
</div>
<input type="hidden" id="debt-customer" required>
<input type="text" id="debt-item" placeholder="မှတ်စုထည့်ပါ (ဥပမာ - မုန့် 2ထုပ် + ရေ 2ဗူး)"
class="brutalist-input w-full p-3" required>
<input type="number" id="debt-amount" placeholder="ပမာဏ ထည့်ပါ"
class="brutalist-input w-full p-3" min="0" required style="font-family: Arial, sans-serif;">
<div>
<label class="font-bold text-sm block mb-1">📅 ရက်စွဲ (Optional - ရက်မရွေးရင် ဒီနေ့ရက်စွဲနဲ့
မှတ်မှာဖြစ်ပါတယ်)</label>
<input type="text" id="debt-date" placeholder="ရက်စွဲရွေးပါ..."
class="brutalist-input w-full p-3" style="font-family: Arial, sans-serif;">
</div>
<button type="submit" class="brutalist-btn bg-black text-white w-full py-3">
သိမ်းမယ်
</button>
</form>
</div>
<!-- Recent Debts -->
<div class="brutalist-card bg-white p-4">
<h2 class="text-lg font-black mb-3 border-b-3 border-black pb-2">📋 နောက်ဆုံးကြွေးမှတ်တမ်းများ</h2>
<!-- Debt Search -->
<div class="mb-4">
<input type="text" id="debt-search" placeholder="🔍 ဖောက်သည်နာမည်နဲ့ရှာပါ..."
class="brutalist-input w-full p-3">
</div>
<div id="recent-debts" class="space-y-3 max-h-60 overflow-y-auto hide-scrollbar">
<!-- Populated by JS -->
</div>
</div>
</div>
<!-- Payments View -->
<div id="view-payments" class="view-content hidden">
<!-- Add Payment Form -->
<div class="brutalist-card gradient-teal p-4 mb-6 animate-slideInUp">
<h2 class="text-lg font-black mb-3">💰ငွေရှင်းတာမှတ်မယ်</h2>
<form id="add-payment-form" class="space-y-3">
<div class="custom-dropdown" id="payment-customer-dropdown">
<button type="button" class="custom-dropdown-button brutalist-input w-full p-3 empty"
id="payment-customer-btn">
<span id="payment-customer-text">ဖောက်သည်ရွေးပါ</span>
<span class="dropdown-arrow">▼</span>
</button>
<div class="custom-dropdown-panel" id="payment-customer-panel">
<div class="custom-dropdown-search">
<input type="text" id="payment-customer-search" placeholder="🔍 ရှာရန်..."
class="w-full p-2 border-2 border-black font-bold" autocomplete="off">
</div>
<div class="custom-dropdown-list" id="payment-customer-list">
<!-- Populated by JS -->
</div>
</div>
</div>
<input type="hidden" id="payment-customer" required>
<div class="brutalist-card bg-white p-3" id="customer-debt-info">
<span class="font-bold">ပေးရန်ကျန်ငွေ: </span>
<span class="text-xl font-black text-red-600" id="remaining-debt">0 Ks</span>
</div>
<input type="number" id="payment-amount" placeholder="ပေးမယ့်ပမာဏ"
class="brutalist-input w-full p-3" min="0" required style="font-family: Arial, sans-serif;">
<div>
<label class="font-bold text-sm block mb-1">📅 ရက်စွဲ (Optional - ရက်မရွေးရင် ဒီနေ့ရက်စွဲနဲ့
မှတ်မှာဖြစ်ပါတယ်)</label>
<input type="text" id="payment-date" placeholder="ရက်စွဲရွေးပါ..."
class="brutalist-input w-full p-3" style="font-family: Arial, sans-serif;">
</div>
<button type="submit" class="brutalist-btn bg-black text-white w-full py-3">
သိမ်းမယ်
</button>
</form>
</div>
<!-- Recent Payments -->
<div class="brutalist-card bg-white p-4">
<h2 class="text-lg font-black mb-3 border-b-3 border-black pb-2">💵 နောက်ဆုံး ပြန်ဆပ်ငွေစာရင်း</h2>
<!-- Payment Search -->
<div class="mb-4">
<input type="text" id="payment-search" placeholder="🔍 ဖောက်သည်နာမည်နဲ့ရှာပါ..."
class="brutalist-input w-full p-3">
</div>
<div id="recent-payments" class="space-y-3 max-h-60 overflow-y-auto hide-scrollbar">
<!-- Populated by JS -->
</div>
</div>
</div>
<!-- Settings View -->
<div id="view-settings" class="view-content hidden">
<!-- Backup & Restore Card -->
<div class="brutalist-card gradient-purple p-6 mb-6 animate-slideInUp">
<div class="text-center mb-6">
<div class="text-6xl mb-3">💾</div>
<h2 class="text-2xl font-black mb-2">Backup & Restore</h2>
<p class="font-bold text-sm text-gray-700">ဒေတာများ သိမ်းဆည်းခြင်း နှင့် ပြန်လည်ရယူခြင်း</p>
</div>
<div class="space-y-4">
<!-- Backup Section -->
<div class="brutalist-card bg-white p-4">
<h3 class="font-black text-lg mb-2 flex items-center gap-2">
📥 Backup Data
</h3>
<p class="text-sm font-bold text-gray-600 mb-3">
လက်ရှိ ဒေတာအားလုံးကို JSON ဖိုင်အဖြစ် ဒေါင်းလုဒ်လုပ်ပါ။
</p>
<button onclick="backupData()" class="brutalist-btn bg-blue-500 text-white w-full py-3">
💾 Backup လုပ်မယ်
</button>
</div>
<!-- Restore Section -->
<div class="brutalist-card bg-white p-4">
<h3 class="font-black text-lg mb-2 flex items-center gap-2">
📤 Restore Data
</h3>
<p class="text-sm font-bold text-gray-600 mb-3">
Backup လုပ်ထားသော ဖိုင်မှ ဒေတာများကို ပြန်လည်ရယူပါ။
</p>
<input type="file" id="restore-file" accept=".json" class="hidden">
<button onclick="document.getElementById('restore-file').click()"
class="brutalist-btn bg-green-500 text-white w-full py-3">
📂 Restore လုပ်မယ်
</button>
</div>
<!-- Warning Notice -->
<div class="brutalist-card bg-yellow-100 p-4 border-4 border-yellow-600">
<div class="flex gap-3">
<div class="text-2xl">⚠️</div>
<div>
<p class="font-black text-sm mb-1">သတိပြုရန်</p>
<p class="text-xs font-bold text-gray-700">
Restore လုပ်ရင် လက်ရှိ ဒေတာအားလုံး ပျောက်သွားပြီး backup မှ ဒေတာများနဲ့
အစားထိုးမှာ ဖြစ်ပါတယ်။
</p>
</div>
</div>
</div>
</div>
</div>
<!-- Data Info -->
<div class="brutalist-card bg-white p-4">
<h3 class="font-black text-lg mb-3 border-b-3 border-black pb-2">📊 ဒေတာအချက်အလက်</h3>
<div class="space-y-2">
<div class="flex justify-between p-3 bg-blue-50 border-2 border-black">
<span class="font-bold">👥 ဖောက်သည်ဦးရေ</span>
<span class="font-black" id="settings-customers-count">0</span>
</div>
<div class="flex justify-between p-3 bg-red-50 border-2 border-black">
<span class="font-bold">📝 အကြွေးမှတ်တမ်း</span>
<span class="font-black" id="settings-debts-count">0</span>
</div>
<div class="flex justify-between p-3 bg-green-50 border-2 border-black">
<span class="font-bold">💰 ပြန်ဆပ်ငွေ မှတ်တမ်း</span>
<span class="font-black" id="settings-payments-count">0</span>
</div>
</div>
</div>
<!-- App Version -->
<div class="text-center mt-6 mb-4">
<p class="text-xs font-bold text-gray-400" id="sidebar-version">Checking Version...</p>
</div>
</div>
<!-- Lock View -->
<div id="view-lock" class="view-content hidden">
<!-- Lock Status Card -->
<div class="brutalist-card gradient-blue p-6 mb-6 animate-slideInUp">
<div class="text-center mb-6">
<div class="text-6xl mb-3">🔒</div>
<h2 class="text-2xl font-black mb-2">လုံခြုံရေး စနစ်</h2>
<p class="font-bold text-sm text-gray-700">PIN Lock System</p>
</div>
<!-- Lock Status -->
<div class="brutalist-card bg-white p-4 mb-4 text-center">
<div class="text-sm font-bold mb-2">Lock Status</div>
<div id="lock-status-display" class="lock-status-badge unlocked mx-auto">
🔓 PIN မသတ်မှတ်ရသေးပါ
</div>
</div>
</div>
<!-- PIN Management Card -->
<div class="brutalist-card gradient-yellow p-6 mb-6 animate-slideInUp" style="animation-delay: 0.1s">
<h2 class="text-xl font-black mb-4 border-b-3 border-black pb-2">🔐 PIN Management</h2>
<div class="space-y-3">
<!-- Set PIN Button -->
<button id="btn-set-pin" onclick="showSetPINDialog()"
class="brutalist-btn bg-green-500 text-white w-full py-3 text-sm font-bold">
🔑 PIN သတ်မှတ်ရန်
</button>
<!-- Change PIN Button -->
<button id="btn-change-pin" onclick="showChangePINDialog()"
class="brutalist-btn bg-blue-500 text-white w-full py-3 text-sm font-bold" disabled>
🔄 PIN ပြောင်းရန်
</button>
<!-- Remove PIN Button -->
<button id="btn-remove-pin" onclick="showRemovePINDialog()"
class="brutalist-btn bg-red-500 text-white w-full py-3 text-sm font-bold" disabled>
🗑️ PIN ဖျက်ရန်
</button>
</div>
</div>
<!-- Info Card -->
<div class="brutalist-card bg-white p-4 animate-slideInUp" style="animation-delay: 0.2s">
<h3 class="font-black text-lg mb-3 border-b-3 border-black pb-2">ℹ️ အချက်အလက်</h3>
<div class="space-y-2 text-sm font-bold">
<div class="flex items-start gap-2">
<span>•</span>
<span>App ဖွင့်တိုင်း PIN ရိုက်ရပါမယ်</span>
</div>
<div class="flex items-start gap-2">
<span>•</span>
<span>PIN က 4 လုံး ဖြစ်ပါတယ်</span>
</div>
<div class="flex items-start gap-2">
<span>•</span>
<span>3 ကြိမ် မှားရင် 30 စက္ကန့် စောင့်ရပါမယ်</span>
</div>
</div>
</div>
</div>
</main>
</div>
<!-- Customer Detail Modal -->
<div id="customer-modal" class="hidden modal-overlay z-50 modal-backdrop">
<div class="modal-content max-w-md mx-auto">
<div class="brutalist-card bg-white p-6">
<div class="flex justify-between items-start mb-4">
<div class="flex-1">
<h2 class="text-xl font-black" id="modal-customer-name"></h2>
<p class="font-bold" id="modal-customer-phone"></p>
</div>
<div class="flex gap-2 items-start">
<button onclick="editCustomer()"
class="brutalist-btn bg-blue-400 text-white px-3 py-2 text-xs">✏️ Edit</button>
<button onclick="deleteCustomer()"
class="brutalist-btn bg-red-400 text-white px-3 py-2 text-xs">🗑️ Del</button>
<button onclick="closeModal()"
class="brutalist-btn bg-gray-400 text-white px-3 py-2 text-xs">✕</button>
</div>
</div>
<div class="brutalist-card bg-red-100 p-4 mb-4">
<div class="text-sm font-bold mb-1">စုစုပေါင်းကြွေးကျန်</div>
<div class="text-3xl font-black text-red-600" id="modal-total-debt">0 Ks</div>
</div>
<div class="mb-4">
<h3 class="font-black mb-2 text-lg border-b-3 border-black pb-2">အကြွေးယူမှုစာရင်း</h3>
<div id="modal-debts" class="space-y-2 max-h-32 overflow-y-auto hide-scrollbar"></div>
</div>
<div>
<h3 class="font-black mb-2 text-lg border-b-3 border-black pb-2">ပြန်ဆပ်ငွေမှတ်တမ်း</h3>
<div id="modal-payments" class="space-y-2 max-h-32 overflow-y-auto hide-scrollbar"></div>
</div>
</div>
</div>
</div>
<!-- Edit Customer Modal -->
<div id="edit-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-blue p-6">
<h2 class="text-xl font-black mb-4 text-center">✏️ ဖောက်သည် အချက်အလက်ပြင်ဆင်ရန်</h2>
<form id="edit-customer-form" class="space-y-3">
<input type="hidden" id="edit-customer-id">
<div>
<label class="font-bold text-sm block mb-1">အမည်</label>
<input type="text" id="edit-customer-name" class="brutalist-input w-full p-3" required>
</div>
<div>
<label class="font-bold text-sm block mb-1">ဖုန်းနံပါတ်</label>
<input type="tel" id="edit-customer-phone" class="brutalist-input w-full p-3">
</div>
<div class="flex gap-2 pt-2">
<button type="submit" class="brutalist-btn bg-green-500 text-white w-full py-3">✅
သိမ်းမယ်</button>
<button type="button" onclick="closeEditModal()"
class="brutalist-btn bg-gray-400 text-white w-full py-3">❌ မလုပ်တော့ဘူး</button>
</div>
</form>
</div>
</div>
</div>
<!-- Delete Confirmation Modal -->
<div id="delete-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-red p-6">
<div class="text-center mb-4">
<div class="text-6xl mb-3">⚠️</div>
<h2 class="text-xl font-black mb-2">သတိပေးချက်!</h2>
<p class="font-bold text-sm">ဒီဖောက်သည်ကို ဖျက်ပစ်မှာ သေချာပါသလား?</p>
</div>
<div class="brutalist-card bg-white p-3 mb-4">
<div class="font-black" id="delete-customer-name"></div>
<div class="font-bold text-sm text-gray-600" id="delete-customer-phone"></div>
</div>
<div class="bg-yellow-100 border-3 border-black p-3 mb-4">
<p class="text-xs font-bold text-center">⚠️ ဖောက်သည်ကို ဖျက်လိုက်ရင် သူနဲ့ ပတ်သက်တဲ့ ကြွေးစာရင်းတွေ၊
ငွေရှင်းမှတ်တမ်းတွေ အားလုံး ပျောက်သွားမှာပါ!</p>
</div>
<div class="flex gap-2">
<button onclick="confirmDelete()" class="brutalist-btn bg-red-600 text-white w-full py-3">🗑️
ဖျက်ပစ်မယ်</button>
<button onclick="closeDeleteModal()" class="brutalist-btn bg-gray-400 text-white w-full py-3">❌
မဖျက်တော့ဘူး</button>
</div>
</div>
</div>
</div>
<!-- Edit Debt Modal -->
<div id="edit-debt-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-pink p-6">
<h2 class="text-xl font-black mb-4 text-center">✏️ ကြွေးစာရင်း ပြင်မယ်</h2>
<form id="edit-debt-form" class="space-y-3">
<input type="hidden" id="edit-debt-id">
<div>
<label class="font-bold text-sm block mb-1">ဖောက်သည်</label>
<div class="brutalist-card bg-white p-3" id="edit-debt-customer-name"></div>
</div>
<div>
<label class="font-bold text-sm block mb-1">မှတ်စု</label>
<input type="text" id="edit-debt-item" class="brutalist-input w-full p-3" required>
</div>
<div>
<label class="font-bold text-sm block mb-1">ပမာဏ (Ks)</label>
<input type="number" id="edit-debt-amount" class="brutalist-input w-full p-3" min="0" required
style="font-family: Arial, sans-serif;">
</div>
<div>
<label class="font-bold text-sm block mb-1">📅 ရက်စွဲ</label>
<input type="text" id="edit-debt-date" placeholder="ရက်စွဲရွေးပါ..."
class="brutalist-input w-full p-3" style="font-family: Arial, sans-serif;">
</div>
<div class="flex gap-2 pt-2">
<button type="submit" class="brutalist-btn bg-green-500 text-white w-full py-3">✅
သိမ်းမယ်</button>
<button type="button" onclick="closeEditDebtModal()"
class="brutalist-btn bg-gray-400 text-white w-full py-3">❌ မလုပ်တော့ဘူး</button>
</div>
</form>
</div>
</div>
</div>
<!-- Delete Debt Modal -->
<div id="delete-debt-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-red p-6">
<div class="text-center mb-4">
<div class="text-6xl mb-3">⚠️</div>
<h2 class="text-xl font-black mb-2">သတိပေးချက်</h2>
<p class="font-bold text-sm">ဒီအကြွေးမှတ်တမ်းကို ဖျက်မှာ သေချာလား?</p>
</div>
<div class="brutalist-card bg-white p-3 mb-4" id="delete-debt-summary"></div>
<div class="flex gap-2">
<button onclick="confirmDeleteDebt()" class="brutalist-btn bg-red-600 text-white w-full py-3">🗑️
ဖျက်မယ်</button>
<button onclick="closeDeleteDebtModal()" class="brutalist-btn bg-gray-400 text-white w-full py-3">❌
မဖျက်တော့ဘူး</button>
</div>
</div>
</div>
</div>
<!-- Edit Payment Modal -->
<div id="edit-payment-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-teal p-6">
<h2 class="text-xl font-black mb-4 text-center">✏️ ငွေရှင်းစာရင်း ပြင်မယ်</h2>
<form id="edit-payment-form" class="space-y-3">
<input type="hidden" id="edit-payment-id">
<div>
<label class="font-bold text-sm block mb-1">ဖောက်သည်</label>
<div class="brutalist-card bg-white p-3" id="edit-payment-customer-name"></div>
</div>
<div>
<label class="font-bold text-sm block mb-1">ပမာဏ (Ks)</label>
<input type="number" id="edit-payment-amount" class="brutalist-input w-full p-3" min="0"
required style="font-family: Arial, sans-serif;">
</div>
<div>
<label class="font-bold text-sm block mb-1">📅 ရက်စွဲ</label>
<input type="text" id="edit-payment-date" placeholder="ရက်စွဲရွေးပါ..."
class="brutalist-input w-full p-3" style="font-family: Arial, sans-serif;">
</div>
<div class="flex gap-2 pt-2">
<button type="submit" class="brutalist-btn bg-green-500 text-white w-full py-3">✅
သိမ်းမယ်</button>
<button type="button" onclick="closeEditPaymentModal()"
class="brutalist-btn bg-gray-400 text-white w-full py-3">❌ မလုပ်တော့ဘူး</button>
</div>
</form>
</div>
</div>
</div>
<!-- Delete Payment Modal -->
<div id="delete-payment-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-red p-6">
<div class="text-center mb-4">
<div class="text-6xl mb-3">⚠️</div>
<h2 class="text-xl font-black mb-2">ငွေရှင်းမှတ်တမ်း ဖျက်မလား?</h2>
<p class="font-bold text-sm">ဒီငွေရှင်းမှတ်တမ်းကို ဖျက်မလား သေချာအောင် စဉ်းစားကြည့်ပါ။</p>
</div>
<div class="brutalist-card bg-white p-3 mb-4" id="delete-payment-summary"></div>
<div class="flex gap-2">
<button onclick="confirmDeletePayment()" class="brutalist-btn bg-red-600 text-white w-full py-3">🗑️
ဖျက်မယ်</button>
<button onclick="closeDeletePaymentModal()"
class="brutalist-btn bg-gray-400 text-white w-full py-3">❌ မဖျက်တော့ဘူး</button>
</div>
</div>
</div>
</div>
<!-- Restore Confirmation Modal -->
<div id="restore-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-md mx-auto">
<div class="brutalist-card gradient-blue p-6">
<div class="text-center mb-4">
<div class="text-6xl mb-3">🌐</div>
<h2 class="text-xl font-black mb-2">Backup Data ကို Restore လုပ်မလား?</h2>
</div>
<!-- Backup Info -->
<div class="brutalist-card bg-white p-4 mb-4">
<div class="text-sm font-bold mb-3 border-b-2 border-black pb-2">📋 Backup အချက်အလက်</div>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="font-bold">📅 Backup ရက်စွဲ:</span>
<span class="font-black" id="restore-backup-date">-</span>
</div>
<div class="flex justify-between">
<span class="font-bold">👥 ဖောက်သည်:</span>
<span class="font-black text-blue-600" id="restore-customers-count">0</span>
</div>
<div class="flex justify-between">
<span class="font-bold">📝 ကြွေးမှတ်တမ်း:</span>
<span class="font-black text-red-600" id="restore-debts-count">0</span>
</div>
<div class="flex justify-between">
<span class="font-bold">💰 ငွေရှင်းမှတ်တမ်း:</span>
<span class="font-black text-green-600" id="restore-payments-count">0</span>
</div>
</div>
</div>
<!-- Warning -->
<div class="brutalist-card bg-yellow-100 border-4 border-yellow-600 p-4 mb-4">
<div class="flex gap-3">
<div class="text-2xl">⚠️</div>
<div>
<p class="font-black text-sm mb-1">သတိပြုရန်!</p>
<p class="text-xs font-bold text-gray-700">
လက်ရှိ ဒေတာအားလုံး ပျောက်သွားပြီး backup မှ ဒေတာများနဲ့ အစားထိုးမှာပါ။ ဆက်လုပ်မလား?
</p>
</div>
</div>
</div>
<!-- Buttons -->
<div class="flex gap-2">
<button onclick="confirmRestore()" class="brutalist-btn bg-green-600 text-white w-full py-3">✅
OK</button>
<button onclick="closeRestoreModal()" class="brutalist-btn bg-gray-400 text-white w-full py-3">❌
Cancel</button>
</div>
</div>
</div>
</div>
<!-- Flatpickr JS -->
</div>
<!-- Delete Confirmation Modal -->
<div id="delete-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-red p-6">
<div class="text-center mb-4">
<div class="text-6xl mb-3">⚠️</div>
<h2 class="text-xl font-black mb-2">သတိပေးချက်!</h2>
<p class="font-bold text-sm">ဒီဖောက်သည်ကို ဖျက်ပစ်မှာ သေချာပါသလား?</p>
</div>
<div class="brutalist-card bg-white p-3 mb-4">
<div class="font-black" id="delete-customer-name"></div>
<div class="font-bold text-sm text-gray-600" id="delete-customer-phone"></div>
</div>
<div class="bg-yellow-100 border-3 border-black p-3 mb-4">
<p class="text-xs font-bold text-center">⚠️ ဖောက်သည်ကို ဖျက်လိုက်ရင် သူနဲ့ ပတ်သက်တဲ့ ကြွေးစာရင်းတွေ၊
ငွေရှင်းမှတ်တမ်းတွေ အားလုံး ပျောက်သွားမှာပါ!</p>
</div>
<div class="flex gap-2">
<button onclick="confirmDelete()" class="brutalist-btn bg-red-600 text-white w-full py-3">🗑️
ဖျက်ပစ်မယ်</button>
<button onclick="closeDeleteModal()" class="brutalist-btn bg-gray-400 text-white w-full py-3">❌
မဖျက်တော့ဘူး</button>
</div>
</div>
</div>
</div>
<!-- Edit Debt Modal -->
<div id="edit-debt-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-pink p-6">
<h2 class="text-xl font-black mb-4 text-center">✏️ ကြွေးစာရင်း ပြင်မယ်</h2>
<form id="edit-debt-form" class="space-y-3">
<input type="hidden" id="edit-debt-id">
<div>
<label class="font-bold text-sm block mb-1">ဖောက်သည်</label>
<div class="brutalist-card bg-white p-3" id="edit-debt-customer-name"></div>
</div>
<div>
<label class="font-bold text-sm block mb-1">မှတ်စု</label>
<input type="text" id="edit-debt-item" class="brutalist-input w-full p-3" required>
</div>
<div>
<label class="font-bold text-sm block mb-1">ပမာဏ (Ks)</label>
<input type="number" id="edit-debt-amount" class="brutalist-input w-full p-3" min="0" required
style="font-family: Arial, sans-serif;">
</div>
<div>
<label class="font-bold text-sm block mb-1">📅 ရက်စွဲ</label>
<input type="text" id="edit-debt-date" placeholder="ရက်စွဲရွေးပါ..."
class="brutalist-input w-full p-3" style="font-family: Arial, sans-serif;">
</div>
<div class="flex gap-2 pt-2">
<button type="submit" class="brutalist-btn bg-green-500 text-white w-full py-3">✅
သိမ်းမယ်</button>
<button type="button" onclick="closeEditDebtModal()"
class="brutalist-btn bg-gray-400 text-white w-full py-3">❌ မလုပ်တော့ဘူး</button>
</div>
</form>
</div>
</div>
</div>
<!-- Delete Debt Modal -->
<div id="delete-debt-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-red p-6">
<div class="text-center mb-4">
<div class="text-6xl mb-3">⚠️</div>
<h2 class="text-xl font-black mb-2">သတိပေးချက်</h2>
<p class="font-bold text-sm">ဒီအကြွေးမှတ်တမ်းကို ဖျက်မှာ သေချာလား?</p>
</div>
<div class="brutalist-card bg-white p-3 mb-4" id="delete-debt-summary"></div>
<div class="flex gap-2">
<button onclick="confirmDeleteDebt()" class="brutalist-btn bg-red-600 text-white w-full py-3">🗑️
ဖျက်မယ်</button>
<button onclick="closeDeleteDebtModal()" class="brutalist-btn bg-gray-400 text-white w-full py-3">❌
မဖျက်တော့ဘူး</button>
</div>
</div>
</div>
</div>
<!-- Edit Payment Modal -->
<div id="edit-payment-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-teal p-6">
<h2 class="text-xl font-black mb-4 text-center">✏️ ငွေရှင်းစာရင်း ပြင်မယ်</h2>
<form id="edit-payment-form" class="space-y-3">
<input type="hidden" id="edit-payment-id">
<div>
<label class="font-bold text-sm block mb-1">ဖောက်သည်</label>
<div class="brutalist-card bg-white p-3" id="edit-payment-customer-name"></div>
</div>
<div>
<label class="font-bold text-sm block mb-1">ပမာဏ (Ks)</label>
<input type="number" id="edit-payment-amount" class="brutalist-input w-full p-3" min="0"
required style="font-family: Arial, sans-serif;">
</div>
<div>
<label class="font-bold text-sm block mb-1">📅 ရက်စွဲ</label>
<input type="text" id="edit-payment-date" placeholder="ရက်စွဲရွေးပါ..."
class="brutalist-input w-full p-3" style="font-family: Arial, sans-serif;">
</div>
<div class="flex gap-2 pt-2">
<button type="submit" class="brutalist-btn bg-green-500 text-white w-full py-3">✅
သိမ်းမယ်</button>
<button type="button" onclick="closeEditPaymentModal()"
class="brutalist-btn bg-gray-400 text-white w-full py-3">❌ မလုပ်တော့ဘူး</button>
</div>
</form>
</div>
</div>
</div>
<!-- Delete Payment Modal -->
<div id="delete-payment-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-sm mx-auto">
<div class="brutalist-card gradient-red p-6">
<div class="text-center mb-4">
<div class="text-6xl mb-3">⚠️</div>
<h2 class="text-xl font-black mb-2">ငွေရှင်းမှတ်တမ်း ဖျက်မလား?</h2>
<p class="font-bold text-sm">ဒီငွေရှင်းမှတ်တမ်းကို ဖျက်မလား သေချာအောင် စဉ်းစားကြည့်ပါ။</p>
</div>
<div class="brutalist-card bg-white p-3 mb-4" id="delete-payment-summary"></div>
<div class="flex gap-2">
<button onclick="confirmDeletePayment()" class="brutalist-btn bg-red-600 text-white w-full py-3">🗑️
ဖျက်မယ်</button>
<button onclick="closeDeletePaymentModal()"
class="brutalist-btn bg-gray-400 text-white w-full py-3">❌ မဖျက်တော့ဘူး</button>
</div>
</div>
</div>
</div>
<!-- Restore Confirmation Modal -->
<div id="restore-modal" class="hidden modal-overlay z-[60] modal-backdrop">
<div class="modal-content max-w-md mx-auto">
<div class="brutalist-card gradient-blue p-6">
<div class="text-center mb-4">
<div class="text-6xl mb-3">🌐</div>
<h2 class="text-xl font-black mb-2">Backup Data ကို Restore လုပ်မလား?</h2>
</div>
<!-- Backup Info -->
<div class="brutalist-card bg-white p-4 mb-4">
<div class="text-sm font-bold mb-3 border-b-2 border-black pb-2">📋 Backup အချက်အလက်</div>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="font-bold">📅 Backup ရက်စွဲ:</span>
<span class="font-black" id="restore-backup-date">-</span>
</div>
<div class="flex justify-between">
<span class="font-bold">👥 ဖောက်သည်:</span>
<span class="font-black text-blue-600" id="restore-customers-count">0</span>
</div>
<div class="flex justify-between">
<span class="font-bold">📝 ကြွေးမှတ်တမ်း:</span>
<span class="font-black text-red-600" id="restore-debts-count">0</span>
</div>
<div class="flex justify-between">
<span class="font-bold">💰 ငွေရှင်းမှတ်တမ်း:</span>
<span class="font-black text-green-600" id="restore-payments-count">0</span>
</div>
</div>
</div>
<!-- Warning -->
<div class="brutalist-card bg-yellow-100 border-4 border-yellow-600 p-4 mb-4">
<div class="flex gap-3">
<div class="text-2xl">⚠️</div>
<div>
<p class="font-black text-sm mb-1">သတိပြုရန်!</p>
<p class="text-xs font-bold text-gray-700">
လက်ရှိ ဒေတာအားလုံး ပျောက်သွားပြီး backup မှ ဒေတာများနဲ့ အစားထိုးမှာပါ။ ဆက်လုပ်မလား?
</p>
</div>
</div>
</div>
<!-- Buttons -->
<div class="flex gap-2">
<button onclick="confirmRestore()" class="brutalist-btn bg-green-600 text-white w-full py-3">✅
OK</button>
<button onclick="closeRestoreModal()" class="brutalist-btn bg-gray-400 text-white w-full py-3">❌
Cancel</button>
</div>
</div>
</div>
</div>
<!-- Update Available Modal -->
<div id="update-modal" class="hidden modal-overlay z-[70] modal-backdrop">
<div class="max-w-sm mx-auto w-full">
<div class="brutalist-card bg-white p-6 border-4 border-black shadow-[8px_8px_0px_0px_rgba(0,0,0,1)]">
<div class="text-center mb-6">
<div class="text-6xl mb-4 animate-bounce">🚀</div>
<h2 class="text-2xl font-black mb-2" id="update-modal-title">Update Available</h2>
<p class="font-bold text-lg" id="modal-version-text">New version available.</p>
<!-- Progress Bar Container -->
<div id="update-progress-container" class="hidden update-progress-container">
<div id="update-progress-fill" class="update-progress-fill"></div>
</div>
</div>
<button id="update-btn" onclick="updateApp()"
class="brutalist-btn bg-black text-white w-full py-4 text-lg font-bold hover:bg-gray-800 transition-colors">
Update Now
</button>
</div>
</div>
</div>
<!-- Flatpickr JS -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="scripts/utils.js"></script>
<script src="scripts/storage.js"></script>
<script src="scripts/pin.js"></script>
<script src="scripts/pin-ui.js"></script>
<script src="scripts/customers.js"></script>
<script src="scripts/debts.js"></script>
<script src="scripts/payments.js"></script>
<script src="scripts/dashboard.js"></script>
<script src="scripts/modals.js"></script>
<script src="scripts/dropdown.js"></script>
<script src="scripts/settings.js"></script>
<script src="scripts/app.js"></script>
<!-- PWA Service Worker Registration & Update Logic -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./sw.js').then(registration => {
console.log('Service Worker registered:', registration.scope);
// Check for updates immediately
registration.update();
// Listen for new service worker installation
registration.addEventListener('updatefound', () => {
const newWorker = registration.installing;
newWorker.addEventListener('statechange', () => {
if (newWorker.state === 'installed' && navigator.serviceWorker.controller) {
// New update available
showUpdateModal();
}
});
});
}).catch(error => {