/* ============================================================================
 * mapa_modal.css — Estilos del modal de gestión documental (Mapa de Procesos)
 * Autocontenido: no depende de Bootstrap ni del tema del website.
 * ==========================================================================*/

.mdocs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(3px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: 'Segoe UI', Arial, sans-serif;
}
.mdocs-overlay.mdocs-open { display: flex; }

.mdocs-panel {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 880px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    animation: mdocs-pop 0.22s ease-out;
}
@keyframes mdocs-pop {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Cabecera ── */
.mdocs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a5f9e, #2b7bc8);
    color: #fff;
}
.mdocs-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mdocs-head-icon { font-size: 22px; flex-shrink: 0; }
.mdocs-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.mdocs-sub { font-size: 11.5px; opacity: 0.85; margin-top: 2px; }
.mdocs-close {
    background: rgba(255, 255, 255, 0.16);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.mdocs-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ── Barra de búsqueda ── */
.mdocs-searchbar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.mdocs-search-icon { font-size: 14px; opacity: 0.65; }
.mdocs-search {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    font-family: inherit;
    color: #1e293b;
    padding: 3px 0;
}
.mdocs-search::placeholder { color: #94a3b8; }
.mdocs-search-clear {
    border: none;
    background: #e2e8f0;
    color: #475569;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.mdocs-search-clear:hover { background: #cbd5e1; }

/* ── Cuerpo ── */
.mdocs-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 16px;
    background: #fff;
}
.mdocs-loading, .mdocs-empty {
    padding: 26px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

/* ── Pilares ── */
.mdocs-pilar { margin-bottom: 12px; border-radius: 9px; overflow: hidden; border: 1px solid #e5eaf1; }
.mdocs-pilar-head {
    padding: 9px 13px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
}
.mdocs-pilar-ico { font-size: 13px; }
.mdocs-pilar-estrategico .mdocs-pilar-head { background: #3a7fc1; }
.mdocs-pilar-misional    .mdocs-pilar-head { background: #388e3c; }
.mdocs-pilar-apoyo       .mdocs-pilar-head { background: #f0a020; color: #3d2a00; }
.mdocs-pilar-evaluacion  .mdocs-pilar-head { background: #e67e22; }
.mdocs-pilar-body { background: #fff; }

/* ── Carpetas ── */
.mdocs-folder { border-bottom: 1px solid #f1f5f9; }
.mdocs-folder:last-child { border-bottom: none; }
.mdocs-folder-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    background: #fbfcfe;
    user-select: none;
}
.mdocs-folder-head:hover { background: #eef4fb; }
.mdocs-arrow { font-size: 10px; color: #7b8a9c; width: 12px; text-align: center; flex-shrink: 0; }
.mdocs-folder-ico { font-size: 14px; flex-shrink: 0; }
.mdocs-folder-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mdocs-subfolder > .mdocs-folder-head { background: #fdfefe; }
.mdocs-subfolder > .mdocs-folder-head .mdocs-folder-name { font-weight: 500; font-size: 12.5px; }
.mdocs-badges { display: flex; gap: 4px; flex-shrink: 0; }
.mdocs-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9px;
}
.mdocs-badge-c { background: #e3ecff; color: #1a56db; }
.mdocs-badge-d { background: #fef3c7; color: #92400e; }
.mdocs-badge-vacio { font-size: 10px; color: #cbd5e1; font-style: italic; }
.mdocs-folder-body { display: block; padding-left: 6px; }
.mdocs-folder.mdocs-collapsed > .mdocs-folder-body { display: none !important; }

/* ── Documentos ── */
.mdocs-doc {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 0;
    border-top: 1px solid #f8fafc;
    font-size: 12.5px;
}
.mdocs-doc:hover { background: #f8faff; }
.mdocs-doc-ico { font-size: 12px; flex-shrink: 0; }
.mdocs-doc-name {
    flex: 1;
    min-width: 0;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mdocs-v {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f0fdf4;
    color: #15803d;
    flex-shrink: 0;
}
.mdocs-v-mayor { background: #fff7ed; color: #c2410c; }
.mdocs-doc-tipo {
    font-size: 10.5px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mdocs-doc-acciones { display: flex; gap: 4px; flex-shrink: 0; }
.mdocs-doc-btn {
    font-size: 10.5px;
    padding: 3px 9px;
    border-radius: 5px;
    border: 1px solid #dbe3ec;
    background: #fff;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
}
.mdocs-doc-btn:hover { background: #f1f5f9; }
.mdocs-doc-ver { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.mdocs-doc-ver:hover { background: #1558b8; }
.mdocs-doc-evid { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; font-weight: 600; }
.mdocs-doc-evid:hover { background: #bae6fd; }

/* ── Pie ── */
.mdocs-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 18px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 11px;
    color: #64748b;
}
.mdocs-status { font-weight: 600; }
.mdocs-hint { opacity: 0.8; }

/* ── Visor a pantalla completa ── */
.mdocs-visor {
    position: fixed;
    inset: 0;
    background: #0b0f14;
    z-index: 100001;
    display: none;
    flex-direction: column;
}
.mdocs-visor.mdocs-open { display: flex; }
.mdocs-visor-bar {
    height: 42px;
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    font-size: 13px;
    gap: 12px;
    flex-shrink: 0;
}
.mdocs-visor-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.mdocs-visor-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    padding: 5px 13px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
}
.mdocs-visor-close:hover { background: rgba(255, 255, 255, 0.34); }
.mdocs-visor-frame { flex: 1; width: 100%; border: none; background: #fff; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .mdocs-overlay { padding: 0; }
    .mdocs-panel { max-width: none; max-height: 100vh; height: 100vh; border-radius: 0; }
    .mdocs-doc-tipo { display: none; }
    .mdocs-hint { display: none; }
}
