/* ── Acordeón raíz ── */
#accordionTransparencia .card {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#accordionTransparencia .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#accordionTransparencia .btn-link {
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: #003A6B;
    text-decoration: none;
}

#accordionTransparencia .btn-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

#accordionTransparencia .btn-link:focus {
    box-shadow: none;
}

#accordionTransparencia .trans-root-chevron {
    transition: transform 0.25s ease;
    font-size: 0.875rem;
}

#accordionTransparencia .btn-link:not(.collapsed) .trans-root-chevron {
    transform: rotate(180deg);
}

#accordionTransparencia .direct-link {
    display: flex;
    align-items: center;
}

#accordionTransparencia .direct-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

/* ── Cuerpo de sección ── */
.transparencia-section-body {
    padding: 1.25rem;
    background: #fff;
}

.transparencia-search-box {
    position: relative;
    margin-bottom: 1.25rem;
}

.transparencia-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.transparencia-search-box .form-control {
    padding-left: 2.4rem;
    border-radius: 0.35rem;
}

.transparencia-no-results {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.trans-tree-lazy-placeholder,
.trans-tree-lazy-loading {
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* ── Árbol jerárquico ── */
.trans-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.trans-tree-item {
    margin-bottom: 0.4rem;
}

.trans-tree-line {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.trans-tree-body {
    flex: 1;
    min-width: 0;
}

.trans-tree-collapse-inner > .trans-tree-list {
    margin-top: 0.5rem;
    padding-left: 0.65rem;
    border-left: 2px solid #d8e2ec;
}

.trans-tree-num {
    flex-shrink: 0;
    min-width: 2.1rem;
    padding: 0.15rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    color: #003A6B;
    background: #fff;
    border: 1px solid #b8c9db;
    border-radius: 0.25rem;
    line-height: 1.3;
    margin-top: 0.5rem;
    white-space: nowrap;
}

.trans-tree-item--branch > .trans-tree-line > .trans-tree-num {
    margin-top: 0.55rem;
}

.trans-tree-item--branch .trans-tree-toggle {
    margin-top: 0;
}

/* ── Grupos colapsables ── */
.trans-tree-group {
    width: 100%;
}

.trans-tree-heading {
    padding: 0.35rem 0.55rem;
    border-left: 3px solid #003A6B;
    background: #f8f9fa;
    border-radius: 0 0.25rem 0.25rem 0;
}

.trans-tree-heading .trans-tree-num {
    margin-top: 0.15rem;
}

.trans-tree-heading .trans-tree-heading-text {
    flex: 1;
    min-width: 0;
    padding-top: 0.35rem;
}

.trans-tree-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    text-align: left;
    background: #f0f4f8;
    border: 1px solid #d0d9e4;
    border-radius: 0.3rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.925rem;
    font-weight: 600;
    color: #003A6B;
    cursor: pointer;
    transition: background 0.15s;
}

.trans-tree-toggle:hover {
    background: #e4ecf4;
}

.trans-tree-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 58, 107, 0.25);
}

.trans-tree-toggle-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.trans-tree-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.trans-tree-count {
    font-size: 0.7rem;
    font-weight: 500;
    color: #6c757d;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 1rem;
    padding: 0.1rem 0.45rem;
    white-space: nowrap;
}

.trans-tree-chevron {
    font-size: 0.7rem;
    color: #6c757d;
    transition: transform 0.25s ease;
}

.trans-tree-toggle:not(.collapsed) .trans-tree-chevron {
    transform: rotate(180deg);
}

.trans-tree-collapse-inner {
    padding: 0.55rem 0 0.15rem 0;
}

/* ── Hojas: documentos, enlaces y encabezados ── */
.trans-tree-item--leaf {
    padding-left: 0;
}

.trans-tree-heading-text {
    font-weight: 700;
    font-size: 0.9rem;
    color: #212529;
}

.trans-tree-resource {
    padding: 0.45rem 0.55rem;
    border-radius: 0.3rem;
    background: #fff;
    border: 1px solid #eef1f4;
    transition: background 0.15s, border-color 0.15s;
}

.trans-tree-resource:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.trans-tree-link {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #003A6B;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.9rem;
}

.trans-tree-link:hover {
    color: #00509e;
    text-decoration: none;
}

.trans-tree-link:hover .trans-tree-link-text {
    text-decoration: underline;
}

.trans-tree-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
}

.trans-icon-pdf { color: #c0392b; }
.trans-icon-word { color: #2b579a; }
.trans-icon-excel { color: #217346; }
.trans-icon-ppt { color: #d24726; }
.trans-icon-archive { color: #e67e22; }
.trans-icon-txt { color: #6c757d; }
.trans-icon-image { color: #8e44ad; }
.trans-icon-generic { color: #6c757d; }

.trans-tree-link-item .trans-tree-icon {
    color: #17a2b8;
}

.trans-tree-link-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.trans-tree-ext-label {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    background: #eef1f4;
    border-radius: 0.2rem;
    vertical-align: middle;
    text-decoration: none !important;
}

.trans-tree-date {
    display: block;
    margin-top: 0.2rem;
    margin-left: 1.6rem;
    font-size: 0.78rem;
    color: #6c757d;
}

.trans-tree-desc {
    margin: 0.25rem 0 0 1.6rem;
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.4;
}

/* ── Búsqueda ── */
.trans-tree-item.is-hidden {
    display: none;
}

.trans-tree-body.is-filter-open .collapse {
    display: block !important;
}

.trans-tree-body.is-filter-open .trans-tree-toggle {
    background: #e4ecf4;
}

.trans-tree-body.is-filter-open .trans-tree-toggle.collapsed .trans-tree-chevron {
    transform: rotate(180deg);
}

/* ── Responsive ── */
@media (max-width: 575.98px) {
    .trans-tree-count {
        display: none;
    }

    .trans-tree-num {
        min-width: 1.85rem;
        font-size: 0.68rem;
    }

    .transparencia-section-body {
        padding: 1rem;
    }
}
