File size: 58,295 Bytes
f9eb7c3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SST Document Manager - Cadastro de Terceiros</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">
    <style>
        .gradient-bg {
            background: linear-gradient(135deg, #10b981 0%, #ffffff 50%, #1f2937 100%);
        }
        .document-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        .sidebar {
            transition: all 0.3s ease;
        }
        .chat-bubble {
            animation: fadeIn 0.3s ease-in-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .pulse-alert {
            animation: pulse 2s infinite;
        }
        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
            100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
        }
        .slide-in {
            animation: slideIn 0.3s ease-out;
        }
        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        .input-error {
            border-color: #ef4444;
        }
        .error-message {
            color: #ef4444;
            font-size: 0.75rem;
            margin-top: 0.25rem;
        }
    </style>
</head>
<body class="bg-gray-50 font-sans">
    <!-- Main Container -->
    <div class="flex h-screen overflow-hidden">
        <!-- Sidebar -->
        <div class="sidebar bg-gray-800 text-white w-64 flex-shrink-0 flex flex-col">
            <div class="p-4 flex items-center justify-center border-b border-gray-700">
                <div class="flex items-center">
                    <div class="w-10 h-10 rounded-full bg-green-500 flex items-center justify-center mr-3">
                        <i class="fas fa-shield-alt text-white"></i>
                    </div>
                    <span class="text-xl font-bold">SST Manager</span>
                </div>
            </div>
            <div class="p-4 border-b border-gray-700">
                <div class="flex items-center space-x-3">
                    <div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center">
                        <i class="fas fa-user text-green-800"></i>
                    </div>
                    <div>
                        <p class="font-medium">Admin User</p>
                        <p class="text-xs text-gray-400">[email protected]</p>
                    </div>
                </div>
            </div>
            <nav class="flex-1 overflow-y-auto">
                <div class="p-2">
                    <p class="text-xs uppercase text-gray-400 mb-2 px-2">Menu Principal</p>
                    <a href="#" class="flex items-center space-x-2 px-3 py-2 rounded hover:bg-gray-700 text-gray-300 hover:text-white">
                        <i class="fas fa-tachometer-alt w-5"></i>
                        <span>Dashboard</span>
                    </a>
                    <a href="#" class="flex items-center space-x-2 px-3 py-2 rounded hover:bg-gray-700 text-gray-300 hover:text-white mt-1">
                        <i class="fas fa-file-alt w-5"></i>
                        <span>Documentos SST</span>
                    </a>
                    <a href="#" class="flex items-center space-x-2 px-3 py-2 rounded hover:bg-gray-700 text-gray-300 hover:text-white mt-1">
                        <i class="fas fa-leaf w-5"></i>
                        <span>Ambientais</span>
                    </a>
                    <a href="terceiros.html" class="flex items-center space-x-2 px-3 py-2 rounded bg-gray-700 text-white mt-1">
                        <i class="fas fa-building w-5"></i>
                        <span>Terceiros</span>
                    </a>
                    <a href="#" class="flex items-center space-x-2 px-3 py-2 rounded hover:bg-gray-700 text-gray-300 hover:text-white mt-1">
                        <i class="fas fa-cog w-5"></i>
                        <span>Configurações</span>
                    </a>
                </div>
                <div class="p-2 mt-4">
                    <p class="text-xs uppercase text-gray-400 mb-2 px-2">Ramo de Atividade</p>
                    <div class="px-2">
                        <select class="w-full bg-gray-700 text-white rounded px-3 py-2 text-sm border border-gray-600 focus:outline-none focus:ring-1 focus:ring-green-500">
                            <option>Construção Civil</option>
                            <option>Indústria</option>
                            <option>Comércio</option>
                            <option>Serviços</option>
                            <option>Saúde</option>
                        </select>
                    </div>
                </div>
            </nav>
            <div class="p-4 border-t border-gray-700">
                <button class="w-full bg-gray-700 hover:bg-gray-600 text-white py-2 rounded flex items-center justify-center space-x-2">
                    <i class="fas fa-sign-out-alt"></i>
                    <span>Sair</span>
                </button>
            </div>
        </div>

        <!-- Main Content -->
        <div class="flex-1 flex flex-col overflow-hidden">
            <!-- Top Navigation -->
            <header class="bg-white border-b border-gray-200 flex items-center justify-between px-6 py-3">
                <div class="flex items-center">
                    <button id="sidebarToggle" class="text-gray-500 mr-4 md:hidden">
                        <i class="fas fa-bars"></i>
                    </button>
                    <h1 class="text-xl font-semibold text-gray-800">Cadastro de Terceiros</h1>
                </div>
                <div class="flex items-center space-x-4">
                    <div class="relative">
                        <button class="text-gray-500 hover:text-gray-700">
                            <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-500 hover:text-gray-700">
                            <i class="fas fa-envelope"></i>
                        </button>
                        <span class="absolute top-0 right-0 w-2 h-2 bg-blue-500 rounded-full"></span>
                    </div>
                    <div class="w-8 h-8 rounded-full bg-green-100 flex items-center justify-center">
                        <i class="fas fa-user text-green-800"></i>
                    </div>
                </div>
            </header>

            <!-- Dashboard Content -->
            <main class="flex-1 overflow-y-auto p-6 bg-gray-50">
                <!-- Terceiros Content -->
                <div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
                    <!-- Lista de Terceiros -->
                    <div class="lg:col-span-1 bg-white rounded-lg shadow overflow-hidden">
                        <div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center">
                            <h2 class="text-lg font-semibold text-gray-800">Terceiros Cadastrados</h2>
                            <span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">24</span>
                        </div>
                        <div class="divide-y divide-gray-200 max-h-[calc(100vh-220px)] overflow-y-auto">
                            <!-- Terceiro Item -->
                            <div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group">
                                <div class="flex items-center space-x-3">
                                    <div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center">
                                        <i class="fas fa-building text-blue-600"></i>
                                    </div>
                                    <div>
                                        <p class="font-medium group-hover:text-blue-600">Construtora ABC</p>
                                        <p class="text-xs text-gray-500">CNPJ: 12.345.678/0001-99</p>
                                    </div>
                                </div>
                                <span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">Ativo</span>
                            </div>
                            
                            <!-- Terceiro Item -->
                            <div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group">
                                <div class="flex items-center space-x-3">
                                    <div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center">
                                        <i class="fas fa-tools text-purple-600"></i>
                                    </div>
                                    <div>
                                        <p class="font-medium group-hover:text-blue-600">Manutenção Industrial</p>
                                        <p class="text-xs text-gray-500">CNPJ: 98.765.432/0001-11</p>
                                    </div>
                                </div>
                                <span class="text-xs bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full">Pendente</span>
                            </div>
                            
                            <!-- Terceiro Item -->
                            <div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group">
                                <div class="flex items-center space-x-3">
                                    <div class="w-10 h-10 rounded-full bg-red-100 flex items-center justify-center">
                                        <i class="fas fa-truck text-red-600"></i>
                                    </div>
                                    <div>
                                        <p class="font-medium group-hover:text-blue-600">Transportes XYZ</p>
                                        <p class="text-xs text-gray-500">CNPJ: 45.678.123/0001-44</p>
                                    </div>
                                </div>
                                <span class="text-xs bg-red-100 text-red-800 px-2 py-1 rounded-full">Vencido</span>
                            </div>
                            
                            <!-- Terceiro Item -->
                            <div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group">
                                <div class="flex items-center space-x-3">
                                    <div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center">
                                        <i class="fas fa-bolt text-green-600"></i>
                                    </div>
                                    <div>
                                        <p class="font-medium group-hover:text-blue-600">Energia Solar Ltda</p>
                                        <p class="text-xs text-gray-500">CNPJ: 78.912.345/0001-66</p>
                                    </div>
                                </div>
                                <span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">Ativo</span>
                            </div>
                            
                            <!-- Terceiro Item -->
                            <div class="p-4 hover:bg-gray-50 cursor-pointer transition flex items-center justify-between group">
                                <div class="flex items-center space-x-3">
                                    <div class="w-10 h-10 rounded-full bg-orange-100 flex items-center justify-center">
                                        <i class="fas fa-shield-alt text-orange-600"></i>
                                    </div>
                                    <div>
                                        <p class="font-medium group-hover:text-blue-600">Segurança Total</p>
                                        <p class="text-xs text-gray-500">CNPJ: 34.567.891/0001-22</p>
                                    </div>
                                </div>
                                <span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">Ativo</span>
                            </div>
                            
                            <!-- Botão Adicionar -->
                            <div class="p-4">
                                <button id="addTerceiroBtn" class="w-full bg-green-600 hover:bg-green-700 text-white py-2 rounded flex items-center justify-center space-x-2 transition">
                                    <i class="fas fa-plus"></i>
                                    <span>Adicionar Terceiro</span>
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Formulário de Cadastro -->
                    <div class="lg:col-span-3">
                        <div id="formContainer" class="bg-white rounded-lg shadow overflow-hidden slide-in">
                            <div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center">
                                <h2 class="text-lg font-semibold text-gray-800">Cadastrar Novo Terceiro</h2>
                                <div class="flex items-center space-x-2">
                                    <span class="text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded-full">Obrigatório</span>
                                    <span class="text-xs bg-gray-100 text-gray-800 px-2 py-1 rounded-full">Todos os campos</span>
                                </div>
                            </div>
                            <form id="terceiroForm" class="p-6">
                                <!-- Dados Básicos -->
                                <div class="mb-8">
                                    <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                        <i class="fas fa-info-circle text-blue-500 mr-2"></i>
                                        Dados Básicos
                                    </h3>
                                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                        <div>
                                            <label for="razaoSocial" class="block text-sm font-medium text-gray-700 mb-1">Razão Social *</label>
                                            <input type="text" id="razaoSocial" name="razaoSocial" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required>
                                            <p id="razaoSocialError" class="error-message hidden">Campo obrigatório</p>
                                        </div>
                                        <div>
                                            <label for="nomeFantasia" class="block text-sm font-medium text-gray-700 mb-1">Nome Fantasia</label>
                                            <input type="text" id="nomeFantasia" name="nomeFantasia" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                        <div>
                                            <label for="cnpj" class="block text-sm font-medium text-gray-700 mb-1">CNPJ *</label>
                                            <input type="text" id="cnpj" name="cnpj" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required>
                                            <p id="cnpjError" class="error-message hidden">CNPJ inválido</p>
                                        </div>
                                        <div>
                                            <label for="inscricaoEstadual" class="block text-sm font-medium text-gray-700 mb-1">Inscrição Estadual</label>
                                            <input type="text" id="inscricaoEstadual" name="inscricaoEstadual" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                    </div>
                                </div>
                                
                                <!-- Contato -->
                                <div class="mb-8">
                                    <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                        <i class="fas fa-address-book text-blue-500 mr-2"></i>
                                        Contato
                                    </h3>
                                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                        <div>
                                            <label for="email" class="block text-sm font-medium text-gray-700 mb-1">E-mail *</label>
                                            <input type="email" id="email" name="email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required>
                                            <p id="emailError" class="error-message hidden">E-mail inválido</p>
                                        </div>
                                        <div>
                                            <label for="telefone" class="block text-sm font-medium text-gray-700 mb-1">Telefone *</label>
                                            <input type="tel" id="telefone" name="telefone" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required>
                                            <p id="telefoneError" class="error-message hidden">Telefone inválido</p>
                                        </div>
                                        <div>
                                            <label for="responsavel" class="block text-sm font-medium text-gray-700 mb-1">Responsável</label>
                                            <input type="text" id="responsavel" name="responsavel" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                        <div>
                                            <label for="celularResponsavel" class="block text-sm font-medium text-gray-700 mb-1">Celular do Responsável</label>
                                            <input type="tel" id="celularResponsavel" name="celularResponsavel" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                    </div>
                                </div>
                                
                                <!-- Endereço -->
                                <div class="mb-8">
                                    <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                        <i class="fas fa-map-marker-alt text-blue-500 mr-2"></i>
                                        Endereço
                                    </h3>
                                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                        <div>
                                            <label for="cep" class="block text-sm font-medium text-gray-700 mb-1">CEP</label>
                                            <div class="flex">
                                                <input type="text" id="cep" name="cep" class="flex-1 px-3 py-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                                <button type="button" id="buscarCep" class="bg-blue-500 text-white px-3 py-2 rounded-r-md hover:bg-blue-600 transition">
                                                    <i class="fas fa-search"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div>
                                            <label for="logradouro" class="block text-sm font-medium text-gray-700 mb-1">Logradouro</label>
                                            <input type="text" id="logradouro" name="logradouro" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                        <div>
                                            <label for="numero" class="block text-sm font-medium text-gray-700 mb-1">Número</label>
                                            <input type="text" id="numero" name="numero" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                        <div>
                                            <label for="complemento" class="block text-sm font-medium text-gray-700 mb-1">Complemento</label>
                                            <input type="text" id="complemento" name="complemento" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                        <div>
                                            <label for="bairro" class="block text-sm font-medium text-gray-700 mb-1">Bairro</label>
                                            <input type="text" id="bairro" name="bairro" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                        <div>
                                            <label for="cidade" class="block text-sm font-medium text-gray-700 mb-1">Cidade</label>
                                            <input type="text" id="cidade" name="cidade" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                        <div>
                                            <label for="estado" class="block text-sm font-medium text-gray-700 mb-1">Estado</label>
                                            <select id="estado" name="estado" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                                <option value="">Selecione...</option>
                                                <option value="AC">Acre</option>
                                                <option value="AL">Alagoas</option>
                                                <option value="AP">Amapá</option>
                                                <option value="AM">Amazonas</option>
                                                <option value="BA">Bahia</option>
                                                <option value="CE">Ceará</option>
                                                <option value="DF">Distrito Federal</option>
                                                <option value="ES">Espírito Santo</option>
                                                <option value="GO">Goiás</option>
                                                <option value="MA">Maranhão</option>
                                                <option value="MT">Mato Grosso</option>
                                                <option value="MS">Mato Grosso do Sul</option>
                                                <option value="MG">Minas Gerais</option>
                                                <option value="PA">Pará</option>
                                                <option value="PB">Paraíba</option>
                                                <option value="PR">Paraná</option>
                                                <option value="PE">Pernambuco</option>
                                                <option value="PI">Piauí</option>
                                                <option value="RJ">Rio de Janeiro</option>
                                                <option value="RN">Rio Grande do Norte</option>
                                                <option value="RS">Rio Grande do Sul</option>
                                                <option value="RO">Rondônia</option>
                                                <option value="RR">Roraima</option>
                                                <option value="SC">Santa Catarina</option>
                                                <option value="SP">São Paulo</option>
                                                <option value="SE">Sergipe</option>
                                                <option value="TO">Tocantins</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                
                                <!-- Informações Adicionais -->
                                <div class="mb-8">
                                    <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                        <i class="fas fa-clipboard-list text-blue-500 mr-2"></i>
                                        Informações Adicionais
                                    </h3>
                                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                        <div>
                                            <label for="ramoAtividade" class="block text-sm font-medium text-gray-700 mb-1">Ramo de Atividade *</label>
                                            <select id="ramoAtividade" name="ramoAtividade" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required>
                                                <option value="">Selecione...</option>
                                                <option value="construcao">Construção Civil</option>
                                                <option value="industria">Indústria</option>
                                                <option value="comercio">Comércio</option>
                                                <option value="servicos">Serviços</option>
                                                <option value="transporte">Transporte</option>
                                                <option value="limpeza">Limpeza</option>
                                                <option value="seguranca">Segurança</option>
                                                <option value="alimentacao">Alimentação</option>
                                                <option value="outro">Outro</option>
                                            </select>
                                            <p id="ramoAtividadeError" class="error-message hidden">Campo obrigatório</p>
                                        </div>
                                        <div>
                                            <label for="tipoServico" class="block text-sm font-medium text-gray-700 mb-1">Tipo de Serviço Prestado</label>
                                            <input type="text" id="tipoServico" name="tipoServico" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                        <div class="md:col-span-2">
                                            <label for="observacoes" class="block text-sm font-medium text-gray-700 mb-1">Observações</label>
                                            <textarea id="observacoes" name="observacoes" rows="3" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500"></textarea>
                                        </div>
                                    </div>
                                </div>
                                
                                <!-- Documentos Obrigatórios -->
                                <div class="mb-8">
                                    <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                        <i class="fas fa-file-contract text-blue-500 mr-2"></i>
                                        Documentos Obrigatórios
                                    </h3>
                                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                        <div>
                                            <label class="block text-sm font-medium text-gray-700 mb-2">Documentos</label>
                                            <div class="space-y-2">
                                                <div class="flex items-center">
                                                    <input type="checkbox" id="docCarteiraTrabalho" name="docCarteiraTrabalho" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                                    <label for="docCarteiraTrabalho" class="ml-2 block text-sm text-gray-700">Carteira de Trabalho</label>
                                                </div>
                                                <div class="flex items-center">
                                                    <input type="checkbox" id="docASO" name="docASO" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                                    <label for="docASO" class="ml-2 block text-sm text-gray-700">ASO</label>
                                                </div>
                                                <div class="flex items-center">
                                                    <input type="checkbox" id="docEPI" name="docEPI" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded">
                                                    <label for="docEPI" class="ml-2 block text-sm text-gray-700">EPI</label>
                                                </div>
                                            </div>
                                        </div>
                                        <div>
                                            <label for="validadeDocumentos" class="block text-sm font-medium text-gray-700 mb-1">Validade dos Documentos</label>
                                            <input type="date" id="validadeDocumentos" name="validadeDocumentos" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                    </div>
                                </div>
                                
                                <!-- Status -->
                                <div class="mb-8">
                                    <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                        <i class="fas fa-toggle-on text-blue-500 mr-2"></i>
                                        Status
                                    </h3>
                                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                        <div>
                                            <label for="statusTerceiro" class="block text-sm font-medium text-gray-700 mb-1">Status *</label>
                                            <select id="statusTerceiro" name="statusTerceiro" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500" required>
                                                <option value="ativo" selected>Ativo</option>
                                                <option value="inativo">Inativo</option>
                                                <option value="pendente">Pendente</option>
                                                <option value="bloqueado">Bloqueado</option>
                                            </select>
                                        </div>
                                        <div>
                                            <label for="dataCadastro" class="block text-sm font-medium text-gray-700 mb-1">Data de Cadastro</label>
                                            <input type="date" id="dataCadastro" name="dataCadastro" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500">
                                        </div>
                                    </div>
                                </div>
                                
                                <!-- Botões de Ação -->
                                <div class="flex justify-end space-x-4 pt-6 border-t border-gray-200">
                                    <button type="button" id="cancelarBtn" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition">
                                        Cancelar
                                    </button>
                                    <button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition flex items-center">
                                        <i class="fas fa-save mr-2"></i>
                                        Salvar Terceiro
                                    </button>
                                </div>
                            </form>
                        </div>
                        
                        <!-- Visualização de Terceiro (Oculto por padrão) -->
                        <div id="viewContainer" class="bg-white rounded-lg shadow overflow-hidden hidden">
                            <div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center">
                                <h2 class="text-lg font-semibold text-gray-800">Detalhes do Terceiro</h2>
                                <div class="flex items-center space-x-2">
                                    <span class="text-xs bg-green-100 text-green-800 px-2 py-1 rounded-full">Ativo</span>
                                    <button id="editTerceiroBtn" class="text-blue-600 hover:text-blue-800">
                                        <i class="fas fa-edit"></i>
                                    </button>
                                </div>
                            </div>
                            <div class="p-6">
                                <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                                    <!-- Dados Básicos -->
                                    <div>
                                        <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                            <i class="fas fa-info-circle text-blue-500 mr-2"></i>
                                            Dados Básicos
                                        </h3>
                                        <div class="space-y-3">
                                            <div>
                                                <p class="text-sm text-gray-500">Razão Social</p>
                                                <p class="font-medium">Construtora ABC Ltda</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Nome Fantasia</p>
                                                <p class="font-medium">Construtora ABC</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">CNPJ</p>
                                                <p class="font-medium">12.345.678/0001-99</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Inscrição Estadual</p>
                                                <p class="font-medium">123.456.789.112</p>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <!-- Contato -->
                                    <div>
                                        <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                            <i class="fas fa-address-book text-blue-500 mr-2"></i>
                                            Contato
                                        </h3>
                                        <div class="space-y-3">
                                            <div>
                                                <p class="text-sm text-gray-500">E-mail</p>
                                                <p class="font-medium">[email protected]</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Telefone</p>
                                                <p class="font-medium">(11) 1234-5678</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Responsável</p>
                                                <p class="font-medium">João da Silva</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Celular do Responsável</p>
                                                <p class="font-medium">(11) 98765-4321</p>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <!-- Endereço -->
                                    <div>
                                        <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                            <i class="fas fa-map-marker-alt text-blue-500 mr-2"></i>
                                            Endereço
                                        </h3>
                                        <div class="space-y-3">
                                            <div>
                                                <p class="text-sm text-gray-500">CEP</p>
                                                <p class="font-medium">01234-567</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Logradouro</p>
                                                <p class="font-medium">Rua das Construções, 123</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Complemento</p>
                                                <p class="font-medium">Sala 45</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Bairro</p>
                                                <p class="font-medium">Centro</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Cidade/Estado</p>
                                                <p class="font-medium">São Paulo/SP</p>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <!-- Informações Adicionais -->
                                    <div>
                                        <h3 class="text-md font-semibold text-gray-700 mb-4 flex items-center">
                                            <i class="fas fa-clipboard-list text-blue-500 mr-2"></i>
                                            Informações Adicionais
                                        </h3>
                                        <div class="space-y-3">
                                            <div>
                                                <p class="text-sm text-gray-500">Ramo de Atividade</p>
                                                <p class="font-medium">Construção Civil</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Tipo de Serviço Prestado</p>
                                                <p class="font-medium">Construção de edifícios comerciais</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Observações</p>
                                                <p class="font-medium">Empresa especializada em estruturas metálicas.</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Documentos Obrigatórios</p>
                                                <p class="font-medium">Carteira de Trabalho, ASO, EPI</p>
                                            </div>
                                            <div>
                                                <p class="text-sm text-gray-500">Validade dos Documentos</p>
                                                <p class="font-medium">31/12/2023</p>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                
                                <!-- Botões de Ação -->
                                <div class="flex justify-end space-x-4 pt-6 mt-6 border-t border-gray-200">
                                    <button id="backToListBtn" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition">
                                        Voltar para Lista
                                    </button>
                                    <button class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition flex items-center">
                                        <i class="fas fa-print mr-2"></i>
                                        Imprimir Ficha
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <!-- Modal de Confirmação -->
    <div id="confirmModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-xl w-full max-w-md">
            <div class="px-6 py-4 border-b border-gray-200">
                <h3 class="text-lg font-semibold text-gray-800">Confirmar Exclusão</h3>
            </div>
            <div class="p-6">
                <p class="text-gray-700 mb-6">Tem certeza que deseja excluir este terceiro? Esta ação não pode ser desfeita.</p>
                <div class="flex justify-end space-x-3">
                    <button id="cancelDeleteBtn" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50">
                        Cancelar
                    </button>
                    <button id="confirmDeleteBtn" class="px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg">
                        Confirmar Exclusão
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-- Modal de Sucesso -->
    <div id="successModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg shadow-xl w-full max-w-md">
            <div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center">
                <h3 class="text-lg font-semibold text-gray-800">Sucesso!</h3>
                <button id="closeSuccessModal" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div class="p-6 text-center">
                <div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
                    <i class="fas fa-check text-green-600 text-2xl"></i>
                </div>
                <p class="text-gray-700 mb-6" id="successMessage">Terceiro cadastrado com sucesso!</p>
                <button id="okSuccessBtn" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg">
                    OK
                </button>
            </div>
        </div>
    </div>

    <script>
        // Toggle sidebar on mobile
        document.getElementById('sidebarToggle').addEventListener('click', function() {
            document.querySelector('.sidebar').classList.toggle('hidden');
            document.querySelector('.sidebar').classList.toggle('block');
        });

        // Máscaras para os campos
        document.addEventListener('DOMContentLoaded', function() {
            // Máscara para CNPJ
            const cnpjInput = document.getElementById('cnpj');
            cnpjInput.addEventListener('input', function(e) {
                let value = e.target.value.replace(/\D/g, '');
                
                if (value.length > 2) {
                    value = value.substring(0, 2) + '.' + value.substring(2);
                }
                if (value.length > 6) {
                    value = value.substring(0, 6) + '.' + value.substring(6);
                }
                if (value.length > 10) {
                    value = value.substring(0, 10) + '/' + value.substring(10);
                }
                if (value.length > 15) {
                    value = value.substring(0, 15) + '-' + value.substring(15);
                }
                if (value.length > 18) {
                    value = value.substring(0, 18);
                }
                
                e.target.value = value;
            });

            // Máscara para Telefone
            const telefoneInput = document.getElementById('telefone');
            telefoneInput.addEventListener('input', function(e) {
                let value = e.target.value.replace(/\D/g, '');
                
                if (value.length > 0) {
                    value = '(' + value.substring(0, 2) + ') ' + value.substring(2);
                }
                if (value.length > 10) {
                    value = value.substring(0, 10) + '-' + value.substring(10, 14);
                }
                if (value.length > 15) {
                    value = value.substring(0, 15);
                }
                
                e.target.value = value;
            });

            // Máscara para Celular
            const celularInput = document.getElementById('celularResponsavel');
            celularInput.addEventListener('input', function(e) {
                let value = e.target.value.replace(/\D/g, '');
                
                if (value.length > 0) {
                    value = '(' + value.substring(0, 2) + ') ' + value.substring(2);
                }
                if (value.length > 10) {
                    value = value.substring(0, 10) + '-' + value.substring(10, 15);
                }
                if (value.length > 16) {
                    value = value.substring(0, 16);
                }
                
                e.target.value = value;
            });

            // Máscara para CEP
            const cepInput = document.getElementById('cep');
            cepInput.addEventListener('input', function(e) {
                let value = e.target.value.replace(/\D/g, '');
                
                if (value.length > 5) {
                    value = value.substring(0, 5) + '-' + value.substring(5, 8);
                }
                if (value.length > 9) {
                    value = value.substring(0, 9);
                }
                
                e.target.value = value;
            });
        });

        // Buscar CEP
        document.getElementById('buscarCep').addEventListener('click', function() {
            const cep = document.getElementById('cep').value.replace(/\D/g, '');
            
            if (cep.length !== 8) {
                alert('CEP inválido! Digite um CEP com 8 dígitos.');
                return;
            }
            
            // Simulação de busca de CEP (em uma aplicação real, seria uma chamada API)
            setTimeout(() => {
                document.getElementById('logradouro').value = 'Rua das Construções';
                document.getElementById('bairro').value = 'Centro';
                document.getElementById('cidade').value = 'São Paulo';
                document.getElementById('estado').value = 'SP';
            }, 1000);
        });

        // Validação do formulário
        document.getElementById('terceiroForm').addEventListener('submit', function(e) {
            e.preventDefault();
            
            let isValid = true;
            
            // Validação Razão Social
            const razaoSocial = document.getElementById('razaoSocial');
            const razaoSocialError = document.getElementById('razaoSocialError');
            if (!razaoSocial.value.trim()) {
                razaoSocial.classList.add('input-error');
                razaoSocialError.classList.remove('hidden');
                isValid = false;
            } else {
                razaoSocial.classList.remove('input-error');
                razaoSocialError.classList.add('hidden');
            }
            
            // Validação CNPJ
            const cnpj = document.getElementById('cnpj');
            const cnpjError = document.getElementById('cnpjError');
            if (!cnpj.value.trim() || cnpj.value.replace(/\D/g, '').length !== 14) {
                cnpj.classList.add('input-error');
                cnpjError.classList.remove('hidden');
                isValid = false;
            } else {
                cnpj.classList.remove('input-error');
                cnpjError.classList.add('hidden');
            }
            
            // Validação Email
            const email = document.getElementById('email');
            const emailError = document.getElementById('emailError');
            const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            if (!email.value.trim() || !emailRegex.test(email.value)) {
                email.classList.add('input-error');
                emailError.classList.remove('hidden');
                isValid = false;
            } else {
                email.classList.remove('input-error');
                emailError.classList.add('hidden');
            }
            
            // Validação Telefone
            const telefone = document.getElementById('telefone');
            const telefoneError = document.getElementById('telefoneError');
            if (!telefone.value.trim() || telefone.value.replace(/\D/g, '').length < 10) {
                telefone.classList.add('input-error');
                telefoneError.classList.remove('hidden');
                isValid = false;
            } else {
                telefone.classList.remove('input-error');
                telefoneError.classList.add('hidden');
            }
            
            // Validação Ramo de Atividade
            const ramoAtividade = document.getElementById('ramoAtividade');
            const ramoAtividadeError = document.getElementById('ramoAtividadeError');
            if (!ramoAtividade.value) {
                ramoAtividade.classList.add('input-error');
                ramoAtividadeError.classList.remove('hidden');
                isValid = false;
            } else {
                ramoAtividade.classList.remove('input-error');
                ramoAtividadeError.classList.add('hidden');
            }
            
            if (isValid) {
                // Simular envio do formulário
                setTimeout(() => {
                    document.getElementById('successMessage').textContent = 'Terceiro cadastrado com sucesso!';
                    document.getElementById('successModal').classList.remove('hidden');
                }, 1000);
            }
        });

        // Navegação entre formulário e visualização
        document.getElementById('addTerceiroBtn').addEventListener('click', function() {
            document.getElementById('formContainer').classList.remove('hidden');
            document.getElementById('viewContainer').classList.add('hidden');
            document.getElementById('terceiroForm').reset();
        });

        document.getElementById('cancelarBtn').addEventListener('click', function() {
            document.getElementById('formContainer').classList.add('hidden');
            document.getElementById('viewContainer').classList.remove('hidden');
        });

        document.getElementById('editTerceiroBtn').addEventListener('click', function() {
            document.getElementById('formContainer').classList.remove('hidden');
            document.getElementById('viewContainer').classList.add('hidden');
        });

        document.getElementById('backToListBtn').addEventListener('click', function() {
            document.getElementById('formContainer').classList.add('hidden');
            document.getElementById('viewContainer').classList.add('hidden');
        });

        // Modal de confirmação
        document.getElementById('confirmDeleteBtn').addEventListener('click', function() {
            document.getElementById('confirmModal').classList.add('hidden');
            document.getElementById('successMessage').textContent = 'Terceiro excluído com sucesso!';
            document.getElementById('successModal').classList.remove('hidden');
        });

        document.getElementById('cancelDeleteBtn').addEventListener('click', function() {
            document.getElementById('confirmModal').classList.add('hidden');
        });

        // Modal de sucesso
        document.getElementById('okSuccessBtn').addEventListener('click', function() {
            document.getElementById('successModal').classList.add('hidden');
            document.getElementById('formContainer').classList.add('hidden');
            document.getElementById('viewContainer').classList.remove('hidden');
        });

        document.getElementById('closeSuccessModal').addEventListener('click', function() {
            document.getElementById('successModal').classList.add('hidden');
            document.getElementById('formContainer').classList.add('hidden');
            document.getElementById('viewContainer').classList.remove('hidden');
        });

        // Selecionar terceiro da lista
        document.querySelectorAll('.group').forEach(item => {
            item.addEventListener('click', function() {
                if (!this.querySelector('button')) { // Não disparar quando clicar no botão de adicionar
                    document.getElementById('formContainer').classList.add('hidden');
                    document.getElementById('viewContainer').classList.remove('hidden');
                }
            });
        });
    </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=Prstore38/prstore38-sst-menager" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>