/* Reset Básico e Estilos Gerais */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ---- ALTERAÇÃO 1: Preparando o corpo para o Flexbox ---- */
html, body {
    height: 100%; /* Garante que o HTML e o corpo ocupem toda a altura da tela */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex; /* ATIVA O FLEXBOX */
    flex-direction: column; /* Organiza os itens (header, main, footer) em uma coluna */
}

/* Cabeçalho Principal */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c3e50;
    color: white;
    padding: 10px 30px;
}
.logo { display: flex; align-items: center; text-decoration: none; color: white;}
.logo img { height: 40px; margin-right: 15px; }
.logo span { font-size: 1.2em; font-weight: bold; }

/* Navegação Principal */
.main-nav ul { list-style: none; display: flex; }
.main-nav ul li a { color: white; text-decoration: none; padding: 15px; display: block; transition: background-color 0.3s; }
.main-nav ul li a:hover { background-color: #34495e; }
.main-nav ul li a .fas { margin-right: 8px; }

/* ---- ALTERAÇÃO 2: Fazendo o conteúdo principal crescer ---- */
.main-content {
    padding: 30px;
    flex: 1; /* FAZ O CONTEÚDO PRINCIPAL CRESCER E OCUPAR O ESPAÇO VAZIO */
    /* A linha min-height antiga foi removida pois o Flexbox cuida disso agora. */
}
.content-box { background-color: white; padding: 25px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.content-box h1, .content-box h2 { color: #2c3e50; margin-bottom: 20px; border-bottom: 2px solid #ecf0f1; padding-bottom: 10px; }



/* Rodapé */
.main-footer {
    text-align: center;
    padding: 20px;
    background-color: #ecf0f1;
    color: #7f8c8d;
    border-top: 1px solid #dcdcdc;
}

/* Tabelas */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; border: 1px solid #ddd; text-align: left; }
th { background-color: #f2f2f2; font-weight: bold; color: #34495e; }
tbody tr:nth-child(even) { background-color: #f9f9f9; }
.actions a { margin: 0 5px; color: #34495e; text-decoration: none; }
.actions a:hover { color: #3498db; }

/* Formulários */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1em; }
button, .btn { padding: 10px 15px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; text-decoration: none; color: white; font-weight: bold; }
.btn-add { background-color: #27ae60; }
.btn-upload { background-color: #3498db; }
.btn-login { width: 100%; background-color: #27ae60; }

/* Funcionalidade de Busca */
.search-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.search-form {
    margin: 0;
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-search {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-search:hover {
    background-color: #0056b3;
}

.btn-clear {
    background-color: #6c757d;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clear:hover {
    background-color: #545b62;
    color: white;
}

@media (max-width: 768px) {
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .btn-search, .btn-clear {
        justify-content: center;
    }
}

/* Estilos para alertas */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Estilos para checkbox personalizado WhatsApp */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 3px;
    border: 2px solid #ddd;
    transition: all 0.3s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #25D366;
    border-color: #25D366;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.alert ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.alert code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* Painel Admin */
.admin-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; }
.upload-form-container, .document-list-container { background-color: #fdfdfd; padding: 20px; border-radius: 5px; border: 1px solid #e0e0e0; }

/* Layout Demo Mudanças - Página de Colaboradores */
.page-header {
    background-color: white !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin-bottom: 2rem !important;
}

.page-header .header-content {
    max-width: 80rem !important;
    margin: 0 auto !important;
    padding: 1rem 1.5rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.page-header h1 {
    font-size: 1.875rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 !important;
}

.page-header .subtitle {
    margin-top: 0.25rem !important;
    font-size: 0.875rem !important;
    color: #6b7280 !important;
}

.btn-add {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.75rem 1.5rem !important;
    border: 1px solid transparent !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: white !important;
    background-color: #059669 !important;
    text-decoration: none !important;
    transition: background-color 0.2s !important;
}

.btn-add:hover {
    background-color: #047857 !important;
    color: white !important;
}

.btn-report {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.75rem 1.5rem !important;
    border: 1px solid transparent !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: white !important;
    background-color: #7c3aed !important;
    text-decoration: none !important;
    transition: background-color 0.2s !important;
    margin-left: 0.75rem !important;
}

.btn-report:hover {
    background-color: #6d28d9 !important;
    color: white !important;
}

.action-buttons {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 1.5rem !important;
}

.filters-section {
    background-color: white !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    padding: 2rem !important;
    margin-bottom: 2rem !important;
    border: 1px solid #f3f4f6 !important;
}

.filters-section h2 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin-bottom: 1.5rem !important;
}

.filters-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    align-items: end !important;
}

@media (min-width: 768px) {
    .filters-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.filter-group label {
    display: block !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 0.25rem !important;
}

.filter-group select,
.filter-group input {
    display: block !important;
    width: 100% !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 1rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    background-color: white !important;
    color: #111827 !important;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none !important;
    ring: 1px !important;
    ring-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.btn-clear {
    width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem 1rem !important;
    border: 1px solid #fed7aa !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #c2410c !important;
    background-color: #fff7ed !important;
    text-decoration: none !important;
    transition: background-color 0.2s !important;
}

.btn-clear:hover {
    background-color: #ffedd5 !important;
    color: #c2410c !important;
}

.employee-list {
    background-color: white !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    border-radius: 0.75rem !important;
    overflow: hidden !important;
}

.employee-list-header {
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid #e5e7eb !important;
    background-color: #f9fafb !important;
}

.employee-list-header h3 {
    font-size: 1.125rem !important;
    font-weight: 500 !important;
    color: #111827 !important;
    margin: 0 !important;
}

.employee-card {
    background-color: white !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
    margin-bottom: 1rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    border: 1px solid #e5e7eb !important;
}

.employee-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.status-badge {
    padding: 0.25rem 0.75rem !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    display: inline-block !important;
}

.status-badge.ativo {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

.status-badge.inativo {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.btn-action {
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    display: inline-block !important;
    border: none !important;
    cursor: pointer !important;
    margin: 0 0.25rem !important;
    transition: all 0.2s !important;
}

.btn-view {
    background-color: #3b82f6 !important;
    color: white !important;
}

.btn-view:hover {
    background-color: #2563eb !important;
    color: white !important;
}

.btn-edit {
    background-color: #f59e0b !important;
    color: white !important;
}

.btn-edit:hover {
    background-color: #d97706 !important;
    color: white !important;
}

.btn-delete {
    background-color: #ef4444 !important;
    color: white !important;
}

.btn-delete:hover {
    background-color: #dc2626 !important;
    color: white !important;
}

.empty-state {
    text-align: center !important;
    padding: 3rem 0 !important;
}

.empty-state h3 {
    margin-top: 0.5rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #111827 !important;
}

.empty-state p {
    margin-top: 0.25rem !important;
    font-size: 0.875rem !important;
    color: #6b7280 !important;
}

.empty-state .btn-add {
    margin-top: 1.5rem !important;
}