File size: 47,298 Bytes
53ec346
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dashboard Financeiro Interativo</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        .sidebar {
            transition: all 0.3s ease;
        }
        .sidebar.collapsed {
            transform: translateX(-100%);
            width: 0;
            padding: 0;
            overflow: hidden;
        }
        .main-content.expanded {
            width: 100%;
        }
        .transaction-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
        .file-upload {
            border: 2px dashed #cbd5e0;
            transition: all 0.3s ease;
        }
        .file-upload:hover {
            border-color: #4f46e5;
            background-color: #f8fafc;
        }
        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                z-index: 50;
                height: 100vh;
                background-color: white;
            }
        }
    </style>
</head>
<body class="bg-gray-50">
    <div class="flex h-screen overflow-hidden">
        <!-- Sidebar -->
        <div id="sidebar" class="sidebar bg-indigo-700 text-white w-64 flex-shrink-0 flex flex-col">
            <div class="p-4 flex items-center justify-between border-b border-indigo-600">
                <h1 class="text-xl font-bold">Finanças Pessoais</h1>
                <button id="toggleSidebar" class="md:hidden text-white">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="flex-1 overflow-y-auto">
                <nav class="p-4">
                    <div class="mb-6">
                        <h2 class="text-sm uppercase font-semibold text-indigo-300 mb-2">Menu</h2>
                        <ul>
                            <li class="mb-2">
                                <button id="dashboardBtn" class="w-full text-left px-3 py-2 rounded-md bg-indigo-800 flex items-center">
                                    <i class="fas fa-chart-pie mr-2"></i> Dashboard
                                </button>
                            </li>
                            <li class="mb-2">
                                <button id="transactionsBtn" class="w-full text-left px-3 py-2 rounded-md hover:bg-indigo-600 flex items-center">
                                    <i class="fas fa-exchange-alt mr-2"></i> Transações
                                </button>
                            </li>
                            <li class="mb-2">
                                <button id="categoriesBtn" class="w-full text-left px-3 py-2 rounded-md hover:bg-indigo-600 flex items-center">
                                    <i class="fas fa-tags mr-2"></i> Categorias
                                </button>
                            </li>
                            <li class="mb-2">
                                <button id="importBtn" class="w-full text-left px-3 py-2 rounded-md hover:bg-indigo-600 flex items-center">
                                    <i class="fas fa-file-import mr-2"></i> Importar Dados
                                </button>
                            </li>
                        </ul>
                    </div>
                    <div>
                        <h2 class="text-sm uppercase font-semibold text-indigo-300 mb-2">Filtros</h2>
                        <div class="mb-4">
                            <label class="block text-sm mb-1">Ano</label>
                            <select id="yearFilter" class="w-full bg-indigo-600 border border-indigo-500 rounded-md px-3 py-2 text-white">
                                <option value="all">Todos</option>
                                <option value="2023">2023</option>
                                <option value="2022">2022</option>
                            </select>
                        </div>
                        <div class="mb-4">
                            <label class="block text-sm mb-1">Mês</label>
                            <select id="monthFilter" class="w-full bg-indigo-600 border border-indigo-500 rounded-md px-3 py-2 text-white">
                                <option value="all">Todos</option>
                                <option value="1">Janeiro</option>
                                <option value="2">Fevereiro</option>
                                <option value="3">Março</option>
                                <option value="4">Abril</option>
                                <option value="5">Maio</option>
                                <option value="6">Junho</option>
                                <option value="7">Julho</option>
                                <option value="8">Agosto</option>
                                <option value="9">Setembro</option>
                                <option value="10">Outubro</option>
                                <option value="11">Novembro</option>
                                <option value="12">Dezembro</option>
                            </select>
                        </div>
                        <div class="mb-4">
                            <label class="block text-sm mb-1">Categoria</label>
                            <select id="categoryFilter" class="w-full bg-indigo-600 border border-indigo-500 rounded-md px-3 py-2 text-white">
                                <option value="all">Todas</option>
                                <option value="Alimentação">Alimentação</option>
                                <option value="Transporte">Transporte</option>
                                <option value="Moradia">Moradia</option>
                                <option value="Lazer">Lazer</option>
                                <option value="Saúde">Saúde</option>
                                <option value="Educação">Educação</option>
                            </select>
                        </div>
                        <div class="mb-4">
                            <label class="block text-sm mb-1">Portador</label>
                            <select id="holderFilter" class="w-full bg-indigo-600 border border-indigo-500 rounded-md px-3 py-2 text-white">
                                <option value="all">Todos</option>
                                <option value="João">João</option>
                                <option value="Maria">Maria</option>
                                <option value="Família">Família</option>
                            </select>
                        </div>
                        <button id="applyFilters" class="w-full bg-indigo-500 hover:bg-indigo-600 text-white py-2 rounded-md">
                            Aplicar Filtros
                        </button>
                    </div>
                </nav>
            </div>
            <div class="p-4 border-t border-indigo-600">
                <div class="flex items-center">
                    <div class="w-8 h-8 rounded-full bg-indigo-500 flex items-center justify-center mr-2">
                        <i class="fas fa-user text-sm"></i>
                    </div>
                    <div>
                        <p class="text-sm font-medium">Usuário</p>
                        <p class="text-xs text-indigo-300">admin@email.com</p>
                    </div>
                </div>
            </div>
        </div>

        <!-- Main Content -->
        <div id="mainContent" class="main-content flex-1 flex flex-col overflow-hidden">
            <!-- Top Navigation -->
            <header class="bg-white shadow-sm">
                <div class="flex items-center justify-between px-4 py-3">
                    <div class="flex items-center">
                        <button id="mobileToggleSidebar" class="mr-4 text-gray-600 md:hidden">
                            <i class="fas fa-bars"></i>
                        </button>
                        <h1 id="pageTitle" class="text-xl font-semibold text-gray-800">Dashboard</h1>
                    </div>
                    <div class="flex items-center space-x-4">
                        <div class="relative">
                            <button class="text-gray-600 hover:text-gray-900">
                                <i class="fas fa-bell"></i>
                            </button>
                            <span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span>
                        </div>
                        <div class="relative">
                            <button class="text-gray-600 hover:text-gray-900">
                                <i class="fas fa-cog"></i>
                            </button>
                        </div>
                    </div>
                </div>
            </header>

            <!-- Page Content -->
            <div class="flex-1 overflow-y-auto p-4 md:p-6">
                <!-- Dashboard View -->
                <div id="dashboardView">
                    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
                        <div class="bg-white rounded-lg shadow p-4">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-sm text-gray-500">Receitas</p>
                                    <p class="text-2xl font-bold text-green-600">R$ 8.500,00</p>
                                </div>
                                <div class="bg-green-100 p-3 rounded-full">
                                    <i class="fas fa-arrow-up text-green-600"></i>
                                </div>
                            </div>
                            <p class="text-xs text-gray-500 mt-2">+5% em relação ao mês passado</p>
                        </div>
                        <div class="bg-white rounded-lg shadow p-4">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-sm text-gray-500">Despesas</p>
                                    <p class="text-2xl font-bold text-red-600">R$ 6.200,00</p>
                                </div>
                                <div class="bg-red-100 p-3 rounded-full">
                                    <i class="fas fa-arrow-down text-red-600"></i>
                                </div>
                            </div>
                            <p class="text-xs text-gray-500 mt-2">+3% em relação ao mês passado</p>
                        </div>
                        <div class="bg-white rounded-lg shadow p-4">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-sm text-gray-500">Saldo</p>
                                    <p class="text-2xl font-bold text-indigo-600">R$ 2.300,00</p>
                                </div>
                                <div class="bg-indigo-100 p-3 rounded-full">
                                    <i class="fas fa-wallet text-indigo-600"></i>
                                </div>
                            </div>
                            <p class="text-xs text-gray-500 mt-2">+2% em relação ao mês passado</p>
                        </div>
                        <div class="bg-white rounded-lg shadow p-4">
                            <div class="flex items-center justify-between">
                                <div>
                                    <p class="text-sm text-gray-500">Economias</p>
                                    <p class="text-2xl font-bold text-blue-600">R$ 15.750,00</p>
                                </div>
                                <div class="bg-blue-100 p-3 rounded-full">
                                    <i class="fas fa-piggy-bank text-blue-600"></i>
                                </div>
                            </div>
                            <p class="text-xs text-gray-500 mt-2">+10% em relação ao mês passado</p>
                        </div>
                    </div>

                    <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
                        <div class="bg-white rounded-lg shadow p-4">
                            <div class="flex items-center justify-between mb-4">
                                <h2 class="text-lg font-semibold">Despesas por Categoria</h2>
                                <select class="text-sm border rounded px-2 py-1">
                                    <option>Últimos 6 meses</option>
                                    <option>Este ano</option>
                                    <option>Ano passado</option>
                                </select>
                            </div>
                            <div class="h-64">
                                <canvas id="categoryChart"></canvas>
                            </div>
                        </div>
                        <div class="bg-white rounded-lg shadow p-4">
                            <div class="flex items-center justify-between mb-4">
                                <h2 class="text-lg font-semibold">Evolução Mensal</h2>
                                <select class="text-sm border rounded px-2 py-1">
                                    <option>2023</option>
                                    <option>2022</option>
                                    <option>2021</option>
                                </select>
                            </div>
                            <div class="h-64">
                                <canvas id="monthlyTrendChart"></canvas>
                            </div>
                        </div>
                    </div>

                    <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
                        <div class="bg-white rounded-lg shadow p-4">
                            <div class="flex items-center justify-between mb-4">
                                <h2 class="text-lg font-semibold">Despesas por Portador</h2>
                                <select class="text-sm border rounded px-2 py-1">
                                    <option>Últimos 3 meses</option>
                                    <option>Este ano</option>
                                </select>
                            </div>
                            <div class="h-64">
                                <canvas id="holderChart"></canvas>
                            </div>
                        </div>
                        <div class="bg-white rounded-lg shadow p-4">
                            <div class="flex items-center justify-between mb-4">
                                <h2 class="text-lg font-semibold">Top Despesas</h2>
                                <select class="text-sm border rounded px-2 py-1">
                                    <option>Este mês</option>
                                    <option>Mês passado</option>
                                </select>
                            </div>
                            <div class="space-y-3">
                                <div class="flex items-center justify-between p-2 hover:bg-gray-50 rounded">
                                    <div class="flex items-center">
                                        <div class="w-8 h-8 bg-red-100 rounded-full flex items-center justify-center mr-3">
                                            <i class="fas fa-shopping-bag text-red-500 text-sm"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Supermercado</p>
                                            <p class="text-xs text-gray-500">10/06/2023</p>
                                        </div>
                                    </div>
                                    <p class="font-semibold text-red-600">R$ 850,00</p>
                                </div>
                                <div class="flex items-center justify-between p-2 hover:bg-gray-50 rounded">
                                    <div class="flex items-center">
                                        <div class="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center mr-3">
                                            <i class="fas fa-car text-blue-500 text-sm"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Combustível</p>
                                            <p class="text-xs text-gray-500">08/06/2023</p>
                                        </div>
                                    </div>
                                    <p class="font-semibold text-red-600">R$ 320,00</p>
                                </div>
                                <div class="flex items-center justify-between p-2 hover:bg-gray-50 rounded">
                                    <div class="flex items-center">
                                        <div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center mr-3">
                                            <i class="fas fa-utensils text-purple-500 text-sm"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Restaurante</p>
                                            <p class="text-xs text-gray-500">05/06/2023</p>
                                        </div>
                                    </div>
                                    <p class="font-semibold text-red-600">R$ 280,00</p>
                                </div>
                                <div class="flex items-center justify-between p-2 hover:bg-gray-50 rounded">
                                    <div class="flex items-center">
                                        <div class="w-8 h-8 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
                                            <i class="fas fa-gamepad text-yellow-500 text-sm"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Lazer</p>
                                            <p class="text-xs text-gray-500">03/06/2023</p>
                                        </div>
                                    </div>
                                    <p class="font-semibold text-red-600">R$ 250,00</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Transactions View -->
                <div id="transactionsView" class="hidden">
                    <div class="bg-white rounded-lg shadow overflow-hidden mb-6">
                        <div class="px-4 py-5 border-b border-gray-200 sm:px-6">
                            <div class="flex flex-col md:flex-row md:items-center md:justify-between">
                                <h3 class="text-lg font-medium leading-6 text-gray-900">Transações Recentes</h3>
                                <div class="mt-2 md:mt-0 flex space-x-2">
                                    <select class="text-sm border rounded px-2 py-1">
                                        <option>Todas as transações</option>
                                        <option>Apenas receitas</option>
                                        <option>Apenas despesas</option>
                                    </select>
                                    <button class="bg-indigo-600 text-white px-3 py-1 rounded-md text-sm hover:bg-indigo-700">
                                        <i class="fas fa-plus mr-1"></i> Adicionar
                                    </button>
                                </div>
                            </div>
                        </div>
                        <div class="divide-y divide-gray-200">
                            <!-- Transaction Item -->
                            <div class="transaction-card p-4 hover:bg-gray-50 transition duration-150 ease-in-out">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center mr-3">
                                            <i class="fas fa-arrow-down text-green-600"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Salário</p>
                                            <p class="text-sm text-gray-500">Empresa XYZ</p>
                                        </div>
                                    </div>
                                    <div class="text-right">
                                        <p class="font-semibold text-green-600">R$ 5.000,00</p>
                                        <p class="text-sm text-gray-500">05/06/2023</p>
                                    </div>
                                </div>
                            </div>
                            <!-- Transaction Item -->
                            <div class="transaction-card p-4 hover:bg-gray-50 transition duration-150 ease-in-out">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mr-3">
                                            <i class="fas fa-shopping-bag text-red-600"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Supermercado</p>
                                            <p class="text-sm text-gray-500">Mercado ABC</p>
                                        </div>
                                    </div>
                                    <div class="text-right">
                                        <p class="font-semibold text-red-600">R$ 850,00</p>
                                        <p class="text-sm text-gray-500">10/06/2023</p>
                                    </div>
                                </div>
                            </div>
                            <!-- Transaction Item -->
                            <div class="transaction-card p-4 hover:bg-gray-50 transition duration-150 ease-in-out">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mr-3">
                                            <i class="fas fa-car text-red-600"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Combustível</p>
                                            <p class="text-sm text-gray-500">Posto Shell</p>
                                        </div>
                                    </div>
                                    <div class="text-right">
                                        <p class="font-semibold text-red-600">R$ 320,00</p>
                                        <p class="text-sm text-gray-500">08/06/2023</p>
                                    </div>
                                </div>
                            </div>
                            <!-- Transaction Item -->
                            <div class="transaction-card p-4 hover:bg-gray-50 transition duration-150 ease-in-out">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mr-3">
                                            <i class="fas fa-utensils text-red-600"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Restaurante</p>
                                            <p class="text-sm text-gray-500">Restaurante XYZ</p>
                                        </div>
                                    </div>
                                    <div class="text-right">
                                        <p class="font-semibold text-red-600">R$ 280,00</p>
                                        <p class="text-sm text-gray-500">05/06/2023</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="px-4 py-3 bg-gray-50 text-right sm:px-6">
                            <button class="text-indigo-600 hover:text-indigo-900 font-medium">
                                Ver todas as transações
                            </button>
                        </div>
                    </div>
                </div>

                <!-- Categories View -->
                <div id="categoriesView" class="hidden">
                    <div class="bg-white rounded-lg shadow overflow-hidden mb-6">
                        <div class="px-4 py-5 border-b border-gray-200 sm:px-6">
                            <div class="flex flex-col md:flex-row md:items-center md:justify-between">
                                <h3 class="text-lg font-medium leading-6 text-gray-900">Categorias</h3>
                                <button class="mt-2 md:mt-0 bg-indigo-600 text-white px-3 py-1 rounded-md text-sm hover:bg-indigo-700">
                                    <i class="fas fa-plus mr-1"></i> Nova Categoria
                                </button>
                            </div>
                        </div>
                        <div class="divide-y divide-gray-200">
                            <!-- Category Item -->
                            <div class="p-4 hover:bg-gray-50">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center mr-3">
                                            <i class="fas fa-shopping-bag text-red-600"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Alimentação</p>
                                            <p class="text-sm text-gray-500">Supermercados, restaurantes, etc.</p>
                                        </div>
                                    </div>
                                    <div class="flex items-center space-x-2">
                                        <span class="px-2 py-1 bg-red-100 text-red-800 text-xs rounded-full">R$ 1.200,00</span>
                                        <button class="text-gray-400 hover:text-gray-600">
                                            <i class="fas fa-ellipsis-v"></i>
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <!-- Category Item -->
                            <div class="p-4 hover:bg-gray-50">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center mr-3">
                                            <i class="fas fa-car text-blue-600"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Transporte</p>
                                            <p class="text-sm text-gray-500">Combustível, táxi, transporte público</p>
                                        </div>
                                    </div>
                                    <div class="flex items-center space-x-2">
                                        <span class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full">R$ 800,00</span>
                                        <button class="text-gray-400 hover:text-gray-600">
                                            <i class="fas fa-ellipsis-v"></i>
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <!-- Category Item -->
                            <div class="p-4 hover:bg-gray-50">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center mr-3">
                                            <i class="fas fa-home text-purple-600"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Moradia</p>
                                            <p class="text-sm text-gray-500">Aluguel, condomínio, contas</p>
                                        </div>
                                    </div>
                                    <div class="flex items-center space-x-2">
                                        <span class="px-2 py-1 bg-purple-100 text-purple-800 text-xs rounded-full">R$ 2.500,00</span>
                                        <button class="text-gray-400 hover:text-gray-600">
                                            <i class="fas fa-ellipsis-v"></i>
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <!-- Category Item -->
                            <div class="p-4 hover:bg-gray-50">
                                <div class="flex items-center justify-between">
                                    <div class="flex items-center">
                                        <div class="w-10 h-10 rounded-full bg-yellow-100 flex items-center justify-center mr-3">
                                            <i class="fas fa-gamepad text-yellow-600"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Lazer</p>
                                            <p class="text-sm text-gray-500">Cinema, viagens, hobbies</p>
                                        </div>
                                    </div>
                                    <div class="flex items-center space-x-2">
                                        <span class="px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded-full">R$ 600,00</span>
                                        <button class="text-gray-400 hover:text-gray-600">
                                            <i class="fas fa-ellipsis-v"></i>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Import View -->
                <div id="importView" class="hidden">
                    <div class="bg-white rounded-lg shadow overflow-hidden">
                        <div class="px-4 py-5 border-b border-gray-200 sm:px-6">
                            <h3 class="text-lg font-medium leading-6 text-gray-900">Importar Dados Financeiros</h3>
                        </div>
                        <div class="px-4 py-5 sm:p-6">
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                <div>
                                    <h4 class="text-md font-medium mb-3">Importar de Arquivos</h4>
                                    <div class="file-upload p-8 rounded-lg text-center cursor-pointer mb-4">
                                        <i class="fas fa-file-import text-4xl text-indigo-500 mb-2"></i>
                                        <p class="font-medium">Arraste e solte arquivos aqui</p>
                                        <p class="text-sm text-gray-500 mt-1">ou clique para selecionar</p>
                                        <input type="file" class="hidden" multiple>
                                    </div>
                                    <div class="text-sm text-gray-500 mb-4">
                                        <p>Formatos suportados: PDF, CSV, XLSX</p>
                                        <p>Tamanho máximo: 10MB por arquivo</p>
                                    </div>
                                    <div class="flex space-x-2">
                                        <button class="bg-indigo-600 text-white px-4 py-2 rounded-md hover:bg-indigo-700">
                                            <i class="fas fa-upload mr-2"></i> Importar
                                        </button>
                                        <button class="border border-gray-300 px-4 py-2 rounded-md hover:bg-gray-50">
                                            Cancelar
                                        </button>
                                    </div>
                                </div>
                                <div>
                                    <h4 class="text-md font-medium mb-3">Importar de Bancos</h4>
                                    <div class="space-y-3">
                                        <button class="w-full flex items-center p-3 border rounded-md hover:bg-gray-50">
                                            <img src="https://logodownload.org/wp-content/uploads/2018/10/itau-logo.png" class="h-6 mr-3" alt="Itaú">
                                            <span>Conectar ao Itaú</span>
                                        </button>
                                        <button class="w-full flex items-center p-3 border rounded-md hover:bg-gray-50">
                                            <img src="https://logodownload.org/wp-content/uploads/2020/09/nubank-logo.png" class="h-6 mr-3" alt="Nubank">
                                            <span>Conectar ao Nubank</span>
                                        </button>
                                        <button class="w-full flex items-center p-3 border rounded-md hover:bg-gray-50">
                                            <img src="https://logodownload.org/wp-content/uploads/2020/09/c6-bank-logo.png" class="h-6 mr-3" alt="C6 Bank">
                                            <span>Conectar ao C6 Bank</span>
                                        </button>
                                    </div>
                                    <div class="mt-4 p-3 bg-blue-50 rounded-md">
                                        <p class="text-sm text-blue-800">
                                            <i class="fas fa-info-circle mr-1"></i> As conexões com bancos utilizam APIs seguras e não armazenamos suas credenciais.
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Sidebar toggle for mobile
        const toggleSidebar = document.getElementById('toggleSidebar');
        const mobileToggleSidebar = document.getElementById('mobileToggleSidebar');
        const sidebar = document.getElementById('sidebar');
        const mainContent = document.getElementById('mainContent');

        mobileToggleSidebar.addEventListener('click', () => {
            sidebar.classList.toggle('collapsed');
            mainContent.classList.toggle('expanded');
        });

        toggleSidebar.addEventListener('click', () => {
            sidebar.classList.toggle('collapsed');
            mainContent.classList.toggle('expanded');
        });

        // Navigation between views
        const dashboardBtn = document.getElementById('dashboardBtn');
        const transactionsBtn = document.getElementById('transactionsBtn');
        const categoriesBtn = document.getElementById('categoriesBtn');
        const importBtn = document.getElementById('importBtn');
        
        const dashboardView = document.getElementById('dashboardView');
        const transactionsView = document.getElementById('transactionsView');
        const categoriesView = document.getElementById('categoriesView');
        const importView = document.getElementById('importView');
        
        const pageTitle = document.getElementById('pageTitle');

        function resetActiveButtons() {
            dashboardBtn.classList.remove('bg-indigo-800');
            dashboardBtn.classList.add('hover:bg-indigo-600');
            transactionsBtn.classList.remove('bg-indigo-800');
            transactionsBtn.classList.add('hover:bg-indigo-600');
            categoriesBtn.classList.remove('bg-indigo-800');
            categoriesBtn.classList.add('hover:bg-indigo-600');
            importBtn.classList.remove('bg-indigo-800');
            importBtn.classList.add('hover:bg-indigo-600');
        }

        function hideAllViews() {
            dashboardView.classList.add('hidden');
            transactionsView.classList.add('hidden');
            categoriesView.classList.add('hidden');
            importView.classList.add('hidden');
        }

        dashboardBtn.addEventListener('click', () => {
            resetActiveButtons();
            dashboardBtn.classList.add('bg-indigo-800');
            dashboardBtn.classList.remove('hover:bg-indigo-600');
            hideAllViews();
            dashboardView.classList.remove('hidden');
            pageTitle.textContent = 'Dashboard';
            
            // On mobile, close sidebar after navigation
            if (window.innerWidth < 768) {
                sidebar.classList.add('collapsed');
                mainContent.classList.add('expanded');
            }
        });

        transactionsBtn.addEventListener('click', () => {
            resetActiveButtons();
            transactionsBtn.classList.add('bg-indigo-800');
            transactionsBtn.classList.remove('hover:bg-indigo-600');
            hideAllViews();
            transactionsView.classList.remove('hidden');
            pageTitle.textContent = 'Transações';
            
            if (window.innerWidth < 768) {
                sidebar.classList.add('collapsed');
                mainContent.classList.add('expanded');
            }
        });

        categoriesBtn.addEventListener('click', () => {
            resetActiveButtons();
            categoriesBtn.classList.add('bg-indigo-800');
            categoriesBtn.classList.remove('hover:bg-indigo-600');
            hideAllViews();
            categoriesView.classList.remove('hidden');
            pageTitle.textContent = 'Categorias';
            
            if (window.innerWidth < 768) {
                sidebar.classList.add('collapsed');
                mainContent.classList.add('expanded');
            }
        });

        importBtn.addEventListener('click', () => {
            resetActiveButtons();
            importBtn.classList.add('bg-indigo-800');
            importBtn.classList.remove('hover:bg-indigo-600');
            hideAllViews();
            importView.classList.remove('hidden');
            pageTitle.textContent = 'Importar Dados';
            
            if (window.innerWidth < 768) {
                sidebar.classList.add('collapsed');
                mainContent.classList.add('expanded');
            }
        });

        // Apply filters
        document.getElementById('applyFilters').addEventListener('click', () => {
            const year = document.getElementById('yearFilter').value;
            const month = document.getElementById('monthFilter').value;
            const category = document.getElementById('categoryFilter').value;
            const holder = document.getElementById('holderFilter').value;
            
            alert(`Filtros aplicados:\nAno: ${year}\nMês: ${month}\nCategoria: ${category}\nPortador: ${holder}`);
            
            // Here you would typically update the charts and data based on filters
            // For this example, we'll just log the filters
            console.log({year, month, category, holder});
        });

        // Initialize charts
        document.addEventListener('DOMContentLoaded', function() {
            // Category Chart
            const categoryCtx = document.getElementById('categoryChart').getContext('2d');
            const categoryChart = new Chart(categoryCtx, {
                type: 'doughnut',
                data: {
                    labels: ['Alimentação', 'Transporte', 'Moradia', 'Lazer', 'Saúde', 'Educação'],
                    datasets: [{
                        data: [1200, 800, 2500, 600, 300, 400],
                        backgroundColor: [
                            '#EF4444',
                            '#3B82F6',
                            '#8B5CF6',
                            '#F59E0B',
                            '#10B981',
                            '#6366F1'
                        ],
                        borderWidth: 0
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'right',
                        }
                    }
                }
            });

            // Monthly Trend Chart
            const monthlyTrendCtx = document.getElementById('monthlyTrendChart').getContext('2d');
            const monthlyTrendChart = new Chart(monthlyTrendCtx, {
                type: 'line',
                data: {
                    labels: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
                    datasets: [
                        {
                            label: 'Receitas',
                            data: [5000, 4800, 5200, 5100, 5300, 5500, 5400, 5600, 5800, 5700, 5900, 6000],
                            borderColor: '#10B981',
                            backgroundColor: 'rgba(16, 185, 129, 0.1)',
                            fill: true,
                            tension: 0.3
                        },
                        {
                            label: 'Despesas',
                            data: [4200, 4000, 4500, 4300, 4600, 4800, 4700, 4900, 5000, 5100, 5200, 5300],
                            borderColor: '#EF4444',
                            backgroundColor: 'rgba(239, 68, 68, 0.1)',
                            fill: true,
                            tension: 0.3
                        }
                    ]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'top',
                        }
                    },
                    scales: {
                        y: {
                            beginAtZero: false
                        }
                    }
                }
            });

            // Holder Chart
            const holderCtx = document.getElementById('holderChart').getContext('2d');
            const holderChart = new Chart(holderCtx, {
                type: 'bar',
                data: {
                    labels: ['João', 'Maria', 'Família'],
                    datasets: [{
                        label: 'Despesas por Portador',
                        data: [3200, 1800, 1200],
                        backgroundColor: [
                            '#3B82F6',
                            '#8B5CF6',
                            '#F59E0B'
                        ],
                        borderWidth: 0
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            display: false
                        }
                    },
                    scales: {
                        y: {
                            beginAtZero: true
                        }
                    }
                }
            });
        });

        // File upload interaction
        const fileUpload = document.querySelector('.file-upload');
        const fileInput = fileUpload.querySelector('input[type="file"]');

        fileUpload.addEventListener('click', () => {
            fileInput.click();
        });

        fileInput.addEventListener('change', () => {
            if (fileInput.files.length > 0) {
                fileUpload.innerHTML = `
                    <i class="fas fa-check-circle text-green-500 text-4xl mb-2"></i>
                    <p class="font-medium">${fileInput.files.length} arquivo(s) selecionado(s)</p>
                    <p class="text-sm text-gray-500 mt-1">Pronto para importar</p>
                `;
            }
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Guto27/dashboardfinancas" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>