/* =========================================
   1. RESET E NAVBAR (Padrão)
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: #f8f9fa; color: #1e293b; overflow-x: hidden; }

/* Navbar */
.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; width: auto; object-fit: contain; filter: brightness(0) invert(1); display: block; cursor: pointer; }
.nav-links { list-style: none; display: flex; gap: 30px; }
.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: #ffffff; }
.nav-right { display: flex; align-items: center; gap: 20px; }
.user-profile { display: flex; align-items: center; gap: 12px; text-align: right; border-right: 1px solid rgba(255,255,255,0.2); padding-right: 20px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); object-fit: cover; }
.user-name { color: white; font-size: 0.85rem; font-weight: 600; display: block; }
.user-email { color: #94a3b8; font-size: 0.75rem; display: block; }
.btn-logout { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; transition: 0.2s; }
.btn-logout:hover { background: rgba(255,255,255,0.1); border-color: white; }

/* =========================================
   2. LAYOUT GERAL
   ========================================= */
.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-size: 0.9rem; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: background 0.2s;
    box-shadow: 0 4px 6px rgba(15, 77, 58, 0.2);
}
.btn-primary:hover { background-color: #0a3528; }

/* =========================================
   3. LISTA DE RDOs
   ========================================= */
.rdo-list { display: flex; flex-direction: column; gap: 15px; }

.rdo-item {
    background: white; border: 1px solid #e2e8f0; border-radius: 10px;
    overflow: hidden; transition: all 0.2s ease;
}
.rdo-item:hover { border-color: #cbd5e1; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.rdo-item.active { border-color: #0F4D3A; }

/* HEADER DO ITEM (RESUMO) */
.rdo-summary {
    padding: 20px 25px; cursor: pointer; background: white;
    display: grid; grid-template-columns: 2fr 1fr 1fr auto; 
    align-items: center; gap: 20px;
}

.col-work { display: flex; flex-direction: column; }
.col-work strong { color: #1e293b; font-size: 1rem; margin-bottom: 2px; }
.rdo-id { font-size: 0.75rem; color: #94a3b8; font-family: monospace; }

.col-date { display: flex; align-items: center; gap: 8px; color: #475569; font-size: 0.9rem; }
.col-date i { color: #0F4D3A; font-size: 1.1rem; }

.col-status { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: #64748b; }
.badge-practicable {
    display: inline-block; padding: 2px 10px; border-radius: 4px;
    font-size: 0.75rem; font-weight: 700; width: fit-content; text-transform: uppercase;
}
.badge-practicable.yes { background: #dcfce7; color: #166534; }
.badge-practicable.no { background: #fee2e2; color: #991b1b; }

.col-actions { display: flex; align-items: center; gap: 15px; }
.arrow-icon { color: #cbd5e1; transition: transform 0.3s; font-size: 1.2rem; }
.rdo-item.active .arrow-icon { transform: rotate(180deg); color: #0F4D3A; }

/* Botão PDF */
.btn-pdf {
    background: white; border: 1px solid #e2e8f0; color: #dc2626; /* Vermelho PDF */
    padding: 6px 12px; border-radius: 6px; cursor: pointer;
    font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 6px;
    transition: 0.2s;
}
.btn-pdf:hover { background: #fef2f2; border-color: #dc2626; }

/* =========================================
   4. DETALHES INTERNOS (ESTILO RELATÓRIO)
   ========================================= */
.rdo-details {
    max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out;
    background-color: #f8fafc; border-top: 1px solid #f1f5f9;
}
.details-inner { padding: 30px; }

/* Títulos das Seções Internas */
.detail-title {
    font-size: 1rem; color: #0F4D3A; margin-bottom: 15px;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 2px solid #e2e8f0; padding-bottom: 8px;
}
.detail-title i { font-size: 1.2rem; }

.divider { border: 0; border-top: 1px solid #e2e8f0; margin: 25px 0; }

/* Grid de Informações Gerais */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.info-box { background: white; padding: 15px; border-radius: 8px; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 5px; }
.info-box .label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.info-box .value { font-size: 1rem; font-weight: 600; color: #1e293b; display: flex; align-items: center; gap: 6px; }
.info-box .value.success { color: #166534; }

/* Grid Dupla (Atividades e Ocorrências / Materiais e Equipamentos) */
.detail-grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

/* Listas */
.activity-list { list-style: none; padding-left: 0; }
.activity-list li {
    padding: 8px 0; border-bottom: 1px dashed #e2e8f0; color: #334155; font-size: 0.95rem;
    position: relative; padding-left: 20px;
}
.activity-list li::before {
    content: "•"; color: #0F4D3A; font-weight: bold; position: absolute; left: 0;
}
.text-muted { color: #94a3b8; font-style: italic; }

/* Equipe (Tags) */
.team-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.team-member {
    background: white; border: 1px solid #e2e8f0; padding: 8px 12px; border-radius: 6px;
    font-size: 0.9rem; display: flex; flex-direction: column;
}
.team-member strong { color: #1e293b; font-size: 0.9rem; }
.team-member span { font-size: 0.75rem; color: #64748b; margin-top: 2px; }

/* Tabela Simples (Materiais) */
.simple-table { width: 100%; border-collapse: collapse; background: white; font-size: 0.9rem; }
.simple-table th { text-align: left; padding: 10px; background: #f1f5f9; color: #475569; font-weight: 600; font-size: 0.8rem; }
.simple-table td { padding: 10px; border-bottom: 1px solid #e2e8f0; color: #334155; }
.simple-table tr:last-child td { border-bottom: none; }

/* Lista de Equipamentos */
.equip-list { list-style: none; }
.equip-list li {
    display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #e2e8f0; font-size: 0.9rem;
}
.equip-list li strong { color: #0F4D3A; background: #e6f4ea; padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; }

/* Galeria */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.gallery-item { position: relative; border-radius: 8px; overflow: hidden; height: 120px; border: 1px solid #e2e8f0; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item span {
    position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.7);
    color: white; font-size: 0.7rem; padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Responsividade */
@media (max-width: 900px) {
    .navbar { padding: 0 20px; }
    .nav-links, .user-info { display: none; }
    .user-profile { border: none; padding-right: 0; }
    
    .rdo-summary { grid-template-columns: 1fr auto; gap: 10px; }
    .col-status, .col-date { display: none; } /* Esconde colunas menos criticas no mobile */
    .detail-grid-row { grid-template-columns: 1fr; gap: 20px; }
}
/* Botão de Perfil (Destaque) */
.btn-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    
    /* Estilo Diferenciado (Cápsula Translúcida) */
    background-color: rgba(255, 255, 255, 0.15); 
    color: white;
    text-decoration: none;
    
    padding: 8px 16px;
    border-radius: 20px; /* Bordas bem redondas */
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent; /* Para evitar pulo no hover */
}

/* Efeito Hover: Fica branco com texto verde */
.btn-profile:hover {
    background-color: #ffffff;
    color: #0F4D3A; /* Verde da marca */
    transform: translateY(-1px); /* Leve subida */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Ajuste no botão de Sair para ficar harmônico ao lado */
.btn-logout {
    /* Se quiser, pode deixar o botão sair apenas como ícone para economizar espaço */
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}

.btn-logout:hover {
    border-color: #fca5a5; /* Vermelho claro ao passar o mouse */
    color: #fca5a5;
    background: rgba(255, 0, 0, 0.05);
}

/* Responsividade: No mobile, esconde o texto 'Minha Conta' e deixa só o ícone */
@media (max-width: 900px) {
    .btn-profile {
        font-size: 0; /* Esconde o texto */
        padding: 10px; /* Ajusta padding para ficar quadrado/redondo */
        border-radius: 50%;
        width: 38px;
        height: 38px;
        justify-content: center;
    }
    
    .btn-profile i {
        font-size: 1.2rem; /* Aumenta o ícone */
    }
}
/* ============================================================
   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);
    }
}