/* --- RESET & VARIÁVEIS --- */
:root {
  --primary-color: #4f8b4f;
  --primary-glow: rgba(79, 139, 79, 0.4);
  --bg-dark: #0a0a0a;
  --card-bg: #111111;
  --input-bg: #050505;
  --error: #ff4444;
  --text-dim: #666;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: radial-gradient(circle at center, #0d1f0d 0%, #000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  color: #e0e0e0;
  padding: 0;
  line-height: 1.6;
}

/* --- TIPOGRAFIA --- */
p {
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  font-weight: 700;
}

/* --- NAVBAR --- */
.navbar {
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #1a2f1a;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 25px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-color);
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 0 10px var(--primary-glow);
}
.btn-exit{
  background: none;
  border: 2px solid var(--error);
  color: var(--error);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  transition: var(--transition);
}

/* --- CONTAINERS (CATRACA) --- */
/* Garante que o container principal alinhe os itens em coluna */
.main-container {
  width: 100%;
  max-width: 1200px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column; /* Faz os itens ficarem um abaixo do outro */
  align-items: center;
  gap: 30px; /* Cria um espaçamento consistente entre as seções */
}

/* Remove larguras fixas que podem quebrar o layout em telas menores */
.catraca {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid #222;
  width: 100%; /* Muda de 600px fixo para 100% */
  max-width: 800px; /* Define um limite máximo elegante */
  position: relative; /* Garante que não use absolute por engano */
}
.display-cpf.password-container {
    display: flex;             /* Ativa o alinhamento flexível */
    align-items: center;       /* Centraliza verticalmente o input e o ícone */
    justify-content: space-between; /* Empurra o ícone para a direita */
    padding-right: 15px;       /* Dá um pequeno distanciamento da borda direita */
}

.password-container input {
    flex: 1;                   /* Faz o input ocupar todo o espaço disponível à esquerda */
    text-align: center;        /* Mantém o texto centralizado se desejar */
    padding-left: 30px;        /* Compensa o espaço do ícone para manter o texto centralizado */
}

.toggle-icon {
    cursor: pointer;
    color: var(--primary-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.toggle-icon:hover {
    filter: brightness(1.2);
    text-shadow: 0 0 8px var(--primary-glow);
}

/* Ajusta o Dashboard para não sobrepor */
.admin-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr; /* Divide o formulário e a tabela lado a lado */
  gap: 30px;
  width: 100%;
}



/* --- INPUTS & FORMS --- */
.display-cpf {
  background: var(--input-bg);
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 6px;
  border: 1px solid #1a1a1a;
  transition: var(--transition);
}
/* Adicione ou altere no seu style.css */
.display-cpf input {
    background: transparent !important;
    background-color: transparent !important;
    border: none;
    outline: none;
}

.display-cpf:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-glow);
}

input[type="text"], 
input[type="password"], 
textarea {
  background: transparent;
  background-color: transparent; /* Garante que não haja cor de fundo */
  border: none;
  color: var(--primary-color);
  width: 100%;
  text-align: center;
  font-family: 'Courier New', monospace;
  outline: none;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.admin-form label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.admin-table th:first-child, 
.admin-table td:first-child {
    width: 100px; /* Ajuste conforme necessário */
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* --- BOTÕES --- */
button {
  padding: 14px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  border: none;
}

/* --- AFASTAR BOTÕES DO FORMULÁRIO (SALVAR E CANCELAR) --- */

.btn-group {
    display: flex;
    flex-direction: column; /* Mantém um abaixo do outro */
    gap: 15px;              /* Aumenta o espaço entre eles */
    margin-top: 20px;       /* Espaço em relação ao campo anterior (Status) */
}

.btn-ok {
    background: var(--primary-color) !important;
    color: #000 !important;
    padding: 14px !important;
    font-weight: 900 !important;
    border-radius: 6px !important;
    cursor: pointer;
    width: 100%;
}

.btn-cancel {
    background: transparent !important;
    color: #888 !important;
    border: 1px solid #333 !important;
    padding: 10px !important;
    font-size: 0.7rem !important;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel:hover {
    color: #ff4444 !important;
    border-color: #ff4444 !important;
}
/* Botões de Ação na Tabela (Correção de Alinhamento) */
.btn-edit-table, .btn-delete-table {
    background: none !important; /* Remove o fundo branco da imagem */
    border: none !important;
    padding: 5px 10px !important;
    cursor: pointer;
    font-weight: 900;
    font-size: 0.75rem;
    transition: var(--transition);
    display: inline-block;
    width: auto !important; /* Impede que fiquem gigantes */
}

.btn-edit-table {
    color: var(--primary-color) !important;
}

.btn-edit-table:hover {
    text-shadow: 0 0 8px var(--primary-glow);
    transform: scale(1.1);
}

.btn-delete-table {
    color: var(--error) !important;
    margin-left: 10px;
}

.btn-delete-table:hover {
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.4);
    transform: scale(1.1);
}

/* Garante que a coluna de ações alinhe à direita */
.admin-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

/* --- TABELAS --- */
.table-container {
  overflow-x: auto;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #222;
  padding-bottom: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.7rem;
  text-align: left;
  padding: 15px;
  border-bottom: 2px solid #1a1a1a;
}
.admin-table td {
  padding: 15px;
  border-bottom: 1px solid #222;
  color: var(--primary-color);
  transition: var(--transition);
}
.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--primary-color);
}

/* --- STAT CARDS --- */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 300px;
  margin: 0 auto;
}

#totalCadastros {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0;
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--primary-glow);
}
/* Cores dos Status */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}


.status-ativo { background: rgba(79, 139, 79, 0.2); color: #4f8b4f; border: 1px solid #4f8b4f; }
.status-inativo { background: rgba(255, 68, 68, 0.2); color: #ff4444; border: 1px solid #ff4444; }
.status-pendente { background: rgba(255, 187, 51, 0.2); color: #ffbb33; border: 1px solid #ffbb33; }
/* --- UTILITÁRIOS --- */
.hidden { display: none !important; }

.error-msg {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 15px;
  padding: 10px;
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: 4px;
  background: rgba(255, 68, 68, 0.05);
}
/* Remove o fundo branco do preenchimento automático do navegador */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--input-bg) inset !important;
    -webkit-text-fill-color: var(--primary-color) !important;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 15px;
  }
}