/* Arquivo: public/CSS/ponto.css (VERSÃO FINAL - DESIGN UNIFICADO) */

/* ==========================================================================
   Estilos Originais Específicos da Tela de Ponto
   ========================================================================== */

/* Tamanho customizado para o pop-up de Ajuste de Ponto */
#popupAjustePonto .popup-content {
    max-width: 50%;
    min-width: 30%;
    max-height: 90%;
    min-height: 50%;
}

/* Estilo para a lista de marcações (batidas do dia) dentro do pop-up */
#lista-marcacoes-dia li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px solid #ecf0f1;
}

#lista-marcacoes-dia li:last-child {
    border-bottom: none;
}

/* Estilos para as "badges" de status na tabela de ponto */
.status.status-ok { background-color: #2ecc71; }
.status.status-pendente { background-color: #f39c12; }
.status.status-falta { background-color: #e74c3c; }
.status.status-sem-jornada { background-color: #95a5a6; color: white; }

/* Estilo para o botão de "Ver Histórico" */
.btn-historico-marcacao {
    background-color: #95a5a6;
    color: white;
}
.btn-historico-marcacao:hover { background-color: #7f8c8d; }

/* Estilos para os botões do pop-up de ajuste */
#popupAjustePonto .form-buttons #btn-cancelar-ajuste { background-color: #e74c3c; }
#popupAjustePonto .form-buttons #btn-cancelar-ajuste:hover { background-color: #c0392b; }
#popupAjustePonto .form-buttons #btn-salvar-nova-marcacao { background-color: #2ecc71; }
#popupAjustePonto .form-buttons #btn-salvar-nova-marcacao:hover { background-color: #27ae60; }

/* Estilos para as cores dinâmicas do saldo na tabela */
.saldo-positivo { color: #27ae60; font-weight: bold; }
.saldo-negativo { color: #c0392b; font-weight: bold; }

/* Estilo para a formatação das marcações na tabela */
.marcacao {
    display: inline-flex;
    align-items: center;
    background-color: #ecf0f1;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    margin: 2px;
}
.marcacao i { margin-right: 4px; font-size: 1.1em; }
.marcacao-entrada { color: #2980b9; }
.marcacao-saida { color: #c0392b; }
.marcacao-intervalo { color: #8e44ad; }

/* Estilo para o spinner de carregamento */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilo para botões de ação inline */
.btn-acao-inline {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    vertical-align: middle;
}
.adjusted-icon {
    color: #f39c12;
    font-size: 1.2em;
    margin-left: 8px;
}
.btn-acao-inline:hover .adjusted-icon { color: #e67e22; }

/* ALINHAMENTO DA TABELA DE PONTO */
#tabela-ponto td {
    text-align: center;
    vertical-align: middle;
}
#tabela-ponto td:nth-child(1), /* Coluna 'Colaborador' */
#tabela-ponto td:nth-child(4)  /* Coluna 'Marcações' */
{
    text-align: left;
}

/* ==========================================================================
   Layout do Container de Busca
   ========================================================================== */

#gestao-ponto .search-container {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end; /* Alinhamento pela base */
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background-color: var(--cor-fundo-container);
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

#gestao-ponto .search-group {
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
    gap: 5px; 
    flex-grow: 1;
    flex-basis: 180px;
}

#gestao-ponto .search-group input,
#gestao-ponto .search-group select {
    padding: 8px;
    border: 1px solid var(--cor-borda);
    border-radius: 4px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
    width: 100%; 
}

#gestao-ponto .search-group input:focus,
#gestao-ponto .search-group select:focus {
    border-color: var(--cor-destaque);
}

#gestao-ponto .button-group {
    display: flex;
    gap: 10px;
    margin-left: auto; 
    align-self: flex-end; 
}

#gestao-ponto .coluna-acoes {
    text-align: center;
}

/* ==========================================================================
   ESTILOS DE ORDENAÇÃO DA TABELA (Padrão Azul #1a237e)
   ========================================================================== */

/* 1. BARRA AZUL SÓLIDA */
#gestao-ponto table thead tr {
    background-color: #1a237e !important; 
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#gestao-ponto table thead tr:hover {
    background-color: #1a237e !important; 
}

/* 2. CÉLULA PADRÃO (Sem Mouse) */
#gestao-ponto table th {
    background-color: #1a237e; 
    color: #ffffff;            
    user-select: none;
    position: relative;
    padding: 12px 10px;
    cursor: default; 
    border: none;
    transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
    text-align: center;
}

/* 3. Colunas ordenáveis (data-column) */
#gestao-ponto table th[data-column] {
    cursor: pointer; 
}

/* 4. EFEITO HOVER (Com Mouse) - INVERTIDO */
#gestao-ponto table th[data-column]:hover {
    background-color: #ffffff !important; 
    color: #1a237e !important;            
    border-radius: 4px 4px 0 0;
}

/* 5. COLUNA ATIVA (Já Ordenada) */
#gestao-ponto table th.sort-asc,
#gestao-ponto table th.sort-desc {
    background-color: #1a237e; 
    color: #ffffff;
    font-weight: 800;
    border-bottom: 3px solid #ffffff; 
}

/* Se passar o mouse na coluna ativa */
#gestao-ponto table th.sort-asc:hover,
#gestao-ponto table th.sort-desc:hover {
    background-color: #ffffff !important;
    color: #1a237e !important;
    border-bottom: 3px solid #1a237e;
}

/* 6. ÍCONES (Setinhas) */
#gestao-ponto table th i {
    font-size: 14px;
    margin-left: 6px;
    vertical-align: middle;
    color: rgba(255, 255, 255, 0.5); 
    transition: all 0.1s;
}

#gestao-ponto table th[data-column]:hover i {
    opacity: 1;
    color: #1a237e !important; 
}

#gestao-ponto table th.sort-asc i,
#gestao-ponto table th.sort-desc i {
    color: #ffffff;
    opacity: 1;
}
#gestao-ponto table th.sort-asc:hover i,
#gestao-ponto table th.sort-desc:hover i {
    color: #1a237e !important;
}

/* ==========================================================================
   REGISTRO DE PONTO (WEB) - Estilos Mantidos
   ========================================================================== */

.ponto-web-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}
.relogio-digital {
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--cor-principal);
    font-family: 'Arial', sans-serif;
}
#ponto-web-status { font-size: 1.2rem; color: var(--cor-texto-secundario); }
#ponto-web-status span { font-weight: 600; color: var(--cor-texto-principal); }
.btn-bater-ponto {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--cor-sucesso);
    color: white;
    transition: background-color 0.3s ease;
}
.btn-bater-ponto:hover:not(:disabled) { background-color: var(--cor-sucesso-hover); }
.btn-bater-ponto:disabled { background-color: #95a5a6; cursor: not-allowed; }
.ultimas-marcacoes { margin-top: 20px; width: 100%; max-width: 400px; }
.ultimas-marcacoes h3 {
    font-size: 1rem;
    color: var(--cor-principal);
    border-bottom: 1px solid var(--cor-borda);
    padding-bottom: 5px;
    margin-bottom: 10px;
}
#lista-marcacoes-web { list-style: none; padding: 0; }
#lista-marcacoes-web li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--cor-borda);
}