/* =============================================
   SISTEMA DE PONTO — Estilos Globais
   estilo.css
   Importar em todas as páginas com:
   <link rel="stylesheet" href="../assets/css/estilo.css">
   ============================================= */

/* ---- Variáveis de Cor ---- */
:root {
    --cor-primaria: #ca521f;
    /* laranja escuro — botões e destaques */
    --cor-primaria-hover: #a84119;
    --cor-secundaria: #dc931a;
    /* laranja claro — links e ícones */
    --cor-admin: #868788;
    /* cinza — nav bar e cabeçalho de tabela */
    --cor-sucesso: #28a745;
    --cor-sucesso-hover: #218838;
    --cor-fundo: #f5f7f4;
    --cor-texto: #333;
    --cor-texto-suave: #666;
    --cor-borda: #ddd;
    --cor-positivo: #28a745;
    --cor-negativo: #d62a07;
}

/* ---- Reset Básico ---- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---- Body Padrão ---- */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--cor-fundo);
    padding: 20px;
    color: var(--cor-texto);
}

/* body centralizado — usado em login, bater_ponto, criar_usuario, edita_usuario */
body.centralizado {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: flex-start;
}

/* ---- Card principal ---- */
.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.card-sm {
    max-width: 400px;
}

.card-md {
    max-width: 550px;
}

.card-lg {
    max-width: 1100px;
    margin: auto;
}

/* ---- Barra de Navegação Admin ---- */
.admin-nav {
    background: var(--cor-admin);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Título "Painel Admin" / "Painel do Usuário" */
.nav-titulo {
    display: inline-flex;
    align-items: center;
    height: 30px;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    color: white;
}

/* Container dos links */
.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* Links como pills — estilo igual em desktop e mobile */
.nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 14px;
    color: var(--cor-secundaria);
    text-decoration: none;
    font-size: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.2s;
    white-space: nowrap;
    box-sizing: border-box;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.25);
    text-decoration: none;
}

/* Link "Sair" levemente diferente */
.nav-sair {
    color: #ffb347 !important;
}

/* ---- Títulos ---- */
h1 {
    color: #26272d;
    margin-bottom: 20px;
    font-size: 24px;
}

/* ---- Formulários ---- */
label {
    display: block;
    margin-bottom: 5px;
    margin-top: 15px;
    color: #555;
    font-weight: bold;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--cor-borda);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--cor-secundaria);
}

small {
    color: var(--cor-texto-suave);
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

/* ---- Botões ---- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primario {
    background: var(--cor-primaria);
    color: white;
}

.btn-primario:hover {
    background: var(--cor-primaria-hover);
}

.btn-sucesso {
    background: var(--cor-sucesso);
    color: white;
}

.btn-sucesso:hover {
    background: var(--cor-sucesso-hover);
}

.btn-cinza {
    background: var(--cor-admin);
    color: white;
}

.btn-cinza:hover {
    background: #6e6f70;
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 25px;
}

/* Link voltar */
.voltar {
    display: inline-block;
    color: var(--cor-secundaria);
    text-decoration: none;
    margin-bottom: 15px;
    font-size: 14px;
}

.voltar:hover {
    text-decoration: underline;
}

/* ---- Tabelas ---- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    background: var(--cor-admin);
    color: white;
    padding: 12px;
    font-size: 14px;
}

td {
    border-bottom: 1px solid #eee;
    padding: 12px;
    font-size: 14px;
}

tr:hover {
    background: #f8f9fa;
}

/* ---- Mensagens de Feedback ---- */
.mensagem {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.mensagem.sucesso {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensagem.erro {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ---- Badges de Perfil ---- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge-admin {
    background: var(--cor-secundaria);
    color: white;
}

.badge-user {
    background: #6c757d;
    color: white;
}

/* ---- Saldo de Horas ---- */
.positivo {
    color: var(--cor-positivo);
    font-weight: bold;
}

.negativo {
    color: var(--cor-negativo);
    font-weight: bold;
}

/* ---- Barra de Ações (gerenciar usuários) ---- */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ---- Animação fadeOut (mensagens auto-hide) ---- */
@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.mensagem.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

/* ==============================================
   RESPONSIVIDADE MOBILE
   Breakpoints:
   - Tablet:  max-width: 768px
   - Celular: max-width: 480px
   ============================================== */

/* ---- Tablet (até 768px) ---- */
@media (max-width: 768px) {

    body {
        padding: 12px;
    }

    /* Card reduz o padding interno */
    .card {
        padding: 20px;
        border-radius: 8px;
    }

    /* Barra de nav: empilha verticalmente */
    .admin-nav {
        max-width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 8px;
        text-align: center;
    }

    /* Título ocupa a linha inteira */
    .nav-titulo {
        text-align: center;
        font-size: 13px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    /* Links centralizam no mobile */
    .nav-links {
        justify-content: center;
    }

    /* Esconde o separador | no mobile (já removido do base, mas mantido por segurança) */
    .nav-links a+a::before {
        display: none;
    }

    /* Tabelas: scroll horizontal controlado */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }

    table {
        min-width: 520px;
        /* evita que a tabela quebre antes de precisar */
    }

    /* Filtros empilham verticalmente */
    .filtros {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filtros>div {
        width: 100%;
    }

    .filtros input,
    .filtros select,
    .filtros button {
        width: 100%;
    }

    /* Barra de ações empilha */
    .actions-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        text-align: center;
    }

    .actions-bar a,
    .actions-bar button {
        width: 100%;
        text-align: center;
    }

    /* Botões de exportação empilham */
    .export-buttons {
        flex-direction: column;
    }

    .export-buttons form {
        flex-direction: column;
        gap: 8px;
    }

    .select-export {
        min-width: unset;
        width: 100%;
    }

    h1 {
        font-size: 20px;
    }
}

/* ---- Celular (até 480px) ---- */
@media (max-width: 480px) {

    body {
        padding: 8px;
    }

    .card {
        padding: 16px;
        border-radius: 6px;
    }

    /* Título menor em telas muito pequenas */
    h1 {
        font-size: 18px;
    }

    /* Células da tabela menores */
    th,
    td {
        padding: 8px 6px;
        font-size: 12px;
    }

    /* Modal ocupa quase toda a tela */
    .modal-container {
        width: 96%;
        margin: 5% auto;
        padding: 18px;
    }

    /* Botões de ação do modal empilham */
    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn-save,
    .modal-actions .btn-cancel {
        flex: unset;
        width: 100%;
    }
}

/* ==========================================================================
   NOVO MENU SUPERIOR SUSPENSO (GLASSMORPHIC & RESPONSIVO)
   ========================================================================== */

/* Ajuste no body para dar espaço à Navbar Fixa */
body.com-navbar {
    padding-top: 90px !important;
    justify-content: flex-start !important;
}.navbar-container {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

/* Efeito de hover de elevação na própria Navbar */
.navbar-container:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.90);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    height: 60px;
    box-sizing: border-box;
    position: relative;
}

/* Marca / Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #26272d;
    font-weight: 700;
    font-size: 18px;
    transition: transform 0.2s ease;
}
.navbar-brand:hover {
    transform: scale(1.03);
}
.navbar-brand .highlight {
    color: var(--cor-primaria);
}
.brand-icon {
    font-size: 22px;
}

/* Links Desktop */
.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-links a {
    text-decoration: none;
    color: var(--cor-texto-suave);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 30px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-links a:hover {
    color: var(--cor-primaria);
    background: rgba(202, 82, 31, 0.08);
}

/* Item Ativo - Destaque Principal */
.navbar-links a.active {
    color: white;
    background: linear-gradient(135deg, var(--cor-secundaria) 0%, var(--cor-primaria) 100%);
    box-shadow: 0 4px 12px rgba(202, 82, 31, 0.3);
}

/* Menu Usuário / Dropdown Desktop */
.navbar-user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 6px 14px;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s ease;
}

.user-menu-btn:hover, .user-menu-btn.active {
    background: rgba(0, 0, 0, 0.08);
}

.user-avatar {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--cor-secundaria) 0%, var(--cor-primaria) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.user-chevron {
    font-size: 9px;
    color: #777;
    transition: transform 0.2s ease;
}
.user-menu-btn.active .user-chevron {
    transform: rotate(180deg);
}

.user-dropdown-card {
    position: absolute;
    top: 50px;
    right: 0;
    width: 220px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px;
    display: none;
    flex-direction: column;
    z-index: 10000;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-dropdown-card.show {
    display: flex;
    animation: slideInDropdown 0.2s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDropdown {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
    display: flex;
    flex-direction: column;
    padding: 4px 8px 8px;
}
.dropdown-header strong {
    font-size: 14px;
    color: #222;
}
.dropdown-header span {
    font-size: 11px;
    color: #777;
    margin-top: 2px;
}

.user-dropdown-card hr {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}
.dropdown-item:hover, .dropdown-item.active {
    background: rgba(0, 0, 0, 0.04);
    color: #000;
}
.dropdown-item.active {
    background: rgba(202, 82, 31, 0.08);
    color: var(--cor-primaria);
}
.dropdown-item.nav-sair {
    color: var(--cor-negativo);
}
.dropdown-item.nav-sair:hover {
    background: rgba(214, 42, 7, 0.06);
}

/* Botão Toggle Mobile */
.navbar-toggle-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
}
.navbar-toggle-btn .bar {
    width: 100%;
    height: 2.5px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hamburguer Animação para X */
.navbar-toggle-btn.open .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.navbar-toggle-btn.open .bar:nth-child(2) {
    opacity: 0;
}
.navbar-toggle-btn.open .bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* Menu Mobile Dropdown */
.navbar-mobile-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.navbar-mobile-menu.show {
    max-height: 350px;
    padding: 10px 20px 20px;
}

.mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-link:hover, .mobile-link.active {
    background: rgba(0, 0, 0, 0.04);
    color: var(--cor-primaria);
}

.mobile-link.active {
    background: rgba(202, 82, 31, 0.08);
}

.mobile-divider {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin: 10px 0;
}

.mobile-sair {
    color: var(--cor-negativo) !important;
}

/* ==========================================================================
   RESPONSIVIDADE (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 768px) {
    body.com-navbar {
        padding-top: 85px !important;
    }

    .navbar-container {
        border-radius: 25px;
        top: 10px;
    }
    
    .navbar-links, .navbar-user-menu {
        display: none; /* Esconde menu comum de desktop */
    }
    
    .navbar-toggle-btn {
        display: flex; /* Exibe o botão hamburguer */
    }
    
    .navbar-mobile-menu {
        display: flex; /* Habilita container mobile */
    }
}

/* Estilo da Logo na Navbar */
.navbar-logo {
    height: 38px;
    max-height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}
.navbar-brand:hover .navbar-logo {
    transform: scale(1.04);
}