flowchart TD
A([🔍 New Risk Identified]) --> B[Create Risk Node\nin Graph DB]
B --> C[Query Related Assets\nvia Graph Traversal]
C --> D[Identify Existing\nControls]
D --> E{Controls\nAdequate?}
E -- Yes --> F([✅ Document\nAccepted Risk])
E -- No --> G[Calculate\nResidual Risk Score\nRisk × 1-Effectiveness]
G --> H{Residual\nRisk Level?}
H -- Low < 25 --> F
H -- Medium 25-75 --> I[Assign to\nControl Owner]
H -- High > 75 --> J[🔴 Escalate to\nExecutive Leadership]
I --> K[Create Remediation\nTasks as Graph Nodes]
J --> K
K --> L[Update Control\nEffectiveness in Graph]
L --> M{Risk Below\nThreshold?}
M -- Yes --> N([🟢 Close Risk\nAudit Trail Preserved])
M -- No --> G
style A fill:#e3f2fd,stroke:#1565c0,color:#0d47a1
style B fill:#e8eaf6,stroke:#3949ab,color:#1a237e
style C fill:#e1f5fe,stroke:#0277bd,color:#01579b
style D fill:#e1f5fe,stroke:#0277bd,color:#01579b
style E fill:#fff9c4,stroke:#f9a825,color:#333
style F fill:#e8f5e9,stroke:#2e7d32,color:#1b5e20
style G fill:#fff3e0,stroke:#e65100,color:#bf360c
style H fill:#fff9c4,stroke:#f9a825,color:#333
style I fill:#fce4ec,stroke:#c62828,color:#b71c1c
style J fill:#ffcdd2,stroke:#b71c1c,color:#7f0000
style K fill:#fce4ec,stroke:#c62828,color:#b71c1c
style L fill:#e1f5fe,stroke:#0277bd,color:#01579b
style M fill:#fff9c4,stroke:#f9a825,color:#333
style N fill:#e8f5e9,stroke:#2e7d32,color:#1b5e20