/* REUTILIZANDO PADRÕES (Navbar, Reset, Layout) */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: #f8f9fa; color: #1e293b; overflow-x: hidden; }

/* NAVBAR (Mesmo CSS das outras telas) */
.navbar {
    background-color: #0F4D3A; height: 70px; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    position: sticky; top: 0; z-index: 1000;
}
.logo { height: 48px; filter: brightness(0) invert(1); }
.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-links a { text-decoration: none; color: #cbd5e1; font-weight: 500; font-size: 0.9rem; transition: 0.3s; }
.nav-links a.active, .nav-links a:hover { color: white; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.user-profile { display: flex; align-items: center; gap: 12px; text-align: right; padding-right: 24px; border-right: 1px solid rgba(255,255,255,0.15); }
.user-info { display: flex; flex-direction: column; justify-content: center; }
.user-name { color: white; font-weight: 600; font-size: 0.9rem; }
.user-email { color: #cbd5e1; font-size: 0.75rem; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.2); }
.btn-profile { background: rgba(255,255,255,0.15); color: white; padding: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; transition: 0.3s; }
.btn-profile:hover { background: white; color: #0F4D3A; }
.btn-logout { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white; padding: 8px 12px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; }
.btn-logout:hover { border-color: #fca5a5; color: #fca5a5; }

/* LAYOUT PRINCIPAL */
.dashboard-container { max-width: 1280px; margin: 0 auto; padding: 40px; }
.page-header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.section-title { font-size: 1.5rem; color: #0F4D3A; font-weight: 600; }
.btn-primary {
    background-color: #0F4D3A; color: white; border: none; padding: 10px 24px;
    border-radius: 8px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 6px rgba(15, 77, 58, 0.2); transition: 0.2s;
}
.btn-primary:hover { background-color: #0a3528; }

/* FILTROS */
.filters-bar {
    background: white; padding: 15px; border-radius: 10px; border: 1px solid #e2e8f0;
    display: flex; gap: 15px; margin-bottom: 30px; align-items: center;
}
.search-wrapper { flex: 1; position: relative; }
.search-wrapper i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.search-wrapper input {
    width: 100%; padding: 10px 10px 10px 35px; border: 1px solid #cbd5e1; border-radius: 6px; outline: none;
}
.filter-group { display: flex; gap: 10px; }
.filter-group select {
    padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: white; color: #334155; outline: none;
}

/* GRID DE EQUIPE */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

/* CARD DE COLABORADOR */
.team-card {
    background: white; border-radius: 12px; border: 1px solid #e2e8f0;
    padding: 25px; text-align: center; transition: all 0.2s;
    position: relative; overflow: hidden;
}
.team-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); border-color: #cbd5e1; }

/* Barra superior colorida do card (Opcional, dá um toque legal) */
.team-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px;
    background: #e2e8f0; /* Cor padrão */
}
.team-card.role-eng::before { background: #3b82f6; } /* Azul */
.team-card.role-mestre::before { background: #f59e0b; } /* Laranja */
.team-card.role-pedreiro::before { background: #10b981; } /* Verde */

.card-avatar {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    margin: 10px auto 15px; border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.card-name { font-size: 1.1rem; font-weight: 600; color: #1e293b; margin-bottom: 5px; }
.card-role {
    display: inline-block; padding: 4px 10px; border-radius: 15px;
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    margin-bottom: 15px; background: #f1f5f9; color: #64748b;
}

/* Cores específicas dos Badges */
.badge-eng { background: #dbeafe; color: #1e40af; }
.badge-mestre { background: #fef3c7; color: #92400e; }
.badge-pedreiro { background: #d1fae5; color: #065f46; }

.card-status { font-size: 0.8rem; color: #94a3b8; display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 20px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; }
.status-dot.active { background: #10b981; }
.status-dot.vacation { background: #f59e0b; }
.status-dot.inactive { background: #ef4444; }

.card-actions {
    display: flex; justify-content: center; gap: 10px; border-top: 1px solid #f1f5f9; padding-top: 15px;
}
.btn-icon-action {
    width: 32px; height: 32px; border-radius: 6px; border: 1px solid #e2e8f0;
    background: white; color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.btn-icon-action:hover { border-color: #0F4D3A; color: #0F4D3A; background: #f0fdf4; }

/* MODAL */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 77, 58, 0.2); backdrop-filter: blur(4px);
    z-index: 2000; display: flex; justify-content: center; align-items: center; opacity: 1; transition: 0.3s;
}
.hidden { display: none; }
.modal-box {
    background: white; width: 100%; max-width: 500px; border-radius: 12px; padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); border: 1px solid #dcfce7;
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 25px; }
.btn-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

/* Upload Avatar no Modal */
.avatar-upload-center {
    display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px;
}
.avatar-preview {
    width: 80px; height: 80px; background: #f1f5f9; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #cbd5e1;
}
.btn-upload-small {
    font-size: 0.8rem; color: #0F4D3A; font-weight: 600; cursor: pointer; text-decoration: underline;
}

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 0.85rem; color: #475569; margin-bottom: 5px; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; outline: none; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn-cancel { background: white; border: 1px solid #cbd5e1; padding: 8px 16px; border-radius: 6px; cursor: pointer; }
.btn-confirm { background: #0F4D3A; color: white; border: none; padding: 8px 20px; border-radius: 6px; cursor: pointer; }

/* Mobile */
@media (max-width: 900px) {
    .filters-bar { flex-direction: column; align-items: stretch; }
    .nav-links, .user-info { display: none; }
    .user-profile { padding-right: 0; border: none; }
}
.card-funcao {
    font-size: 0.85rem;
    color: #6366f1; /* Um azul/roxo para destacar do cargo */
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* ============================================================
   NAVBAR & MENU RESPONSIVO (COMPLETO)
   ============================================================ */

/* --- Estilos Base (Desktop) --- */
.navbar {
    background-color: #0F4D3A; /* Verde Marca */
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Esconde o controle do menu e o ícone no Desktop */
#menu-check, .menu-hamburguer {
    display: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: white;
}

/* --- Responsividade (Mobile: abaixo de 900px) --- */
@media (max-width: 900px) {
    .navbar {
        padding: 0 20px;
        justify-content: space-between;
    }

    /* Exibe o ícone de hambúrguer */
    .menu-hamburguer {
        display: block;
        color: white;
        font-size: 2rem;
        cursor: pointer;
        order: -1; /* Posiciona à esquerda do logo */
    }

    /* Menu Lateral (Drawer) */
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%; /* Escondido à esquerda */
        width: 280px;
        height: calc(100vh - 70px);
        background-color: #0F4D3A;
        flex-direction: column;
        gap: 5px; /* Espaçamento entre os blocos de link */
        padding-top: 30px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: 10px 0 25px rgba(0,0,0,0.3);
    }

    /* Itens do Menu Mobile */
    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        padding: 22px 35px; /* Espaço generoso para o clique */
        font-size: 1.1rem;
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.03);
        color: #cbd5e1;
    }

    /* Estado Ativo e Hover no Mobile */
    .nav-links a.active {
        background-color: rgba(255, 255, 255, 0.08);
        color: white;
        border-left: 6px solid #ffffff;
        padding-left: 29px; /* Ajuste para compensar a borda lateral */
    }

    .nav-links a:active {
        background-color: rgba(255, 255, 255, 0.15);
    }

    /* LOGICA DE ABERTURA: Quando o checkbox é marcado */
    #menu-check:checked ~ .nav-center .nav-links {
        left: 0; /* Desliza para dentro da tela */
    }

    /* Ajustes de interface mobile */
    .logo { height: 38px; }
    
    .nav-right {
        gap: 15px;
    }

    .btn-profile span, .user-info {
        display: none !important; /* Esconde textos para não quebrar a barra */
    }

    .btn-profile {
        padding: 10px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
    }
}