/* =========================================
   1. ESTRUTURA GERAL E FONTES
========================================= */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: linear-gradient(135deg, #004ba0 0%, #002f6c 100%); 
    color: #333;
    margin: 0;
    min-height: 100vh;
}

body.layout-painel {
    background: linear-gradient(135deg, #004ba0 0%, #002f6c 100%);
    min-height: 100vh; 
    display: flex;
}

h2 { color: #2c3e50; margin-top: 0; }

/* =========================================
   2. TELA DE LOGIN (Isolada)
========================================= */
body.tela-login {
    background: linear-gradient(135deg, #004ba0 0%, #002f6c 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.logo-login { max-width: 120px; margin-bottom: 20px; }

/* =========================================
   3. MENU LATERAL (SIDEBAR) E CONTEÚDO
========================================= */
/* =========================================
   3. MENU LATERAL (SIDEBAR) - VERSÃO SEGURA
========================================= */
.sidebar {
    width: 230px; 
    background-color: #1a1e21; 
    min-height: 100vh;
    color: white;
    position: fixed; /* Mantém a barra fixa na esquerda */
    left: 0;
    top: 0;
    box-shadow: 4px 0 15px rgba(0,0,0,0.4);
    z-index: 1000;
    display: block; /* Voltamos para o padrão seguro */
}

.sidebar-logo {
    padding: 25px 10px;
    text-align: center; /* Centralização clássica por texto */
    border-bottom: 1px solid #2c3136;
    background-color: #16191c;
    width: 100%;
    display: block;
}

.sidebar-logo a {
    text-decoration: none !important;
    display: block;
    width: 100%;
}

.sidebar-logo img {
    width: 130px !important; /* Tamanho fixo controlado */
    height: auto !important;
    margin: 0 auto;
    display: block; /* Garante que a margem auto funcione */
}

.sidebar-logo div {
    color: #0d6efd !important;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    display: block;
}

/* Garante que o conteúdo principal não seja "atropelado" pela barra */
.main-content {
    margin-left: 230px !important; 
    padding: 30px;
    width: calc(100% - 230px);
    display: block;
}

.accordion-item {
    background-color: transparent !important;
    border: none !important;
}

.accordion-button {
    background-color: #1a1e21 !important; 
    color: #ced4da !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border-bottom: 1px solid #2c3136 !important;
    padding: 10px 15px; 
    font-size: 13px;
}

.accordion-button:not(.collapsed) {
    color: #ffffff !important;
    background-color: #0d6efd !important;
}

.accordion-button::after { filter: invert(1); }

.sub-menu-list {
    background-color: #16191c;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sub-menu-list a {
    color: #adb5bd;
    text-decoration: none;
    padding: 8px 15px 8px 40px;
    display: block;
    font-size: 0.85rem; 
    border-bottom: 1px solid #22262a;
    transition: 0.3s;
}

.sub-menu-list a:hover {
    color: white;
    background-color: #004ba0;
    border-left: 4px solid #ffffff;
}

.main-content {
    margin-left: 230px; 
    padding: 30px;
    flex-grow: 1;
    width: calc(100% - 230px); 
}

/* =========================================
   4. BOTÕES E BARRA DE FERRAMENTAS
========================================= */
.toolbar { 
    background-color: #f8f9fa; 
    padding: 10px; 
    border-radius: 6px; 
    margin-bottom: 15px; 
    display: flex; 
    gap: 6px; 
    border: 1px solid #e1e4e8; 
    flex-wrap: wrap;
}

.btn-toolbar { 
    padding: 6px 14px; 
    text-decoration: none; 
    border-radius: 4px; 
    border: none; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 12px; 
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
    transition: opacity 0.2s; 
}

.btn-toolbar:hover { opacity: 0.85; }

.btn-incluir  { background-color: #5cb85c; color: white; }
.btn-editar   { background-color: #f0ad4e; color: white; }
.btn-excluir  { background-color: #d9534f; color: white; }
.btn-alocacao { background-color: #4a90e2; color: white; }
.btn-ficha    { background-color: #8e44ad; color: white; }
.btn-limpar   { background-color: #7f8c8d; color: white; }

.btn-voltar { 
    display: inline-block; margin-bottom: 20px; padding: 8px 15px; 
    background-color: #fff; color: #555; text-decoration: none; 
    border-radius: 4px; border: 1px solid #ccc; font-weight: bold; font-size: 13px;
}
.btn-voltar:hover { background-color: #e9ecef; }

/* =========================================
   5. TABELAS E FILTROS (REFINADO)
========================================= */
.tabela-container { 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    margin-top: 20px;
}

/* Base da Tabela */
table {
    background-color: #ffffff !important;
    color: #333333 !important;
    width: 100%;
    border-collapse: collapse !important;
    font-size: 13px !important;
    border: 1px solid #dee2e6 !important;
}

/* 1. CABEÇALHO DESTACADO (Títulos) */
thead tr:first-child th {
    font-size: 13px !important; 
    font-weight: 800 !important; /* Texto bem marcado */
    text-transform: uppercase; /* Deixa os títulos em maiúsculas para autoridade */
    letter-spacing: 0.5px;
    background-color: #eceef1 !important; /* Cinza um pouco mais forte que o anterior */
    color: #2c3e50 !important;
    padding: 10px 8px !important;
    border: 1px solid #d1d5db !important;
}

/* 2. LINHA DE FILTROS E A DIVISÃO GROSSA */
thead tr:last-child th {
    background-color: #f8f9fa !important;
    padding: 8px !important;
    /* 👇 A linha grossa que divide os filtros dos dados 👇 */
    border-bottom: 3px solid #6c757d !important; 
    border-left: 1px solid #dee2e6 !important;
    border-right: 1px solid #dee2e6 !important;
}

/* 3. Células de Dados */
tbody td {
    padding: 4px 8px !important;
    vertical-align: middle;
    white-space: nowrap !important;
    border: 1px solid #dee2e6 !important;
    background-color: #ffffff !important;
}

/* Hover e Seleção (Mantidos) */
tbody tr:hover td { background-color: #f1f3f5 !important; }

tbody tr.linha-selecionada td {
    background-color: #cfe2ff !important;
    color: #084298 !important;
    font-weight: 600 !important;
    border: 1px solid #b6d4fe !important;
}

/* =========================================
   ESTILO DOS FILTROS (FINALIZADO)
========================================= */
.input-filtro { 
    width: 100%; 
    box-sizing: border-box; 
    padding: 4px 6px; 
    font-size: 11px; 
    font-weight: 800 !important; /* ⬅️ O NEGRITO POTENTE AQUI */
    color: #2c3e50 !important;  /* Um tom levemente mais escuro para o texto digitado */
    border: 1px solid #adb5bd; 
    border-radius: 3px;
    background-color: #ffffff;
    transition: all 0.2s;
}

/* Efeito de foco para saber qual campo está sendo editado */
.input-filtro:focus { 
    border-color: #0d6efd; 
    box-shadow: 0 0 4px rgba(13, 110, 253, 0.25);
    outline: none; 
    background-color: #fffdec; /* Um leve tom amarelado para destacar o campo ativo */
}

/* =========================================
   ESTILO RETRATO 3x4 COM MOLDURA
========================================= */
/* Moldura 3x4 Reduzida e Profissional */
.preview-container {
    width: 90px;            /* Ficou menor e mais elegante */
    height: 120px;          /* Mantém a proporção 3x4 */
    border: 2px solid #dee2e6; 
    border-radius: 4px;
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#img-preview {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Garante que o rosto preencha o 3x4 */
}

/* Garante que o input sumiu mesmo */
input[type="file"] {
    display: none !important;
}
/* Garante que a linha de demitido ignore o efeito zebrado e destaque bem */
.table-danger {
    --bs-table-bg: #f8d7da !important;  /* Fundo vermelho claro */
    --bs-table-color: #842029 !important; /* Texto vermelho escuro */
}

/* Se quiser que a linha inteira tenha uma borda esquerda vermelha grossa */
tr.table-danger {
    border-left: 5px solid #dc3545 !important;
}