/* ===== RESET E ESTILOS BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== CABEÇALHO ===== */
/* CABEÇALHO ATUALIZADO */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e1e5eb;
}

.header-title-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-voltar {
  padding: 6px 10px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.btn-voltar:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
}

/* ===== FILTROS ===== */
.filtros-container {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.filtros-container input,
.filtros-container select {
  padding: 10px 15px;
  border: 1px solid #d1d7e0;
  border-radius: 6px;
  font-size: 14px;
  min-width: 200px;
  background-color: #fff;
  transition: border-color 0.2s ease;
}

.filtros-container input:focus,
.filtros-container select:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.filtros-container input {
  flex: 1;
  max-width: 400px;
}

/* ===== LISTA DE USUÁRIOS ===== */
.usuarios-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.usuario-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid #e1e5eb;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.usuario-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ===== INFORMAÇÕES DO USUÁRIO ===== */
.usuario-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.usuario-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usuario-info-item strong {
  font-weight: 600;
  color: #2d3748;
  min-width: 80px;
  display: inline-block;
}

.usuario-info-item span {
  color: #4a5568;
  font-size: 14px;
}

/* ===== STATUS DO USUÁRIO ===== */
.tag-ativo {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: white;
}

.tag-ativo.true {
  background-color: #38a169;
}

.tag-ativo.false {
  background-color: #e53e3e;
}

/* ===== FUNÇÕES/PERMISSÕES ===== */
.funcoes-container {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #edf2f7;
}

.funcoes-title {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 10px;
}

.funcoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.funcoes button {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #edf2f7;
  color: #4a5568;
  transition: all 0.2s ease;
}

.funcoes button.ativa {
  background-color: #4299e1;
  color: white;
}

.funcoes button:hover {
  opacity: 0.9;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .filtros-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .filtros-container input,
  .filtros-container select {
    width: 100%;
    max-width: 100%;
  }
  
  .usuarios-container {
    grid-template-columns: 1fr;
  }
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.usuario-card {
  animation: fadeIn 0.3s ease forwards;
  opacity: 0;
}

/* Adiciona delay progressivo para os cards */
.usuario-card:nth-child(1) { animation-delay: 0.1s; }
.usuario-card:nth-child(2) { animation-delay: 0.2s; }
.usuario-card:nth-child(3) { animation-delay: 0.3s; }
.usuario-card:nth-child(4) { animation-delay: 0.4s; }
.usuario-card:nth-child(5) { animation-delay: 0.5s; }
.usuario-card:nth-child(n+6) { animation-delay: 0.6s; }

/* INSTRUÇÃO DE STATUS */
.status-instruction {
  font-size: 13px;
  color: #64748b;
  margin: -10px 0 20px 0;
  padding: 0 5px;
  text-align: right;
}

.active-text {
  color: #3b82f6; /* Azul */
  font-weight: 500;
}

.inactive-text {
  color: #94a3b8; /* Cinza */
  font-weight: 500;
}
.status-instruction {
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}
/* ALERTA CENTRAL - ESTILOS ESSENCIAIS */
.alert-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 16px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  z-index: 9999;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: alertFade 2s ease-in-out;
}

@keyframes alertFade {
  0% { opacity: 0; transform: translate(-50%, -40%); }
  20% { opacity: 1; transform: translate(-50%, -50%); }
  80% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -60%); }
}

/* Botão Novo Usuário no Header */
.header {
    display: flex;
    justify-content: space-between; /* Separa titulo do botão */
    align-items: center;
}
.btn-novo-usuario {
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}
.btn-novo-usuario:hover { background-color: #218838; }

/* Estilos da Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%; max-width: 500px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close-modal { cursor: pointer; font-size: 24px; font-weight: bold; }

.info-box {
    background: #e9ecef; color: #495057; padding: 10px;
    border-radius: 4px; font-size: 0.9em; margin-bottom: 15px;
}
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-group input, .form-group select {
    width: 100%; padding: 10px; border: 1px solid #ced4da; border-radius: 4px; box-sizing: border-box;
}
.form-row { display: flex; gap: 10px; }

/* Lista de Sugestões (Autocomplete) */
.lista-sugestoes {
    position: absolute; width: 100%; max-height: 150px;
    overflow-y: auto; background: white; border: 1px solid #ced4da;
    border-top: none; z-index: 10; display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.sugestao-item {
    padding: 10px; cursor: pointer; border-bottom: 1px solid #eee;
}
.sugestao-item:hover { background-color: #f8f9fa; }

/* Botões da Modal */
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn-cancelar { background: #6c757d; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }
.btn-salvar { background: #007bff; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }

/* Notificações Profissionais (Toasts) */
#alertCenter {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 300px;
    max-width: 80%;
    text-align: center;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none; /* Oculto por padrão */
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Tipos de mensagem */
.toast-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
}

.toast-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
}

/* Animação de entrada */
.show-toast {
    display: block !important;
    opacity: 1 !important;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from { top: -50px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}