forked from Buen016/Vigged
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
3055 lines (2755 loc) · 173 KB
/
Copy pathadmin.php
File metadata and controls
3055 lines (2755 loc) · 173 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// Configurar título da página
$title = 'Painel Administrativo';
// Estilos customizados para admin (sidebar, modais, etc)
$additionalStyles = [
'<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">',
'<style>
.sidebar-link:hover {
background-color: rgba(124, 58, 237, 0.1);
}
.sidebar-link.active {
background-color: rgba(124, 58, 237, 0.2);
border-left: 4px solid #7c3aed;
}
.stat-card {
transition: transform 0.2s;
}
.stat-card:hover {
transform: translateY(-4px);
}
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
}
.modal.active {
display: flex;
align-items: center;
justify-content: center;
}
</style>'
];
// Verificar autenticação
require_once 'config/auth.php';
startSecureSession();
requireAdmin();
// Incluir head
include 'includes/head.php';
?>
<!-- Header -->
<header class="bg-gradient-to-r from-purple-600 to-purple-700 text-white shadow-lg">
<div class="container mx-auto px-6 py-4">
<div class="flex items-center justify-between">
<div class="flex items-center space-x-8">
<h1 class="text-2xl font-bold">Vigged Admin</h1>
</div>
<div class="flex items-center space-x-4">
<span class="text-sm">Administrador</span>
<a href="logout.php" class="bg-white text-purple-600 px-4 py-2 rounded-lg hover:bg-gray-100 transition text-sm font-medium">
Sair
</a>
</div>
</div>
</div>
</header>
<div class="flex">
<!-- Sidebar -->
<aside class="w-64 bg-white h-screen shadow-lg sticky top-0">
<nav class="p-4">
<ul class="space-y-2">
<li>
<a href="#dashboard" class="sidebar-link active flex items-center space-x-3 p-3 rounded-lg text-gray-700">
<i class="fas fa-chart-line w-5"></i>
<span>Dashboard</span>
</a>
</li>
<li>
<a href="#usuarios" class="sidebar-link flex items-center space-x-3 p-3 rounded-lg text-gray-700">
<i class="fas fa-users w-5"></i>
<span>Usuários PCD</span>
</a>
</li>
<li>
<a href="#empresas" class="sidebar-link flex items-center space-x-3 p-3 rounded-lg text-gray-700">
<i class="fas fa-building w-5"></i>
<span>Empresas</span>
</a>
</li>
<li>
<a href="#vagas" class="sidebar-link flex items-center space-x-3 p-3 rounded-lg text-gray-700">
<i class="fas fa-briefcase w-5"></i>
<span>Vagas</span>
</a>
</li>
<li>
<a href="#planos" class="sidebar-link flex items-center space-x-3 p-3 rounded-lg text-gray-700">
<i class="fas fa-crown w-5"></i>
<span>Planos Pendentes</span>
<span id="planosBadge" class="ml-auto bg-red-500 text-white text-xs rounded-full px-2 py-1 hidden">0</span>
</a>
</li>
<li>
<a href="#gerenciar-planos" class="sidebar-link flex items-center space-x-3 p-3 rounded-lg text-gray-700">
<i class="fas fa-credit-card w-5"></i>
<span>Gerenciar Planos</span>
</a>
</li>
<li>
<a href="#relatorios" class="sidebar-link flex items-center space-x-3 p-3 rounded-lg text-gray-700">
<i class="fas fa-file-alt w-5"></i>
<span>Relatórios</span>
</a>
</li>
<li>
<a href="#configuracoes" class="sidebar-link flex items-center space-x-3 p-3 rounded-lg text-gray-700">
<i class="fas fa-cog w-5"></i>
<span>Configurações</span>
</a>
</li>
</ul>
</nav>
</aside>
<!-- Main Content -->
<main class="flex-1 p-8">
<!-- Dashboard Section -->
<section id="dashboard-section">
<div class="flex items-center justify-between mb-6">
<h2 class="text-3xl font-bold text-gray-800">Dashboard</h2>
<div class="flex items-center space-x-2">
<button onclick="refreshDashboard()" class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 transition text-sm">
<i class="fas fa-sync-alt mr-2"></i>Atualizar
</button>
</div>
</div>
<!-- Statistics Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div class="stat-card bg-gradient-to-br from-purple-500 to-purple-600 text-white p-6 rounded-xl shadow-lg">
<div class="flex items-center justify-between">
<div>
<p class="text-purple-100 text-sm mb-1">Total de Usuários PCD</p>
<p id="total-users" class="text-4xl font-bold">0</p>
<p id="users-growth" class="text-purple-100 text-xs mt-2">
<i class="fas fa-chart-line"></i> <span>Carregando...</span>
</p>
</div>
<div class="bg-white bg-opacity-20 p-4 rounded-full">
<i class="fas fa-users text-2xl"></i>
</div>
</div>
</div>
<div class="stat-card bg-gradient-to-br from-blue-500 to-blue-600 text-white p-6 rounded-xl shadow-lg">
<div class="flex items-center justify-between">
<div>
<p class="text-blue-100 text-sm mb-1">Empresas Cadastradas</p>
<p id="total-companies" class="text-4xl font-bold">0</p>
<p id="companies-growth" class="text-blue-100 text-xs mt-2">
<i class="fas fa-chart-line"></i> <span>Carregando...</span>
</p>
</div>
<div class="bg-white bg-opacity-20 p-4 rounded-full">
<i class="fas fa-building text-2xl"></i>
</div>
</div>
</div>
<div class="stat-card bg-gradient-to-br from-green-500 to-green-600 text-white p-6 rounded-xl shadow-lg">
<div class="flex items-center justify-between">
<div>
<p class="text-green-100 text-sm mb-1">Vagas Ativas</p>
<p id="total-jobs" class="text-4xl font-bold">0</p>
<p class="text-green-100 text-xs mt-2">
<span id="jobs-status"></span>
</p>
</div>
<div class="bg-white bg-opacity-20 p-4 rounded-full">
<i class="fas fa-briefcase text-2xl"></i>
</div>
</div>
</div>
<div class="stat-card bg-gradient-to-br from-orange-500 to-orange-600 text-white p-6 rounded-xl shadow-lg">
<div class="flex items-center justify-between">
<div>
<p class="text-orange-100 text-sm mb-1">Total de Candidaturas</p>
<p id="total-applications" class="text-4xl font-bold">0</p>
<p id="applications-growth" class="text-orange-100 text-xs mt-2">
<i class="fas fa-chart-line"></i> <span>Carregando...</span>
</p>
</div>
<div class="bg-white bg-opacity-20 p-4 rounded-full">
<i class="fas fa-file-alt text-2xl"></i>
</div>
</div>
</div>
</div>
<!-- Secondary Stats -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white p-6 rounded-xl shadow-md border-l-4 border-purple-500">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm mb-1">Taxa de Conversão</p>
<p id="conversion-rate" class="text-2xl font-bold text-purple-600">0%</p>
<p class="text-gray-500 text-xs mt-1">Candidaturas por vaga</p>
</div>
<i class="fas fa-percentage text-purple-500 text-3xl"></i>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md border-l-4 border-green-500">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm mb-1">Taxa de Aprovação</p>
<p id="approval-rate" class="text-2xl font-bold text-green-600">0%</p>
<p class="text-gray-500 text-xs mt-1">Candidaturas aprovadas</p>
</div>
<i class="fas fa-check-circle text-green-500 text-3xl"></i>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md border-l-4 border-blue-500">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm mb-1">Candidaturas Aprovadas</p>
<p id="approved-applications" class="text-2xl font-bold text-blue-600">0</p>
<p class="text-gray-500 text-xs mt-1">Total de aprovações</p>
</div>
<i class="fas fa-thumbs-up text-blue-500 text-3xl"></i>
</div>
</div>
</div>
<!-- Charts and Activity -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
<!-- Growth Chart -->
<div class="bg-white p-6 rounded-xl shadow-md">
<h3 class="text-xl font-bold text-gray-800 mb-4">Crescimento Mensal</h3>
<div id="growth-chart" class="h-64 flex items-end justify-between space-x-2">
<div class="flex items-center justify-center">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"></div>
</div>
</div>
</div>
<!-- Status Distribution -->
<div class="bg-white p-6 rounded-xl shadow-md">
<h3 class="text-xl font-bold text-gray-800 mb-4">Distribuição por Status</h3>
<div id="status-distribution" class="space-y-4">
<div class="flex items-center justify-center">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"></div>
</div>
</div>
</div>
</div>
<!-- Recent Activity -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
<div class="bg-white p-6 rounded-xl shadow-md">
<div class="flex items-center justify-between mb-4">
<h3 class="text-xl font-bold text-gray-800">Cadastros Recentes</h3>
<a href="#usuarios" onclick="document.querySelector('a[href=\"#usuarios\"]').click()" class="text-purple-600 text-sm hover:underline">Ver todos</a>
</div>
<div id="recent-registrations" class="space-y-3">
<div class="flex items-center justify-center py-8">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"></div>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md">
<div class="flex items-center justify-between mb-4">
<h3 class="text-xl font-bold text-gray-800">Vagas Mais Populares</h3>
<a href="#vagas" onclick="document.querySelector('a[href=\"#vagas\"]').click()" class="text-purple-600 text-sm hover:underline">Ver todas</a>
</div>
<div id="popular-jobs" class="space-y-3">
<div class="flex items-center justify-center py-8">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"></div>
</div>
</div>
</div>
</div>
</section>
<!-- Users Section -->
<section id="usuarios-section" class="hidden">
<div class="flex items-center justify-between mb-6">
<h2 class="text-3xl font-bold text-gray-800">Usuários PCD</h2>
<button onclick="openUserModal()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-plus mr-2"></i>Adicionar Usuário
</button>
</div>
<!-- Search and Filter -->
<div class="bg-white p-4 rounded-xl shadow-md mb-6">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<input type="text" id="user-search" placeholder="Buscar por nome..." class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<select id="user-disability-filter" class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="">Tipo de Deficiência</option>
<option value="Deficiência Física">Deficiência Física</option>
<option value="Deficiência Visual">Deficiência Visual</option>
<option value="Deficiência Auditiva">Deficiência Auditiva</option>
<option value="Deficiência Intelectual">Deficiência Intelectual</option>
</select>
<select id="user-status-filter" class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="">Status</option>
<option value="Ativo">Ativo</option>
<option value="Inativo">Inativo</option>
<option value="Pendente">Pendente</option>
</select>
<button onclick="filterUsers()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-search mr-2"></i>Buscar
</button>
</div>
</div>
<!-- Users Table -->
<div class="bg-white rounded-xl shadow-md overflow-hidden">
<table class="w-full">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nome</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tipo de Deficiência</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data de Cadastro</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th>
</tr>
</thead>
<tbody id="users-table-body" class="bg-white divide-y divide-gray-200">
<!-- Will be populated by JavaScript -->
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="flex items-center justify-between mt-6">
<p class="text-sm text-gray-700">
Mostrando <span id="users-showing-start">0</span> a <span id="users-showing-end">0</span> de <span id="users-total">0</span> resultados
</p>
<div id="users-pagination" class="flex space-x-2">
<!-- Will be populated by JavaScript -->
</div>
</div>
</section>
<!-- Configurações Section -->
<section id="configuracoes-section" class="hidden">
<h2 class="text-3xl font-bold text-gray-800 mb-6">Configurações do Sistema</h2>
<!-- Tabs -->
<div class="mb-6 border-b border-gray-200">
<nav class="flex space-x-8">
<button onclick="showConfigTab('geral')" id="tab-geral" class="config-tab active py-4 px-1 border-b-2 border-purple-600 font-medium text-purple-600">
Geral
</button>
<button onclick="showConfigTab('email')" id="tab-email" class="config-tab py-4 px-1 border-b-2 border-transparent font-medium text-gray-500 hover:text-gray-700">
Email
</button>
<button onclick="showConfigTab('upload')" id="tab-upload" class="config-tab py-4 px-1 border-b-2 border-transparent font-medium text-gray-500 hover:text-gray-700">
Upload
</button>
<button onclick="showConfigTab('seguranca')" id="tab-seguranca" class="config-tab py-4 px-1 border-b-2 border-transparent font-medium text-gray-500 hover:text-gray-700">
Segurança
</button>
<button onclick="showConfigTab('sistema')" id="tab-sistema" class="config-tab py-4 px-1 border-b-2 border-transparent font-medium text-gray-500 hover:text-gray-700">
Informações do Sistema
</button>
</nav>
</div>
<!-- Tab: Geral -->
<div id="config-geral" class="config-tab-content">
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<h3 class="text-xl font-bold text-gray-800 mb-4">Configurações Gerais</h3>
<form id="config-geral-form" class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Nome do Site</label>
<input type="text" id="site_name" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Descrição do Site</label>
<textarea id="site_description" rows="3" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500"></textarea>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">URL Base</label>
<input type="url" id="base_url" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<p class="text-sm text-gray-500 mt-1">Exemplo: http://localhost/vigged ou https://seu-dominio.com</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Fuso Horário</label>
<select id="timezone" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="America/Sao_Paulo">America/Sao_Paulo (Brasil)</option>
<option value="America/Manaus">America/Manaus</option>
<option value="America/Rio_Branco">America/Rio_Branco</option>
<option value="UTC">UTC</option>
</select>
</div>
<button type="submit" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
Salvar Configurações Gerais
</button>
</form>
</div>
</div>
<!-- Tab: Email -->
<div id="config-email" class="config-tab-content hidden">
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<h3 class="text-xl font-bold text-gray-800 mb-4">Configurações de Email (SMTP)</h3>
<form id="config-email-form" class="space-y-4">
<div class="grid md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Servidor SMTP</label>
<input type="text" id="smtp_host" placeholder="smtp.gmail.com" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Porta SMTP</label>
<input type="number" id="smtp_port" value="587" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
</div>
<div class="grid md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Usuário SMTP</label>
<input type="text" id="smtp_user" placeholder="seu-email@gmail.com" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Senha SMTP</label>
<input type="password" id="smtp_pass" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
</div>
<div class="grid md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Email Remetente</label>
<input type="email" id="from_email" placeholder="noreply@vigged.com.br" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Nome do Remetente</label>
<input type="text" id="from_name" value="Vigged" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
</div>
<div class="bg-yellow-50 border border-yellow-200 rounded-lg p-4">
<p class="text-yellow-800 text-sm">
<strong>⚠️ Importante:</strong> Para Gmail, use uma senha de aplicativo em vez da senha da conta.
</p>
</div>
<button type="submit" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
Salvar Configurações de Email
</button>
</form>
</div>
</div>
<!-- Tab: Upload -->
<div id="config-upload" class="config-tab-content hidden">
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<h3 class="text-xl font-bold text-gray-800 mb-4">Configurações de Upload</h3>
<form id="config-upload-form" class="space-y-4">
<div class="grid md:grid-cols-3 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tamanho Máximo de Arquivo (MB)</label>
<input type="number" id="max_file_size" min="1" max="100" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<p class="text-xs text-gray-500 mt-1">Padrão: 5MB</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tamanho Máximo de Laudo (MB)</label>
<input type="number" id="max_laudo_size" min="1" max="100" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<p class="text-xs text-gray-500 mt-1">Padrão: 5MB</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tamanho Máximo de Documento (MB)</label>
<input type="number" id="max_documento_size" min="1" max="100" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<p class="text-xs text-gray-500 mt-1">Padrão: 10MB</p>
</div>
</div>
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
<p class="text-blue-800 text-sm">
<strong>ℹ️ Informação:</strong> Os limites do PHP são: upload_max_filesize = <?php echo ini_get('upload_max_filesize'); ?>, post_max_size = <?php echo ini_get('post_max_size'); ?>
</p>
</div>
<button type="submit" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
Salvar Configurações de Upload
</button>
</form>
</div>
</div>
<!-- Tab: Segurança -->
<div id="config-seguranca" class="config-tab-content hidden">
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<h3 class="text-xl font-bold text-gray-800 mb-4">Configurações de Segurança</h3>
<form id="config-seguranca-form" class="space-y-4">
<div class="grid md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tamanho Mínimo de Senha</label>
<input type="number" id="password_min_length" min="6" max="32" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<p class="text-xs text-gray-500 mt-1">Padrão: 8 caracteres</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tentativas Máximas de Login</label>
<input type="number" id="login_max_attempts" min="3" max="10" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<p class="text-xs text-gray-500 mt-1">Padrão: 5 tentativas</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tempo de Bloqueio (minutos)</label>
<input type="number" id="login_lockout_time" min="5" max="60" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<p class="text-xs text-gray-500 mt-1">Padrão: 15 minutos</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tempo de Sessão (horas)</label>
<input type="number" id="session_lifetime" min="1" max="168" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<p class="text-xs text-gray-500 mt-1">Padrão: 24 horas</p>
</div>
</div>
<button type="submit" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
Salvar Configurações de Segurança
</button>
</form>
</div>
</div>
<!-- Tab: Sistema -->
<div id="config-sistema" class="config-tab-content hidden">
<div class="bg-white rounded-xl shadow-md p-6 mb-6">
<h3 class="text-xl font-bold text-gray-800 mb-4">Informações do Sistema</h3>
<div id="system-info" class="space-y-4">
<div class="flex items-center justify-center">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"></div>
</div>
</div>
<div class="mt-6 flex space-x-4">
<button onclick="loadSystemInfo()" class="bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition">
<i class="fas fa-sync-alt mr-2"></i>Atualizar Informações
</button>
<button onclick="clearCache()" class="bg-orange-600 text-white px-6 py-2 rounded-lg hover:bg-orange-700 transition">
<i class="fas fa-broom mr-2"></i>Limpar Cache e Logs
</button>
</div>
</div>
</div>
</section>
<!-- Vagas Section -->
<section id="vagas-section" class="hidden">
<div class="flex items-center justify-between mb-6">
<h2 class="text-3xl font-bold text-gray-800">Gerenciar Vagas</h2>
<button onclick="loadVagas()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-sync-alt mr-2"></i>Atualizar
</button>
</div>
<!-- Search and Filter -->
<div class="bg-white p-4 rounded-xl shadow-md mb-6">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<input type="text" id="job-search" placeholder="Buscar por título ou empresa..." class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<select id="job-status-filter" class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="todas">Todas</option>
<option value="ativa">Ativas</option>
<option value="pausada">Pausadas</option>
<option value="encerrada">Encerradas</option>
</select>
<button onclick="filterJobs()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-search mr-2"></i>Buscar
</button>
<button onclick="exportJobs()" class="bg-green-600 text-white px-6 py-2 rounded-lg hover:bg-green-700 transition">
<i class="fas fa-download mr-2"></i>Exportar
</button>
</div>
</div>
<!-- Jobs Table -->
<div class="bg-white rounded-xl shadow-md overflow-hidden">
<table class="w-full">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Vaga</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Empresa</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Localização</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Candidaturas</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Visualizações</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th>
</tr>
</thead>
<tbody id="jobs-table-body" class="bg-white divide-y divide-gray-200">
<tr>
<td colspan="8" class="px-6 py-8 text-center text-gray-500">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600 mx-auto"></div>
<p class="mt-4">Carregando vagas...</p>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="flex items-center justify-between mt-6">
<p class="text-sm text-gray-700">
Mostrando <span id="jobs-showing-start">0</span> a <span id="jobs-showing-end">0</span> de <span id="jobs-total">0</span> resultados
</p>
<div id="jobs-pagination" class="flex space-x-2">
<!-- Will be populated by JavaScript -->
</div>
</div>
</section>
<!-- Relatórios Section -->
<section id="relatorios-section" class="hidden">
<div class="flex items-center justify-between mb-6">
<h2 class="text-3xl font-bold text-gray-800">Relatórios e Analytics</h2>
<div class="flex space-x-3">
<button onclick="exportRelatorio('pdf')" class="bg-red-600 text-white px-6 py-2 rounded-lg hover:bg-red-700 transition">
<i class="fas fa-file-pdf mr-2"></i>Exportar PDF
</button>
<button onclick="exportRelatorio('excel')" class="bg-green-600 text-white px-6 py-2 rounded-lg hover:bg-green-700 transition">
<i class="fas fa-file-excel mr-2"></i>Exportar Excel
</button>
</div>
</div>
<!-- Filtros de Período -->
<div class="bg-white p-4 rounded-xl shadow-md mb-6">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Data Inicial</label>
<input type="date" id="relatorio-data-inicio" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Data Final</label>
<input type="date" id="relatorio-data-fim" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tipo de Relatório</label>
<select id="relatorio-tipo" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="geral">Geral</option>
<option value="vagas">Vagas</option>
<option value="candidaturas">Candidaturas</option>
<option value="empresas">Empresas</option>
<option value="usuarios">Usuários</option>
</select>
</div>
<div class="flex items-end">
<button onclick="gerarRelatorio()" class="w-full bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-chart-bar mr-2"></i>Gerar Relatório
</button>
</div>
</div>
</div>
<!-- Cards de Resumo -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
<div class="bg-white p-6 rounded-xl shadow-md border-l-4 border-blue-500">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm mb-1">Total de Vagas</p>
<p id="relatorio-total-vagas" class="text-3xl font-bold text-blue-600">0</p>
</div>
<i class="fas fa-briefcase text-blue-500 text-3xl"></i>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md border-l-4 border-green-500">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm mb-1">Candidaturas</p>
<p id="relatorio-total-candidaturas" class="text-3xl font-bold text-green-600">0</p>
</div>
<i class="fas fa-file-alt text-green-500 text-3xl"></i>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md border-l-4 border-purple-500">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm mb-1">Taxa de Conversão</p>
<p id="relatorio-taxa-conversao" class="text-3xl font-bold text-purple-600">0%</p>
</div>
<i class="fas fa-percentage text-purple-500 text-3xl"></i>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md border-l-4 border-orange-500">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm mb-1">Taxa de Aprovação</p>
<p id="relatorio-taxa-aprovacao" class="text-3xl font-bold text-orange-600">0%</p>
</div>
<i class="fas fa-check-circle text-orange-500 text-3xl"></i>
</div>
</div>
</div>
<!-- Gráficos -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<div class="bg-white p-6 rounded-xl shadow-md">
<h3 class="text-xl font-bold text-gray-800 mb-4">Vagas por Status</h3>
<div id="grafico-vagas-status" class="h-64">
<div class="flex items-center justify-center h-full">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"></div>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md">
<h3 class="text-xl font-bold text-gray-800 mb-4">Candidaturas por Status</h3>
<div id="grafico-candidaturas-status" class="h-64">
<div class="flex items-center justify-center h-full">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"></div>
</div>
</div>
</div>
</div>
<!-- Relatório de Planos -->
<div class="bg-white rounded-xl shadow-md overflow-hidden mb-6">
<div class="p-6 border-b border-gray-200">
<h3 class="text-xl font-bold text-gray-800">Relatório de Planos</h3>
</div>
<div id="relatorio-planos" class="p-6">
<div class="flex items-center justify-center py-8">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"></div>
</div>
</div>
</div>
<!-- Tabela Detalhada -->
<div class="bg-white rounded-xl shadow-md overflow-hidden">
<div class="p-6 border-b border-gray-200">
<h3 class="text-xl font-bold text-gray-800">Detalhamento</h3>
</div>
<div id="relatorio-detalhes" class="p-6">
<p class="text-gray-500 text-center py-8">Selecione um período e tipo de relatório para visualizar os detalhes.</p>
</div>
</div>
</section>
<!-- Gerenciar Planos Section -->
<section id="gerenciar-planos-section" class="hidden">
<div class="flex items-center justify-between mb-6">
<h2 class="text-3xl font-bold text-gray-800">Gerenciar Planos das Empresas</h2>
<button onclick="loadEmpresasPlanos()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-sync-alt mr-2"></i>Atualizar
</button>
</div>
<!-- Search and Filter -->
<div class="bg-white p-4 rounded-xl shadow-md mb-6">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<input type="text" id="empresa-plano-search" placeholder="Buscar por nome ou CNPJ..." class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<select id="empresa-plano-filter" class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="todas">Todos os Planos</option>
<option value="com_plano">Com Plano Pago</option>
<option value="gratuito">Gratuito</option>
<option value="essencial">Essencial</option>
<option value="profissional">Profissional</option>
<option value="enterprise">Enterprise</option>
</select>
<select id="empresa-plano-status-filter" class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="todas">Todos os Status</option>
<option value="ativo">Ativo</option>
<option value="pendente">Pendente</option>
<option value="cancelado">Cancelado</option>
</select>
<button onclick="filterEmpresasPlanos()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-search mr-2"></i>Buscar
</button>
</div>
</div>
<!-- Companies with Plans Table -->
<div class="bg-white rounded-xl shadow-md overflow-hidden">
<table class="w-full">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Empresa</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">CNPJ</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Plano Atual</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Vagas</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Candidaturas</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th>
</tr>
</thead>
<tbody id="empresas-planos-table-body" class="bg-white divide-y divide-gray-200">
<tr>
<td colspan="7" class="px-6 py-8 text-center text-gray-500">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600 mx-auto"></div>
<p class="mt-4">Carregando empresas...</p>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="flex items-center justify-between mt-6">
<p class="text-sm text-gray-700">
Mostrando <span id="empresas-planos-showing-start">0</span> a <span id="empresas-planos-showing-end">0</span> de <span id="empresas-planos-total">0</span> resultados
</p>
<div id="empresas-planos-pagination" class="flex space-x-2">
<!-- Will be populated by JavaScript -->
</div>
</div>
</section>
<!-- Planos Pendentes Section -->
<section id="planos-section" class="hidden">
<div class="flex items-center justify-between mb-6">
<h2 class="text-3xl font-bold text-gray-800">Solicitações de Planos Pendentes</h2>
<button onclick="loadPlanosPendentes()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-sync-alt mr-2"></i>Atualizar
</button>
</div>
<div id="planosPendentesList" class="space-y-4">
<div class="bg-white rounded-xl shadow-md p-6 text-center">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600 mx-auto"></div>
<p class="mt-4 text-gray-600">Carregando solicitações...</p>
</div>
</div>
</section>
<!-- Companies Section -->
<section id="empresas-section" class="hidden">
<div class="flex items-center justify-between mb-6">
<h2 class="text-3xl font-bold text-gray-800">Empresas Cadastradas</h2>
<button onclick="openCompanyModal()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-plus mr-2"></i>Adicionar Empresa
</button>
</div>
<!-- Search and Filter -->
<div class="bg-white p-4 rounded-xl shadow-md mb-6">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<input type="text" id="company-search" placeholder="Buscar por nome..." class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<select id="company-sector-filter" class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="">Setor</option>
<option value="Tecnologia">Tecnologia</option>
<option value="Saúde">Saúde</option>
<option value="Educação">Educação</option>
<option value="Varejo">Varejo</option>
<option value="Consultoria">Consultoria</option>
<option value="Marketing">Marketing</option>
</select>
<select id="company-status-filter" class="border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="">Status</option>
<option value="Ativa">Ativa</option>
<option value="Inativa">Inativa</option>
<option value="Pendente">Pendente</option>
</select>
<button onclick="filterCompanies()" class="bg-purple-600 text-white px-6 py-2 rounded-lg hover:bg-purple-700 transition">
<i class="fas fa-search mr-2"></i>Buscar
</button>
</div>
</div>
<!-- Companies Table -->
<div class="bg-white rounded-xl shadow-md overflow-hidden">
<table class="w-full">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Empresa</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">CNPJ</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Setor</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Vagas Ativas</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Data de Cadastro</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Ações</th>
</tr>
</thead>
<tbody id="companies-table-body" class="bg-white divide-y divide-gray-200">
<!-- Will be populated by JavaScript -->
</tbody>
</table>
</div>
<!-- Pagination -->
<div class="flex items-center justify-between mt-6">
<p class="text-sm text-gray-700">
Mostrando <span id="companies-showing-start">0</span> a <span id="companies-showing-end">0</span> de <span id="companies-total">0</span> resultados
</p>
<div id="companies-pagination" class="flex space-x-2">
<!-- Will be populated by JavaScript -->
</div>
</div>
</section>
</main>
</div>
<!-- User Modal -->
<div id="user-modal" class="modal">
<div class="bg-white rounded-xl shadow-2xl p-8 max-w-2xl w-full mx-4 max-h-[90vh] overflow-y-auto">
<div class="flex items-center justify-between mb-6">
<h3 class="text-2xl font-bold text-gray-800" id="user-modal-title">Adicionar Usuário</h3>
<button onclick="closeUserModal()" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times text-2xl"></i>
</button>
</div>
<form id="user-form" onsubmit="saveUser(event)">
<input type="hidden" id="user-id">
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Nome Completo *</label>
<input type="text" id="user-name" required class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Email *</label>
<input type="email" id="user-email" required class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">CPF *</label>
<input type="text" id="user-cpf" required class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="000.000.000-00">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Telefone</label>
<input type="tel" id="user-phone" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Tipo de Deficiência *</label>
<select id="user-disability" required class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="">Selecione...</option>
<option value="Deficiência Física">Deficiência Física</option>
<option value="Deficiência Visual">Deficiência Visual</option>
<option value="Deficiência Auditiva">Deficiência Auditiva</option>
<option value="Deficiência Intelectual">Deficiência Intelectual</option>
<option value="Deficiência Múltipla">Deficiência Múltipla</option>
</select>
</div>
<div id="user-password-field">
<label class="block text-sm font-medium text-gray-700 mb-2">Senha *</label>
<input type="password" id="user-password" class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" minlength="6">
<p class="text-xs text-gray-500 mt-1">Mínimo 6 caracteres</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Status *</label>
<select id="user-status" required class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="ativo">Ativo</option>
<option value="inativo">Inativo</option>
<option value="pendente">Pendente</option>
</select>
</div>
</div>
<div class="flex space-x-4 mt-6">
<button type="button" onclick="closeUserModal()" class="flex-1 bg-gray-200 text-gray-700 px-6 py-3 rounded-lg hover:bg-gray-300 transition">
Cancelar
</button>
<button type="submit" class="flex-1 bg-purple-600 text-white px-6 py-3 rounded-lg hover:bg-purple-700 transition">
Salvar
</button>
</div>
</form>
</div>
</div>
<!-- Edit Plano Modal -->
<div id="edit-plano-modal" class="modal">
<div class="bg-white rounded-xl shadow-2xl p-8 max-w-2xl w-full mx-4 max-h-[90vh] overflow-y-auto">
<div class="flex items-center justify-between mb-6">
<h3 class="text-2xl font-bold text-gray-800">Editar Plano da Empresa</h3>
<button onclick="closeEditPlanoModal()" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times text-2xl"></i>
</button>
</div>
<form id="edit-plano-form" onsubmit="savePlano(event)">
<input type="hidden" id="edit-plano-company-id">
<div class="space-y-4">
<div class="bg-gray-50 p-4 rounded-lg">
<p class="text-sm text-gray-600 mb-1">Empresa:</p>
<p id="edit-plano-empresa-nome" class="font-semibold text-gray-900"></p>
<p id="edit-plano-empresa-cnpj" class="text-sm text-gray-500 mt-1"></p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Plano *</label>
<select id="edit-plano-plano" required class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="gratuito">Gratuito</option>
<option value="essencial">Essencial - R$199/mês</option>
<option value="profissional">Profissional - R$399/mês</option>
<option value="enterprise">Enterprise - R$799/mês</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Status do Plano *</label>
<select id="edit-plano-status" required class="w-full border border-gray-300 rounded-lg px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
<option value="ativo">Ativo</option>
<option value="pendente">Pendente</option>
<option value="cancelado">Cancelado</option>
<option value="expirado">Expirado</option>
</select>
</div>
<div class="bg-yellow-50 border border-yellow-200 rounded-lg p-4">
<p class="text-yellow-800 text-sm">
<strong>⚠️ Atenção:</strong> Ao alterar o plano, a empresa será notificada automaticamente.
</p>
</div>
</div>
<div class="flex space-x-4 mt-6">
<button type="button" onclick="closeEditPlanoModal()" class="flex-1 bg-gray-200 text-gray-700 px-6 py-3 rounded-lg hover:bg-gray-300 transition">
Cancelar
</button>
<button type="submit" class="flex-1 bg-purple-600 text-white px-6 py-3 rounded-lg hover:bg-purple-700 transition">
Salvar Alterações
</button>
</div>