* {
    box-sizing: border-box;
}

:root {
    --primary: #0060B1;
    --primary-dark: #004c8c;
    --secondary: #FF6500;
    --bg: #f4f7fa;
    --text: #333;
    --card-bg: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    margin: 0;
    padding: 20px;
    color: var(--text);

}

main {
    max-width: 1200px;
    margin: 0 auto 30px;
    border-radius: 15px;
    overflow: hidden;
}

main img {
    max-width: 100%;
}

/* HEADER */
header {
    max-width: 1200px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

footer {
    max-width: 1200px;
    padding-top: 20px;
    margin: 0 auto;
    text-align: center;

}

footer p {
    font-size: 0.8rem;
}

footer a {
    color: var(--secondary);
}

footer a:hover {
    color: var(--primary);
}

.logo-area h2 {
    margin: 0;
    color: var(--primary);
    cursor: pointer;
}

.search-container {
    flex-grow: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: 25px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    outline: none;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.btn-voltar {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-voltar:hover {
    background: var(--primary);
    color: white;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
}

/* MENU HIERÁRQUICO (TREE VIEW) */
.area-block {
    background: var(--primary);
    color: white;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.area-header {
    padding: 18px 25px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.area-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tree-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: none;
    background: var(--primary-dark);
}

.tree-item {
    color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tree-content {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.2s;
    cursor: pointer;
}

.tree-content:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tree-label {
    flex-grow: 0;
    padding: 4px 8px;
    border-radius: 4px;
    transition: 0.2s;
}

.tree-label:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--secondary);
    text-decoration: underline;
}

/* Níveis de Indentação */
.level-1 {
    background: rgba(0, 0, 0, 0.1);
    font-weight: 600;
    padding-left: 25px;
}

.level-2 .tree-content {
    padding-left: 40px;
    font-weight: 500;
    font-size: 1rem;
}

.level-3 .tree-content {
    padding-left: 60px;
    font-size: 0.95rem;
    opacity: 0.9;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.level-4 .tree-content {
    padding-left: 80px;
    font-size: 0.9rem;
    opacity: 0.8;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.tree-toggle-icon {
    padding: 5px 10px;
    border-radius: 4px;
    margin-left: auto;
}

.caret {
    transition: transform 0.2s;
    font-size: 0.8em;
    opacity: 0.7;
}

.caret-down {
    transform: rotate(180deg);
}

/* BREADCRUMBS */
.breadcrumb-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed transparent;
    transition: 0.2s;
}

.breadcrumb-link:hover {
    border-bottom-color: var(--primary);
    opacity: 0.8;
}

.breadcrumb-separator {
    color: #999;
    font-size: 0.8em;
    margin: 0 6px;
}

/* GRID DE CARDS */
.grid-funcionarios {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background-color: #f0f7ff;
    border-radius: 8px;
    margin-bottom: 15px;
}

.card-name {
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.card-role {
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
}

/* LIDERANÇA */
.leadership-wrapper h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leadership-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: #eef6fc;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #dae8f5;
    margin-bottom: 20px;
}

.leader-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 6px 12px 6px 6px;
    border-radius: 50px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    cursor: pointer;
    min-width: 160px;
    transition: 0.2s;
}

.leader-card:hover {
    transform: translateY(-2px);
    border-color: var(--secondary);
}

.leader-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}

.leader-info {
    display: flex;
    flex-direction: column;
}

.leader-name {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--primary);
}

.leader-role {
    font-size: 0.7rem;
    color: #666;
}

.arrow {
    color: #ccc;
    font-weight: bold;
    font-size: 0.9rem;
}

/* PERFIL DETALHADO */
.profile-view {
    background: white;
    border-radius: 20px;
    padding: 40px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.profile-img-lg {
    width: 280px;
    height: 280px;
    background: #f0f7ff;
    border-radius: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-info h2 {
    font-size: 2.2rem;
    color: var(--primary);
    margin: 0 0 15px 0;
    line-height: 1.1;
}

.info-line {
    margin: 6px 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-line strong {
    min-width: 60px;
    color: #555;
}

.bio-box {
    background: #f9f9f9;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid var(--secondary);
    line-height: 1.5;
    font-size: 0.95rem;
    color: #555;
    font-style: italic;
}

.btn-email {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    box-shadow: 0 4px 6px rgba(255, 101, 0, 0.2);
}

.btn-email:hover {
    background: #e65b00;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(255, 101, 0, 0.3);
}

/* SELOS (BADGES) */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.badge-time {
    background: #FFD700;
    color: #333;
}

.badge-cipa {
    background: #28a745;
    color: white;
}

.badge-brigada {
    background: #dc3545;
    color: white;
}

.badge-conselho {
    background: #fd7e14;
    color: white;
}

.badge-ninja {
    background: #f8f9fa;
    color: #555;
    border: 1px solid #ddd;
}

.badge-niver {
    background: linear-gradient(135deg, #ff6b6b, #845ef7);
    color: white;
}

@media (max-width: 768px) {
    .profile-view {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }

    .profile-img-lg {
        width: 100%;
        height: auto;
        max-width: 250px;
        margin: 0 auto 20px auto;
    }

    .leadership-container {
        flex-direction: column;
        align-items: stretch;
    }

    .arrow {
        transform: rotate(90deg);
        text-align: center;
        margin: -5px 0;
    }

    .info-line {
        justify-content: center;
    }

    .badges-container {
        justify-content: center;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 50px 0 20px 0;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.section-header h3 {
    color: var(--primary);
    margin: 0;
}


.btn-action {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    transition: 0.2s;
    text-decoration: none;
}

.btn-action:hover {
    background: var(--secondary);
    color: white;
}


@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

button.btn-email {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    display: none;
    animation: fadeIn 0.3s;
    z-index: 9999;
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}