File size: 30,821 Bytes
130fcff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MobileStore Dashboard</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">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        .sidebar {
            transition: all 0.3s;
        }
        .sidebar.collapsed {
            width: 70px;
        }
        .sidebar.collapsed .sidebar-text {
            display: none;
        }
        .sidebar.collapsed .logo-text {
            display: none;
        }
        .content {
            transition: all 0.3s;
            width: calc(100% - 16rem); /* Ajuste para ocupar o espaço restante */
        }
        .sidebar.collapsed + .content {
            width: calc(100% - 70px); /* Ajuste quando o sidebar estiver recolhido */
            margin-left: 70px;
        }
        .notification-dropdown {
            max-height: 400px;
            overflow-y: auto;
        }
        .chart-container {
            height: 300px;
        }
        body {
            overflow-x: hidden; /* Evita barra de rolagem horizontal */
        }
    </style>
</head>
<body class="bg-gray-900 text-gray-200">
    <div class="flex h-screen">
        <!-- Sidebar -->
        <div class="sidebar bg-gray-800 text-white w-64 flex flex-col fixed h-full">
            <div class="p-4 flex items-center space-x-2 border-b border-gray-700">
                <i class="fas fa-mobile-alt text-blue-400 text-2xl"></i>
                <span class="logo-text text-xl font-bold">MobileStore</span>
            </div>
            <div class="p-4 flex justify-between items-center border-b border-gray-700">
                <div class="flex items-center space-x-2">
                    <div class="w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center">
                        <span class="text-lg font-semibold">AD</span>
                    </div>
                    <div>
                        <div class="sidebar-text font-medium">Admin User</div>
                        <div class="sidebar-text text-xs text-gray-400">Admin</div>
                    </div>
                </div>
                <button id="toggleSidebar" class="text-gray-400 hover:text-white">
                    <i class="fas fa-bars"></i>
                </button>
            </div>
            <nav class="flex-1 overflow-y-auto p-4 space-y-2">
                <a href="#" class="flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-blue-400">
                    <i class="fas fa-tachometer-alt"></i>
                    <span class="sidebar-text">Dashboard</span>
                </a>
                <a href="#" class="flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-gray-300">
                    <i class="fas fa-box"></i>
                    <span class="sidebar-text">Produtos</span>
                </a>
                <a href="#" class="flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-gray-300">
                    <i class="fas fa-shopping-cart"></i>
                    <span class="sidebar-text">Vendas</span>
                </a>
                <a href="#" class="flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-gray-300">
                    <i class="fas fa-users"></i>
                    <span class="sidebar-text">Clientes</span>
                </a>
                <a href="#" class="flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-gray-300">
                    <i class="fas fa-chart-line"></i>
                    <span class="sidebar-text">Relatórios</span>
                </a>
                <a href="#" class="flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-gray-300">
                    <i class="fas fa-cog"></i>
                    <span class="sidebar-text">Configurações</span>
                </a>
            </nav>
            <div class="p-4 border-t border-gray-700">
                <a href="#" class="flex items-center space-x-2 p-2 rounded hover:bg-gray-700 text-gray-300">
                    <i class="fas fa-sign-out-alt"></i>
                    <span class="sidebar-text">Sair</span>
                </a>
            </div>
        </div>

        <!-- Main Content -->
        <div class="content flex-1 flex flex-col overflow-hidden ml-64">
            <!-- Top Navbar -->
            <header class="bg-gray-800 border-b border-gray-700 p-4 flex items-center justify-between">
                <div class="flex items-center space-x-4">
                    <h1 class="text-xl font-semibold">Dashboard</h1>
                </div>
                <div class="flex items-center space-x-6">
                    <div class="relative">
                        <button id="themeToggle" class="text-gray-300 hover:text-white">
                            <i class="fas fa-moon"></i>
                        </button>
                    </div>
                    <div class="relative">
                        <button id="notificationButton" class="text-gray-300 hover:text-white relative">
                            <i class="fas fa-bell"></i>
                            <span class="absolute -top-2 -right-2 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">6</span>
                        </button>
                        <div id="notificationDropdown" class="hidden absolute right-0 mt-2 w-80 bg-gray-800 rounded-md shadow-lg z-50 border border-gray-700 notification-dropdown">
                            <div class="p-3 border-b border-gray-700 flex justify-between items-center">
                                <h3 class="font-medium">Notificações</h3>
                                <span class="text-xs text-blue-400">Marcar todas como lidas</span>
                            </div>
                            <div class="divide-y divide-gray-700">
                                <a href="#" class="flex items-start p-3 hover:bg-gray-700">
                                    <div class="bg-blue-500 rounded-full p-2 mr-3">
                                        <i class="fas fa-shopping-cart text-white text-sm"></i>
                                    </div>
                                    <div>
                                        <p class="text-sm font-medium">Nova venda realizada</p>
                                        <p class="text-xs text-gray-400">iPhone 13 vendido por R$ 4.999</p>
                                        <p class="text-xs text-gray-500 mt-1">2 minutos atrás</p>
                                    </div>
                                </a>
                                <a href="#" class="flex items-start p-3 hover:bg-gray-700">
                                    <div class="bg-green-500 rounded-full p-2 mr-3">
                                        <i class="fas fa-box text-white text-sm"></i>
                                    </div>
                                    <div>
                                        <p class="text-sm font-medium">Novo produto cadastrado</p>
                                        <p class="text-xs text-gray-400">Galaxy S23 adicionado ao estoque</p>
                                        <p class="text-xs text-gray-500 mt-1">1 hora atrás</p>
                                    </div>
                                </a>
                                <a href="#" class="flex items-start p-3 hover:bg-gray-700">
                                    <div class="bg-yellow-500 rounded-full p-2 mr-3">
                                        <i class="fas fa-exclamation-triangle text-white text-sm"></i>
                                    </div>
                                    <div>
                                        <p class="text-sm font-medium">Estoque baixo</p>
                                        <p class="text-xs text-gray-400">AirPods Pro com apenas 3 unidades</p>
                                        <p class="text-xs text-gray-500 mt-1">3 horas atrás</p>
                                    </div>
                                </a>
                                <a href="#" class="flex items-start p-3 hover:bg-gray-700">
                                    <div class="bg-purple-500 rounded-full p-2 mr-3">
                                        <i class="fas fa-user-plus text-white text-sm"></i>
                                    </div>
                                    <div>
                                        <p class="text-sm font-medium">Novo cliente cadastrado</p>
                                        <p class="text-xs text-gray-400">João Silva criou uma conta</p>
                                        <p class="text-xs text-gray-500 mt-1">Ontem</p>
                                    </div>
                                </a>
                            </div>
                            <div class="p-3 text-center border-t border-gray-700">
                                <a href="#" class="text-sm text-blue-400">Ver todas as notificações</a>
                            </div>
                        </div>
                    </div>
                    <div class="relative">
                        <button id="userMenuButton" class="flex items-center space-x-2">
                            <div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center">
                                <span class="text-sm font-semibold">AD</span>
                            </div>
                            <span class="text-sm">Admin</span>
                            <i class="fas fa-chevron-down text-xs"></i>
                        </button>
                        <div id="userMenuDropdown" class="hidden absolute right-0 mt-2 w-48 bg-gray-800 rounded-md shadow-lg z-50 border border-gray-700">
                            <div class="py-1">
                                <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Perfil</a>
                                <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Configurações</a>
                                <div class="border-t border-gray-700"></div>
                                <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Login</a>
                                <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Registrar</a>
                                <div class="border-t border-gray-700"></div>
                                <a href="#" class="block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700">Sair</a>
                            </div>
                        </div>
                    </div>
                </div>
            </header>

            <!-- Main Content Area -->
            <main class="flex-1 overflow-y-auto p-6 bg-gray-900">
                <!-- Cards -->
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
                    <div class="bg-gray-800 rounded-lg shadow p-6 border-l-4 border-blue-500">
                        <div class="flex justify-between items-center">
                            <div>
                                <p class="text-gray-400 text-sm">Vendas Hoje</p>
                                <h3 class="text-2xl font-bold text-white">R$ 24,580</h3>
                                <p class="text-green-400 text-sm mt-1">
                                    <i class="fas fa-arrow-up"></i> 12% em relação a ontem
                                </p>
                            </div>
                            <div class="bg-blue-500 p-3 rounded-full">
                                <i class="fas fa-shopping-cart text-white text-xl"></i>
                            </div>
                        </div>
                    </div>
                    <div class="bg-gray-800 rounded-lg shadow p-6 border-l-4 border-green-500">
                        <div class="flex justify-between items-center">
                            <div>
                                <p class="text-gray-400 text-sm">Produtos em Estoque</p>
                                <h3 class="text-2xl font-bold text-white">1,248</h3>
                                <p class="text-red-400 text-sm mt-1">
                                    <i class="fas fa-arrow-down"></i> 5% em relação ao mês passado
                                </p>
                            </div>
                            <div class="bg-green-500 p-3 rounded-full">
                                <i class="fas fa-box text-white text-xl"></i>
                            </div>
                        </div>
                    </div>
                    <div class="bg-gray-800 rounded-lg shadow p-6 border-l-4 border-yellow-500">
                        <div class="flex justify-between items-center">
                            <div>
                                <p class="text-gray-400 text-sm">Clientes Novos</p>
                                <h3 class="text-2xl font-bold text-white">48</h3>
                                <p class="text-green-400 text-sm mt-1">
                                    <i class="fas fa-arrow-up"></i> 20% em relação a semana passada
                                </p>
                            </div>
                            <div class="bg-yellow-500 p-3 rounded-full">
                                <i class="fas fa-users text-white text-xl"></i>
                            </div>
                        </div>
                    </div>
                    <div class="bg-gray-800 rounded-lg shadow p-6 border-l-4 border-purple-500">
                        <div class="flex justify-between items-center">
                            <div>
                                <p class="text-gray-400 text-sm">Lucro Líquido</p>
                                <h3 class="text-2xl font-bold text-white">R$ 8,750</h3>
                                <p class="text-green-400 text-sm mt-1">
                                    <i class="fas fa-arrow-up"></i> 8% em relação ao mês passado
                                </p>
                            </div>
                            <div class="bg-purple-500 p-3 rounded-full">
                                <i class="fas fa-dollar-sign text-white text-xl"></i>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Charts -->
                <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
                    <div class="bg-gray-800 rounded-lg shadow p-6 lg:col-span-2">
                        <div class="flex justify-between items-center mb-4">
                            <h3 class="text-lg font-semibold">Vendas Mensais</h3>
                            <div class="flex space-x-2">
                                <button class="px-3 py-1 text-xs bg-gray-700 rounded hover:bg-gray-600">Mês</button>
                                <button class="px-3 py-1 text-xs bg-gray-700 rounded hover:bg-gray-600">Ano</button>
                            </div>
                        </div>
                        <div class="chart-container">
                            <canvas id="salesChart"></canvas>
                        </div>
                    </div>
                    <div class="bg-gray-800 rounded-lg shadow p-6">
                        <h3 class="text-lg font-semibold mb-4">Dispositivos Mais Vendidos</h3>
                        <div class="chart-container">
                            <canvas id="devicesChart"></canvas>
                        </div>
                    </div>
                </div>

                <!-- Products Table -->
                <div class="bg-gray-800 rounded-lg shadow overflow-hidden">
                    <div class="p-4 border-b border-gray-700 flex justify-between items-center">
                        <h3 class="text-lg font-semibold">Últimos Produtos Adicionados</h3>
                        <button class="px-3 py-1 text-sm bg-blue-600 rounded hover:bg-blue-700">Adicionar Produto</button>
                    </div>
                    <div class="p-4">
                        <table id="productsTable" class="w-full">
                            <thead>
                                <tr class="text-left text-gray-400 border-b border-gray-700">
                                    <th class="pb-2">Produto</th>
                                    <th class="pb-2">Categoria</th>
                                    <th class="pb-2">Estoque</th>
                                    <th class="pb-2">Preço</th>
                                    <th class="pb-2">Status</th>
                                    <th class="pb-2">Ações</th>
                                </tr>
                            </thead>
                            <tbody class="divide-y divide-gray-700">
                                <tr>
                                    <td class="py-3 flex items-center">
                                        <div class="w-10 h-10 bg-gray-700 rounded mr-3 flex items-center justify-center">
                                            <i class="fas fa-mobile-alt text-blue-400"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">iPhone 15 Pro Max</p>
                                            <p class="text-xs text-gray-400">Apple</p>
                                        </div>
                                    </td>
                                    <td>Smartphone</td>
                                    <td>24</td>
                                    <td>R$ 9.999</td>
                                    <td><span class="px-2 py-1 bg-green-900 text-green-400 rounded-full text-xs">Disponível</span></td>
                                    <td>
                                        <button class="text-blue-400 hover:text-blue-300 mr-2"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-400 hover:text-red-300"><i class="fas fa-trash"></i></button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="py-3 flex items-center">
                                        <div class="w-10 h-10 bg-gray-700 rounded mr-3 flex items-center justify-center">
                                            <i class="fas fa-mobile-alt text-blue-400"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Galaxy S23 Ultra</p>
                                            <p class="text-xs text-gray-400">Samsung</p>
                                        </div>
                                    </td>
                                    <td>Smartphone</td>
                                    <td>18</td>
                                    <td>R$ 7.499</td>
                                    <td><span class="px-2 py-1 bg-green-900 text-green-400 rounded-full text-xs">Disponível</span></td>
                                    <td>
                                        <button class="text-blue-400 hover:text-blue-300 mr-2"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-400 hover:text-red-300"><i class="fas fa-trash"></i></button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="py-3 flex items-center">
                                        <div class="w-10 h-10 bg-gray-700 rounded mr-3 flex items-center justify-center">
                                            <i class="fas fa-headphones text-blue-400"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">AirPods Pro 2</p>
                                            <p class="text-xs text-gray-400">Apple</p>
                                        </div>
                                    </td>
                                    <td>Acessório</td>
                                    <td>3</td>
                                    <td>R$ 1.999</td>
                                    <td><span class="px-2 py-1 bg-yellow-900 text-yellow-400 rounded-full text-xs">Estoque Baixo</span></td>
                                    <td>
                                        <button class="text-blue-400 hover:text-blue-300 mr-2"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-400 hover:text-red-300"><i class="fas fa-trash"></i></button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="py-3 flex items-center">
                                        <div class="w-10 h-10 bg-gray-700 rounded mr-3 flex items-center justify-center">
                                            <i class="fas fa-tablet-alt text-blue-400"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">iPad Pro 12.9"</p>
                                            <p class="text-xs text-gray-400">Apple</p>
                                        </div>
                                    </td>
                                    <td>Tablet</td>
                                    <td>7</td>
                                    <td>R$ 8.499</td>
                                    <td><span class="px-2 py-1 bg-green-900 text-green-400 rounded-full text-xs">Disponível</span></td>
                                    <td>
                                        <button class="text-blue-400 hover:text-blue-300 mr-2"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-400 hover:text-red-300"><i class="fas fa-trash"></i></button>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="py-3 flex items-center">
                                        <div class="w-10 h-10 bg-gray-700 rounded mr-3 flex items-center justify-center">
                                            <i class="fas fa-mobile-alt text-blue-400"></i>
                                        </div>
                                        <div>
                                            <p class="font-medium">Xiaomi 13 Pro</p>
                                            <p class="text-xs text-gray-400">Xiaomi</p>
                                        </div>
                                    </td>
                                    <td>Smartphone</td>
                                    <td>12</td>
                                    <td>R$ 5.999</td>
                                    <td><span class="px-2 py-1 bg-green-900 text-green-400 rounded-full text-xs">Disponível</span></td>
                                    <td>
                                        <button class="text-blue-400 hover:text-blue-300 mr-2"><i class="fas fa-edit"></i></button>
                                        <button class="text-red-400 hover:text-red-300"><i class="fas fa-trash"></i></button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <script>
        // Toggle sidebar
        document.getElementById('toggleSidebar').addEventListener('click', function() {
            document.querySelector('.sidebar').classList.toggle('collapsed');
            document.querySelector('.content').classList.toggle('ml-64');
            document.querySelector('.content').classList.toggle('ml-[70px]');
        });

        // Toggle notification dropdown
        document.getElementById('notificationButton').addEventListener('click', function(e) {
            e.stopPropagation();
            document.getElementById('notificationDropdown').classList.toggle('hidden');
            document.getElementById('userMenuDropdown').classList.add('hidden');
        });

        // Toggle user menu dropdown
        document.getElementById('userMenuButton').addEventListener('click', function(e) {
            e.stopPropagation();
            document.getElementById('userMenuDropdown').classList.toggle('hidden');
            document.getElementById('notificationDropdown').classList.add('hidden');
        });

        // Close dropdowns when clicking outside
        document.addEventListener('click', function() {
            document.getElementById('notificationDropdown').classList.add('hidden');
            document.getElementById('userMenuDropdown').classList.add('hidden');
        });

        // Theme toggle (just UI for this example)
        document.getElementById('themeToggle').addEventListener('click', function() {
            const icon = this.querySelector('i');
            if (icon.classList.contains('fa-moon')) {
                icon.classList.remove('fa-moon');
                icon.classList.add('fa-sun');
            } else {
                icon.classList.remove('fa-sun');
                icon.classList.add('fa-moon');
            }
        });

        // Initialize DataTable
        $(document).ready(function() {
            $('#productsTable').DataTable({
                "paging": true,
                "searching": true,
                "ordering": true,
                "info": true,
                "language": {
                    "lengthMenu": "Mostrar _MENU_ registros por página",
                    "zeroRecords": "Nenhum registro encontrado",
                    "info": "Mostrando página _PAGE_ de _PAGES_",
                    "infoEmpty": "Nenhum registro disponível",
                    "infoFiltered": "(filtrado de _MAX_ registros totais)",
                    "search": "Pesquisar:",
                    "paginate": {
                        "first": "Primeiro",
                        "last": "Último",
                        "next": "Próximo",
                        "previous": "Anterior"
                    },
                }
            });
        });

        // Charts
        // Sales Chart
        const salesCtx = document.getElementById('salesChart').getContext('2d');
        const salesChart = new Chart(salesCtx, {
            type: 'line',
            data: {
                labels: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
                datasets: [{
                    label: 'Vendas 2023',
                    data: [12500, 19000, 15000, 18000, 21000, 25000, 22000, 28000, 26000, 30000, 32000, 35000],
                    borderColor: 'rgba(59, 130, 246, 1)',
                    backgroundColor: 'rgba(59, 130, 246, 0.1)',
                    tension: 0.4,
                    fill: true
                }]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false,
                plugins: {
                    legend: {
                        display: false
                    }
                },
                scales: {
                    y: {
                        beginAtZero: true,
                        grid: {
                            color: 'rgba(255, 255, 255, 0.1)'
                        },
                        ticks: {
                            color: 'rgba(255, 255, 255, 0.7)'
                        }
                    },
                    x: {
                        grid: {
                            color: 'rgba(255, 255, 255, 0.1)'
                        },
                        ticks: {
                            color: 'rgba(255, 255, 255, 0.7)'
                        }
                    }
                }
            }
        });

        // Devices Chart
        const devicesCtx = document.getElementById('devicesChart').getContext('2d');
        const devicesChart = new Chart(devicesCtx, {
            type: 'doughnut',
            data: {
                labels: ['iPhone', 'Samsung', 'Xiaomi', 'Outros'],
                datasets: [{
                    data: [45, 30, 15, 10],
                    backgroundColor: [
                        'rgba(59, 130, 246, 0.8)',
                        'rgba(16, 185, 129, 0.8)',
                        'rgba(245, 158, 11, 0.8)',
                        'rgba(139, 92, 246, 0.8)'
                    ],
                    borderColor: [
                        'rgba(59, 130, 246, 1)',
                        'rgba(16, 185, 129, 1)',
                        'rgba(245, 158, 11, 1)',
                        'rgba(139, 92, 246, 1)'
                    ],
                    borderWidth: 1
                }]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false,
                plugins: {
                    legend: {
                        position: 'bottom',
                        labels: {
                            color: 'rgba(255, 255, 255, 0.7)'
                        }
                    }
                }
            }
        });
    </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=gallabs/dashboard-redecell" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>