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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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Relatórios - Mobile Test Pilot</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#21223a',
                        secondary: '#ff580f',
                    }
                }
            }
        }
    </script>
</head>
<body class="bg-primary min-h-screen text-white">
    <custom-sidebar></custom-sidebar>
    
    <main class="ml-64 p-8">
        <div class="max-w-7xl mx-auto">
            <div class="flex items-center justify-between mb-8">
                <div>
                    <h1 class="text-3xl font-bold mb-2">Relatórios</h1>
                    <p class="text-gray-300">Análise detalhada do desempenho dos seus testes</p>
                </div>
                <div class="flex items-center gap-4">
                    <div class="relative">
                        <input type="text" placeholder="Buscar relatório..." class="bg-gray-800 border border-gray-700 rounded-lg px-4 py-2 pl-10 text-white focus:border-secondary focus:ring-2 focus:ring-secondary focus:ring-opacity-50">
                        <i data-feather="search" class="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"></i>
                    </div>
                    <button class="bg-secondary hover:bg-orange-600 text-white px-4 py-2 rounded-lg flex items-center gap-2">
                        <i data-feather="filter" class="w-4 h-4"></i>
                        Filtrar
                    </button>
                    <button class="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 rounded-lg flex items-center gap-2">
                        <i data-feather="download" class="w-4 h-4"></i>
                        Exportar
                    </button>
                </div>
            </div>

            <!-- Estatísticas Gerais -->
            <div class="grid grid-cols-4 gap-6 mb-8">
                <div class="bg-gray-800 p-6 rounded-2xl border border-gray-700">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-400 text-sm">Total de Testes</p>
                            <p class="text-2xl font-bold">245</p>
                        </div>
                        <div class="w-12 h-12 bg-secondary bg-opacity-20 rounded-full flex items-center justify-center">
                            <i data-feather="bar-chart-2" class="text-secondary"></i>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-800 p-6 rounded-2xl border border-gray-700">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-400 text-sm">Taxa de Sucesso</p>
                            <p class="text-2xl font-bold text-green-400">89%</p>
                        </div>
                        <div class="w-12 h-12 bg-green-500 bg-opacity-20 rounded-full flex items-center justify-center">
                            <i data-feather="trending-up" class="text-green-400"></i>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-800 p-6 rounded-2xl border border-gray-700">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-400 text-sm">Tempo Médio</p>
                            <p class="text-2xl font-bold text-blue-400">28min</p>
                        </div>
                        <div class="w-12 h-12 bg-blue-500 bg-opacity-20 rounded-full flex items-center justify-center">
                            <i data-feather="clock" class="text-blue-400"></i>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-800 p-6 rounded-2xl border border-gray-700">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-400 text-sm">Apps Testados</p>
                            <p class="text-2xl font-bold text-purple-400">18</p>
                        </div>
                        <div class="w-12 h-12 bg-purple-500 bg-opacity-20 rounded-full flex items-center justify-center">
                            <i data-feather="smartphone" class="text-purple-400"></i>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Gráficos -->
            <div class="grid grid-cols-2 gap-6 mb-8">
                <!-- Gráfico de Status dos Testes -->
                <div class="bg-primary rounded-2xl border border-gray-700 p-6 shadow-2xl">
                    <h3 class="text-xl font-semibold mb-4">Status dos Testes</h3>
                    <div class="h-64">
                        <canvas id="statusChart"></canvas>
                    </div>
                </div>

                <!-- Gráfico de Performance por Plataforma -->
                <div class="bg-primary rounded-2xl border border-gray-700 p-6 shadow-2xl">
                    <h3 class="text-xl font-semibold mb-4">Performance por Plataforma</h3>
                    <div class="h-64">
                        <canvas id="platformChart"></canvas>
                    </div>
                </div>
            </div>

            <!-- Tendência Temporal -->
            <div class="bg-primary rounded-2xl border border-gray-700 p-6 shadow-2xl mb-8">
                <h3 class="text-xl font-semibold mb-4">Tendência de Testes (Últimos 30 dias)</h3>
                <div class="h-80">
                    <canvas id="trendChart"></canvas>
                </div>
            </div>

            <!-- Relatórios Detalhados -->
            <div class="bg-primary rounded-2xl border border-gray-700 p-6 shadow-2xl">
                <div class="flex items-center justify-between mb-6">
                    <h3 class="text-xl font-semibold">Relatórios Detalhados</h3>
                    <button class="bg-secondary hover:bg-orange-600 text-white px-4 py-2 rounded-lg flex items-center gap-2">
                        <i data-feather="plus" class="w-4 h-4"></i>
                        Novo Relatório
                    </button>
                </div>

                <div class="overflow-x-auto">
                    <table class="w-full">
                        <thead>
                            <tr class="border-b border-gray-700">
                                <th class="text-left py-3 px-4">Aplicativo</th>
                                <th class="text-left py-3 px-4">Plataforma</th>
                                <th class="text-left py-3 px-4">Data</th>
                                <th class="text-left py-3 px-4">Status</th>
                                <th class="text-left py-3 px-4">Métricas</th>
                                <th class="text-left py-3 px-4">Ações</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr class="border-b border-gray-700 hover:bg-gray-800 transition-colors">
                                <td class="py-4 px-4">
                                    <div class="flex items-center gap-3">
                                        <div class="w-10 h-10 bg-secondary bg-opacity-20 rounded-lg flex items-center justify-center">
                                            <i data-feather="smartphone" class="text-secondary"></i>
                                        </div>
                                        <div>
                                            <p class="font-semibold">App Banking</p>
                                            <p class="text-sm text-gray-400">v1.2.3</p>
                                        </div>
                                    </div>
                                </td>
                                <td class="py-4 px-4">
                                    <span class="bg-green-500 text-white px-2 py-1 rounded-full text-xs">Android</span>
                                </td>
                                <td class="py-4 px-4">
                                    <p class="text-sm">15/12/2024</p>
                                    <p class="text-xs text-gray-400">14:30</p>
                                </td>
                                <td class="py-4 px-4">
                                    <span class="text-green-400 flex items-center gap-2">
                                        <i data-feather="check-circle" class="w-4 h-4"></i>
                                        Concluído
                                    </span>
                                </td>
                                <td class="py-4 px-4">
                                    <div class="text-sm">
                                        <p>CPU: 15% | Mem: 128MB</p>
                                        <p class="text-xs text-gray-400">FPS: 60 | Latência: 42ms</p>
                                    </div>
                                </td>
                                <td class="py-4 px-4">
                                    <div class="flex gap-2">
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Visualizar">
                                            <i data-feather="eye" class="w-4 h-4"></i>
                                        </button>
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Download">
                                            <i data-feather="download" class="w-4 h-4"></i>
                                        </button>
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Compartilhar">
                                            <i data-feather="share" class="w-4 h-4"></i>
                                        </button>
                                    </div>
                                </td>
                            </tr>

                            <tr class="border-b border-gray-700 hover:bg-gray-800 transition-colors">
                                <td class="py-4 px-4">
                                    <div class="flex items-center gap-3">
                                        <div class="w-10 h-10 bg-blue-500 bg-opacity-20 rounded-lg flex items-center justify-center">
                                            <i data-feather="shopping-cart" class="text-blue-400"></i>
                                        </div>
                                        <div>
                                            <p class="font-semibold">E-commerce App</p>
                                            <p class="text-sm text-gray-400">v2.0.1</p>
                                        </div>
                                    </div>
                                </td>
                                <td class="py-4 px-4">
                                    <span class="bg-blue-500 text-white px-2 py-1 rounded-full text-xs">iOS</span>
                                </td>
                                <td class="py-4 px-4">
                                    <p class="text-sm">14/12/2024</p>
                                    <p class="text-xs text-gray-400">11:15</p>
                                </td>
                                <td class="py-4 px-4">
                                    <span class="text-green-400 flex items-center gap-2">
                                        <i data-feather="check-circle" class="w-4 h-4"></i>
                                        Concluído
                                    </span>
                                </td>
                                <td class="py-4 px-4">
                                    <div class="text-sm">
                                        <p>CPU: 18% | Mem: 156MB</p>
                                        <p class="text-xs text-gray-400">FPS: 58 | Latência: 38ms</p>
                                    </div>
                                </td>
                                <td class="py-4 px-4">
                                    <div class="flex gap-2">
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Visualizar">
                                            <i data-feather="eye" class="w-4 h-4"></i>
                                        </button>
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Download">
                                            <i data-feather="download" class="w-4 h-4"></i>
                                        </button>
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Compartilhar">
                                            <i data-feather="share" class="w-4 h-4"></i>
                                        </button>
                                    </div>
                                </td>
                            </tr>

                            <tr class="border-b border-gray-700 hover:bg-gray-800 transition-colors">
                                <td class="py-4 px-4">
                                    <div class="flex items-center gap-3">
                                        <div class="w-10 h-10 bg-red-500 bg-opacity-20 rounded-lg flex items-center justify-center">
                                            <i data-feather="map" class="text-red-400"></i>
                                        </div>
                                        <div>
                                            <p class="font-semibold">Navigation App</p>
                                            <p class="text-sm text-gray-400">v3.1.0</p>
                                        </div>
                                    </div>
                                </td>
                                <td class="py-4 px-4">
                                    <span class="bg-red-500 text-white px-2 py-1 rounded-full text-xs">Android</span>
                                </td>
                                <td class="py-4 px-4">
                                    <p class="text-sm">13/12/2024</p>
                                    <p class="text-xs text-gray-400">16:45</p>
                                </td>
                                <td class="py-4 px-4">
                                    <span class="text-red-400 flex items-center gap-2">
                                        <i data-feather="x-circle" class="w-4 h-4"></i>
                                        Falhou
                                    </span>
                                </td>
                                <td class="py-4 px-4">
                                    <div class="text-sm">
                                        <p>CPU: 85% | Mem: 256MB</p>
                                        <p class="text-xs text-gray-400">FPS: 12 | Latência: 120ms</p>
                                    </div>
                                </td>
                                <td class="py-4 px-4">
                                    <div class="flex gap-2">
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Visualizar">
                                            <i data-feather="eye" class="w-4 h-4"></i>
                                        </button>
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Download">
                                            <i data-feather="download" class="w-4 h-4"></i>
                                        </button>
                                        <button class="p-2 hover:bg-gray-700 rounded-lg transition-colors" title="Compartilhar">
                                            <i data-feather="share" class="w-4 h-4"></i>
                                        </button>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>

                <!-- Paginação -->
                <div class="flex items-center justify-between mt-6 pt-6 border-t border-gray-700">
                    <p class="text-sm text-gray-400">Mostrando 3 de 45 relatórios</p>
                    <div class="flex gap-2">
                        <button class="px-3 py-1 border border-gray-700 rounded-lg text-gray-400 hover:bg-gray-800">
                            <i data-feather="chevron-left" class="w-4 h-4"></i>
                        </button>
                        <button class="px-3 py-1 bg-secondary text-white rounded-lg">1</button>
                        <button class="px-3 py-1 border border-gray-700 rounded-lg text-gray-400 hover:bg-gray-800">2</button>
                        <button class="px-3 py-1 border border-gray-700 rounded-lg text-gray-400 hover:bg-gray-800">3</button>
                        <button class="px-3 py-1 border border-gray-700 rounded-lg text-gray-400 hover:bg-gray-800">
                            <i data-feather="chevron-right" class="w-4 h-4"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <script src="components/sidebar.js"></script>
    <script src="script.js"></script>
    <script>
        feather.replace();
        
        // Atualizar sidebar para marcar a página ativa
        document.addEventListener('DOMContentLoaded', function() {
            const sidebar = document.querySelector('custom-sidebar');
            if (sidebar) {
                const navItems = sidebar.shadowRoot.querySelectorAll('.nav-item');
                navItems.forEach(item => {
                    if (item.querySelector('span').textContent === 'Relatórios') {
                        item.classList.add('active');
                    } else {
                        item.classList.remove('active');
                    }
                });
            }

            // Inicializar gráficos
            initializeCharts();
        });

        function initializeCharts() {
            // Gráfico de Status dos Testes
            const statusCtx = document.getElementById('statusChart').getContext('2d');
            new Chart(statusCtx, {
                type: 'doughnut',
                data: {
                    labels: ['Concluídos', 'Falhas', 'Pausados', 'Em Execução'],
                    datasets: [{
                        data: [218, 27, 12, 8],
                        backgroundColor: [
                            '#10B981',
                            '#EF4444',
                            '#F59E0B',
                            '#3B82F6'
                        ],
                        borderWidth: 0
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'bottom',
                            labels: {
                                color: '#E5E7EB',
                                font: {
                                    size: 12
                                }
                            }
                        }
                    }
                }
            });

            // Gráfico de Performance por Plataforma
            const platformCtx = document.getElementById('platformChart').getContext('2d');
            new Chart(platformCtx, {
                type: 'bar',
                data: {
                    labels: ['Android', 'iOS'],
                    datasets: [{
                        label: 'Taxa de Sucesso (%)',
                        data: [92, 86],
                        backgroundColor: '#FF580F',
                        borderRadius: 6
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    scales: {
                        y: {
                            beginAtZero: true,
                            max: 100,
                            grid: {
                                color: '#374151'
                            },
                            ticks: {
                                color: '#9CA3AF'
                            }
                        },
                        x: {
                            grid: {
                                display: false
                            },
                            ticks: {
                                color: '#9CA3AF'
                            }
                        }
                    },
                    plugins: {
                        legend: {
                            display: false
                        }
                    }
                }
            });

            // Gráfico de Tendência Temporal
            const trendCtx = document.getElementById('trendChart').getContext('2d');
            new Chart(trendCtx, {
                type: 'line',
                data: {
                    labels: ['1', '5', '10', '15', '20', '25', '30'],
                    datasets: [
                        {
                            label: 'Testes Concluídos',
                            data: [8, 12, 6, 14, 10, 16, 12],
                            borderColor: '#10B981',
                            backgroundColor: 'rgba(16, 185, 129, 0.1)',
                            tension: 0.4,
                            fill: true
                        },
                        {
                            label: 'Testes com Falha',
                            data: [2, 3, 1, 4, 2, 3, 1],
                            borderColor: '#EF4444',
                            backgroundColor: 'rgba(239, 68, 68, 0.1)',
                            tension: 0.4,
                            fill: true
                        }
                    ]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    scales: {
                        y: {
                            grid: {
                                color: '#374151'
                            },
                            ticks: {
                                color: '#9CA3AF'
                            }
                        },
                        x: {
                            grid: {
                                color: '#374151'
                            },
                            ticks: {
                                color: '#9CA3AF'
                            }
                        }
                    },
                    plugins: {
                        legend: {
                            position: 'bottom',
                            labels: {
                                color: '#E5E7EB'
                            }
                        }
                    }
                }
            });
        }
    </script>
</body>
</html>