body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    margin: 0;
}

.title-estructura {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 600;
    font-size: 2.5rem;
}

.intro-text {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 1.1rem;
}

.directorio-link {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
}

.directorio-link:hover {
    text-decoration: underline;
}

/* Estilos del filtro */
.filter-container {
    margin-bottom: 30px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #7D2735;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
}

.clear-search {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.clear-search:hover {
    background-color: #e9ecef;
}

.search-results-info {
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

/* Estilos del árbol */
.tree-view {
    margin-top: 20px;
}

.tree-view ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tree-view ul ul {
    padding-left: 30px;
    margin-top: 10px;
}

.tree-view li {
    margin: 8px 0;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #7D2735;
    transition: all 0.3s ease;
    position: relative;
}

.tree-item:hover {
    background: #e8f4f8;
    transform: translateX(5px);
}

.tree-item.level-0 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border-left: 4px solid #5a67d8;
}

.tree-item.has-children {
    background:rgb(207, 170, 181);
    border-left-color: #891435;
}

.toggle-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 5px;
    margin-right: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 14px;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.toggle-btn i {
    transition: transform 0.3s ease;
}

.toggle-btn.expanded i {
    transform: rotate(180deg);
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cargo {
    font-weight: 600;
    color:rgb(0, 0, 0);
    font-size: 14px;
}

.tree-item.level-0 .cargo {
    color: #000;
    font-size: 16px;
}

.nombre {
    color: #7f8c8d;
    font-size: 13px;
    font-style: italic;
}

.tree-item.level-0 .nombre {
    color: rgba(255, 255, 255, 0.9);
}

.status {
    color: #e74c3c;
    font-size: 12px;
    font-style: italic;
    font-weight: 500;
}

/* Estilos para resultados de búsqueda */
.tree-item.search-match {
    background:rgb(228, 207, 137);
    border-left-color: #bc955b;
    animation: highlight 0.5s ease;
}

.tree-item.search-match .cargo,
.tree-item.search-match .nombre {
    color: #856404;
}

.highlight {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

@keyframes highlight {
    from {
        background: #ffeb3b;
    }

    to {
        background: #fff3cd;
    }
}

.tree-item.hidden {
    display: none;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #bbb;
}

@media (max-width: 768px) {

    .title-estructura {
        font-size: 2rem;
    }

    .tree-view ul ul {
        padding-left: 20px;
    }

    .item-content {
        font-size: 13px;
    }
}
