/* ===== VARIÁVEIS E CONFIGURAÇÕES GERAIS ===== */
:root {
  --primary: #0039ba;
  --primary-dark: #034cc2;
  --primary-light: #306fd4;
  --secondary: #6c757d;
  --success: #039b54;
  --danger: #c80028;
  --warning: #ffc107;
  --info: #0dcaf0;
  --light: #f8f9fa;
  --dark: #212529;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-sm: 0.25rem;
  
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --box-shadow-hover: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
  
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

/* ===== ESTILOS GERAIS ===== */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fb;
  color: var(--gray-800);
  line-height: 1.6;
}

/* ===== HEADER E ESTATÍSTICAS ===== */


.header-section .text-muted {
  font-size: 1.1rem;
}

/* Cards de Estatísticas */
.stats-card {
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  color: white;
  display: flex;
  align-items: center;
  transition: var(--transition);
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.stats-card:hover {
 
  box-shadow: var(--box-shadow-hover);
}

.stats-icon {
  font-size: 2.5rem;
  margin-right: 1rem;
  opacity: 0.9;
}

.stats-content h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stats-content p {
  margin-bottom: 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

/* Cores dos cards de estatísticas */
.stats-card.bg-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.stats-card.bg-success { background: linear-gradient(135deg, var(--success), #018629); }
.stats-card.bg-secondary { background: linear-gradient(135deg, var(--secondary), #6c767e); }
.stats-card.bg-info { background: linear-gradient(135deg, var(--info), #026be4); }

/* ===== BARRA DE FERRAMENTAS ===== */
.toolbar {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow);
}

.search-box {
  position: relative;
}

.search-box .fas.fa-search {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
}

.search-box .form-control {
  padding-left: 45px;
  padding-right: 45px;
  border-radius: 50px;
  border: 1px solid var(--gray-300);
  transition: var(--transition);
}

.search-box .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

.search-clear {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--gray-500);
  transition: var(--transition);
}

.search-clear:hover {
  color: var(--danger);
}

.filter-btn.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== CONTADOR DE RESULTADOS ===== */
.results-counter {
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

.results-counter span {
  font-weight: 700;
  color: var(--primary);
}

/* ===== CARDS DE FUNCIONÁRIOS ===== */


.employee-card-inner {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.employee-card-inner:hover {
 
  box-shadow: var(--box-shadow-hover) !important;
}

/* Badge de Status */
.status-badge {
  position: absolute;
  top: 28px;
  right: 28px;
  padding: 0.25rem 0.75rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 10;
  box-shadow: var(--box-shadow);
}

.badge-ativo {
  background-color: var(--success);
  color: white;
}

.badge-inativo {
  background-color: var(--secondary);
  color: white;
}

/* Cabeçalho do Card */
.employee-card-inner .card-header {
  border-bottom: none;
  padding: 1rem;
  position: relative;
  border-radius: 10px;
  background: #e9f0f7;
  box-shadow: var(--box-shadow);
}

.avatar-container {
  position: relative;
  display: inline-block;
}

.avatar-sm {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.avatar-xl {
  width: 70px;
  height: 70px;
  object-fit: cover;
}

.avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  border: 2px solid white;
}

.employee-card-inner .card-header h6 {
  font-weight: 600;
}

.employee-card-inner .card-header p {
  font-size: 0.85rem;
}

/* Corpo do Card */
.employee-card-inner .card-body {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.info-item i {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  min-width: 16px;
}

.info-item.small {
  font-size: 0.85rem;
}

.info-item.small strong {
  font-size: 0.9rem;
  border-bottom: 1px dashed #333;
}

/* Seção de Permissões */
.permissions-section {
  margin-top: auto;
}

.permissions-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.permission-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  line-height: 1;
}

/* Cores das tags de permissão */
.bg-purple { background-color: #6f42c1; }
.bg-orange { background-color: #fd7e14; }
.bg-teal { background-color: #20c997; }
.bg-pink { background-color: #d63384; }
.bg-indigo { background-color: #6610f2; }
.bg-cyan { background-color: #0dcaf0; }
.bg-lime { background-color: #84cc16; }

/* Rodapé do Card */
.employee-card-inner .card-footer {
  background-color: var(--gray-100) !important;
  border-top: 1px solid var(--gray-300);
  padding: 0.7rem;
}

.employee-card-inner .card-footer .btn {
  padding: 0.375rem 0.5rem;
  font-size: 0.8rem;
}

/* ===== MODAIS ===== */
.modal-header {
  border-bottom: 1px solid var(--gray-300);
}

.modal-footer {
  border-top: 1px solid var(--gray-300);
}

.photo-upload-area {
  text-align: center;
  border: 2px dashed var(--gray-400);
  border-radius: var(--border-radius);
  padding: 0.8rem;
  transition: var(--transition);
  cursor: pointer;
}

.photo-upload-area:hover {
  border-color: var(--primary);
  background-color: var(--gray-100);
}

.photo-funcionarios {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  margin: 1px;
  border: 3px solid var(--gray-300);
}

 .current-photo img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  margin: 1px;
  border: 3px solid var(--gray-300);
    }
    
.upload-label-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.upload-label-btn:hover {
  background-color: var(--primary-dark);
}

.permissions-section-modal {
  border-top: 1px solid var(--gray-300);
  padding-top: 0.8rem;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ===== VISUALIZAÇÃO EM LISTA ===== */
#employeeGrid.list-view .employee-card {
  flex: 0 0 100%;
  max-width: 100%;
}

#employeeGrid.list-view .employee-card-inner {
  max-height: none !important;
  flex-direction: row;
}

#employeeGrid.list-view .employee-card-inner .card-header {
  flex: 0 0 250px;
  border-right: 1px solid var(--gray-300);
}

#employeeGrid.list-view .employee-card-inner .card-body {
  flex: 1;
  max-height: none !important;
}

#employeeGrid.list-view .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ===== ESTADOS E ANIMAÇÕES ===== */
.shadow-hover {
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.shadow-hover:hover {
  box-shadow: var(--box-shadow-hover);
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}

/* Animações de entrada */
.employee-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilização da barra de rolagem */
.employee-card-inner .card-body::-webkit-scrollbar {
  width: 4px;
}

.employee-card-inner .card-body::-webkit-scrollbar-track {
  background: var(--gray-200);
  border-radius: 10px;
}

.employee-card-inner .card-body::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 10px;
}

.employee-card-inner .card-body::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1199.98px) {
  .main-content {
    margin-left: 0;
  }
  
  .employee-card-inner .card-header h6,
  .employee-card-inner .card-header p {
    font-size: 0.8rem;
  }
}

@media (max-width: 991.98px) {
  .header-section h1 {
    font-size: 1.75rem;
  }
  
  .stats-content h3 {
    font-size: 1.75rem;
  }
  
  .employee-card-inner .card-body {
    padding: 0.75rem;
  }
}

@media (max-width: 767.98px) {
  .main-content {
    padding: 15px;
  }
  
  .page-container {
    padding: 0;
  }
  
  .header-section h1 {
    font-size: 1.5rem;
  }
  
  .toolbar {
    padding: 1rem;
  }
  
  .search-box .form-control {
    font-size: 0.9rem;
  }
  
  .employee-card-inner .card-header {
    padding: 0.75rem;
  }
  
  .avatar-sm {
    width: 40px;
    height: 40px;
  }
  
  .info-item {
    font-size: 0.8rem;
  }
  
  .permission-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
}

@media (max-width: 575.98px) {
  .header-section .d-flex {
    flex-direction: column;
    gap: 1rem;
  }
  
  .header-section .btn-lg {
    align-self: flex-start;
  }
  
  .stats-card {
    padding: 1rem;
  }
  
  .stats-icon {
    font-size: 2rem;
    margin-right: 0.75rem;
  }
  
  .stats-content h3 {
    font-size: 1.5rem;
  }
  
  .toolbar .row {
    flex-direction: column;
    gap: 1rem !important;
  }
  
  .toolbar .justify-content-end {
    justify-content: flex-start !important;
  }
  
  #employeeGrid.list-view .employee-card-inner {
    flex-direction: column;
  }
  
  #employeeGrid.list-view .employee-card-inner .card-header {
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--gray-300);
  }
}

/* ===== ESTILOS PARA ESTADOS ESPECIAIS ===== */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-600);
}

.no-results i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Estados de foco e ativo melhorados */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
  border-color: var(--primary);
}

/* Transições suaves para todos os elementos interativos */
a, button, .form-control, .form-select, .form-check-input {
  transition: var(--transition-fast);
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .stats-card {
    border: 2px solid currentColor;
  }
  
  .employee-card-inner {
    border: 1px solid var(--gray-700);
  }
  
  .permission-tag {
    border: 1px solid currentColor;
  }
}