flowchart TB
    subgraph POOL_1["🏢 Pool: Sistema de Gestión de Vacaciones"]
        
        subgraph LANE_GERENTE["👔 Lane: Gerente"]
            direction TB
            GER_REV["📋 Tarea: Revisar Solicitud"]
            DECISION_1{"🤔 ¿Solicitud\nválida?"}
            GER_APROBAR["✅ Tarea: Aprobar\nSolicitud"]
            GER_RECHAZAR["❌ Tarea: Rechazar\nSolicitud"]
            GER_MOTIVO{{"📝 Motivo del\nrechazo (obligatorio)"}}
        end
        
        subgraph LANE_EMPLEADO["👤 Lane: Empleado"]
            direction TB
            EMP_SOLICITAR["📤 Tarea: Enviar\nSolicitud de Vacaciones"]
            EMP_CONSULTAR["🔍 Tarea: Consultar\nEstado"]
            EMP_MODIFICAR["✏️ Tarea: Modificar y\nReenviar"]
            EMP_RECIBIR_APROB["📩 Recibir: Notificación\nde Aprobación"]
            EMP_RECIBIR_RECHAZO["📩 Recibir: Notificación\nde Rechazo"]
        end
        
        subgraph LANE_RRHH["💼 Lane: Sistema RRHH"]
            direction TB
            RRHH_REGISTRAR["💾 Tarea: Registrar\nVacaciones Aprobadas"]
            RRHH_GENERAR["📊 Tarea: Generar\nReportes"]
        end
    end
    
    %% Eventos de Inicio y Fin
    START(("🟢 Evento Inicio"))
    FIN_APROBADO(("🏁 Evento Fin:\nSolicitud Aprobada"))
    FIN_RECHAZADO(("🏁 Evento Fin:\nSolicitud Rechazada"))
    FIN_MODIFICADO(("🏁 Evento Fin:\nReenvío Exitoso"))
    
    %% Conectores - Swim Lane Empleado
    START --> EMP_SOLICITAR
    EMP_SOLICITAR --> EMP_CONSULTAR
    
    %% Conectores - Revisión Gerente
    EMP_CONSULTAR -.envío.-> GER_REV
    GER_REV --> DECISION_1
    
    %% Compuerta Exclusiva (XOR Gateway)
    DECISION_1 -->|"✔️ Válida\ny Justificada"| GER_APROBAR
    DECISION_1 -->|"❌ Inválida\no No Justificada"| GER_RECHAZAR
    
    %% Rama de Aprobación
    GER_APROBAR --> RRHH_REGISTRAR
    RRHH_REGISTRAR -.registro.-> EMP_RECIBIR_APROB
    EMP_RECIBIR_APROB --> FIN_APROBADO
    
    %% Rama de Rechazo
    GER_RECHAZAR --> GER_MOTIVO
    GER_MOTIVO -.notificación.-> EMP_RECIBIR_RECHAZO
    EMP_RECIBIR_RECHAZO --> EMP_MODIFICAR
    
    %% Loop de modificación
    EMP_MODIFICAR -->|¿Reenviar?| DECISION_LOOP{"🔄"}
    DECISION_LOOP -->|"Sí, modificar"| EMP_SOLICITAR
    DECISION_LOOP -->|"No, cancelar"| FIN_RECHAZADO
    
    %% Estilos
    style START fill:#90EE90,stroke:#228B22,stroke-width:3px
    style FIN_APROBADO fill:#98FB98,stroke:#006400,stroke-width:3px
    style FIN_RECHAZADO fill:#FFB6C1,stroke:#8B0000,stroke-width:3px
    style FIN_MODIFICADO fill:#87CEEB,stroke:#00008B,stroke-width:3px
    
    style EMP_SOLICITAR fill:#E6F3FF,stroke:#3366CC
    style EMP_CONSULTAR fill:#E6F3FF,stroke:#3366CC
    style EMP_MODIFICAR fill:#E6F3FF,stroke:#3366CC
    style EMP_RECIBIR_APROB fill:#CCE5FF,stroke:#3366CC
    style EMP_RECIBIR_RECHAZO fill:#CCE5FF,stroke:#3366CC
    
    style GER_REV fill:#FFFACD,stroke:#CC9900
    style GER_APROBAR fill:#90EE90,stroke:#228B22
    style GER_RECHAZAR fill:#FFB6C1,stroke:#CC0000
    style GER_MOTIVO fill:#FFE4B5,stroke:#CC9900
    
    style RRHH_REGISTRAR fill:#DDA0DD,stroke:#800080
    style RRHH_GENERAR fill:#DDA0DD,stroke:#800080
    
    style DECISION_1 fill:#FFE4E1,stroke:#FF4500,stroke-width:2px
    style DECISION_LOOP fill:#FFE4E1,stroke:#FF4500,stroke-width:2px
    
    style POOL_1 fill:#F5F5F5,stroke:#333333,stroke-width:4px
    style LANE_EMPLEADO fill:#F0F8FF,stroke:#4169E1,stroke-width:2px
    style LANE_GERENTE fill:#FFFEF0,stroke:#DAA520,stroke-width:2px
    style LANE_RRHH fill:#FFF0F5,stroke:#DB7093,stroke-width:2px