/* Directorio de servidores públicos — rediseño nov-2026 con el estilo de la portada de InnVimanet.
   Clases dir-*; el CSS anterior (employee_styles.css) sigue para la ficha y el organigrama. */
.dir { background: #EEF4F7; }
.dir-contenedor { max-width: 1360px; padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; color: #13212E; }

/* Encabezado */
.dir-hero { border-radius: 32px; padding: 30px 34px; background: linear-gradient(135deg, #A3D3E5 0%, #E3F2F8 55%, #D0E8C7 100%); }
.dir-hero-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.dir-titulo { margin: 0; font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; color: #13212E; }
.dir-sub { margin: 6px 0 0; color: #3A4753; font-size: 1rem; }
.dir-buscar { flex: 0 1 520px; display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 6px 0 18px;
              border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(11, 46, 79, .10); }
.dir-buscar .fa { color: #0A6E91; }
.dir-buscar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; color: #13212E; }
.dir-buscar button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: #0A6E91; color: #fff; font-weight: 600; }
.dir-buscar button:hover { background: #085A77; }
.dir-buscar:focus-within { box-shadow: 0 0 0 3px rgba(10, 110, 145, .35); }
.dir-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 20px; }
.dir-filtro { display: flex; flex-direction: column; gap: 4px; flex: 0 1 300px; min-width: 200px; margin: 0; }
.dir-filtro span { font-size: .82rem; font-weight: 600; color: #3A4753; }
.dir-filtro .form-select { min-height: 44px; border: 0; border-radius: 999px; padding-left: 16px; background-color: #fff; font-weight: 600; color: #13212E; }
.dir-filtro .form-select:focus { box-shadow: 0 0 0 3px rgba(10, 110, 145, .35); }
.dir-organigrama { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
                   border-radius: 999px; background: rgba(255, 255, 255, .75); color: #0A5F8E !important; font-weight: 600; text-decoration: none !important; }
.dir-organigrama:hover { background: #fff; }

.dir-conteo { margin: 0; color: #3A4753; }
.dir-vacio { display: flex; align-items: center; gap: 12px; padding: 22px; border-radius: 24px; background: #fff; color: #3A4753; }
.dir-vacio .fa { font-size: 1.6rem; color: #0A6E91; }
.dir-vacio p { margin: 0; }

/* Tarjetas */
.dir-tarjetas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dir-tarjeta { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 24px; background: #fff;
               box-shadow: 0 10px 30px rgba(11, 46, 79, .06); min-width: 0; }
.dir-tarjeta-cab { display: flex; align-items: center; gap: 14px; }
.dir-foto img { display: block; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #E4F4F9; }
.dir-quien { min-width: 0; display: flex; flex-direction: column; }
.dir-nombre { font-weight: 700; font-size: 1rem; line-height: 1.3; color: #13212E !important; text-decoration: none !important; }
.dir-nombre:hover { color: #0A5F8E !important; }
.dir-cargo { color: #3A4753; font-size: .88rem; text-transform: none; }
.dir-tipo { margin-left: auto; align-self: flex-start; flex: none; padding: 3px 10px; border-radius: 999px; background: #E8F6EE; color: #1B7A45; font-size: .74rem; font-weight: 700; }
.dir-tipo--contratista { background: #FDF1E7; color: #B4530F; }
.dir-dependencia { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: #F4F8FA; }
.dir-dependencia small { color: #56636F; font-weight: 600; font-size: .76rem; }
.dir-dependencia b { font-size: .92rem; line-height: 1.3; }
.dir-dependencia span { color: #56636F; font-size: .8rem; line-height: 1.3; }
.dir-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.dir-accion { flex: 1 1 auto; display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
              border-radius: 12px; font-size: .86rem; font-weight: 600; text-decoration: none !important; transition: filter .2s; }
.dir-accion:hover { filter: brightness(.96); }
.dir-accion:focus-visible { outline: 3px solid #0A6E91; outline-offset: 2px; }
.dir-accion--tel { background: #EAF2FD; color: #1F5FBF !important; }
.dir-accion--teams { background: #F2EDFC; color: #5B3FC4 !important; }
.dir-accion--correo { background: #E4F4F9; color: #0A6E91 !important; }
.dir-pie { margin: auto 0 0; color: #56636F; font-size: .8rem; overflow-wrap: anywhere; }

.dir-paginas { display: flex; justify-content: center; }

@media (max-width: 1100px) { .dir-tarjetas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
    .dir-hero { padding: 22px 18px; border-radius: 24px; }
    .dir-tarjetas { grid-template-columns: 1fr; }
    .dir-organigrama { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .dir-accion { transition: none; } }

/* ===== Organigrama (/empleados/estructura) v4: árbol institucional =====
   Dirección General arriba, oficinas como staff a ambos lados del tronco, y en la fila de abajo
   Secretaría General y direcciones con sus grupos. Solo colores sólidos de la paleta, sin íconos. */
.org4 { --org-linea: #A9B6C2; --org-borde: #CBD5DE; --org-texto: #1A2733; --org-suave: #4A5560;
        background: #F4F6F8; }
.org4-contenedor { max-width: 1440px; padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 20px; color: var(--org-texto); }
.org4 a:focus-visible, .org4 summary:focus-visible { outline: 2px solid #139EC8; outline-offset: 2px; }

.org4-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.org4-volver { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-weight: 600; color: #0B6284; text-decoration: none; }
.org4-volver:hover { text-decoration: underline; }
.org4-titulo { margin: 0; font-size: 2rem; font-weight: 700; color: #003366 !important; }
.org4-sub { margin: 4px 0 0; color: var(--org-suave); }
.org4-buscar { flex: 0 1 420px; display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 0; padding: 0 14px;
               border: 1px solid var(--org-borde); border-radius: 8px; background: #FDFEFE; }
.org4-buscar .fa { color: #0B6284; }
.org4-buscar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; color: var(--org-texto); }
.org4-buscar:focus-within { border-color: #139EC8; box-shadow: 0 0 0 3px rgba(19, 158, 200, .2); }

.org4-arbol { padding: 32px 24px 28px; border: 1px solid #DEE2E6; border-radius: 8px; background: #FDFEFE; }

/* Nivel 1 */
.org4-cima { display: flex; justify-content: center; position: relative; padding-bottom: 20px; }
.org4-cima::after { content: ""; position: absolute; left: 50%; bottom: 0; height: 20px; border-left: 1px solid var(--org-linea); }
.org4-dg { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 300px; padding: 14px 28px; border-radius: 8px;
           background: #003366; color: #F4F7FA !important; text-align: center; text-decoration: none !important; }
.org4-dg b { font-size: 1.1rem; font-weight: 600; }
.org4-dg small { color: #C8D6E3; }
.org4-dg:hover { background: #0B4A7A; }

/* Staff: oficinas unidas al tronco con una línea horizontal */
.org4-staff { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); }
.org4-tronco { background: var(--org-linea); }
.org4-staff-lado { display: flex; flex-direction: column; gap: 10px; padding-block: 10px; }
.org4-izq { align-items: flex-end; padding-right: 28px; }
.org4-der { align-items: flex-start; padding-left: 28px; }
.org4-caja { position: relative; display: block; width: 100%; max-width: 380px; padding: 10px 14px; border: 1px solid var(--org-borde);
             border-radius: 6px; background: #FDFEFE; color: var(--org-texto) !important; text-decoration: none !important; }
.org4-caja::after { content: ""; position: absolute; top: 1.45rem; width: 28px; border-top: 1px solid var(--org-linea); }
.org4-izq .org4-caja::after { right: -29px; }
.org4-der .org4-caja::after { left: -29px; }
.org4-caja b { display: block; font-size: .92rem; font-weight: 600; line-height: 1.3; }
.org4-caja small { display: block; margin-top: 2px; color: var(--org-suave); font-size: .8rem; }
a.org4-caja:hover, .org4-plegable > summary:hover b { color: #0B6284 !important; }
a.org4-caja:hover { border-color: #139EC8; }
.org4-plegable > summary { list-style: none; cursor: pointer; position: relative; padding-right: 20px; }
.org4-plegable > summary::-webkit-details-marker { display: none; }
.org4-plegable > summary::after { content: "\f107"; font-family: FontAwesome; position: absolute; right: 0; top: 0; color: #0B6284; }
.org4-plegable[open] > summary::after { content: "\f106"; }
.org4-plegable[open] { border-color: #139EC8; }
.org4-plegable > .org4-grupos { margin-top: 10px; }
.org4-ver { display: inline-block; margin-top: 8px; font-size: .84rem; font-weight: 600; color: #0B6284; }

/* Nivel 2: barra horizontal que reparte a cada columna */
.org4-desplaza { overflow-x: auto; }
.org4-fila { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr);
             margin: 0; padding: 20px 0 4px; list-style: none; }
.org4-fila::before { content: ""; position: absolute; left: 50%; top: 0; height: 20px; border-left: 1px solid var(--org-linea); }
.org4-col { position: relative; padding: 20px 6px 0; }
.org4-col::before { content: ""; position: absolute; left: 50%; top: 0; height: 20px; border-left: 1px solid var(--org-linea); }
.org4-col::after { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--org-linea); }
.org4-col:first-child::after { left: 50%; }
.org4-col:last-child::after { right: 50%; }
.org4-col:only-child::after { display: none; }
.org4-jefe { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 8.6rem; padding: 12px; border: 1px solid #A8D3E3;
             border-radius: 6px; background: #E1F2F8; color: #0B4F6C !important; text-align: center; text-decoration: none !important; }
.org4-jefe b { font-size: .92rem; font-weight: 600; line-height: 1.3; }
.org4-jefe small { color: #2F5F73; font-size: .78rem; }
.org4-jefe:hover { border-color: #139EC8; background: #D3ECF5; }

/* Grupos: lista en árbol con conectores finos */
.org4-grupos { list-style: none; margin: 0; padding: 0; }
.org4-col > .org4-grupos { padding: 12px 0 0 10px; }
.org4-grupos .org4-grupos { padding-left: 4px; }
.org4-nodo { position: relative; padding: 4px 0 4px 18px; line-height: 1.3; }
.org4-nodo::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--org-linea); }
.org4-nodo:last-child::before { bottom: auto; height: 1.05rem; }
.org4-nodo::after { content: ""; position: absolute; left: 0; top: 1.05rem; width: 12px; border-top: 1px solid var(--org-linea); }
.org4-nodo[hidden] { display: none; }
.org4-nodo-nombre { font-size: .84rem; font-weight: 500; color: var(--org-texto); text-decoration: none; }
.org4-rama > .org4-grupos > .org4-nodo > .org4-nodo-nombre, .org4-rama > .org4-grupos > .org4-nodo > details > summary > .org4-nodo-nombre { font-weight: 600; }
a.org4-nodo-nombre:hover { color: #0B6284; text-decoration: underline; }
.org4-n { margin-left: 4px; color: var(--org-suave); font-size: .74rem; font-variant-numeric: tabular-nums; }

/* Búsqueda */
.org4-coincide > .org4-nodo-nombre, .org4-coincide > details > summary > .org4-nodo-nombre, .org4-coincide > b, .org4-coincide > summary > b, .org4-col.org4-coincide .org4-jefe b {
    background: #EDF4DD; color: #3E5416; border-radius: 3px; box-shadow: 0 0 0 2px #EDF4DD; }
.org4 [hidden] { display: none !important; }
.org4-vacio { margin: 16px 0 0; text-align: center; color: var(--org-suave); }

@media (max-width: 991px) {
    .org4-arbol { padding: 20px 14px; }
    .org4-dg { min-width: 0; width: 100%; }
    .org4-staff { grid-template-columns: 1fr; }
    .org4-tronco, .org4-caja::after, .org4-fila::before, .org4-col::before, .org4-col::after { display: none; }
    .org4-izq, .org4-der { align-items: stretch; padding: 0 0 10px; }
    .org4-caja { max-width: none; }
    .org4-fila { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; padding-top: 10px; }
    .org4-col { padding: 0; }
    .org4-jefe { min-height: 0; }
    .org4-cima { padding-bottom: 12px; }
    .org4-cima::after { display: none; }
}
@media (max-width: 600px) { .org4-fila { grid-template-columns: 1fr; } .org4-titulo { font-size: 1.6rem; } }

/* Plegado: direcciones, oficinas y grupos con subgrupos */
.org4-acciones { display: flex; align-items: center; gap: 10px; flex: 0 1 560px; flex-wrap: wrap; }
.org4-acciones .org4-buscar { flex: 1 1 280px; }
.org4-todo { min-height: 46px; padding: 0 16px; border: 1px solid var(--org-borde); border-radius: 8px; background: #FDFEFE;
             color: #0B6284; font-weight: 600; white-space: nowrap; cursor: pointer; }
.org4-todo:hover { border-color: #139EC8; }
.org4-todo:focus-visible { outline: 2px solid #139EC8; outline-offset: 2px; }
.org4-rama > summary { list-style: none; cursor: pointer; position: relative; }
.org4-rama > summary::-webkit-details-marker, .org4-sub-rama > summary::-webkit-details-marker { display: none; }
.org4-rama > summary::after { content: "\f107"; font-family: FontAwesome; color: #0B6284; font-size: 1rem; line-height: 1; }
.org4-rama[open] > summary::after { content: "\f106"; }
.org4-rama[open] > summary { border-color: #139EC8; }
.org4-rama > .org4-ver { display: block; margin: 8px 0 0 10px; }
.org4-rama > .org4-grupos { padding: 8px 0 0 10px; }
.org4-sub-rama > summary { list-style: none; cursor: pointer; }
.org4-sub-rama > summary::after { content: "\f107"; font-family: FontAwesome; margin-left: 6px; color: #0B6284; font-size: .85rem; }
.org4-sub-rama[open] > summary::after { content: "\f106"; }
